Skip to content

Commit

Permalink
Major Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Sep 30, 2023
1 parent 22c645e commit 6b96266
Show file tree
Hide file tree
Showing 17 changed files with 289 additions and 195 deletions.
4 changes: 4 additions & 0 deletions src/Library/Sucrose.Manager/Manage/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public static class Manager

public static SEST DownloadType => SMMI.BackgroundogSettingManager.GetSetting(SMC.DownloadType, SEST.Megabyte);

public static bool PausePerformance => SMMI.BackgroundogSettingManager.GetSetting(SMC.PausePerformance, false);

public static bool ClosePerformance => SMMI.BackgroundogSettingManager.GetSetting(SMC.ClosePerformance, false);

public static int Startup => SHS.Clamp(SMMI.GeneralSettingManager.GetSettingStable(SMC.Startup, 0), 0, 10);

public static SEST UploadType => SMMI.BackgroundogSettingManager.GetSetting(SMC.UploadType, SEST.Kilobyte);
Expand Down
4 changes: 4 additions & 0 deletions src/Library/Sucrose.Memory/Constant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ public static class Constant

public const string BackgroundImage = "BackgroundImage";

public const string ClosePerformance = "ClosePerformance";

public const string PausePerformance = "PausePerformance";

public const string AdvertisingState = "AdvertisingState";

public const string AdvertisingDelay = "AdvertisingDelay";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ private void StartupSelected(int Index)
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Startup}{SMR.ValueSeparator}{SMR.AppName}{SMR.ValueSeparator}{SSSMI.Launcher}{SMR.ValueSeparator}{true}");
break;
case 2:
SSSHP.Runas(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.StartupP}{SMR.ValueSeparator}{SMR.AppName}{SMR.ValueSeparator}{SSSMI.Launcher}{SMR.ValueSeparator}{true}");
SSSHP.Runas(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.StartupP}{SMR.ValueSeparator}{SSSMI.Launcher}{SMR.ValueSeparator}{true}");
break;
case 3:
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Scheduler}{SMR.ValueSeparator}{SSDESCT.Create}{SMR.ValueSeparator}{SSSMI.Launcher}");
Expand Down
50 changes: 31 additions & 19 deletions src/Portal/Sucrose.Portal/Views/Controls/LibraryCard.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using SSRER = Sucrose.Shared.Resources.Extension.Resources;
using SSSHL = Sucrose.Shared.Space.Helper.Live;
using SSSHP = Sucrose.Shared.Space.Helper.Processor;
using SSSMI = Sucrose.Shared.Space.Manage.Internal;
using SSTHI = Sucrose.Shared.Theme.Helper.Info;

namespace Sucrose.Portal.Views.Controls
Expand All @@ -40,18 +41,21 @@ internal LibraryCard(string Theme, SSTHI Info)

private void Use()
{
if (SMMM.LibrarySelected != Path.GetFileName(Theme) || !SSSHL.Run())
if ((!SMMM.ClosePerformance && !SMMM.PausePerformance) || !SSSHP.Work(SSSMI.Backgroundog))
{
SMMI.LibrarySettingManager.SetSetting(SMC.LibrarySelected, Path.GetFileName(Theme));

if (SSSHL.Run())
if (SMMM.LibrarySelected != Path.GetFileName(Theme) || !SSSHL.Run())
{
SSLHK.Stop();
}
SMMI.LibrarySettingManager.SetSetting(SMC.LibrarySelected, Path.GetFileName(Theme));

SSLHR.Start();
if (SSSHL.Run())
{
SSLHK.Stop();
}

Cursor = Cursors.Arrow;
SSLHR.Start();

Cursor = Cursors.Arrow;
}
}
}

Expand Down Expand Up @@ -128,23 +132,31 @@ private void ThemeMore_Click(object sender, RoutedEventArgs e)

private void ContextMenu_Opened(object sender, RoutedEventArgs e)
{
if (SMMM.LibrarySelected == Path.GetFileName(Theme) && SSSHL.Run())
{
MenuUse.IsEnabled = false;
MenuDelete.IsEnabled = false;
}
else
if ((!SMMM.ClosePerformance && !SMMM.PausePerformance) || !SSSHP.Work(SSSMI.Backgroundog))
{
if (Info.AppVersion.CompareTo(SHV.Entry()) <= 0)
if (SMMM.LibrarySelected == Path.GetFileName(Theme) && SSSHL.Run())
{
MenuUse.IsEnabled = true;
MenuUse.IsEnabled = false;
MenuDelete.IsEnabled = false;
}
else
{
MenuUse.IsEnabled = false;
if (Info.AppVersion.CompareTo(SHV.Entry()) <= 0)
{
MenuUse.IsEnabled = true;
}
else
{
MenuUse.IsEnabled = false;
}

MenuDelete.IsEnabled = true;
}

MenuDelete.IsEnabled = true;
}
else
{
MenuUse.IsEnabled = false;
MenuDelete.IsEnabled = false;
}
}

