public MenuItem AddItem(string title, string action, string keyEquivalent) { return((MenuItem)Object.FromIntPtr((IntPtr)ObjCMessaging.objc_msgSend(NativeObject, "addItemWithTitle:action:keyEquivalent:", typeof(IntPtr), typeof(IntPtr), new Cocoa.String(title).NativeObject, typeof(IntPtr), ObjCMethods.sel_getUid(action), typeof(IntPtr), new Cocoa.String(keyEquivalent).NativeObject))); }
public void BeginSheet(Cocoa.Window sheet, Cocoa.Window docWindow, SheetHandler modalDelegate, System.IntPtr contextInfo) { if (sheet == null) { throw new ArgumentNullException("sheet"); } if (modalDelegate == null) { throw new ArgumentNullException("modalDelegate"); } Cocoa.Object target = (Cocoa.Object)modalDelegate.Target; MethodInfo method = modalDelegate.Method; string selector = method.Name; foreach (ExportAttribute export_attribute in Attribute.GetCustomAttributes(method, typeof(ExportAttribute))) { if (export_attribute.Selector != null) { selector = export_attribute.Selector; } } ObjCMessaging.objc_msgSend(NativeObject, "beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:", typeof(void), typeof(System.IntPtr), sheet.NativeObject, typeof(System.IntPtr), (docWindow == null) ? IntPtr.Zero : docWindow.NativeObject, typeof(System.IntPtr), target.NativeObject, typeof(System.IntPtr), ObjCMethods.sel_getUid(selector), typeof(System.IntPtr), contextInfo); }
public void BeginSheet(string directory, string filename, string [] fileTypes, Cocoa.Window docWindow, OpenPanelHandler modalDelegate, System.IntPtr contextInfo) { if (modalDelegate == null) { throw new ArgumentNullException("modalDelegate"); } Cocoa.Object target = (Cocoa.Object)modalDelegate.Target; MethodInfo method = modalDelegate.Method; string selector = method.Name; foreach (ExportAttribute export_attribute in Attribute.GetCustomAttributes(method, typeof(ExportAttribute))) { if (export_attribute.Selector != null) { selector = export_attribute.Selector; } } ObjCMessaging.objc_msgSend(NativeObject, "beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:", typeof(void), typeof(System.IntPtr), (directory == null) ? IntPtr.Zero : new Cocoa.String(directory).NativeObject, typeof(System.IntPtr), (filename == null) ? IntPtr.Zero : new Cocoa.String(filename).NativeObject, typeof(System.IntPtr), (fileTypes == null) ? IntPtr.Zero : new MutableArray(fileTypes).NativeObject, typeof(System.IntPtr), (docWindow == null) ? IntPtr.Zero : docWindow.NativeObject, typeof(System.IntPtr), target.NativeObject, typeof(System.IntPtr), ObjCMethods.sel_getUid(selector), typeof(System.IntPtr), contextInfo); }