示例#1
0
        private void Menu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!FormReady)
            {
                return;
            }
            string Text = (Menu.SelectedItem as TabItem).Header.ToString();

            switch (Text.ToLower())
            {
            case "multirpc":
            {
                RPC.Type = "default";
                if (!IsRPCOn())
                {
                    BtnToggleRPC.Content = "Start MultiRPC";
                }
            }
            break;

            case "custom":
            {
                RPC.Type = "custom";
                if (RPC.Config.Disabled.HelpIcons)
                {
                    FuncSettings.DisableHelpIcons();
                }
                CheckProfileMenuWidth();
                if (!IsRPCOn())
                {
                    BtnToggleRPC.Content = "Start Custom";
                }
            }
            break;

            case "settings":
            {
                if (FirstSettings)
                {
                    FirstSettings = false;
                    FormReady     = false;
                    if (RPC.Config.AFKTime)
                    {
                        App.WD.ToggleAfkTime.IsChecked = true;
                    }
                    TextDev.Content = App.Developer;
                    if (RPC.Config.Disabled.HelpIcons)
                    {
                        App.WD.ToggleHelpIcons.IsChecked = true;
                    }
                    if (RPC.Config.Disabled.ProgramsTab)
                    {
                        App.WD.ToggleProgramsTab.IsChecked = true;
                    }
                    FormReady = true;
                }
            }
            break;
            }
        }
示例#2
0
 private void ToggleSetting(object sender, RoutedEventArgs e)
 {
     if (!FormReady)
     {
         return;
     }
     if (sender is CheckBox checkBox)
     {
         FuncSettings.ToggleSetting(this, checkBox.Tag.ToString());
     }
     else if (sender is ComboBox comboBox)
     {
         FuncSettings.SelectAutoStart(comboBox);
     }
     else
     {
         RPC.Log.Error("App", "Unknown setting");
     }
 }