public MainForm() { Program.Log.Info("Initializing"); // Initialize InitializeComponent(); // Set this instance Form = this; // Show Splash Screen Controls.Add(FormSplashScreen); FormSplashScreen.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom; FormSplashScreen.Location = new Point(0, 0); FormSplashScreen.Size = Form.ClientSize; FormSplashScreen.BringToFront(); FormSplashScreen.Show(); // Set default preferences ComboBoxType.SelectedIndex = 0; ComboBoxSort.SelectedIndex = 0; ComboBoxHost.SelectedIndex = 0; Program.Log.Info("Initialized"); }
[STAThread] //Single Apartment Thread only static void Main() { Logger.Init(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(true); _splashScreen = new FormSplashScreen(); Application.Run(_splashScreen); #if !DEBUG if (_splashScreen.DialogResult == DialogResult.OK) { #endif _splashScreen.Dispose(); Application.Run(new FormMainScreen()); #if !DEBUG } #endif if (Server.ShuttingDown || Server.Running) { Server.Stop(); ServerSettings.Save(); GuiSettings.Save(); } }
public MainForm() { Program.Log.Info("Initializing"); InitializeComponent(); Form = this; Controls.Add(FormSplashScreen); FormSplashScreen.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom; FormSplashScreen.Location = new Point(0, 0); FormSplashScreen.Size = Form.ClientSize; FormSplashScreen.BringToFront(); FormSplashScreen.Show(); ListboxSearchType.SelectedIndex = 0; DropdownSearchSort.SelectedIndex = 0; DropdownSearchSizePrefix.SelectedIndex = 0; DateTimeMaxMTime.Value = DateTime.Now; }
private static bool LaunchAction(string[] args, bool isFirstInstance) { if (isFirstInstance) { // Use GDI strings everywhere Application.SetCompatibleTextRenderingDefault(false); InitializeApplicationEnvironment(); string downloadUrl = UpdateSettings.CheckForBetaUpdates ? UpdateSettings.BetaUpdateDownloadUrl : UpdateSettings.UpdateDownloadUrl; RegisterSquirrelEventHandlers(downloadUrl); try { // TODO:OLW // using (WindowsLiveSetup windowsLiveSetup = new WindowsLiveSetup()) // { try { // TODO:OLW // Load the culture. LoadCulture("en"); // Apply any culture overrides. WriterCommandLineOptions opts = WriterCommandLineOptions.Create(args); if (!String.IsNullOrEmpty(opts.CultureOverride)) { LoadCulture(opts.CultureOverride); } // Save the current culture for other instances. currentUICulture = CultureInfo.CurrentUICulture; // show splash screen IDisposable splashScreen = null; // Show the splash screen. SplashScreen splashScreenForm = new SplashScreen(); splashScreenForm.ShowSplashScreen(); splashScreen = new FormSplashScreen(splashScreenForm); LaunchFirstInstance(splashScreen, args); } finally { // TODO:OLW // windowsLiveSetup.ClearThreadUILanguages(); } // } } catch (Exception) { // Most likely we failed to create WLSetupClass, installation corrupt or incomplete // Redirect user to repair/reinstall. DisplayMessage.Show(MessageId.WriterCannotStart); } return(true); } else { return(LaunchAdditionalInstance(args)); } }