private void AcceptLicenseBtn_Click(object sender, RoutedEventArgs e) { BaseDialog.IsOpen = false; File.WriteAllText($"{Environment.ExpandEnvironmentVariables("%appdata%")}\\SacredUtils\\LicenseAgreement.su", "true"); MainWindow.MainWindowInstance.UpdateLbl.IsEnabled = true; MainWindow.MainWindowInstance.MinimizeBtn.IsEnabled = true; GetChangeLogDialogVisibility.Get(); }
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)!"); }; }