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); } }
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); } }
public EPITimeout(int installationNo, EPIProcessType processType, DateTime lastUpdatedTime) { this.InstallationNo = installationNo; this.ProcessType = processType; this.LastUpdatedTime = lastUpdatedTime; }
public string PrepareKey(int installationNo, EPIProcessType processType) { return(string.Format("{0:D},{1:D}", installationNo, (int)processType)); }