static void Main() { if (!StartChecks.StartCheck()) { return; } // initialize DPIManager BEFORE setting // the application to be DPI aware DPIManager.PreInitialize(); User32Util.SetProcessDpiAwareness(ProcessDPIAwareness.ProcessPerMonitorDPIAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainForm form = new MainForm(); DPIManager.AddForm(form); DPIManager.ForceUpdate(); Settings sform = new Settings(); DPIManager.AddForm(sform); DPIManager.ForceUpdate(); SearchDisksForm sdf = new SearchDisksForm(form); DPIManager.AddForm(sdf); DPIManager.ForceUpdate(); Application.Run(form); }
static void Main(string[] args) { new Log(true); // Add the event handler for handling UI thread exceptions to the event. Application.ThreadException += new ThreadExceptionEventHandler(ThreadExceptionEventHandler); // Set the unhandled exception mode to force all Windows Forms errors // to go through our handler. Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); // Add the event handler for handling non-UI thread exceptions to the event. AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionEventHandler); // initialize DPIManager BEFORE setting // the application to be DPI aware DPIManager.PreInitialize(); User32Util.SetProcessDpiAwareness(ProcessDPIAwareness.ProcessPerMonitorDPIAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainForm form = new MainForm(args); DPIManager.AddForm(form); DPIManager.ForceUpdate(); Application.Run(form); }
static void Main() { // initialize DPIManager BEFORE setting // the application to be DPI aware DPIManager.PreInitialize(); User32Util.SetProcessDpiAwareness(ProcessDPIAwareness.ProcessPerMonitorDPIAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainForm form = new MainForm(); DPIManager.AddForm(form); DPIManager.ForceUpdate(); Application.Run(form); }
public SearchDisksForm(MainForm main) { this.main = main; InitializeComponent(); DPIManager.AddForm(this); DPIManager.ForceUpdate(); for (int x = 1; x <= 100; x++) { if (ini.IniReadValue("SearchPaths", x.ToString()) == "") { break; } else { disksBox.Items.Add(ini.IniReadValue("SearchPaths", x.ToString()), true); } } }
public Settings(MainForm mf, PositionsControl pc) { InitializeComponent(); DPIManager.AddForm(this); DPIManager.ForceUpdate(); Invalidate(); controllerGuids = new TextBox[] { controllerOneGuid, controllerTwoGuid, controllerThreeGuid, controllerFourGuid, controllerFiveGuid, controllerSixGuid, controllerSevenGuid, controllerEightGuid, controllerNineGuid, controllerTenGuid, controllerElevenGuid, controllerTwelveGuid, controllerThirteenGuid, controllerFourteenGuid, controllerFifteenGuid, controllerSixteenGuid }; controllerNicks = new TextBox[] { controllerOneNick, controllerTwoNick, controllerThreeNick, controllerFourNick, controllerFiveNick, controllerSixNick, controllerSevenNick, controllerEightNick, controllerNineNick, controllerTenNick, controllerElevenNick, controllerTwelveNick, controllerThirteenNick, controllerFourteenNick, controllerFifteenNick, controllerSixteenNick }; mainForm = mf as MainForm; positionsControl = pc; RefreshCmbNetwork(); if (ini.IniReadValue("Misc", "Network") != "") { cmb_Network.Text = ini.IniReadValue("Misc", "Network"); } else { cmb_Network.SelectedIndex = 0; } if (ini.IniReadValue("Misc", "SteamLang") != "") { cmb_Lang.Text = ini.IniReadValue("Misc", "SteamLang"); } else { cmb_Lang.SelectedIndex = 0; } //Hotkeys if (ini.IniReadValue("Hotkeys", "Close").Contains('+')) { string[] closeHk = ini.IniReadValue("Hotkeys", "Close").Split('+'); if ((closeHk[0] == "Ctrl" || closeHk[0] == "Alt" || closeHk[0] == "Shift") && closeHk[1].Length == 1 && Regex.IsMatch(closeHk[1], @"^[a-zA-Z0-9]+$")) { settingsCloseCmb.SelectedItem = closeHk[0]; settingsCloseHKTxt.Text = closeHk[1]; } } else { ini.IniWriteValue("Hotkeys", "Close", ""); } if (ini.IniReadValue("Hotkeys", "Stop").Contains('+')) { string[] stopHk = ini.IniReadValue("Hotkeys", "Stop").Split('+'); if ((stopHk[0] == "Ctrl" || stopHk[0] == "Alt" || stopHk[0] == "Shift") && stopHk[1].Length == 1 && Regex.IsMatch(stopHk[1], @"^[a-zA-Z0-9]+$")) { settingsStopCmb.SelectedItem = stopHk[0]; settingsStopTxt.Text = stopHk[1]; } } else { ini.IniWriteValue("Hotkeys", "Stop", ""); } if (ini.IniReadValue("Hotkeys", "TopMost").Contains('+')) { string[] topHk = ini.IniReadValue("Hotkeys", "TopMost").Split('+'); if ((topHk[0] == "Ctrl" || topHk[0] == "Alt" || topHk[0] == "Shift") && topHk[1].Length == 1 && Regex.IsMatch(topHk[1], @"^[a-zA-Z0-9]+$")) { settingsTopCmb.SelectedItem = topHk[0]; settingsTopTxt.Text = topHk[1]; } } //Controll GetControllers(); if (ini.IniReadValue("ControllerMapping", "Keyboard") != "") { keyboardNick.Text = ini.IniReadValue("ControllerMapping", "Keyboard"); } //Custom Layout //if (ini.IniReadValue("CustomLayout", "Enabled") != "") //{ // mutexLogCheck.Checked = Boolean.Parse(ini.IniReadValue("CustomLayout", "Enabled")); //} if (ini.IniReadValue("CustomLayout", "HorizontalLines") != "") { numHorDiv.Value = int.Parse(ini.IniReadValue("CustomLayout", "HorizontalLines")); } if (ini.IniReadValue("CustomLayout", "VerticalLines") != "") { numVerDiv.Value = int.Parse(ini.IniReadValue("CustomLayout", "VerticalLines")); } if (ini.IniReadValue("CustomLayout", "MaxPlayers") != "") { numMaxPlyrs.Value = int.Parse(ini.IniReadValue("CustomLayout", "MaxPlayers")); } //Misc if (ini.IniReadValue("Misc", "UseNicksInGame") != "") { useNicksCheck.Checked = Boolean.Parse(ini.IniReadValue("Misc", "UseNicksInGame")); } if (ini.IniReadValue("Misc", "DebugLog") != "") { debugLogCheck.Checked = Boolean.Parse(ini.IniReadValue("Misc", "DebugLog")); } if (ini.IniReadValue("Misc", "ShowStatus") != "") { statusCheck.Checked = Boolean.Parse(ini.IniReadValue("Misc", "ShowStatus")); } if (ini.IniReadValue("Misc", "KeepAccounts") != "") { keepAccountsCheck.Checked = Boolean.Parse(ini.IniReadValue("Misc", "KeepAccounts")); } if (ini.IniReadValue("Misc", "NucleusAccountPassword") != "") { nucUserPassTxt.Text = ini.IniReadValue("Misc", "NucleusAccountPassword"); } if (ini.IniReadValue("Audio", "Custom") == "0") { audioDefaultSettingsRadio.Checked = true; audioCustomSettingsBox.Enabled = false; } else { audioCustomSettingsRadio.Checked = true; } //if (ini.IniReadValue("Misc", "VibrateOpen") != "") //{ // check_Vibrate.Checked = Boolean.Parse(ini.IniReadValue("Misc", "VibrateOpen")); //} RefreshAudioList(); }
public Settings() { InitializeComponent(); DPIManager.AddForm(this); DPIManager.ForceUpdate(); }