public Insert ( int index, object item ) : void | ||
index | int | |
item | object | |
return | void |
public CreatTask(ScheduleForm form, ListView view) { InitializeComponent(); scheduleform = form; listView = view; int i = 1; ComboBox.ObjectCollection Macs = new ComboBox.ObjectCollection(Computers); Macs.Insert(0, ""); foreach(ListViewItem item in view.Items) { if (i != view.Items.Count) { Macs.Insert(i, item.SubItems[1].Text); i++; } } Computers.DataSource = Macs; }
public void Insert_Null () { ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ()); col.Add ("Item1"); try { col.Insert (0, 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 ("item", ex.ParamName, "#6"); } }