public static SchedulerService GetService()
        {
            if (m_instance == null)
            {
                m_instance = new SchedulerService();
            }

            return(m_instance);
        }
예제 #2
0
 static void Main(string[] args)
 {
     if (args.Length > 0 && args[0].ToLower().StartsWith("-c"))
     {
         TextWriterTraceListener[] listener = new TextWriterTraceListener[] { new TextWriterTraceListener(Console.Out) };
         Debug.Listeners.AddRange(listener);
         try
         {
             service = new ServiceHost(SchedulerService.GetService());
             service.Open();
             Trace.WriteLine("Scheduler Service Started...");
             Trace.WriteLine("Press Enter to close Service");
             Console.ReadLine();
             service.Close();
         }
         catch (Exception e)
         {
             Trace.WriteLine(e.Message + "-" + e.StackTrace);
             Console.ReadLine();
         }
     }
 }
 private SchedulerService()
 {
     m_instance = this;
     this.StartScheduler();
 }