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);
        }
Exemplo n.º 2
0
 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);
 }