/// <summary> /// Creates a long attribute with given key and value /// </summary> /// <param name="key"></param> /// <param name="value"></param> public virtual void SetLong(string key, long value) { lock (attributesLock) { attributes[key] = new LongAttribute(value); } }
/// <summary> /// Retrieves a long or default value if key is not found /// </summary> /// <param name="key"></param> /// <param name="defaultValue"></param> /// <returns></returns> public virtual long GetLong(string key, long defaultValue = 0) { LongAttribute attr = (LongAttribute)attributes.TryGetValue(key); return(attr == null ? defaultValue : attr.value); }