SidebarLibrary.Menus.MenuControl.OnCollectionInserted C# (CSharp) Method

OnCollectionInserted() protected method

protected OnCollectionInserted ( int index, object value ) : void
index int
value object
return void
		protected void OnCollectionInserted(int index, object value)
		{
			MenuCommand mc = value as MenuCommand;

			// We need notification whenever the properties of this command change
			mc.PropertyChanged += new MenuCommand.PropChangeHandler(OnCommandChanged);

			// Reset state ready for a recalculation
			_selected = false;
			_trackItem = -1;

			Recalculate();
			Invalidate();
		}