Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        /// <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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 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);
 }
Beispiel #5
0
        /// <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;
        }
Beispiel #6
0
 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;
 }
Beispiel #7
0
        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;
        }
Beispiel #8
0
        /// <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;
        }