Exemple #1
0
 protected void OnGetDefault(PropertyDefaultArgs e)
 {
     if (PropertyDefaults != null)
     {
         PropertyDefaults(this, e);
     }
 }
Exemple #2
0
        /// <summary>
        /// Gets a property out of the collection.
        /// </summary>
        /// <returns>
        /// The property, or <code>null</code>, if the property wasn't found.
        /// </returns>
        /// <param name="key">
        /// The name of the property.
        /// </param>
        public object GetProperty(string key)
        {
            if (!_preferences.ContainsKey(key))
            {
                object def = null;

                PropertyDefaultArgs e = new PropertyDefaultArgs(key, def);
                OnGetDefault(e);
                if (e.Value != null)
                {
                    _preferences[key] = e.Value;
                    return(e.Value);
                }
            }

            object obj = _preferences[key];

            return(obj);
        }