Ejemplo n.º 1
0
        public void AddTask(ExecInfoModelBase execInfo)
        {
            if (_timerCollection == null)
            {
                _timerCollection = new List <CustomTimerBase>();
            }

            _timerCollection.Add(TimerLoadingFactory.CreateTimerType(execInfo));
        }
Ejemplo n.º 2
0
        private static string GetTimerTypeName(ExecInfoModelBase execType)
        {
            string removeSuffix = "InfoModel";

            StringBuilder execName = new StringBuilder(execType.GetType().Name);

            execName.Replace(removeSuffix, string.Empty);

            return(execName.ToString());
        }
Ejemplo n.º 3
0
        public static CustomTimerBase CreateTimerType(ExecInfoModelBase execType)
        {
            string prefix      = "TasksManager.";
            string timerSuffix = "Timer";

            StringBuilder timerName = new StringBuilder(prefix);

            timerName.Append(GetTimerTypeName(execType));
            timerName.Append(timerSuffix);

            Type   timerType = Type.GetType(timerName.ToString());
            object instance  = Activator.CreateInstance(timerType, execType);

            return(instance as CustomTimerBase);
        }
Ejemplo n.º 4
0
 public CustomTimerBase(ExecInfoModelBase execInfo)
 {
     this.ReportTask += TaskMessageQueue.GetInstance().AddToQueue;
 }