/// <summary> /// Module initialization /// </summary> /// <returns></returns> public override ModuleError ModuleStart() { ModuleError me = new ModuleError(); me.errorType = ModuleErrorType.Success; try { LoadConfig(); if (PersistentData == null) { data = new ScanData(); } else { data = (ScanData)PersistentData; } // set our timer to do stuff janitor.Elapsed += new ElapsedEventHandler(timer_Tick); janitor.Interval = 60000; janitor.Enabled = true; janitor.Start(); } catch (Exception e) { me.errorMessage = e.Message; me.errorType = ModuleErrorType.UnknownError; me.moduleName = "Scan Detector"; data = new ScanData(); } return(me); }
/// <summary> /// Module initialization /// </summary> /// <returns></returns> public override bool ModuleStart() { try { data = Load <ScanData>(); if (null == data) { data = new ScanData(); } // set our timer to do stuff janitor.Elapsed += new ElapsedEventHandler(timer_Tick); janitor.Interval = 60000; janitor.Enabled = true; janitor.Start(); } catch (Exception e) { LogCenter.Instance.LogException(e); data = new ScanData(); return(false); } return(true); }
public override ModuleError ModuleStop() { if (null != data) { if (!data.Save) { data = new ScanData(); } PersistentData = data; SaveConfig(); } ModuleError me = new ModuleError(); me.errorType = ModuleErrorType.Success; return(me); }
public override bool ModuleStop() { try { ScanData d = data; if (null != data) { if (!data.Save) { data = new ScanData(); } } Save <ScanData>(d); } catch (Exception e) { LogCenter.Instance.LogException(e); return(false); } return(true); }
/// <summary> /// Module initialization /// </summary> /// <returns></returns> public override bool ModuleStart() { try { data = Load<ScanData>(); if (null == data) data = new ScanData(); // set our timer to do stuff janitor.Elapsed += new ElapsedEventHandler(timer_Tick); janitor.Interval = 60000; janitor.Enabled = true; janitor.Start(); } catch (Exception e) { LogCenter.Instance.LogException(e); data = new ScanData(); return false; } return true; }
public override bool ModuleStop() { try { ScanData d = data; if (null != data) { if (!data.Save) data = new ScanData(); } Save<ScanData>(d); } catch (Exception e) { LogCenter.Instance.LogException(e); return false; } return true; }
public override ModuleError ModuleStop() { if (null != data) { if (!data.Save) data = new ScanData(); PersistentData = data; SaveConfig(); } ModuleError me = new ModuleError(); me.errorType = ModuleErrorType.Success; return me; }
/// <summary> /// Module initialization /// </summary> /// <returns></returns> public override ModuleError ModuleStart() { ModuleError me = new ModuleError(); me.errorType = ModuleErrorType.Success; try { LoadConfig(); if (PersistentData == null) data = new ScanData(); else data = (ScanData)PersistentData; // set our timer to do stuff janitor.Elapsed += new ElapsedEventHandler(timer_Tick); janitor.Interval = 60000; janitor.Enabled = true; janitor.Start(); } catch (Exception e) { me.errorMessage = e.Message; me.errorType = ModuleErrorType.UnknownError; me.moduleName = "Scan Detector"; data = new ScanData(); } return me; }