protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs eventArgs) { _app = new App(); _app.Run(); return(false); }
protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { // First time app is launched app = new SingleInstanceApplication(); app.Run(); return(false); }
protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { app = new UkuleleApp(); app.StartupUri = new Uri("MainWindow.xaml", UriKind.Relative); app.Run(); return(false); }
protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { BeforeStartup?.Invoke(); app = new T(); app.Run(); return(false); }
protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { app = new App(); app.InitializeComponent(); app.Run(); return(false); }
protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs eventArgs) { // First time _application is launched _commandLine = eventArgs.CommandLine; _application = new SingleInstanceApplication(); _application.Run(); return(false); }
void SingleInstanceController_Startup(object sender, Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { if (!Util.VerifyKey()) { RegisterForm form = new RegisterForm(); DialogResult res = form.ShowDialog(); if (res == DialogResult.OK) { Application.Restart(); } e.Cancel = true; return; } Login log = null; Program.usersManager = UsersManager.LoadUsers(); User currentUser = null; #if !DEBUG while (true) { log = new Login(); log.LabelClicked += new EventHandler(log_LabelClicked); log.LoginButtonClick += new EventHandler(log_LoginButtonClick); if (log.ShowDialog() != DialogResult.OK) { e.Cancel = true; return; } currentUser = Program.usersManager.GetUser(log.UserName, log.Password); if (currentUser != null) { break; } else { Util.ShowErrorMessage(Properties.Resources.ErrorUserNameOrPassword); } } #endif #if DEBUG currentUser = Program.usersManager.GetUser("admin", "admin"); #endif System.Threading.Thread.CurrentPrincipal = currentUser.ToPrincipal(); if (e.CommandLine.Count > 0) { Program.directory = e.CommandLine[0]; } }
/// <summary> /// "Entry" point that inits the D-IDE Mainform /// </summary> protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs eventArgs) { var CurrentApp = new Application(); var mw = new MainWindow(eventArgs.CommandLine); CurrentApp.MainWindow = mw; CurrentApp.Run(); // Return false to avoid base.Run() throwing an exception that no Winforms MainWindow could be found return(false); }
//当应用程序启动时触发的OnStartup()方法,此时重写该方法并创建WPF应用程序对象 protected override bool OnStartup( Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { string extension = ".testDoc"; string title = "WPF_SingleInstanceApplication"; string extensionDescription = "A Test Document"; //Uncomment this line to create the file registration. //In Windows Vista, you'll need to run the application as an administrator. //FileRegistrationHelper.SetFileAssociation(extension, title + "." + extensionDescription); app = new WpfApp(); app.Run(); return(false); }
void SingleInstanceController_Startup(object sender, Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { bool shouldReturn; RequestRegistrationIfInvalidKey(out shouldReturn); if (shouldReturn) { e.Cancel = shouldReturn; return; } var directory = string.Empty; if (e.CommandLine.Count > 0) { directory = e.CommandLine[0]; } InitProgram(directory); }
protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { app = new SingleInstance.App(); if (e.CommandLine.Count > 0) { String[] cmdLine = new string[1]; cmdLine[0] = e.CommandLine[0]; app.commandLine = cmdLine; // } app.InitializeComponent(); app.Run(); return(false); }
protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs eventArgs) { app = new App();//创建当前的App实例 app.Exit += (sender, e) => { if (app.AutoReStart) { ReStart(); } };//关闭本程序时 如果配置设定AutoReStart为true则自动重启 app.DispatcherUnhandledException += (sender, e) => { if (app.AutoReStart) { ReStart(); } };//出现任何不可处理的异常时 如果配置设定AutoReStart为true则自动重启 app.Run(); return(false); }
private void MyApplication_Startup(object sender, Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { GetDataLayers(); }
private void OnAppStart(object sender, Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { SM64Lib.TextValueConverter.TextValueConverter.WantIntegerValueMode += ee => ee.IntegerValueMode = SettingsManager.Settings.General.IntegerValueMode; }
private void MyApplication_Startup(object sender, Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { LoadSettings(); TheProDev.clsRegistration.ValidateRegistration(); }
protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { app = new SingleInstanceApplication(); app.Run(); return false; }