コード例 #1
0
ファイル: Config.cs プロジェクト: biuken/eAnt
 protected void OnGetDefault(PropertyDefaultArgs e)
 {
     if (PropertyDefaults != null)
     {
         PropertyDefaults(this, e);
     }
 }
コード例 #2
0
ファイル: Config.cs プロジェクト: biuken/eAnt
        /// <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);
        }