コード例 #1
0
ファイル: ProtocolElementTest.cs プロジェクト: nobled/mono
		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
ファイル: ProtocolElementTest.cs プロジェクト: nobled/mono
		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");
		}
コード例 #7
0
 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);
     }
 }
コード例 #10
0
        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);
		}