Пример #1
0
      public Event(IEventTimer timer, string name = null, TimerEvent body = null, TimeSpan? interval = null, IConfigSectionNode config = null) : base(timer)
      {
         if ((timer as IEventTimerImplementation) == null)
          throw new TimeException(StringConsts.ARGUMENT_ERROR + "Event.ctor(timer=null | timer!=IEventTimerImplementation)");

         m_Timer = timer;

         if (body!=null)
          Body += body;

         if (interval.HasValue)
          m_Interval = interval.Value;
      
         if (config!=null)
         {
           Configure(config);
           m_Name = config.AttrByName(Configuration.CONFIG_NAME_ATTR).Value;
         }
      
         if (name.IsNotNullOrWhiteSpace())
           m_Name = name;

         if (m_Name.IsNullOrWhiteSpace()) m_Name = Guid.NewGuid().ToString();

         ((IEventTimerImplementation)timer).__InternalRegisterEvent(this);
      }
Пример #2
0
 public DeleteFilesJob(
     IEventTimer timer,
     string name = null,
     TimeSpan? interval = null,
     IConfigSectionNode config = null,
     FileSystem fs = null,
     FileSystemSessionConnectParams fsConnectParams = null,
     string fsRootPath = null
     )
     : base(timer, name, null, interval, config, EventBodyAsyncModel.LongRunningAsyncTask)
 {
     if (fs!=null) m_FS = fs;
       if (fsConnectParams!=null) m_FSConnectParams = fsConnectParams;
       if (fsRootPath.IsNotNullOrWhiteSpace()) m_FSRootPath  = fsRootPath;
 }
Пример #3
0
        public Event(IEventTimer timer,
                     string name                        = null,
                     TimerEvent body                    = null,
                     TimeSpan?interval                  = null,
                     IConfigSectionNode config          = null,
                     EventBodyAsyncModel bodyAsyncModel = EventBodyAsyncModel.AsyncTask,
                     bool enabled                       = true) : base(timer)
        {
            if ((timer as IEventTimerImplementation) == null)
            {
                throw new TimeException(StringConsts.ARGUMENT_ERROR + "Event.ctor(timer=null | timer!=IEventTimerImplementation)");
            }

            m_Enabled = enabled;

            m_Timer = timer;

            if (body != null)
            {
                Body += body;
            }

            if (interval.HasValue)
            {
                m_Interval = interval.Value;
            }

            BodyAsyncModel = bodyAsyncModel;

            if (config != null)
            {
                Configure(config);
                m_Name = config.AttrByName(Configuration.CONFIG_NAME_ATTR).Value;
            }

            if (name.IsNotNullOrWhiteSpace())
            {
                m_Name = name;
            }

            if (m_Name.IsNullOrWhiteSpace())
            {
                m_Name = Guid.NewGuid().ToString();
            }

            ((IEventTimerImplementation)timer).__InternalRegisterEvent(this);
        }
Пример #4
0
 public DeleteFilesJob(
     IEventTimer timer,
     string name               = null,
     TimeSpan?interval         = null,
     IConfigSectionNode config = null,
     FileSystem fs             = null,
     FileSystemSessionConnectParams fsConnectParams = null,
     string fsRootPath = null
     ) : base(timer, name, null, interval, config, EventBodyAsyncModel.LongRunningAsyncTask)
 {
     if (fs != null)
     {
         m_FS = fs;
     }
     if (fsConnectParams != null)
     {
         m_FSConnectParams = fsConnectParams;
     }
     if (fsRootPath.IsNotNullOrWhiteSpace())
     {
         m_FSRootPath = fsRootPath;
     }
 }
Пример #5
0
 public DeleteFilesJob(IEventTimer timer, IConfigSectionNode config) : this(timer, null, config : config)
 {
 }
Пример #6
0
 public Event(IEventTimer timer, IConfigSectionNode config) : this(timer, null, null, null, config)
 {
 }
Пример #7
0
 public Event(IEventTimer timer, IConfigSectionNode config)
     : this(timer, null, config: config)
 {
 }
Пример #8
0
 public DeleteFilesJob(IEventTimer timer, IConfigSectionNode config)
     : this(timer, null, config: config)
 {
 }