Exemplo n.º 1
0
        private void StartServer(MainForm mainForm, CommandLineArgs commandLine)
        {
            if (!commandLine.SingleInstance)
            {
                return;
            }

            this.server = new CommandLineServer(mainForm);
            this.server.Open();
        }
Exemplo n.º 2
0
 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();
     }
 }