public MainWindow() { InitializeComponent(); EventSubscribe(); MainWindowInstance = this; ChangeApplicationSelectionSettings.UnSelectSettings(UnselectedStg); LanguageValueProvider.AssignLanguageValue(); ThemeValueProvider.AssignThemeValue(); GetApplicationScaleValue.Get(); GetPermissionsOnGettingMemory.Get(); GetApplicationLicenseState.GetLicenseState(); }
private void EventSubscribe() { Closing += (s, e) => SaveSettings(); MenuGrLabel.Click += (s, e) => ChangeApplicationSelectionSettings.SelectSettings(GraphicsStgOne, GraphicsPanel); MenuSnLabel.Click += (s, e) => ChangeApplicationSelectionSettings.SelectSettings(SoundStgOne, SoundPanel); MenuGpLabel.Click += (s, e) => ChangeApplicationSelectionSettings.SelectSettings(GamePlayStgOne, GameplayPanel); MenuCtLabel.Click += (s, e) => ChangeApplicationSelectionSettings.SelectSettings(ChatStgOne, ChatPanel); MenuFtLabel.Click += (s, e) => ChangeApplicationSelectionSettings.SelectSettings(FontStgOne, FontsPanel); MenuMdLabel.Click += (s, e) => ChangeApplicationSelectionSettings.SelectSettings(ModifyStgOne, ModifPanel); MenuStLabel.Click += (s, e) => ChangeApplicationSelectionSettings.SelectSettings(AppStgOne, SettingsPanel); MenuPlLabel.Click += (s, e) => ApplicationStartSacredGameFile.StartDialog(); if (Settings.EnableRefreshSettingsOnWindowFocus) { Activated += (s, e) => RefreshApplicationSettings.Refresh(); } Timeline.DesiredFrameRateProperty.OverrideMetadata( typeof(Timeline), new FrameworkPropertyMetadata { DefaultValue = Settings.DesiredFrameRateProperty } ); CloseBtn.Click += (s, e) => ApplicationUtils.Shutdown(); UpdateLbl.MouseDown += (s, e) => ApplicationStartUtilityUpdate.Start(); BaseWindow.PreviewKeyDown += ApplicationBaseWindowHotkeys.KeyDown; MinimizeBtn.Click += (s, e) => WindowState = WindowState.Minimized; MemoryLbl.MouseDown += (s, e) => GC.Collect(); HeaderPanel.MouseDown += DragWindow; Timer.Interval = new TimeSpan( 0, 0, Settings.ShowUsedMemoryUpdateInterval ); Timer.Tick += (s, e) => GetApplicationCurrentUsedMemory.Get(); Loaded += (sender, args) => { Task.Run(CheckAvailabilityAlphaUpdates.GetPerm); Task.Run(NetworkUtils.ShowNoConnection); Task.Run(GetSacredUtilsCelebrationDates.CheckDates); if (File.ReadAllText( $"{Environment.ExpandEnvironmentVariables("%appdata%")}\\SacredUtils\\LicenseAgreement.su") .Contains("true")) { GetChangeLogDialogVisibility.Get(); } ApplicationInfo.StartupStopwatch.Stop(); // Make Yourself ^_^ Log.Info( $"Loading SacredUtils application done ({ApplicationInfo.StartupStopwatch.Elapsed.TotalMilliseconds / 1000.00} seconds)!"); }; }