Inheritance: System.Windows.Forms.Form
Esempio n. 1
0
 protected override void OnStart(string[] args)
 {
     try {
         Debug.Print("Starting");
         try {
             EventLog.WriteEntry("Service starting");
         }
         catch {
             Debug.Print("Writing to the event log is failing");
         }
         needsShutdown = new ManualResetEvent(false);
         base.OnStart(args);
         hiddenform = new HiddenForm();
         new Thread(RunMessagePump, 1024 * 256).Start();
         hiddenform.started.WaitOne();
         starting = false;
         running  = false;
         OnNeedsReset();
     }
     catch (Exception e) {
         Debug.Print("Exception :" + e.ToString());
         try {
             EventLog.WriteEntry("Exception :" + e.ToString());
         }
         catch {}
     }
 }
Esempio n. 2
0
 protected override void OnStart(string[] args)
 {
     try {
         Debug.Print("Starting");
         try {
             EventLog.WriteEntry("Service starting");
         }
         catch {
             Debug.Print("Writing to the event log is failing");
         }
         needsShutdown = new ManualResetEvent(false);
         base.OnStart(args);
         hiddenform = new HiddenForm();
         new Thread(RunMessagePump, 1024*256).Start();
         hiddenform.started.WaitOne();
         starting = false;
         running = false;
         OnNeedsReset();
     }
     catch (Exception e) {
         Debug.Print("Exception :" + e.ToString());
         try {
             EventLog.WriteEntry("Exception :"+e.ToString());
         }
         catch{}
     }
 }