Пример #1
0
 public void BeginSheet(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), IntPtr.Zero, typeof (System.IntPtr), IntPtr.Zero, typeof (System.IntPtr), IntPtr.Zero, 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(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), IntPtr.Zero, typeof(System.IntPtr), IntPtr.Zero, typeof(System.IntPtr), IntPtr.Zero, 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);
        }