void SingleInstanceManager_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { string[] args = new string[e.CommandLine.Count]; e.CommandLine.CopyTo(args, 0); mainForm.ProcessArgs(args); mainForm.Show(); }
protected override void OnCreateMainForm() { try { Factory.CurrentTheme = NimbusTheme.FromFile(Path.GetDirectoryName(Application.ExecutablePath) + "\\themes\\default\\default.theme"); } catch (ThemingError e) { MessageBox.Show(e.Error); Application.Exit(); } mainForm = new NimbusMain(Factory.CurrentTheme); this.MainForm = mainForm; string[] args = new string[this.CommandLineArgs.Count]; this.CommandLineArgs.CopyTo(args, 0); base.OnCreateMainForm(); mainForm.ProcessArgs(args); }