Esempio n. 1
0
 public void SetValueIfNotSet(ProtocolLoggerData dataType, uint value)
 {
     if (this.storedData[dataType] == null)
     {
         this.storedData[dataType] = value;
     }
 }
Esempio n. 2
0
 public void SetValue(ProtocolLoggerData dataType, string value)
 {
     if (dataType == ProtocolLoggerData.DomainController && string.IsNullOrEmpty(value))
     {
         return;
     }
     this.storedData[dataType] = value;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
        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");
        }
Esempio n. 7
0
        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");
        }
Esempio n. 8
0
 public void SetValue(ProtocolLoggerData dataType, ExDateTime value)
 {
     this.storedData[dataType] = value;
 }
Esempio n. 9
0
 public void IncrementValue(ProtocolLoggerData dataType)
 {
     this.IncrementValueBy(dataType, 1);
 }