SIL.FieldWorks.Common.Widgets.FwListBox.ObjectCollection.Add C# (CSharp) Method

Add() public method

Add an item to the collection and the display.
public Add ( object item ) : int
item object
return int
			public int Add(object item)
			{
				CheckDisposed();

				int index = m_list.Count; // nb index is count BEFORE Add.
				m_list.Add(item);
				InsertItemAtIndex(index, item);
				return index;
			}

Usage Example

Esempio n. 1
0
		public void Remove_CollectionWithSingleElement_CollectionShouldBeEmpty()
		{
			using (var listBox = new FwListBox())
			{
				using (var collection = new FwListBox.ObjectCollection(listBox))
				{
					ITsString testString = TsStringHelper.MakeTSS("test", m_hvoEnglishWs);
					collection.Add(testString);

					// The Test
					collection.Remove(testString);

					Assert.AreEqual(0, collection.Count);
					Assert.IsFalse(collection.Contains(testString));
				}
			}
		}
All Usage Examples Of SIL.FieldWorks.Common.Widgets.FwListBox.ObjectCollection::Add