private void StartServer(MainForm mainForm, CommandLineArgs commandLine) { if (!commandLine.SingleInstance) { return; } this.server = new CommandLineServer(mainForm); this.server.Open(); }
private bool ForwardCommand(CommandLineArgs args) { try { // wait until the main instance startup/shutdown ends this.startupLock.WaitOne(); ICommandLineService client = CommandLineServer.CreateClient(); client.ForwardCommand(args); return(true); } catch { return(false); } finally { this.startupLock.ReleaseMutex(); } }