System.Windows.Forms.ComboBox.ObjectCollection.this C# (CSharp) Method

this() private method

private this ( int index ) : object
index int
return object
			public virtual object this[int index] {
				get {
					if (index < 0 || index >= Count)
						throw new ArgumentOutOfRangeException ("index");
					
					return object_items[index];
				}
				set {
					if (index < 0 || index >= Count)
						throw new ArgumentOutOfRangeException ("index");
					if (value == null)
						throw new ArgumentNullException ("value");
					
					//UIA Framework event: Item Removed
					OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Remove, object_items[index]));
					
					object_items[index] = value;
					
					//UIA Framework event: Item Added
					OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, value));
					
					//if (owner.listbox_ctrl != null)
					//	owner.listbox_ctrl.InvalidateItem (index);
					if (index == owner.SelectedIndex)
					{
						if (owner.textbox_ctrl == null)
							owner.Refresh ();
						else
							owner.textbox_ctrl.SelectedText = value.ToString ();
					}
				}
			}