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

AddRange() private method

private AddRange ( IList items ) : void
items IList
return void
			internal void AddRange (IList items)
			{
				foreach (object mi in items)
					AddItem (mi, false);
				
				if (owner.sorted)
					Sort ();
				
				owner.UpdatedItems ();
			}

Same methods

ComboBox.ObjectCollection::AddRange ( object items ) : void

Usage Example

Example #1
0
		public void AddRange_Null ()
		{
			ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ());
			try {
				col.AddRange (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");
				Assert.AreEqual ("items", ex.ParamName, "#6");
			}
		}