void Update(NSMenu parent, ref int index, CommandInfo info) { if (!isArrayItem) { SetItemValues(this, info, ce.DisabledVisible, ce.OverrideLabel); return; } Hidden = true; if (index < parent.Count - 1) { for (int i = index + 1; i < parent.Count; i++) { var nextItem = parent.ItemAt(i); if (nextItem == null || nextItem.Target != this) { break; } parent.RemoveItemAt(i); i--; } } index++; PopulateArrayItems(info.ArrayInfo, parent, ref index); }
static void ClearNSMenu(NSMenu menu) { // remove the menu that was created in the code for (var i = menu.Count - _storyboardMainMenuCount; i > 0; i--) { menu.RemoveItemAt(i); } }
static void ClearNSMenu(NSMenu menu) { //for now we can't remove the 1st menu item for (var i = menu.Count - 1; i > 0; i--) { menu.RemoveItemAt(i); } }