Пример #1
0
        private EPITimeout RemoveTimeout(int installationNo, EPIProcessType processType)
        {
            using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "RemoveTimeout"))
            {
                EPITimeout result = null;

                try
                {
                    string fullKey = this.PrepareKey(installationNo, processType);
                    _collection.TryRemove(fullKey, out result);
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return(result);
            }
        }
Пример #2
0
        private EPITimeout AddOrUpdateTimeout(int installationNo, EPIProcessType processType, DateTime lastUpdatedTime)
        {
            using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "AddOrUpdateTimeout"))
            {
                EPITimeout result = null;

                try
                {
                    string fullKey = this.PrepareKey(installationNo, processType);
                    result = _collection.AddOrGet(fullKey, () => { return(new EPITimeout()); });
                    result.InstallationNo  = installationNo;
                    result.ProcessType     = processType;
                    result.LastUpdatedTime = lastUpdatedTime;
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return(result);
            }
        }
Пример #3
0
 public EPITimeout(int installationNo, EPIProcessType processType, DateTime lastUpdatedTime)
 {
     this.InstallationNo  = installationNo;
     this.ProcessType     = processType;
     this.LastUpdatedTime = lastUpdatedTime;
 }
Пример #4
0
 public string PrepareKey(int installationNo, EPIProcessType processType)
 {
     return(string.Format("{0:D},{1:D}", installationNo, (int)processType));
 }