/// <summary> /// Initializes this instance. /// </summary> internal static void Initialize() { if (_providers == null) { lock (typeof(ControlProperties)) { if (_providers == null) { ControlPropertiesSection section = (ControlPropertiesSection) ConfigurationManager.GetSection("mediachase.ControlPropertiesProviders/storageProvider"); if (section == null) { _providers = new ControlPropertiesProviderCollection(); _enabled = false; } else { _enabled = section.Enabled; section.ValidateDefaultProvider(); _providers = section.ControlPropertiesCollecition; _defaultProvider = _providers[section.DefaultProvider]; _providers.SetReadOnly(); } } } } }
/// <summary> /// Adds the specified provider. /// </summary> /// <param name="provider">The provider.</param> public void Add(ControlPropertiesBase provider) { if (provider == null) { throw new ArgumentNullException("provider"); } base.Add(provider); }
/// <summary> /// Adds the array. /// </summary> /// <param name="providerArray">The provider array.</param> public void AddArray(ControlPropertiesBase[] providerArray) { if (providerArray == null) { throw new ArgumentNullException("providerArray"); } foreach (ControlPropertiesBase provider in providerArray) { if (this[provider.Name] != null) { throw new ArgumentException("ControlPropertiesBase already exists."); } this.Add(provider); } }