public static ContextMenuStrip add_MenuItem(this ContextMenuStrip contextMenu, string text, bool dummyValue, MethodInvoker onClick) { // since we can't have two different return types the dummyValue is there for the cases where we want to get the reference to the // ContextMenuStrip and not the menu item created if (dummyValue.isFalse()) { "invalid value in ContextMenuStrip add_MenuItem, only true creates the expected behaviour".error(); } contextMenu.add_MenuItem(text, onClick); return(contextMenu); }
public static ToolStripMenuItem add_MenuItem(this ContextMenuStrip contextMenu, string text, MethodInvoker onClick) { return(contextMenu.add_MenuItem(text, (item) => O2Thread.mtaThread(() => onClick()))); }
public static ToolStripMenuItem add_MenuItem(this ContextMenuStrip contextMenu, string text) { return(contextMenu.add_MenuItem(text, () => { })); }