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

Remove() public method

public Remove ( object item ) : void
item object
return void
			public virtual void Remove(object item)
			{
				CheckDisposed();

				int index = m_list.IndexOf(item);
				if (index >= 0)
					RemoveAt(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));
				}
			}
		}