System.Configuration.KeyValueConfigurationElement.Init C# (CSharp) Метод

Init() защищенный Метод

protected Init ( ) : void
Результат void
        protected internal override void Init() {
            base.Init();

            // We cannot initialize configuration properties in the constructor,
            // because Properties is an overridable virtual property that 
            // hence may not be available in the constructor.
            if (_needsInit) {
                _needsInit = false;
                base[_propKey] = _initKey;
                Value = _initValue;
            }
        }

Usage Example

 public void Add(KeyValueConfigurationElement keyValue)
 {
     keyValue.Init();
     KeyValueConfigurationElement element = (KeyValueConfigurationElement) base.BaseGet(keyValue.Key);
     if (element == null)
     {
         this.BaseAdd(keyValue);
     }
     else
     {
         element.Value = element.Value + "," + keyValue.Value;
         int index = base.BaseIndexOf(element);
         base.BaseRemoveAt(index);
         this.BaseAdd(index, element);
     }
 }
All Usage Examples Of System.Configuration.KeyValueConfigurationElement::Init
KeyValueConfigurationElement