public void Start(MainForm mainForm) { if (!this.firstInstance) return; this.server = new CommandLineServer(mainForm); this.server.Open(); // startupLock obtained in constructor, the server is now available to notifications this.startupLock.ReleaseMutex(); }
public void Start(MainForm mainForm) { if (!this.firstInstance) { return; } this.server = new CommandLineServer(mainForm); this.server.Open(); // startupLock obtained in constructor, the server is now available to notifications this.startupLock.ReleaseMutex(); }
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(); } }