예제 #1
0
		public void Ctors ()
		{
			WsiProfilesElement el = new WsiProfilesElement ();
			Assert.AreEqual (WsiProfiles.None, el.Name, "A1");

			el = new WsiProfilesElement (WsiProfiles.BasicProfile1_1);
			Assert.AreEqual (WsiProfiles.BasicProfile1_1, el.Name, "A2");
		}
예제 #2
0
 public int IndexOf(WsiProfilesElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     return(base.BaseIndexOf(element));
 }
 public int IndexOf(WsiProfilesElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     return base.BaseIndexOf(element);
 }
예제 #4
0
 public void Remove(WsiProfilesElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     base.BaseRemove(this.GetElementKey(element));
 }
 public void Remove(WsiProfilesElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     base.BaseRemove(this.GetElementKey(element));
 }
 public void CopyTo(WsiProfilesElement[] array, int index)
 {
     if (array == null)
     {
         throw new ArgumentNullException("array");
     }
     ((ICollection) this).CopyTo(array, index);
 }
 public void Add(WsiProfilesElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     this.BaseAdd(element);
 }
예제 #8
0
		public void GetSet ()
		{
			WsiProfilesElement el = new WsiProfilesElement ();

			el.Name = WsiProfiles.BasicProfile1_1;

			Assert.AreEqual (WsiProfiles.BasicProfile1_1, el.Name, "A1");
		}
예제 #9
0
 public void Add(WsiProfilesElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     this.BaseAdd(element);
 }
예제 #10
0
        protected override object GetElementKey(ConfigurationElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }
            WsiProfilesElement element2 = (WsiProfilesElement)element;

            return(element2.Name.ToString());
        }
 public WsiProfilesElement this [object key] {
     get { return((WsiProfilesElement)BaseGet(key)); }
     set {
         WsiProfilesElement el = (WsiProfilesElement)BaseGet(key);
         if (el == null)
         {
             BaseAdd(value);
             return;
         }
         int index = IndexOf(el);
         BaseRemoveAt(index);
         BaseAdd(index, value);
     }
 }
 public WsiProfilesElement this[object key]
 {
     get
     {
         if (key == null)
         {
             throw new ArgumentNullException("key");
         }
         WsiProfilesElement retval = (WsiProfilesElement)this.BaseGet(key);
         if (retval == null)
         {
             throw new System.Collections.Generic.KeyNotFoundException(
                       string.Format(CultureInfo.InvariantCulture,
                                     Res.GetString(Res.ConfigKeyNotFoundInElementCollection),
                                     key.ToString()));
         }
         return(retval);
     }
     set
     {
         if (value == null)
         {
             throw new ArgumentNullException("value");
         }
         if (key == null)
         {
             throw new ArgumentNullException("key");
         }
         // NOTE [ivelin : integration fix] The change bellow have the issue that it wont use the collection comparer
         // if one is specified. We ( System.Configuration ) usually avoid having set_item[ key ] when the element contains
         // the key and instead provide an Add( element ) method only.
         if (this.GetElementKey(value).Equals(key))
         {
             if (BaseGet(key) != null)
             {
                 BaseRemove(key);
             }
             Add(value);
         }
         else
         {
             throw new ArgumentException(string.Format(CultureInfo.InvariantCulture,
                                                       Res.GetString(Res.ConfigKeysDoNotMatch), this.GetElementKey(value).ToString(),
                                                       key.ToString()));
         }
     }
 }
예제 #13
0
 public WsiProfilesElement this[object key]
 {
     get
     {
         if (key == null)
         {
             throw new ArgumentNullException("key");
         }
         WsiProfilesElement element = (WsiProfilesElement)base.BaseGet(key);
         if (element == null)
         {
             throw new KeyNotFoundException(string.Format(CultureInfo.InvariantCulture, Res.GetString("ConfigKeyNotFoundInElementCollection"), new object[] { key.ToString() }));
         }
         return(element);
     }
     set
     {
         if (value == null)
         {
             throw new ArgumentNullException("value");
         }
         if (key == null)
         {
             throw new ArgumentNullException("key");
         }
         if (!this.GetElementKey(value).Equals(key))
         {
             throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Res.GetString("ConfigKeysDoNotMatch"), new object[] { this.GetElementKey(value).ToString(), key.ToString() }));
         }
         if (base.BaseGet(key) != null)
         {
             base.BaseRemove(key);
         }
         this.Add(value);
     }
 }
예제 #14
0
		public int IndexOf (WsiProfilesElement element)
		{
			return BaseIndexOf (element);
		}
예제 #15
0
		public void Remove (WsiProfilesElement element)
		{
			BaseRemove (element.Name);
		}
예제 #16
0
		public void Add (WsiProfilesElement element)
		{
			BaseAdd (element);
		}
예제 #17
0
		public void CopyTo (WsiProfilesElement[] array, int index)
		{
			((ICollection)this).CopyTo (array, index);
		}
 internal void SetDefaults()
 {
     WsiProfilesElement basic10Element = new WsiProfilesElement(WsiProfiles.BasicProfile1_1);
     this.Add(basic10Element);
 }
예제 #19
0
        internal void SetDefaults()
        {
            WsiProfilesElement element = new WsiProfilesElement(WsiProfiles.BasicProfile1_1);

            this.Add(element);
        }
 public void Add(WsiProfilesElement element)
 {
     BaseAdd(element);
 }
 public int IndexOf(WsiProfilesElement element)
 {
     return(BaseIndexOf(element));
 }
 public void Remove(WsiProfilesElement element)
 {
     BaseRemove(element.Name);
 }