Beispiel #1
0
 internal void OnStartService(string[] args)
 {
     if (ChoApplication.ApplicationMode == ChoApplicationMode.Service)
     {
         ChoQueuedExecutionService.GetService("Local").Enqueue(() =>
         {
             OnStart(args);
         });
     }
     else
     {
         OnStart(args);
     }
 }
Beispiel #2
0
        internal void OnStartService(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                ChoEnvironment.CommandLineArgs = Environment.GetCommandLineArgs().Skip(1).ToArray();
            }
            else
            {
                ChoEnvironment.CommandLineArgs = args;
            }

            if (ChoApplication.ApplicationMode == ChoApplicationMode.Service)
            {
                if (ChoServiceInstallerSettings.Me.Timeout <= 0)
                {
                    ChoQueuedExecutionService.GetService("Local").Enqueue(() =>
                    {
                        OnStart(ChoEnvironment.CommandLineArgs);
                    },
                                                                          (result) =>
                    {
                        result.EndInvoke();
                    },
                                                                          null);
                }
                else
                {
                    OnStart(ChoEnvironment.CommandLineArgs);
                }
            }
            else
            {
                OnStart(ChoEnvironment.CommandLineArgs);
                PostStart();
            }
        }