Skip to content

Commit c2c1046

Browse files
committed
Cleanup and implementation from scratch
1 parent a03ea2b commit c2c1046

File tree

180 files changed

+377
-36360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+377
-36360
lines changed

OpenBoardAnim.Library/OpenBoardAnim.Library.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>

OpenBoardAnim.Utilities/OpenBoardAnim.Utilities.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

OpenBoardAnim.VideoTools/OpenBoardAnim.VideoTools.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>

OpenBoardAnim.sln

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,20 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31912.275
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenBoardAnim", "OpenBoardAnim\OpenBoardAnim.csproj", "{461D5D27-3965-4285-992C-D54A0DD447FF}"
7-
EndProject
86
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenBoardAnim.Utilities", "OpenBoardAnim.Utilities\OpenBoardAnim.Utilities.csproj", "{4E7C2263-6E1E-42ED-889A-8391C79C69A3}"
97
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenBoardAnim.VideoTools", "OpenBoardAnim.VideoTools\OpenBoardAnim.VideoTools.csproj", "{92626A36-DD17-4318-AD95-38125B4BDE76}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenBoardAnim.VideoTools", "OpenBoardAnim.VideoTools\OpenBoardAnim.VideoTools.csproj", "{92626A36-DD17-4318-AD95-38125B4BDE76}"
9+
EndProject
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenBoardAnim.Library", "OpenBoardAnim.Library\OpenBoardAnim.Library.csproj", "{62FBC3EE-6D55-4F13-B0A3-48F20C14C84A}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenBoardAnim.Library", "OpenBoardAnim.Library\OpenBoardAnim.Library.csproj", "{62FBC3EE-6D55-4F13-B0A3-48F20C14C84A}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenBoardAnim", "OpenBoardAnim\OpenBoardAnim.csproj", "{5472CFF7-E929-4D81-98E3-B68F39326C95}"
1313
EndProject
1414
Global
1515
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1616
Debug|Any CPU = Debug|Any CPU
1717
Release|Any CPU = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20-
{461D5D27-3965-4285-992C-D54A0DD447FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21-
{461D5D27-3965-4285-992C-D54A0DD447FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
22-
{461D5D27-3965-4285-992C-D54A0DD447FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
23-
{461D5D27-3965-4285-992C-D54A0DD447FF}.Release|Any CPU.Build.0 = Release|Any CPU
2420
{4E7C2263-6E1E-42ED-889A-8391C79C69A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2521
{4E7C2263-6E1E-42ED-889A-8391C79C69A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
2622
{4E7C2263-6E1E-42ED-889A-8391C79C69A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -33,6 +29,10 @@ Global
3329
{62FBC3EE-6D55-4F13-B0A3-48F20C14C84A}.Debug|Any CPU.Build.0 = Debug|Any CPU
3430
{62FBC3EE-6D55-4F13-B0A3-48F20C14C84A}.Release|Any CPU.ActiveCfg = Release|Any CPU
3531
{62FBC3EE-6D55-4F13-B0A3-48F20C14C84A}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{5472CFF7-E929-4D81-98E3-B68F39326C95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{5472CFF7-E929-4D81-98E3-B68F39326C95}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{5472CFF7-E929-4D81-98E3-B68F39326C95}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{5472CFF7-E929-4D81-98E3-B68F39326C95}.Release|Any CPU.Build.0 = Release|Any CPU
3636
EndGlobalSection
3737
GlobalSection(SolutionProperties) = preSolution
3838
HideSolutionNode = FALSE

OpenBoardAnim/App.xaml

+9-710
Large diffs are not rendered by default.

OpenBoardAnim/App.xaml.cs

+25-132
Original file line numberDiff line numberDiff line change
@@ -1,148 +1,41 @@
1-
using OpenBoardAnim.Helpers;
2-
using OpenBoardAnim.Util;
3-
using OpenBoardAnim.Utilities;
4-
using OpenBoardAnim.Windows;
5-
using OpenBoardAnim.Windows.Other;
6-
using System;
7-
using System.Collections.Generic;
1+
using Microsoft.Extensions.DependencyInjection;
2+
using OpenBoardAnim.Core;
3+
using OpenBoardAnim.Services;
4+
using OpenBoardAnim.ViewModels;
85
using System.Windows;
9-
using System.Windows.Threading;
106

117
namespace OpenBoardAnim
128
{
139
/// <summary>
1410
/// Interaction logic for App.xaml
1511
/// </summary>
16-
public partial class App
12+
public partial class App : Application
1713
{
18-
private void Application_Startup(object sender, StartupEventArgs e)
19-
{
20-
#region Unhandled Exceptions
21-
22-
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
23-
24-
#endregion
25-
26-
#region Upgrade Application Settings
27-
28-
//See http://stackoverflow.com/questions/534261/how-do-you-keep-user-config-settings-across-different-assembly-versions-in-net
29-
if (Settings.Default.UpgradeRequired)
30-
{
31-
Settings.Default.Upgrade();
32-
Settings.Default.UpgradeRequired = false;
33-
Settings.Default.Save();
34-
}
35-
36-
#endregion
37-
38-
#region Language
39-
40-
try
41-
{
42-
LocalizationHelper.SelectCulture(Settings.Default.Language);
43-
}
44-
catch (Exception ex)
45-
{
46-
var errorViewer = new ExceptionViewer(ex);
47-
errorViewer.ShowDialog();
48-
LogWriter.Log(ex, "Language Settings Exception.");
49-
}
50-
51-
#endregion
52-
53-
//var select = new SelectFolderDialog();
54-
//select.ShowDialog();
55-
56-
//var select = new TestField();
57-
//select.ShowDialog();
58-
59-
//return;
60-
61-
try
62-
{
63-
#region Startup
64-
65-
if (Settings.Default.StartUp == 0)
66-
{
67-
var startup = new Startup();
68-
Current.MainWindow = startup;
69-
startup.ShowDialog();
70-
}
71-
else if (Settings.Default.StartUp == 4)
72-
{
73-
var edit = new Editor();
74-
Current.MainWindow = edit;
75-
edit.ShowDialog();
76-
}
77-
else
78-
{
79-
var editor = new Editor();
80-
List<FrameInfo> frames = null;
81-
var exitArg = ExitAction.Exit;
82-
bool? result = null;
83-
84-
if (result.HasValue && result.Value)
85-
{
86-
#region If Close
14+
private readonly ServiceProvider _serviceProvider;
8715

88-
Environment.Exit(0);
89-
90-
#endregion
91-
}
92-
else if (result.HasValue)
93-
{
94-
#region If Backbutton or Stop Clicked
95-
96-
if (exitArg == ExitAction.Recorded)
97-
{
98-
editor.ListFrames = frames;
99-
Current.MainWindow = editor;
100-
editor.ShowDialog();
101-
}
102-
103-
#endregion
104-
}
105-
}
106-
107-
#endregion
108-
}
109-
catch (Exception ex)
110-
{
111-
var errorViewer = new ExceptionViewer(ex);
112-
errorViewer.ShowDialog();
113-
LogWriter.Log(ex, "Generic Exception - Root");
114-
}
115-
}
116-
117-
private void App_OnExit(object sender, ExitEventArgs e)
118-
{
119-
//TODO: Save all settings, stop all encoding.
120-
}
121-
122-
#region Exception Handling
123-
124-
private void App_OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
16+
public App()
12517
{
126-
LogWriter.Log(e.Exception, "On Dispacher Unhandled Exception - Unknow");
18+
IServiceCollection services = new ServiceCollection();
19+
services.AddSingleton<INavigationService, NavigationService>();
20+
services.AddSingleton<MainWindow>(provider =>
21+
new MainWindow
22+
{
23+
DataContext = provider.GetRequiredService<MainViewModel>()
24+
});
25+
services.AddSingleton<MainViewModel>();
26+
services.AddSingleton<LaunchViewModel>();
27+
services.AddSingleton<EditorViewModel>();
28+
services.AddSingleton<Func<Type, ViewModel>>(sp => vMType => (ViewModel)sp.GetRequiredService(vMType));
12729

128-
var errorViewer = new ExceptionViewer(e.Exception);
129-
errorViewer.ShowDialog();
13030

131-
e.Handled = true;
31+
_serviceProvider = services.BuildServiceProvider();
13232
}
133-
134-
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
33+
protected override void OnStartup(StartupEventArgs e)
13534
{
136-
var exception = e.ExceptionObject as Exception;
137-
138-
if (exception == null) return;
139-
140-
LogWriter.Log(exception, "Current Domain Unhandled Exception - Unknow");
141-
142-
var errorViewer = new ExceptionViewer(exception);
143-
errorViewer.ShowDialog();
35+
var mainWindow = _serviceProvider.GetRequiredService<MainWindow>();
36+
mainWindow.Show();
37+
base.OnStartup(e);
14438
}
145-
146-
#endregion
14739
}
148-
}
40+
41+
}

OpenBoardAnim/AppConstants/BoardStyle.cs

-16
This file was deleted.

OpenBoardAnim/AppConstants/Resolution.cs

-16
This file was deleted.

OpenBoardAnim/AssemblyInfo.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System.Windows;
22

33
[assembly: ThemeInfo(
4-
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5-
//(used if a resource is not found in the page,
6-
// or application resource dictionaries)
7-
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8-
//(used if a resource is not found in the page,
9-
// app, or any theme specific resource dictionaries)
10-
)]
4+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5+
//(used if a resource is not found in the page,
6+
// or application resource dictionaries)
7+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8+
//(used if a resource is not found in the page,
9+
// app, or any theme specific resource dictionaries)
10+
)]

OpenBoardAnim/Controls/AttachmentListBoxItem.cs

-87
This file was deleted.

0 commit comments

Comments
 (0)