Add() public méthode

public Add ( object item ) : int
item object
Résultat int
 //methods that intialize and adds members to the two collections
 private void FillWideCollection()
 {
     WideCollection = new ComboBox.ObjectCollection(this.ResCntrl);
     WideCollection.Add("1024 x 576");
     WideCollection.Add("1366 x 768");
     WideCollection.Add("1600 x 900");
 }
 private void FillFullCollection()
 {
     FullCollection = new ComboBox.ObjectCollection(this.ResCntrl);
     FullCollection.Add("800 x 600");
     FullCollection.Add("1024 x 768");
     FullCollection.Add("1152 x 864");
 }
Exemple #3
0
		public void Indexer_Null ()
		{
			ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ());
			col.Add ("Item1");
			try {
				col [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 ("value", ex.ParamName, "#6");
			}
		}
Exemple #4
0
		public void RemoveAtTest ()
		{
			ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ());
			col.Add ("Item1");
			col.Add ("Item2");
			col.RemoveAt (0);
			Assert.AreEqual (1, col.Count, "#H1");
			Assert.AreEqual (true, col.Contains ("Item2"), "#H1");
		}
Exemple #5
0
		public void RemoveTest ()
		{
			ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ());
			col.Add ("Item1");
			col.Add ("Item2");
			col.Remove ("Item1");
			Assert.AreEqual (1, col.Count, "#1");
			col.Remove (null);
			Assert.AreEqual (1, col.Count, "#2");
		}
Exemple #6
0
		public void IndexOfTest ()
		{
			ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ());
			col.Add ("Item1");
			col.Add ("Item2");
			Assert.AreEqual (1, col.IndexOf ("Item2"), "#F1");
		}
Exemple #7
0
		public void ContainsTest ()
		{
			ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ());
			object obj = "Item1";
			col.Add (obj);
			Assert.AreEqual (true, col.Contains ("Item1"), "#E1");
			Assert.AreEqual (false, col.Contains ("Item2"), "#E2");
		}
Exemple #8
0
		public void ClearTest ()
		{
			ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ());
			col.Add ("Item1");
			col.Add ("Item2");
			col.Clear ();
			Assert.AreEqual (0, col.Count, "#D1");
		}
Exemple #9
0
		public void AddTest ()
		{
			ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ());
			col.Add ("Item1");
			col.Add ("Item2");
			Assert.AreEqual (2, col.Count, "#C1");
		}
 private void cmbOperator_SelectedIndexChanged(object sender, EventArgs e)
 {
     ComboBox.ObjectCollection rows = new ComboBox.ObjectCollection(cmbMobileNumberPrefix);
     rows.Clear();
     if (cmbOperator.SelectedItem.ToString() == "Bakcell")
     {
         //bakcell de prefix yalniz bir denedir
         rows.Add("55");
         cmbMobileNumberPrefix.SelectedItem = "55";
     }
     else
     {
         rows.Add("50");
         rows.Add("51");
         cmbMobileNumberPrefix.SelectedItem = "50";
     }
 }