private void Startup() { string vpnPath = GetVPNPath(); if (vpnPath == null) { string eventlogAppName = "OpenVPNManager"; if (!EventLog.SourceExists(eventlogAppName)) EventLog.CreateEventSource(eventlogAppName, "Application"); EventLog.WriteEntry(eventlogAppName, "Will not start - no service parameters found", EventLogEntryType.Error, 0); return; } List<string> configs = UtilsHelper.LocateOpenVPNManagerConfigs(true); foreach (String config in configs) { OpenVPNService openVPNservice = new OpenVPNService(this, vpnPath, config); openVPNservices.Add(openVPNservice); openVPNservice.Start(); } ServiceHelper.MinimizeFootprint(); Timer timerReference = new Timer( delegate(object state) { ServiceHelper.MinimizeFootprint(); timerReference = null; }, null, 5000, 0); }
private void Startup() { string vpnPath = GetVPNPath(); if (vpnPath == null) { string eventlogAppName = "OpenVPNManager"; if (!EventLog.SourceExists(eventlogAppName)) { EventLog.CreateEventSource(eventlogAppName, "Application"); } EventLog.WriteEntry(eventlogAppName, "Will not start - no service parameters found", EventLogEntryType.Error, 0); return; } List <string> configs = UtilsHelper.LocateOpenVPNManagerConfigs(true); foreach (String config in configs) { OpenVPNService openVPNservice = new OpenVPNService(this, vpnPath, config); openVPNservices.Add(openVPNservice); openVPNservice.Start(); } ServiceHelper.MinimizeFootprint(); Timer timerReference = new Timer( delegate(object state) { ServiceHelper.MinimizeFootprint(); timerReference = null; }, null, 5000, 0); }