예제 #1
0
		public void GetSet ()
		{
			ProtocolElement el = new ProtocolElement ();

			el.Name = WebServiceProtocols.HttpGet;
			Assert.AreEqual (WebServiceProtocols.HttpGet, el.Name, "A1");
		}
 public void CopyTo(ProtocolElement[] array, int index)
 {
     if (array == null)
     {
         throw new ArgumentNullException("array");
     }
     ((ICollection) this).CopyTo(array, index);
 }
 public void Remove(ProtocolElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     base.BaseRemove(this.GetElementKey(element));
 }
 public void Add(ProtocolElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     this.BaseAdd(element);
 }
 public int IndexOf(ProtocolElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     return base.BaseIndexOf(element);
 }
예제 #6
0
		public void Ctors ()
		{
			ProtocolElement el = new ProtocolElement ();

			Assert.AreEqual (WebServiceProtocols.Unknown, el.Name, "A1");

			el = new ProtocolElement (WebServiceProtocols.HttpPost);

			Assert.AreEqual (WebServiceProtocols.HttpPost, el.Name, "A2");
		}
 public ProtocolElement this[object key]
 {
     get
     {
         if (key == null)
         {
             throw new ArgumentNullException("key");
         }
         ProtocolElement retval = (ProtocolElement)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()));
         }
     }
 }
예제 #8
0
 public ProtocolElement this [object key]
 {
     get
     {
         return((ProtocolElement)BaseGet(key));
     }
     set
     {
         ProtocolElement el = (ProtocolElement)BaseGet(key);
         if (el == null)
         {
             BaseAdd(value);
             return;
         }
         int index = IndexOf(el);
         BaseRemoveAt(index);
         BaseAdd(index, value);
     }
 }
예제 #9
0
 public ProtocolElement this[object key]
 {
     get
     {
         if (key == null)
         {
             throw new ArgumentNullException("key");
         }
         ProtocolElement element = (ProtocolElement)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);
     }
 }
        internal void SetDefaults()
        {
            ProtocolElement httpSoap12Element = new ProtocolElement(WebServiceProtocols.HttpSoap12);
            ProtocolElement httpSoapElement = new ProtocolElement(WebServiceProtocols.HttpSoap);
            ProtocolElement httpPostLocalhostElement = new ProtocolElement(WebServiceProtocols.HttpPostLocalhost);
            ProtocolElement documentationElement = new ProtocolElement(WebServiceProtocols.Documentation);

            this.Add(httpSoap12Element);
            this.Add(httpSoapElement);
            this.Add(httpPostLocalhostElement);
            this.Add(documentationElement);
        }
예제 #11
0
		public void Add (ProtocolElement element)
		{
			BaseAdd (element);
		}
예제 #12
0
		public void CopyTo (ProtocolElement[] array, int index)
		{
			((ICollection)this).CopyTo (array, index);
		}
예제 #13
0
 public void Remove(ProtocolElement element)
 {
     BaseRemove(element.Name);
 }
예제 #14
0
 public int IndexOf(ProtocolElement element)
 {
     return(BaseIndexOf(element));
 }
예제 #15
0
 public void Add(ProtocolElement element)
 {
     BaseAdd(element);
 }
 internal void SetDefaults()
 {
     ProtocolElement element = new ProtocolElement(WebServiceProtocols.HttpSoap12);
     ProtocolElement element2 = new ProtocolElement(WebServiceProtocols.HttpSoap);
     ProtocolElement element3 = new ProtocolElement(WebServiceProtocols.HttpPostLocalhost);
     ProtocolElement element4 = new ProtocolElement(WebServiceProtocols.Documentation);
     this.Add(element);
     this.Add(element2);
     this.Add(element3);
     this.Add(element4);
 }
예제 #17
0
		public int IndexOf (ProtocolElement element)
		{
			return BaseIndexOf (element);
		}
예제 #18
0
		public void Remove (ProtocolElement element)
		{
			BaseRemove (element.Name);
		}