コード例 #1
0
        public static NSInvocation Ct_swizzleClassMethod(this NSObject This, Selector origSel, NSObject block, out NSError error)
        {
            var    origSel__handle__ = origSel.GetNonNullHandle(nameof(origSel));
            var    block__handle__   = block.GetNonNullHandle(nameof(block));
            IntPtr errorValue        = IntPtr.Zero;

            NSInvocation ret;

            ret   = Runtime.GetNSObject <NSInvocation> (global::ApiDefinition.Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr_ref_IntPtr(class_ptr, Selector.GetHandle("ct_swizzleClassMethod:withBlock:error:"), origSel.Handle, block__handle__, ref errorValue));
            error = Runtime.GetNSObject <NSError> (errorValue);

            return(ret !);
        }
コード例 #2
0
        public static void PutObject(NSObject @object, string key)
        {
            var @object__handle__ = @object.GetNonNullHandle(nameof(@object));

            if (key == null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(key));
            }
            var nskey = NSString.CreateNative(key);

            global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_IntPtr(class_ptr, Selector.GetHandle("putObject:forKey:"), @object__handle__, nskey);
            NSString.ReleaseNative(nskey);
        }
コード例 #3
0
        public static bool ArchiveObject(NSObject @object, string fileName)
        {
            var @object__handle__ = @object.GetNonNullHandle(nameof(@object));

            if (fileName == null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(fileName));
            }
            var nsfileName = NSString.CreateNative(fileName);

            bool ret;

            ret = global::ApiDefinition.Messaging.bool_objc_msgSend_IntPtr_IntPtr(class_ptr, Selector.GetHandle("archiveObject:forFileName:"), @object__handle__, nsfileName);
            NSString.ReleaseNative(nsfileName);

            return(ret !);
        }
コード例 #4
0
        public unsafe static void BuildGraphUser(NSObject graphUser, [BlockProxy(typeof(ObjCRuntime.Trampolines.NIDActionArity3V0))] global::System.Action <NSDictionary, NSDictionary, NSArray <CTValidationResult> > completion)
        {
            var graphUser__handle__ = graphUser.GetNonNullHandle(nameof(graphUser));

            if (completion == null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(completion));
            }
            BlockLiteral *block_ptr_completion;
            BlockLiteral  block_completion;

            block_completion     = new BlockLiteral();
            block_ptr_completion = &block_completion;
            block_completion.SetupBlockUnsafe(Trampolines.SDActionArity3V0.Handler, completion);

            global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_IntPtr(class_ptr, Selector.GetHandle("buildGraphUser:completionHandler:"), graphUser__handle__, (IntPtr)block_ptr_completion);
            block_ptr_completion->CleanupBlock();
        }
コード例 #5
0
        public virtual void SetProfileFieldWithKey(string key, NSObject value)
        {
            if (key == null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(key));
            }
            var value__handle__ = value.GetNonNullHandle(nameof(value));
            var nskey           = NSString.CreateNative(key);

            if (IsDirectBinding)
            {
                global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_IntPtr(this.Handle, Selector.GetHandle("setProfileFieldWithKey:andValue:"), nskey, value__handle__);
            }
            else
            {
                global::ApiDefinition.Messaging.void_objc_msgSendSuper_IntPtr_IntPtr(this.SuperHandle, Selector.GetHandle("setProfileFieldWithKey:andValue:"), nskey, value__handle__);
            }
            NSString.ReleaseNative(nskey);
        }
コード例 #6
0
        public static void SetObject(this ICTValidationResult This, NSObject value)
        {
            var value__handle__ = value.GetNonNullHandle(nameof(value));

            global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr(This.Handle, Selector.GetHandle("setObject:"), value__handle__);
        }