public static void Menu_AppendConnect(this IGH_Param param, ToolStripDropDown menu) { EventHandler DefaultConnectMenuHandler = (sender, e) => { if (sender is ToolStripMenuItem item && item.Tag is Guid componentGuid) { var obj = Instances.ComponentServer.EmitObject(componentGuid); if (obj is null) { return; } if (param.ConnectNewObject(obj)) { obj.ExpireSolution(true); } } }; Menu_AppendConnect(param, menu, DefaultConnectMenuHandler); }