System.Windows.Forms.ListView.ListViewItemCollection.this C# (CSharp) Method

this() public method

public this ( int index ) : System.Windows.Forms.ListViewItem
index int
return System.Windows.Forms.ListViewItem
			public virtual ListViewItem this [int index] {
				get {
					if (index < 0 || index >= Count)
						throw new ArgumentOutOfRangeException ("index");

					if (owner != null && owner.VirtualMode)
						return RetrieveVirtualItemFromOwner (index);
					return (ListViewItem) list [index];
				}

				set {
					if (index < 0 || index >= Count)
						throw new ArgumentOutOfRangeException ("index");

					if (owner != null && owner.VirtualMode)
						throw new InvalidOperationException ();

					if (list.Contains (value))
						throw new ArgumentException ("An item cannot be added more than once. To add an item again, you need to clone it.", "value");

					if (value.ListView != null && value.ListView != owner)
						throw new ArgumentException ("Cannot add or insert the item '" + value.Text + "' in more than one place. You must first remove it from its current location or clone it.", "value");

					if (is_main_collection)
						value.Owner = owner;
					else {
						if (value.Group != null)
							value.Group.Items.Remove (value);

						value.SetGroup (group);
					}

					//UIA Framework event: Item Replaced
					OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Remove, list [index]));

					list [index] = value;

					CollectionChanged (true);

					//UIA Framework event: Item Replaced
					OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, value));

				}
			}

Same methods

ListView.ListViewItemCollection::this ( string key ) : System.Windows.Forms.ListViewItem
ListView.ListViewItemCollection::this ( int index ) : objectIList.System.Collections