System.Windows.Forms.ListView.CheckedListViewItemCollection.IndexOfKey C# (CSharp) Method

IndexOfKey() public method

public IndexOfKey ( string key ) : int
key string
return int
			public virtual int IndexOfKey (string key)
			{
				if (owner.VirtualMode)
					throw new InvalidOperationException ();
				if (key == null || key.Length == 0)
					return -1;

				ArrayList checked_items = List;
				for (int i = 0; i < checked_items.Count; i++) {
					ListViewItem item = (ListViewItem) checked_items [i];
					if (String.Compare (key, item.Name, true) == 0)
						return i;
				}

				return -1;
			}
			#endregion	// Public Methods