MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / MainPage

Class MainPage

loader/Views/MainPage.xaml.cs:12–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace PenguLoader.Views
11{
12 public partial class MainPage : Page, INotifyPropertyChanged
13 {
14 public event PropertyChangedEventHandler PropertyChanged;
15 void TriggerPropertyChanged(string name) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
16
17 Window Owner => Window.GetWindow(this);
18
19 public bool OptimizeClient
20 {
21 get => Config.OptimizeClient;
22 set
23 {
24 if (value == true)
25 {
26 var caption = App.GetTranslation("t_optimize_client");
27 var message = App.GetTranslation("t_msg_optimize_client_prompt");
28
29 value = MessageBox.Show(Owner, message, caption,
30 MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes;
31 }
32
33 Config.OptimizeClient = value;
34 TriggerPropertyChanged(nameof(OptimizeClient));
35 }
36 }
37
38 public bool SuperLowSpecMode
39 {
40 get => Config.SuperLowSpecMode;
41 set
42 {
43 if (value == true)
44 {
45 var caption = App.GetTranslation("t_super_potato_mode");
46 var message = App.GetTranslation("t_msg_super_potato_mode_prompt");
47
48 value = MessageBox.Show(Owner, message, caption,
49 MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes;
50 }
51
52 Config.SuperLowSpecMode = value;
53 TriggerPropertyChanged(nameof(SuperLowSpecMode));
54 }
55 }
56
57 public bool IsActivated
58 {
59 get => Module.IsFound && Module.IsActivated;
60 set
61 {
62 if (!Module.IsFound)
63 {
64 MessageBox.Show(Owner, App.GetTranslation("t_msg_module_not_found"),
65 Program.Name, MessageBoxButton.OK, MessageBoxImage.Warning);
66
67 Module.SetActive(false);
68 TriggerPropertyChanged(nameof(IsActivated));
69

Callers

nothing calls this directly

Calls 5

GetTranslationMethod · 0.80
SetActiveMethod · 0.80
IsValidDirMethod · 0.80
KillUxAndRestartMethod · 0.80
OpenLinkMethod · 0.80

Tested by

no test coverage detected