public void SetValueIfNotSet(ProtocolLoggerData dataType, uint value) { if (this.storedData[dataType] == null) { this.storedData[dataType] = value; } }
public void SetValue(ProtocolLoggerData dataType, string value) { if (dataType == ProtocolLoggerData.DomainController && string.IsNullOrEmpty(value)) { return; } this.storedData[dataType] = value; }
public void SetTrimmedValue(ProtocolLoggerData dataType, string value, int maxLength) { if (dataType == ProtocolLoggerData.DomainController && string.IsNullOrEmpty(value)) { return; } if (value != null && value.Length > maxLength) { value = value.Remove(maxLength); } this.storedData[dataType] = value; }
public bool TryGetValue <T>(ProtocolLoggerData key, out T data) { object obj = this.storedData[key]; if (obj != null && obj is T) { data = (T)((object)obj); return(true); } data = default(T); return(false); }
public void AppendValue(ProtocolLoggerData dataType, string value) { if (dataType == ProtocolLoggerData.DomainController && string.IsNullOrEmpty(value)) { return; } if (this.storedData.ContainsKey(dataType) && this.storedData[dataType] != null) { this.storedData[dataType] = (string)this.storedData[dataType] + ";" + value; return; } this.SetValue(dataType, value); }
public int GetIntegerValue(ProtocolLoggerData dataType) { object obj = this.storedData[dataType]; if (obj == null) { return(0); } if (obj is int) { return((int)obj); } throw new ArgumentException("The dataType is not an integer"); }
public void IncrementValueBy(ProtocolLoggerData dataType, int incBy) { if (incBy == 0) { return; } object obj = this.storedData[dataType]; if (obj == null) { this.storedData[dataType] = incBy; return; } if (obj is int) { this.storedData[dataType] = (int)obj + incBy; return; } throw new ArgumentException("The dataType is not an integer"); }
public void SetValue(ProtocolLoggerData dataType, ExDateTime value) { this.storedData[dataType] = value; }
public void IncrementValue(ProtocolLoggerData dataType) { this.IncrementValueBy(dataType, 1); }