Exemple #1
0
 /// <summary>
 /// Creates a bool attribute with given key and value
 /// </summary>
 /// <param name="key"></param>
 /// <param name="value"></param>
 public virtual void SetBool(string key, bool value)
 {
     lock (attributesLock)
     {
         attributes[key] = new BoolAttribute(value);
     }
 }
Exemple #2
0
        /// <summary>
        /// Retrieves a bool or default value if key is not found
        /// </summary>
        /// <param name="key"></param>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public virtual bool GetBool(string key, bool defaultValue = false)
        {
            BoolAttribute attr = attributes.TryGetValue(key) as BoolAttribute;

            return(attr == null ? defaultValue : attr.value);
        }