System.Windows.Forms.ComboBox.ObjectCollection.IndexOf C# (CSharp) Method

IndexOf() public method

public IndexOf ( object value ) : int
value object
return int
			public int IndexOf (object value)
			{
				if (value == null)
					throw new ArgumentNullException ("value");
				
				return object_items.IndexOf (value);
			}

Usage Example

Example #1
0
		public void IndexOf_Null ()
		{
			ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ());
			try {
				col.IndexOf (null);
				Assert.Fail ("#1");
			} catch (ArgumentNullException ex) {
				Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
				Assert.IsNull (ex.InnerException, "#3");
				Assert.IsNotNull (ex.Message, "#4");
				Assert.IsNotNull (ex.ParamName, "#5");
#if NET_2_0
				Assert.AreEqual ("value", ex.ParamName, "#6");
#endif
			}
		}
All Usage Examples Of System.Windows.Forms.ComboBox.ObjectCollection::IndexOf