Exemplo n.º 1
0
 protected void Execute(string[] args, StartLocal startDebug, StopLocal stopDebug, Assembly executingAssembly)
 {
     if (args.Length > 0)
     {
         CommandArguments commandArguments = new CommandArguments();
         if (!Parser.ParseArgumentsWithUsage(args, (object)commandArguments) || !commandArguments.DoExtendedValidations())
         {
             return;
         }
         if (commandArguments.ActionType == ActionType.Debug)
         {
             ServiceBase.RunDebug(startDebug, stopDebug);
         }
         else
         {
             this.RunInstallTask(commandArguments, executingAssembly);
         }
     }
     else
     {
         System.ServiceProcess.ServiceBase.Run((System.ServiceProcess.ServiceBase[]) new ServiceBase[1]
         {
             this
         });
     }
 }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (StartLocal != false)
            {
                hash ^= StartLocal.GetHashCode();
            }
            if (StartRemote != false)
            {
                hash ^= StartRemote.GetHashCode();
            }
            if (robot_ != null)
            {
                hash ^= Robot.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 3
0
 private static void RunDebug(StartLocal startDebug, StopLocal stopDebug)
 {
     try
     {
         if (startDebug == null)
         {
             throw new ArgumentNullException("startDebug");
         }
         if (stopDebug == null)
         {
             throw new ArgumentNullException("stopDebug");
         }
         Trace.Listeners.Add((TraceListener) new TextWriterTraceListener(Console.Out));
         Console.WriteLine("Attempting to start service. Hit Enter to stop the service");
         startDebug(new string[0]);
         Console.ReadKey();
         stopDebug();
         Trace.WriteLine("Debug finishing.");
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
Exemplo n.º 4
0
 protected void Execute(string[] args, StartLocal startDebug, StopLocal stopDebug)
 {
     this.Execute(args, startDebug, stopDebug, Assembly.GetCallingAssembly());
 }