public void IncrementValueBy(string folderId, PerFolderProtocolLoggerData dataType, int incBy) { if (folderId == null) { folderId = "null"; } Hashtable hashtable; if (!this.storedFolders.TryGetValue(folderId, out hashtable)) { hashtable = new Hashtable(); this.storedFolders[folderId] = hashtable; } if (incBy == 0) { return; } object obj = hashtable[dataType]; if (obj == null) { hashtable[dataType] = incBy; return; } if (obj is int) { hashtable[dataType] = (int)obj + incBy; return; } throw new ArgumentException("The dataType is not an integer"); }
public int GetIntegerValue(string folderId, PerFolderProtocolLoggerData dataType) { if (folderId == null) { folderId = "null"; } Hashtable hashtable; if (!this.storedFolders.TryGetValue(folderId, out hashtable)) { hashtable = new Hashtable(); this.storedFolders[folderId] = hashtable; } object obj = hashtable[dataType]; if (obj == null) { return(0); } if (obj is int) { return((int)obj); } throw new ArgumentException("The dataType is not an integer"); }
private object GetIntegerValueAsObject(string folderId, PerFolderProtocolLoggerData dataType) { Hashtable hashtable; if (!this.storedFolders.TryGetValue(folderId, out hashtable)) { return(ProtocolLogger.PreBoxedZero); } object obj = hashtable[dataType]; if (obj == null) { return(ProtocolLogger.PreBoxedZero); } return(obj); }
private void InternalSetValue(string folderId, PerFolderProtocolLoggerData dataType, object value) { if (folderId == null) { folderId = "null"; } if (value == null) { return; } Hashtable hashtable; if (!this.storedFolders.TryGetValue(folderId, out hashtable)) { hashtable = new Hashtable(); this.storedFolders[folderId] = hashtable; } hashtable[dataType] = value; }
public void IncrementValue(string folderId, PerFolderProtocolLoggerData dataType) { this.IncrementValueBy(folderId, dataType, 1); }
public void SetValue(string folderId, PerFolderProtocolLoggerData dataType, string value) { this.InternalSetValue(folderId, dataType, value); }