예제 #1
0
 static void Main()
 {
     var service = new MainService();
     service.InizializzaLogging();
     if (System.Diagnostics.Debugger.IsAttached || Environment.UserInteractive) {
         Application.EnableVisualStyles();
         Application.Run(new MainForm(service));
     } else {
         ServiceBase.Run(new ServiceBase[] { service });
     }
 }
예제 #2
0
 public MainForm(MainService service)
 {
     InitializeComponent();
     _service = service;
     _service.StartServer(this);
 }