C# Component Add Menu Item

Hello,

I’ve been trying to add a simple bool to the menu on a Grasshopper C# component in Rhino 8. It appears that I need to add a Nuget package? How would I do that?

What do I need to add to get the code up and running?

The code, courtesy of James Ramsden:

        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            base.AppendAdditionalComponentMenuItems(menu);
            Menu_AppendItem(menu, "Flip myBool", Menu_DoClick);
        }

        private void Menu_DoClick(object sender, EventArgs e)
        {
            myBool = !myBool;
        }
        public bool myBool = false; 

Any help or advice would be very very welcome!

Ash

I’m curious to see if it can be done too.
It seems that the GH_ScriptInstance class doesn’t have that method to override.
Also not much documentation on this GH_ScriptInstance