예제 #1
0
 private static void CreateService(bool testing)
 {
     if (service != null)
     {
         service.Dispose();
     }
     service = IPBanService.CreateService(testing);
     service.Start();
     eventViewer = new IPBanWindowsEventViewer(service);
 }
예제 #2
0
        private static void CreateService(bool test)
        {
            if (service != null)
            {
                service.Dispose();
            }
            service = IPBanService.CreateService();
            if (test)
            {
                // TODO: Move to unit test project
                service.MultiThreaded     = false;
                service.ManualCycle       = true;
                service.SubmitIPAddresses = false;
                service.DB.Truncate(true);
            }
            service.Start();

            // attach Windows event viewer to the service
            eventViewer = new IPBanWindowsEventViewer(service);
        }