Expand Down
18 changes: 11 additions & 7 deletions src/Portal/Sucrose.Portal/Views/Controls/StoreCard.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using SSSHN = Sucrose.Shared.Space.Helper.Network;
using SSSHP = Sucrose.Shared.Space.Helper.Processor;
using SSSIW = Sucrose.Shared.Store.Interface.Wallpaper;
using SSSMI = Sucrose.Shared.Space.Manage.Internal;
using SSSPMI = Sucrose.Shared.Space.Manage.Internal;
using SSSTMI = Sucrose.Shared.Store.Manage.Internal;
using SSTHI = Sucrose.Shared.Theme.Helper.Info;
Expand Down Expand Up @@ -159,16 +160,19 @@ private async void DownloadTheme()
{
SSSHC.Folder(TemporaryPath, LibraryPath);

if (SMMM.Start)
if ((!SMMM.ClosePerformance && !SMMM.PausePerformance) || !SSSHP.Work(SSSMI.Backgroundog))
{
SMMI.LibrarySettingManager.SetSetting(SMC.LibrarySelected, Path.GetFileName(Keys));

if (SSSHL.Run())
if (SMMM.Start)
{
SSLHK.Stop();
}
SMMI.LibrarySettingManager.SetSetting(SMC.LibrarySelected, Path.GetFileName(Keys));

if (SSSHL.Run())
{
SSLHK.Stop();
}

SSLHR.Start();
SSLHR.Start();
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/Project/Sucrose.Backgroundog/Helper/Attempt.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using SBMI = Sucrose.Backgroundog.Manage.Internal;
using SMC = Sucrose.Memory.Constant;
using SMMI = Sucrose.Manager.Manage.Internal;
using SSSHL = Sucrose.Shared.Space.Helper.Live;

namespace Sucrose.Backgroundog.Helper
Expand All @@ -22,6 +24,8 @@ public static async Task Start()

SBMI.Exit = false;
SBMI.Initialize.Stop();
SMMI.BackgroundogSettingManager.SetSetting(SMC.ClosePerformance, false);
SMMI.BackgroundogSettingManager.SetSetting(SMC.PausePerformance, false);

await Task.CompletedTask;
}
Expand Down
4 changes: 4 additions & 0 deletions src/Project/Sucrose.Backgroundog/Helper/Condition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Diagnostics;
using SBMI = Sucrose.Backgroundog.Manage.Internal;
using SBMM = Sucrose.Backgroundog.Manage.Manager;
using SMC = Sucrose.Memory.Constant;
using SMMI = Sucrose.Manager.Manage.Internal;
using SMMM = Sucrose.Manager.Manage.Manager;
using SMR = Sucrose.Memory.Readonly;
using SSDECPT = Sucrose.Shared.Dependency.Enum.CategoryPerformanceType;
Expand Down Expand Up @@ -85,10 +87,12 @@ private static void Lifecycle()
{
if (SBMI.Performance == SSDEPT.Close)
{
SMMI.BackgroundogSettingManager.SetSetting(SMC.ClosePerformance, false);
SSLHR.Start();
}
else
{
SMMI.BackgroundogSettingManager.SetSetting(SMC.PausePerformance, false);
SBMI.Live = SSSHL.Get();

if (SBMI.Live != null && !SBMI.Live.HasExited)
Expand Down
5 changes: 5 additions & 0 deletions src/Project/Sucrose.Backgroundog/Helper/Initialize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using SBHS = Sucrose.Backgroundog.Helper.Specification;
using SBMI = Sucrose.Backgroundog.Manage.Internal;
using SSSHL = Sucrose.Shared.Space.Helper.Live;
using SMC = Sucrose.Memory.Constant;
using SMMI = Sucrose.Manager.Manage.Internal;

namespace Sucrose.Backgroundog.Helper
{
Expand All @@ -14,6 +16,9 @@ public void Start()
SBMI.Computer.Open();
TimerCallback Callback = InitializeTimer_Callback;
SBMI.InitializeTimer = new(Callback, null, 0, SBMI.InitializeTime);

SMMI.BackgroundogSettingManager.SetSetting(SMC.ClosePerformance, false);
SMMI.BackgroundogSettingManager.SetSetting(SMC.PausePerformance, false);
}

public void Stop()
Expand Down
4 changes: 4 additions & 0 deletions src/Project/Sucrose.Backgroundog/Helper/Performance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Diagnostics;
using SBMI = Sucrose.Backgroundog.Manage.Internal;
using SBMM = Sucrose.Backgroundog.Manage.Manager;
using SMC = Sucrose.Memory.Constant;
using SMMI = Sucrose.Manager.Manage.Internal;
using SMMM = Sucrose.Manager.Manage.Manager;
using SMR = Sucrose.Memory.Readonly;
using SSDECPT = Sucrose.Shared.Dependency.Enum.CategoryPerformanceType;
Expand Down Expand Up @@ -75,10 +77,12 @@ private static void Lifecycle()
{
if (SBMI.Performance == SSDEPT.Close)
{
SMMI.BackgroundogSettingManager.SetSetting(SMC.ClosePerformance, true);
SSLHK.Stop();
}
else
{
SMMI.BackgroundogSettingManager.SetSetting(SMC.PausePerformance, true);
SBMI.Live = SSSHL.Get();

if (SBMI.Live != null && !SBMI.Live.HasExited)
Expand Down
Loading

0 comments on commit 6b96266

Please sign in to comment.