Ejemplo n.º 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     Logger.Info(Assembly.GetExecutingAssembly().GetCustomAttribute <AssemblyTitleAttribute>().Title + ": v" + Assembly.GetExecutingAssembly().GetName().Version.ToString(), ConsoleColor.Yellow);
     Logger.Info("Service: Starting...");
     if (args.Length != 0)
     {
         if (args.Contains("/debug"))
         {
             ImmediateAccess.Start(args);
             Console.Read();
             ImmediateAccess.Stop().Wait();
             return;
         }
     }
     ServiceBase[] ServicesToRun;
     ServicesToRun = new ServiceBase[]
     {
         new Main()
     };
     ServiceBase.Run(ServicesToRun);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Service on-stop interface.
 /// </summary>
 protected override void OnStop()
 {
     ImmediateAccess.Stop().Wait();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Service on-start interface.
 /// </summary>
 protected override void OnStart(string[] args)
 {
     ImmediateAccess.Start(args);
 }