Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Dec 3, 2024
1 parent 4e1945d commit 478aba5
Show file tree
Hide file tree
Showing 27 changed files with 304 additions and 73 deletions.
4 changes: 2 additions & 2 deletions src/Library/Sucrose.Manager/Helper/Cleaner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static string Clean(string Content)
{
if (Content.StartsWith("{{"))
{
#if NET48_OR_GREATER || NETSTANDARD2_0
#if NET48_OR_GREATER
Content = Content.Substring(1);
#else
Content = Content[1..];
Expand All @@ -17,7 +17,7 @@ public static string Clean(string Content)

if (Content.EndsWith("}}"))
{
#if NET48_OR_GREATER || NETSTANDARD2_0
#if NET48_OR_GREATER
Content = Content.Substring(0, Content.Length - 1);
#else
Content = Content[..^1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static class PlatformDll

private static IDllLoadUtils SelectDllLoadUtils()
{
#if NETSTANDARD2_0_OR_GREATER || NET6_0_OR_GREATER
#if NET6_0_OR_GREATER
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return new WindowsDllLoadUtils();
Expand Down
7 changes: 4 additions & 3 deletions src/Live/Sucrose.Live.CefSharp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
using SSEVLMB = Sucrose.Shared.Engine.View.LightMessageBox;
using SSLHK = Sucrose.Shared.Live.Helper.Kill;
using SSSHC = Sucrose.Shared.Space.Helper.Cycyling;
using SSSHF = Sucrose.Shared.Space.Helper.Filing;
using SSSHI = Sucrose.Shared.Space.Helper.Instance;
using SSSHS = Sucrose.Shared.Space.Helper.Security;
using SSSHWG = Sucrose.Shared.Space.Helper.Watchdog;
Expand Down Expand Up @@ -439,7 +440,7 @@ protected void Configure()

if (!File.Exists(SSEMI.PropertiesFile))
{
File.Copy(SSEMI.PropertiesPath, SSEMI.PropertiesFile, true);
SSSHF.CopyBuffer(SSEMI.PropertiesPath, SSEMI.PropertiesFile);
}

try
Expand All @@ -448,13 +449,13 @@ protected void Configure()
}
catch (NotSupportedException Ex)
{
File.Delete(SSEMI.PropertiesFile);
SSSHF.Delete(SSEMI.PropertiesFile);

throw new NotSupportedException(Ex.Message);
}
catch (Exception Ex)
{
File.Delete(SSEMI.PropertiesFile);
SSSHF.Delete(SSEMI.PropertiesFile);

throw new Exception(Ex.Message, Ex.InnerException);
}
Expand Down
7 changes: 4 additions & 3 deletions src/Live/Sucrose.Live.WebView/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
using SSEWVVYT = Sucrose.Shared.Engine.WebView.View.YouTube;
using SSLHK = Sucrose.Shared.Live.Helper.Kill;
using SSSHC = Sucrose.Shared.Space.Helper.Cycyling;
using SSSHF = Sucrose.Shared.Space.Helper.Filing;
using SSSHI = Sucrose.Shared.Space.Helper.Instance;
using SSSHS = Sucrose.Shared.Space.Helper.Security;
using SSSHW = Sucrose.Shared.Space.Helper.Watchdog;
Expand Down Expand Up @@ -371,7 +372,7 @@ protected void Configure()

if (!File.Exists(SSEMI.PropertiesFile))
{
File.Copy(SSEMI.PropertiesPath, SSEMI.PropertiesFile, true);
SSSHF.CopyBuffer(SSEMI.PropertiesPath, SSEMI.PropertiesFile);
}

try
Expand All @@ -380,13 +381,13 @@ protected void Configure()
}
catch (NotSupportedException Ex)
{
File.Delete(SSEMI.PropertiesFile);
SSSHF.Delete(SSEMI.PropertiesFile);

throw new NotSupportedException(Ex.Message);
}
catch (Exception Ex)
{
File.Delete(SSEMI.PropertiesFile);
SSSHF.Delete(SSEMI.PropertiesFile);

throw new Exception(Ex.Message, Ex.InnerException);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Portal/Sucrose.Portal/Views/Controls/LibraryCard.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
using SSDMME = Sucrose.Shared.Dependency.Manage.Manager.Engine;
using SSLHK = Sucrose.Shared.Live.Helper.Kill;
using SSLHR = Sucrose.Shared.Live.Helper.Run;
using SSSHF = Sucrose.Shared.Space.Helper.Filing;
using SSSHL = Sucrose.Shared.Space.Helper.Live;
using SSSHP = Sucrose.Shared.Space.Helper.Processor;
using SSSMI = Sucrose.Shared.Space.Manage.Internal;
Expand Down Expand Up @@ -238,7 +239,7 @@ await Task.Run(() =>
{
if (File.Exists(Record) && Record.Contains(Path.GetFileName(Theme)))
{
File.Delete(Record);
SSSHF.Delete(Record);
}
}
}
Expand Down
29 changes: 15 additions & 14 deletions src/Portal/Sucrose.Portal/Views/Controls/ThemeCreate.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using SSDEWT = Sucrose.Shared.Dependency.Enum.WallpaperType;
using SSSHA = Sucrose.Shared.Space.Helper.Access;
using SSSHC = Sucrose.Shared.Space.Helper.Copy;
using SSSHF = Sucrose.Shared.Space.Helper.Filing;
using SSTHI = Sucrose.Shared.Theme.Helper.Info;
using SSTHV = Sucrose.Shared.Theme.Helper.Various;
using SSWEW = Sucrose.Shared.Watchdog.Extension.Watch;
Expand Down Expand Up @@ -724,7 +725,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
if (File.Exists(Gif.LocalPath))
{
Name = "s_" + Path.GetFileName(Gif.LocalPath);
await Task.Run(() => File.Copy(Gif.LocalPath, Path.Combine(Theme, Name), true));
await Task.Run(() => SSSHF.CopyBuffer(Gif.LocalPath, Path.Combine(Theme, Name)));
}
else
{
Expand All @@ -736,7 +737,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{GifThumbnail.Content}";
Thumbnail = "t_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Thumbnail), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Thumbnail)));
}
else
{
Expand All @@ -760,7 +761,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{GifPreview.Content}";
Preview = "p_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Preview), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Preview)));
}
else
{
Expand Down Expand Up @@ -871,7 +872,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{UrlThumbnail.Content}";
Thumbnail = "t_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Thumbnail), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Thumbnail)));
}
else
{
Expand All @@ -882,7 +883,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{UrlPreview.Content}";
Preview = "p_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Preview), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Preview)));
}
else
{
Expand Down Expand Up @@ -996,7 +997,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{WebThumbnail.Content}";
Thumbnail = "t_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Thumbnail), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Thumbnail)));
}
else
{
Expand All @@ -1007,7 +1008,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{WebPreview.Content}";
Preview = "p_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Preview), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Preview)));
}
else
{
Expand Down Expand Up @@ -1120,7 +1121,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
if (File.Exists(Video.LocalPath))
{
Name = "s_" + Path.GetFileName(Video.LocalPath);
await Task.Run(() => File.Copy(Video.LocalPath, Path.Combine(Theme, Name), true));
await Task.Run(() => SSSHF.CopyBuffer(Video.LocalPath, Path.Combine(Theme, Name)));
}
else
{
Expand All @@ -1132,7 +1133,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{VideoThumbnail.Content}";
Thumbnail = "t_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Thumbnail), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Thumbnail)));
}
else
{
Expand All @@ -1156,7 +1157,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{VideoPreview.Content}";
Preview = "p_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Preview), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Preview)));
}
else
{
Expand Down Expand Up @@ -1267,7 +1268,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{YouTubeThumbnail.Content}";
Thumbnail = "t_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Thumbnail), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Thumbnail)));
}
else
{
Expand All @@ -1278,7 +1279,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{YouTubePreview.Content}";
Preview = "p_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Preview), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Preview)));
}
else
{
Expand Down Expand Up @@ -1410,7 +1411,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{ApplicationThumbnail.Content}";
Thumbnail = "t_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Thumbnail), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Thumbnail)));
}
else
{
Expand All @@ -1421,7 +1422,7 @@ protected override async void OnButtonClick(ContentDialogButton Button)
{
string Source = $"{ApplicationPreview.Content}";
Preview = "p_" + Path.GetFileName(Source);
await Task.Run(() => File.Copy(Source, Path.Combine(Theme, Preview), true));
await Task.Run(() => SSSHF.CopyBuffer(Source, Path.Combine(Theme, Preview)));
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion src/Portal/Sucrose.Portal/Views/Controls/ThemeShare.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
using SSDMMP = Sucrose.Shared.Dependency.Manage.Manager.Portal;
using SSSEPS = Sucrose.Shared.Space.Extension.ProgressStream;
using SSSHC = Sucrose.Shared.Space.Helper.Clean;
using SSSHF = Sucrose.Shared.Space.Helper.Filing;
using SSSHGHD = Sucrose.Shared.Store.Helper.GitHub.Download;
using SSSHN = Sucrose.Shared.Space.Helper.Network;
using SSSHS = Sucrose.Shared.Store.Helper.Store;
Expand Down Expand Up @@ -322,7 +323,7 @@ await Application.Current.Dispatcher.InvokeAsync(async () =>

if (!string.IsNullOrEmpty(TempFile) && File.Exists(TempFile))
{
File.Delete(TempFile);
SSSHF.Delete(TempFile);
}

Publish.IsEnabled = true;
Expand Down
3 changes: 2 additions & 1 deletion src/Portal/Sucrose.Portal/Views/Pages/LibraryPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using SSDECT = Sucrose.Shared.Dependency.Enum.CompatibilityType;
using SSSHA = Sucrose.Shared.Space.Helper.Access;
using SSSHC = Sucrose.Shared.Space.Helper.Copy;
using SSSHF = Sucrose.Shared.Space.Helper.Filing;
using SSSHS = Sucrose.Shared.Space.Helper.Sort;
using SSTHI = Sucrose.Shared.Theme.Helper.Info;
using SSTHV = Sucrose.Shared.Theme.Helper.Various;
Expand Down Expand Up @@ -172,7 +173,7 @@ private void InitializeThemes()

if (File.Exists(PropertiesFile))
{
File.Delete(PropertiesFile);
SSSHF.Delete(PropertiesFile);
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/Project/Sucrose.Property/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using SSDEPT = Sucrose.Shared.Dependency.Enum.PropertiesType;
using SSDEWT = Sucrose.Shared.Dependency.Enum.WallpaperType;
using SSDMME = Sucrose.Shared.Dependency.Manage.Manager.Engine;
using SSSHF = Sucrose.Shared.Space.Helper.Filing;
using SSSHI = Sucrose.Shared.Space.Helper.Instance;
using SSSHW = Sucrose.Shared.Space.Helper.Watchdog;
using SSTHI = Sucrose.Shared.Theme.Helper.Info;
Expand Down Expand Up @@ -222,7 +223,7 @@ protected void Configure(string[] Args)

if (!File.Exists(SPMI.PropertiesFile))
{
File.Copy(SPMI.PropertiesPath, SPMI.PropertiesFile, true);
SSSHF.CopyBuffer(SPMI.PropertiesPath, SPMI.PropertiesFile);
}

try
Expand All @@ -231,13 +232,13 @@ protected void Configure(string[] Args)
}
catch (NotSupportedException Ex)
{
File.Delete(SPMI.PropertiesFile);
SSSHF.Delete(SPMI.PropertiesFile);

throw new NotSupportedException(Ex.Message);
}
catch (Exception Ex)
{
File.Delete(SPMI.PropertiesFile);
SSSHF.Delete(SPMI.PropertiesFile);

throw new Exception(Ex.Message, Ex.InnerException);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Project/Sucrose.Property/Controls/FileDropDown.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using SPMI = Sucrose.Property.Manage.Internal;
using SRER = Sucrose.Resources.Extension.Resources;
using SSSHA = Sucrose.Shared.Space.Helper.Access;
using SSSHF = Sucrose.Shared.Space.Helper.Filing;
using SSTMFDDM = Sucrose.Shared.Theme.Model.FileDropDownModel;
using ToolTip = System.Windows.Controls.ToolTip;
using UserControl = System.Windows.Controls.UserControl;
Expand Down Expand Up @@ -108,7 +109,7 @@ private async Task Command_Click(SSTMFDDM Data)

if (File.Exists(Target))
{
File.Delete(Target);
SSSHF.Delete(Target);
}

using FileStream Destination = new(Target, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
Expand Down
9 changes: 5 additions & 4 deletions src/Project/Sucrose.Property/View/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using SSDMMG = Sucrose.Shared.Dependency.Manage.Manager.General;
using SSLHK = Sucrose.Shared.Live.Helper.Kill;
using SSLHR = Sucrose.Shared.Live.Helper.Run;
using SSSHF = Sucrose.Shared.Space.Helper.Filing;
using SSSHL = Sucrose.Shared.Space.Helper.Live;
using SSTHP = Sucrose.Shared.Theme.Helper.Properties;
using SSTMBM = Sucrose.Shared.Theme.Model.ButtonModel;
Expand Down Expand Up @@ -192,11 +193,11 @@ private async void Delete_Click(object sender, RoutedEventArgs e)

await Task.Delay(250);

File.Delete(SPMI.PropertiesFile);
SSSHF.Delete(SPMI.PropertiesFile);

await Task.Delay(250);

File.Copy(SPMI.PropertiesPath, SPMI.PropertiesFile, true);
SSSHF.CopyBuffer(SPMI.PropertiesPath, SPMI.PropertiesFile);

SPMI.Properties = SSTHP.ReadJson(SPMI.PropertiesFile);

Expand Down Expand Up @@ -267,13 +268,13 @@ private async void Restore_Click(object sender, RoutedEventArgs e)
Refresh.IsEnabled = false;
Delete.IsEnabled = false;

File.Copy(SPMI.PropertiesPath, SPMI.PropertiesFile, true);
SSSHF.CopyBuffer(SPMI.PropertiesPath, SPMI.PropertiesFile);

if (SMML.Selected == SPMI.LibrarySelected && SSSHL.Run())
{
await Task.Delay(250);

File.Copy(SPMI.PropertiesPath, SPMI.WatcherFile.Replace("*", $"{Guid.NewGuid()}"), true);
SSSHF.CopyBuffer(SPMI.PropertiesPath, SPMI.WatcherFile.Replace("*", $"{Guid.NewGuid()}"));
}

await Task.Delay(250);
Expand Down
3 changes: 2 additions & 1 deletion src/Project/Sucrose.Reportdog/Helper/Initialize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using SSDMMG = Sucrose.Shared.Dependency.Manage.Manager.General;
using SSDMMP = Sucrose.Shared.Dependency.Manage.Manager.Portal;
using SSDMMU = Sucrose.Shared.Dependency.Manage.Manager.Update;
using SSSHF = Sucrose.Shared.Space.Helper.Filing;
using SSSHN = Sucrose.Shared.Space.Helper.Network;
using SSSHU = Sucrose.Shared.Space.Helper.User;
using SSSHW = Sucrose.Shared.Space.Helper.Watchdog;
Expand Down Expand Up @@ -293,7 +294,7 @@ private static async Task SendThrow(string Path)
{
await Task.Delay(50);

File.Delete(Path);
SSSHF.Delete(Path);
}
}
}
Expand Down
Loading

0 comments on commit 478aba5

Please sign in to comment.