Skip to content

Commit d4cd384

Browse files
Merge pull request #3 from Stone-Red-Code/develop
Develop
2 parents 536890a + 414f84a commit d4cd384

13 files changed

Lines changed: 19 additions & 50 deletions

File tree

217 KB
Binary file not shown.

src/DesktopMagic/App.xaml.cs

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
global using Stone_Red_Utilities.Logging;
22

3-
using AlwaysUpToDate;
4-
53
using Stone_Red_C_Sharp_Utilities.Logging;
64

75
using System;
@@ -20,11 +18,7 @@ public partial class App : Application
2018

2119
public const string AppName = "Desktop Magic";
2220
private readonly string logFilePath;
23-
#if DEBUG
24-
private readonly Updater updater = new Updater(TimeSpan.FromDays(1), "https://raw.githubusercontent.com/Stone-Red-Code/DesktopMagic/develop/update/updateInfo.json");
25-
#else
26-
private readonly Updater updater = new Updater(TimeSpan.FromDays(1), "https://raw.githubusercontent.com/Stone-Red-Code/DesktopMagic/main/update/updateInfo.json");
27-
#endif
21+
2822
private readonly Thread? eventThread;
2923
private readonly EventWaitHandle eventWaitHandle;
3024

@@ -64,12 +58,6 @@ public App()
6458

6559
Setup(true);
6660
Exit += CloseHandler;
67-
68-
updater.ProgressChanged += Updater_ProgressChanged;
69-
updater.OnException += Updater_OnException;
70-
updater.NoUpdateAvailible += Updater_NoUpdateAvailible;
71-
updater.UpdateAvailible += Updater_UpdateAvailible;
72-
updater.Start();
7361
}
7462
}
7563

@@ -79,26 +67,6 @@ protected void CloseHandler(object sender, EventArgs e)
7967
eventThread?.Interrupt();
8068
}
8169

82-
private void Updater_UpdateAvailible(string version, string additionalInformation)
83-
{
84-
updater.Update();
85-
}
86-
87-
private void Updater_NoUpdateAvailible()
88-
{
89-
Logger.Log("No update available", "Updater");
90-
}
91-
92-
private void Updater_OnException(Exception exception)
93-
{
94-
Logger.Log(exception.ToString(), "Updater");
95-
}
96-
97-
private void Updater_ProgressChanged(long? totalFileSize, long totalBytesDownloaded, double? progressPercentage)
98-
{
99-
Logger.Log($"Downloading: {progressPercentage}% {totalBytesDownloaded}/{totalFileSize}", "Updater");
100-
}
101-
10270
private void Setup(bool clearLogFile)
10371
{
10472
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

src/DesktopMagic/DesktopMagic.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<ApplicationIcon>icon.ico</ApplicationIcon>
88
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
99
<Authors>Stone_Red</Authors>
10-
<Version>1.0.0.0</Version>
10+
<Version>1.0.1.0</Version>
1111
<PackageProjectUrl>https://github.com/Stone-Red-Code/DesktopMagic</PackageProjectUrl>
1212
<RepositoryUrl>https://github.com/Stone-Red-Code/DesktopMagic</RepositoryUrl>
13-
<AssemblyVersion>1.0.0.0</AssemblyVersion>
14-
<FileVersion>1.0.0.0</FileVersion>
13+
<AssemblyVersion>1.0.1.0</AssemblyVersion>
14+
<FileVersion>1.0.1.0</FileVersion>
1515
<TargetFramework>net8.0-windows7.0</TargetFramework>
1616
<Nullable>enable</Nullable>
1717
</PropertyGroup>
@@ -35,7 +35,6 @@
3535
</ItemGroup>
3636

3737
<ItemGroup>
38-
<PackageReference Include="AlwaysUpToDate" Version="1.0.0.4" />
3938
<PackageReference Include="BusyIndicators" Version="2.1.2" />
4039
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.5.1" />
4140
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />

src/DesktopMagic/GlobalSuppressions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77

88
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Windows only application")]
99
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "No need to")]
10-
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hardcoded", Justification = "<Pending>")]
10+
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hardcoded", Justification = "<Pending>")]
11+
[assembly: SuppressMessage("Critical Code Smell", "S2696:Instance members should not write to \"static\" fields", Justification = "<Pending>", Scope = "member", Target = "~P:DesktopMagic.DataContexts.MainWindowDataContext.Settings")]

src/DesktopMagic/Helpers/Win32Wrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Runtime.InteropServices;
33
using System.Text;
4-
4+
#pragma warning disable
55
namespace DesktopMagic.Helpers;
66

77
internal class W32

src/DesktopMagic/Helpers/WindowPos.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Windows;
44
using System.Windows.Interop;
55
using System.Windows.Shapes;
6-
6+
#pragma warning disable
77
namespace DesktopMagic
88
{
99
using static NativeMethods;

src/DesktopMagic/Plugins/PluginWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public partial class PluginWindow : Window
3535

3636
public bool IsRunning { get; private set; } = true;
3737
public PluginMetadata PluginMetadata { get; private set; }
38-
public string? PluginFolderPath { get; private set; }
38+
public string PluginFolderPath { get; private set; }
3939

4040
public PluginWindow(PluginMetadata pluginMetadata, PluginSettings settings, string pluginFolderPath)
4141
{

src/DesktopMagicPluginAPI/Drawing/FontComparer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ namespace DesktopMagic.Api.Drawing;
66

77
internal class FontComparer : IEqualityComparer<Font>
88
{
9-
public bool Equals(Font font1, Font font2)
9+
public bool Equals(Font? font1, Font? font2)
1010
{
11+
if (font1 is null || font2 is null)
12+
{
13+
return false;
14+
}
15+
1116
if (font1.Name != font2.Name)
1217
{
1318
return false;

src/DesktopMagicPluginAPI/Settings/Button.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public class Button : Setting
1010
/// <summary>
1111
/// Occurs when the button gets clicked.
1212
/// </summary>
13-
public event Action OnClick;
13+
public event Action? OnClick;
1414

15-
private string _value;
15+
private string _value = string.Empty;
1616

1717
/// <summary>
1818
/// Gets or sets the text caption displayed in the <see cref="Button"/> element.

src/DesktopMagicPluginAPI/Settings/Label.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/// </summary>
66
public class Label : Setting
77
{
8-
private string _value;
8+
private string _value = string.Empty;
99

1010
/// <summary>
1111
/// Gets or sets the text associated with this <see cref="Label"/>.

0 commit comments

Comments
 (0)