Example #1
0
        public void UseAsVersionsMenu()
        {
            NSMenu menu = NSApplication.SharedApplication.MainMenu.ItemWithTitle("Versions").Submenu;

            menu.RemoveAllItems();

            menu.AddItem(current_item);
            menu.AddItem(NSMenuItem.SeparatorItem);
            menu.AddItem(new NSMenuItem("Labels")
            {
                Enabled = false
            });

            foreach (NSMenuItem item in named_version_items)
            {
                menu.AddItem(item);
            }

            menu.AddItem(NSMenuItem.SeparatorItem);
            menu.AddItem(new NSMenuItem("Autosaves")
            {
                Enabled = false
            });

            foreach (NSMenuItem item in other_version_items)
            {
                menu.AddItem(item);
            }

            menu.Update();
        }