Пример #1
0
        public static void RequestSharedWebCredential(string domainName, string account, Action<string[], NSError> handler)
        {
            // do not check domain an account because they can be null
            Action<NSArray, NSError> onComplete = (NSArray a, NSError e) => {
                // get a string [] for the user rather than an ugly NSArray
                var array = NSArray.StringArrayFromHandle (a.Handle);
                handler (array, e);
            };
            // we need to create our own block literal.
            unsafe {
                BlockLiteral *block_ptr_onComplete;
                BlockLiteral block_onComplete;
                block_onComplete = new BlockLiteral ();
                block_ptr_onComplete = &block_onComplete;
                block_onComplete.SetupBlock (ArrayErrorActionTrampoline.Handler, onComplete);

                NSString nsDomain = null;
                if (domainName != null)
                    nsDomain = new NSString (domainName);

                NSString nsAccount = null;
                if (account != null)
                    nsAccount = new NSString (account);

                SecRequestSharedWebCredential ((nsDomain == null)? IntPtr.Zero : nsDomain.Handle, (nsAccount == null)? IntPtr.Zero : nsAccount.Handle,
                    (IntPtr) block_ptr_onComplete);
                block_ptr_onComplete->CleanupBlock ();
                if (nsDomain != null)
                    nsDomain.Dispose ();
                if (nsAccount != null)
                    nsAccount.Dispose ();
            }
        }
Пример #2
0
        public static void AddSharedWebCredential(string domainName, string account, string password, Action<NSError> handler)
        {
            if (domainName == null)
                throw new ArgumentNullException ("domainName");
            if (account == null)
                throw new ArgumentNullException ("account");
            // we need to create our own block literal. We can reuse the SDActionArity1V12 which is generated and takes a
            // NSError because a CFError is a toll-free bridget to CFError
            unsafe {
                BlockLiteral *block_ptr_onComplete;
                BlockLiteral block_onComplete;
                block_onComplete = new BlockLiteral ();
                block_ptr_onComplete = &block_onComplete;
                block_onComplete.SetupBlock (ActionTrampoline.Handler, handler);

                using (var nsDomain = new NSString (domainName))
                using (var nsAccount = new NSString (account)) {
                    if (password == null) {  // we are removing a password
                        SecAddSharedWebCredential (nsDomain.Handle, nsAccount.Handle, IntPtr.Zero, (IntPtr) block_ptr_onComplete);
                    } else {
                        using (var nsPassword = new NSString (password)) {
                            SecAddSharedWebCredential (nsDomain.Handle, nsAccount.Handle, nsPassword.Handle, (IntPtr) block_ptr_onComplete);
                        }
                    }
                    block_ptr_onComplete->CleanupBlock ();
                }
            }
        }
Пример #3
0
        //
        // You must invoke ->CleanupBlock after you have transferred ownership to
        // the unmanaged code to release the resources allocated on the managed side
        //
        public static unsafe void Invoke(Action codeToRun, Action<IntPtr> invoker)
        {
            BlockLiteral *block_ptr;
            BlockLiteral block;
            block = new BlockLiteral ();
            block_ptr = &block;

            block.SetupBlock (Trampolines.SDAction.Handler, codeToRun);
            invoker ((IntPtr) block_ptr);
            block_ptr->CleanupBlock ();
        }
		public unsafe static void CloseDrawerAnimated (this MMDrawerController This, bool animated, float velocity, global::MonoTouch.UIKit.UIViewAnimationOptions options, [BlockProxy (typeof (MonoTouch.ObjCRuntime.Trampolines.NIDAction))]global::System.Action completion)
		{
			if (completion == null)
				throw new ArgumentNullException ("completion");
			BlockLiteral *block_ptr_completion;
			BlockLiteral block_completion;
			block_completion = new BlockLiteral ();
			block_ptr_completion = &block_completion;
			block_completion.SetupBlock (Trampolines.SDAction.Handler, completion);
			
			ApiDefinitions.Messaging.void_objc_msgSend_bool_float_int_IntPtr (This.Handle, selCloseDrawerAnimatedVelocityAnimationOptionsCompletion_Handle, animated, velocity, (int)options, (IntPtr) block_ptr_completion);
			block_ptr_completion->CleanupBlock ();
			
		}
		public unsafe static void Show (this IMTMBProgressHUD This, bool animated, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDNSDispatchHandlerT))]NSDispatchHandlerT whileExecutingHandler)
		{
			if (whileExecutingHandler == null)
				throw new ArgumentNullException ("whileExecutingHandler");
			BlockLiteral *block_ptr_whileExecutingHandler;
			BlockLiteral block_whileExecutingHandler;
			block_whileExecutingHandler = new BlockLiteral ();
			block_ptr_whileExecutingHandler = &block_whileExecutingHandler;
			block_whileExecutingHandler.SetupBlock (Trampolines.SDNSDispatchHandlerT.Handler, whileExecutingHandler);
			
			ApiDefinition.Messaging.void_objc_msgSend_bool_IntPtr (This.Handle, Selector.GetHandle ("showAnimated:whileExecutingBlock:"), animated, (IntPtr) block_ptr_whileExecutingHandler);
			block_ptr_whileExecutingHandler->CleanupBlock ();
			
		}
		public unsafe virtual void BumpEvent (BumpEventBlock evt)
		{
			if (evt == null)
				throw new ArgumentNullException ("evt");
			BlockLiteral *block_ptr_evt;
			BlockLiteral block_evt;
			block_evt = new BlockLiteral ();
			block_ptr_evt = &block_evt;
			block_evt.SetupBlock (static_InnerBumpEventBlock, evt);
			
			MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selBumpEventBlock_, (IntPtr) block_ptr_evt);
			block_ptr_evt->CleanupBlock ();
			
		}
Пример #7
0
        static void TrampolineIterateHandler(IntPtr block, IntPtr options)
        {
            var del = BlockLiteral.GetTarget <Action <NWProtocolOptions> > (block);

            if (del != null)
            {
                using (var tempOptions = new NWProtocolOptions(options, owns: false))
                    using (var definition = tempOptions.ProtocolDefinition) {
                        NWProtocolOptions?castedOptions = null;

                        if (definition.Equals(NWProtocolDefinition.CreateTcpDefinition()))
                        {
                            castedOptions = new NWProtocolTcpOptions(options, owns: false);
                        }
                        else if (definition.Equals(NWProtocolDefinition.CreateUdpDefinition()))
                        {
                            castedOptions = new NWProtocolUdpOptions(options, owns: false);
                        }
                        else if (definition.Equals(NWProtocolDefinition.CreateTlsDefinition()))
                        {
                            castedOptions = new NWProtocolTlsOptions(options, owns: false);
                        }
                        else if (definition.Equals(NWProtocolDefinition.CreateIPDefinition()))
                        {
                            castedOptions = new NWProtocolIPOptions(options, owns: false);
                        }
                        else if (definition.Equals(NWProtocolDefinition.CreateWebSocketDefinition()))
                        {
                            castedOptions = new NWWebSocketOptions(options, owns: false);
                        }

                        del(castedOptions ?? tempOptions);
                        castedOptions?.Dispose();
                    }
            }
        }
        public unsafe static void DidReceiveNotificationResponse(this IOSUserNotificationCenterDelegate This, NSObject center, NSObject response, [BlockProxy(typeof(ObjCRuntime.Trampolines.NIDAction))] global::System.Action completionHandler)
        {
            if (center == null)
            {
                throw new ArgumentNullException("center");
            }
            if (response == null)
            {
                throw new ArgumentNullException("response");
            }
            if (completionHandler == null)
            {
                throw new ArgumentNullException("completionHandler");
            }
            BlockLiteral *block_ptr_completionHandler;
            BlockLiteral  block_completionHandler;

            block_completionHandler     = new BlockLiteral();
            block_ptr_completionHandler = &block_completionHandler;
            block_completionHandler.SetupBlock(Trampolines.SDAction.Handler, completionHandler);

            global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_IntPtr_IntPtr(This.Handle, Selector.GetHandle("userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:"), center.Handle, response.Handle, (IntPtr)block_ptr_completionHandler);
            block_ptr_completionHandler->CleanupBlock();
        }
        public unsafe static void WillPresentNotification(this IOSUserNotificationCenterDelegate This, NSObject center, NSObject notification, [BlockProxy(typeof(ObjCRuntime.Trampolines.NIDActionArity1V0))] global::System.Action <global::System.nuint> completionHandler)
        {
            if (center == null)
            {
                throw new ArgumentNullException("center");
            }
            if (notification == null)
            {
                throw new ArgumentNullException("notification");
            }
            if (completionHandler == null)
            {
                throw new ArgumentNullException("completionHandler");
            }
            BlockLiteral *block_ptr_completionHandler;
            BlockLiteral  block_completionHandler;

            block_completionHandler     = new BlockLiteral();
            block_ptr_completionHandler = &block_completionHandler;
            block_completionHandler.SetupBlock(Trampolines.SDActionArity1V0.Handler, completionHandler);

            global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_IntPtr_IntPtr(This.Handle, Selector.GetHandle("userNotificationCenter:willPresentNotification:withCompletionHandler:"), center.Handle, notification.Handle, (IntPtr)block_ptr_completionHandler);
            block_ptr_completionHandler->CleanupBlock();
        }
Пример #10
0
        public unsafe void Swiper(CCCSwiper swiper, NSError error, [BlockProxy(typeof(ObjCRuntime.Trampolines.NIDAction))] global::System.Action completion)
        {
            if (swiper == null)
            {
                throw new ArgumentNullException("swiper");
            }
            if (error == null)
            {
                throw new ArgumentNullException("error");
            }
            if (completion == null)
            {
                throw new ArgumentNullException("completion");
            }
            BlockLiteral *block_ptr_completion;
            BlockLiteral  block_completion;

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

            global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_IntPtr_IntPtr(this.Handle, Selector.GetHandle("swiper:didFailWithError:completion:"), swiper.Handle, error.Handle, (IntPtr)block_ptr_completion);
            block_ptr_completion->CleanupBlock();
        }
Пример #11
0
        static void TrampolineConfigureHandler(IntPtr block, IntPtr iface)
        {
            var del = BlockLiteral.GetTarget <Action <NWProtocolOptions> > (block);

            if (del != null)
            {
                using (var tempOptions = new NWProtocolOptions(iface, owns: false))
                    using (var definition = tempOptions.ProtocolDefinition) {
                        NWProtocolOptions castedOptions = null;

                        if (definition.Equals(NWProtocolDefinition.TcpDefinition))
                        {
                            castedOptions = new NWProtocolTcpOptions(iface, owns: false);
                        }
                        else if (definition.Equals(NWProtocolDefinition.UdpDefinition))
                        {
                            castedOptions = new NWProtocolUdpOptions(iface, owns: false);
                        }
                        else if (definition.Equals(NWProtocolDefinition.TlsDefinition))
                        {
                            castedOptions = new NWProtocolTlsOptions(iface, owns: false);
                        }
                        else if (definition.Equals(NWProtocolDefinition.IPDefinition))
                        {
                            castedOptions = new NWProtocolIPOptions(iface, owns: false);
                        }
                        else if (definition.Equals(NWProtocolDefinition.WebSocketDefinition))
                        {
                            castedOptions = new NWWebSocketOptions(iface, owns: false);
                        }

                        del(castedOptions ?? tempOptions);
                        castedOptions?.Dispose();
                    }
            }
        }
Пример #12
0
        public unsafe static NSUrlSessionTask GenerateTokenForApplePay(this ICCCAPI This, global::PassKit.PKPayment payment, [BlockProxy(typeof(ObjCRuntime.Trampolines.NIDActionArity2V1))] global::System.Action <NSString, NSError> completion)
        {
            if (payment == null)
            {
                throw new ArgumentNullException("payment");
            }
            if (completion == null)
            {
                throw new ArgumentNullException("completion");
            }
            BlockLiteral *block_ptr_completion;
            BlockLiteral  block_completion;

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

            NSUrlSessionTask ret;

            ret = Runtime.GetNSObject <NSUrlSessionTask> (global::ApiDefinition.Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr(This.Handle, Selector.GetHandle("generateTokenForApplePay:completion:"), payment.Handle, (IntPtr)block_ptr_completion));
            block_ptr_completion->CleanupBlock();

            return(ret);
        }
Пример #13
0
        public static CGImageAnimationStatus AnimateImage(NSData data, CGImageAnimationOptions options, [BlockProxy(typeof(NIDCGImageSourceAnimationBlock))] CGImageSourceAnimationHandler handler)
        {
#if IOS && ARCH_32
            throw new PlatformNotSupportedException("This API is not supported on this version of iOS");
#else
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }
            if (handler == null)
            {
                throw new ArgumentNullException(nameof(handler));
            }

            var block = new BlockLiteral();
            block.SetupBlockUnsafe(SDCGImageSourceAnimationBlock.Handler, handler);

            try {
                return(CGAnimateImageDataWithBlock(data.Handle, options.GetHandle(), ref block));
            } finally {
                block.CleanupBlock();
            }
#endif
        }
        public unsafe static void Build(string eventName, NSDictionary?eventActions, [BlockProxy(typeof(ObjCRuntime.Trampolines.NIDActionArity2V0))] global::System.Action <NSDictionary, NSArray <CTValidationResult> > completion)
        {
            if (eventName == null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(eventName));
            }
            var eventActions__handle__ = eventActions.GetHandle();

            if (completion == null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(completion));
            }
            var           nseventName = NSString.CreateNative(eventName);
            BlockLiteral *block_ptr_completion;
            BlockLiteral  block_completion;

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

            global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_IntPtr_IntPtr(class_ptr, Selector.GetHandle("build:withEventActions:completionHandler:"), nseventName, eventActions__handle__, (IntPtr)block_ptr_completion);
            NSString.ReleaseNative(nseventName);
            block_ptr_completion->CleanupBlock();
        }
Пример #15
0
        public unsafe static NSUrlSessionTask GenerateAccountForCard(this ICCCAPI This, CCCCardInfo card, [BlockProxy(typeof(ObjCRuntime.Trampolines.NIDActionArity2V0))] global::System.Action <CCCAccount, NSError> completion)
        {
            if (card == null)
            {
                throw new ArgumentNullException("card");
            }
            if (completion == null)
            {
                throw new ArgumentNullException("completion");
            }
            BlockLiteral *block_ptr_completion;
            BlockLiteral  block_completion;

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

            NSUrlSessionTask ret;

            ret = Runtime.GetNSObject <NSUrlSessionTask> (global::ApiDefinition.Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr(This.Handle, Selector.GetHandle("generateAccountForCard:completion:"), card.Handle, (IntPtr)block_ptr_completion));
            block_ptr_completion->CleanupBlock();

            return(ret);
        }
Пример #16
0
        public unsafe static NWParameters CreateTcp(Action <NWProtocolOptions>?configureTcp = null)
        {
            var tcpHandler = new BlockLiteral();

            var tcpPtr = &tcpHandler;

            if (configureTcp == null)
            {
                tcpPtr = DEFAULT_CONFIGURATION();
            }
            else
            {
                tcpHandler.SetupBlockUnsafe(static_ConfigureHandler, configureTcp);
            }

            var ptr = nw_parameters_create_secure_tcp(DISABLE_PROTOCOL(), tcpPtr);

            if (configureTcp != null)
            {
                tcpPtr->CleanupBlock();
            }

            return(new NWParameters(ptr, owns: true));
        }
Пример #17
0
        public unsafe static NWParameters CreateCustomIP(byte protocolNumber, Action <NWProtocolOptions>?configureCustomIP = null)
        {
            var ipHandler = new BlockLiteral();

            var ipPtr = &ipHandler;

            if (configureCustomIP == null)
            {
                ipPtr = DEFAULT_CONFIGURATION();
            }
            else
            {
                ipHandler.SetupBlockUnsafe(static_ConfigureHandler, configureCustomIP);
            }

            var ptr = nw_parameters_create_custom_ip(protocolNumber, ipPtr);

            if (configureCustomIP != null)
            {
                ipPtr->CleanupBlock();
            }

            return(new NWParameters(ptr, owns: true));
        }
        public unsafe static void BuildSetMultiValues(string[] values, string key, CTLocalDataStore dataStore, [BlockProxy(typeof(ObjCRuntime.Trampolines.NIDActionArity3V1))] global::System.Action <NSDictionary, NSArray, NSArray <CTValidationResult> > completion)
        {
            if (values == null)
            {
                throw new ArgumentNullException("values");
            }
            if (completion == null)
            {
                throw new ArgumentNullException("completion");
            }
            var           nsa_values = NSArray.FromStrings(values);
            var           nskey      = NSString.CreateNative(key);
            BlockLiteral *block_ptr_completion;
            BlockLiteral  block_completion;

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

            global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr(class_ptr, Selector.GetHandle("buildSetMultiValues:forKey:localDataStore:completionHandler:"), nsa_values.Handle, nskey, dataStore == null ? IntPtr.Zero : dataStore.Handle, (IntPtr)block_ptr_completion);
            nsa_values.Dispose();
            NSString.ReleaseNative(nskey);
            block_ptr_completion->CleanupBlock();
        }
			public unsafe NIDBranchListLoaded (BlockLiteral *block)
			{
				blockPtr = _Block_copy ((IntPtr) block);
				invoker = block->GetDelegateForBlock<DBranchListLoaded> ();
			}
Пример #20
0
 static extern void nw_framer_message_set_value(OS_nw_protocol_metadata message, string key, IntPtr value, ref BlockLiteral dispose_value);
Пример #21
0
 static extern void nw_browse_result_enumerate_interfaces(OS_nw_browse_result result, ref BlockLiteral enumerator);
Пример #22
0
		static unsafe void VTCompressionOutputHandlerTrampoline (BlockLiteral *block,
			VTStatus status, VTEncodeInfoFlags infoFlags, IntPtr sampleBuffer)
		{
			var del = (VTCompressionOutputHandler)(block->Target);
			if (del != null)
				del (status, infoFlags, new CMSampleBuffer (sampleBuffer));
		}
		public unsafe virtual void PresentAnimatedFromParentViewController (global::UIKit.UIViewController viewController, CGRect frame, [BlockProxy (typeof (ObjCRuntime.Trampolines.SDAction))]global::System.Action completion)
		{
			if (viewController == null)
				throw new ArgumentNullException ("viewController");
			if (completion == null)
				throw new ArgumentNullException ("completion");
			BlockLiteral *block_ptr_completion;
			BlockLiteral block_completion;
			block_completion = new BlockLiteral ();
			block_ptr_completion = &block_completion;
			block_completion.SetupBlock (Trampolines.SDAction.Handler, completion);
			
			if (IsDirectBinding) {
				global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_CGRect_IntPtr (this.Handle, Selector.GetHandle ("presentAnimatedFromParentViewController:fromFrame:completion:"), viewController.Handle, frame, (IntPtr) block_ptr_completion);
			} else {
				global::ApiDefinition.Messaging.void_objc_msgSendSuper_IntPtr_CGRect_IntPtr (this.SuperHandle, Selector.GetHandle ("presentAnimatedFromParentViewController:fromFrame:completion:"), viewController.Handle, frame, (IntPtr) block_ptr_completion);
			}
			block_ptr_completion->CleanupBlock ();
			
		}
		public unsafe virtual void Show (bool animated, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDNSDispatchHandlerT))]NSDispatchHandlerT whileExecutingHandler, global::CoreFoundation.DispatchQueue queue, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDMBProgressHUDCompletionHandler))]MBProgressHUDCompletionHandler completionHandler)
		{
			if (whileExecutingHandler == null)
				throw new ArgumentNullException ("whileExecutingHandler");
			if (completionHandler == null)
				throw new ArgumentNullException ("completionHandler");
			BlockLiteral *block_ptr_whileExecutingHandler;
			BlockLiteral block_whileExecutingHandler;
			block_whileExecutingHandler = new BlockLiteral ();
			block_ptr_whileExecutingHandler = &block_whileExecutingHandler;
			block_whileExecutingHandler.SetupBlock (Trampolines.SDNSDispatchHandlerT.Handler, whileExecutingHandler);
			BlockLiteral *block_ptr_completionHandler;
			BlockLiteral block_completionHandler;
			block_completionHandler = new BlockLiteral ();
			block_ptr_completionHandler = &block_completionHandler;
			block_completionHandler.SetupBlock (Trampolines.SDMBProgressHUDCompletionHandler.Handler, completionHandler);
			
			if (IsDirectBinding) {
				ApiDefinition.Messaging.void_objc_msgSend_bool_IntPtr_IntPtr_IntPtr (this.Handle, Selector.GetHandle ("showAnimated:whileExecutingBlock:onQueue:completionBlock:"), animated, (IntPtr) block_ptr_whileExecutingHandler, queue.Handle, (IntPtr) block_ptr_completionHandler);
			} else {
				ApiDefinition.Messaging.void_objc_msgSendSuper_bool_IntPtr_IntPtr_IntPtr (this.SuperHandle, Selector.GetHandle ("showAnimated:whileExecutingBlock:onQueue:completionBlock:"), animated, (IntPtr) block_ptr_whileExecutingHandler, queue.Handle, (IntPtr) block_ptr_completionHandler);
			}
			block_ptr_whileExecutingHandler->CleanupBlock ();
			block_ptr_completionHandler->CleanupBlock ();
			
		}
	public unsafe virtual void ApiRequest (string url, string method, NSData body, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDActionArity1V0))]global::System.Action<global::LISDKAPIResponse> successCompletion, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDActionArity1V1))]global::System.Action<global::LISDKAPIError> errorCompletion)
	{
		if (url == null)
			throw new ArgumentNullException ("url");
		if (method == null)
			throw new ArgumentNullException ("method");
		if (body == null)
			throw new ArgumentNullException ("body");
		if (successCompletion == null)
			throw new ArgumentNullException ("successCompletion");
		if (errorCompletion == null)
			throw new ArgumentNullException ("errorCompletion");
		var nsurl = NSString.CreateNative (url);
		var nsmethod = NSString.CreateNative (method);
		BlockLiteral *block_ptr_successCompletion;
		BlockLiteral block_successCompletion;
		block_successCompletion = new BlockLiteral ();
		block_ptr_successCompletion = &block_successCompletion;
		block_successCompletion.SetupBlock (Trampolines.SDActionArity1V0.Handler, successCompletion);
		BlockLiteral *block_ptr_errorCompletion;
		BlockLiteral block_errorCompletion;
		block_errorCompletion = new BlockLiteral ();
		block_ptr_errorCompletion = &block_errorCompletion;
		block_errorCompletion.SetupBlock (Trampolines.SDActionArity1V1.Handler, errorCompletion);
		
		if (IsDirectBinding) {
			global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr (this.Handle, Selector.GetHandle ("apiRequest:method:body:success:error:"), nsurl, nsmethod, body.Handle, (IntPtr) block_ptr_successCompletion, (IntPtr) block_ptr_errorCompletion);
		} else {
			global::ApiDefinition.Messaging.void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr (this.SuperHandle, Selector.GetHandle ("apiRequest:method:body:success:error:"), nsurl, nsmethod, body.Handle, (IntPtr) block_ptr_successCompletion, (IntPtr) block_ptr_errorCompletion);
		}
		NSString.ReleaseNative (nsurl);
		NSString.ReleaseNative (nsmethod);
		block_ptr_successCompletion->CleanupBlock ();
		block_ptr_errorCompletion->CleanupBlock ();
		
	}
		public unsafe static void SetCompletionHandler (this IMTMBProgressHUD This, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDMBProgressHUDCompletionHandler))]MBProgressHUDCompletionHandler value)
		{
			if (value == null)
				throw new ArgumentNullException ("value");
			BlockLiteral *block_ptr_value;
			BlockLiteral block_value;
			block_value = new BlockLiteral ();
			block_ptr_value = &block_value;
			block_value.SetupBlock (Trampolines.SDMBProgressHUDCompletionHandler.Handler, value);
			
			ApiDefinition.Messaging.void_objc_msgSend_IntPtr (This.Handle, Selector.GetHandle ("setCompletionBlock:"), (IntPtr) block_ptr_value);
			block_ptr_value->CleanupBlock ();
			
		}
	public unsafe static void CreateSessionWithAuth (NSObject[] permissions, string state, bool showDialog, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDAuthSuccessBlock))]global::AuthSuccessBlock successBlock, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDAuthErrorBlock))]global::AuthErrorBlock erroBlock)
	{
		if (permissions == null)
			throw new ArgumentNullException ("permissions");
		if (successBlock == null)
			throw new ArgumentNullException ("successBlock");
		if (erroBlock == null)
			throw new ArgumentNullException ("erroBlock");
		var nsa_permissions = NSArray.FromNSObjects (permissions);
		var nsstate = NSString.CreateNative (state);
		BlockLiteral *block_ptr_successBlock;
		BlockLiteral block_successBlock;
		block_successBlock = new BlockLiteral ();
		block_ptr_successBlock = &block_successBlock;
		block_successBlock.SetupBlock (Trampolines.SDAuthSuccessBlock.Handler, successBlock);
		BlockLiteral *block_ptr_erroBlock;
		BlockLiteral block_erroBlock;
		block_erroBlock = new BlockLiteral ();
		block_ptr_erroBlock = &block_erroBlock;
		block_erroBlock.SetupBlock (Trampolines.SDAuthErrorBlock.Handler, erroBlock);
		
		global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_IntPtr_bool_IntPtr_IntPtr (class_ptr, Selector.GetHandle ("createSessionWithAuth:state:showGoToAppStoreDialog:successBlock:errorBlock:"), nsa_permissions.Handle, nsstate, showDialog, (IntPtr) block_ptr_successBlock, (IntPtr) block_ptr_erroBlock);
		nsa_permissions.Dispose ();
		NSString.ReleaseNative (nsstate);
		block_ptr_successBlock->CleanupBlock ();
		block_ptr_erroBlock->CleanupBlock ();
		
	}
			public unsafe NIDNSDispatchHandlerT (BlockLiteral *block)
			{
				blockPtr = _Block_copy ((IntPtr) block);
				invoker = block->GetDelegateForBlock<DNSDispatchHandlerT> ();
			}
			public unsafe NIDMBProgressHUDCompletionHandler (BlockLiteral *block)
			{
				blockPtr = _Block_copy ((IntPtr) block);
				invoker = block->GetDelegateForBlock<DMBProgressHUDCompletionHandler> ();
			}
Пример #30
0
		public VTStatus EncodeFrame (CVImageBuffer imageBuffer, CMTime presentationTimestamp, CMTime duration,
			NSDictionary frameProperties, IntPtr sourceFrame, out VTEncodeInfoFlags infoFlags,
			VTCompressionOutputHandler outputHandler)
		{
			if (Handle == IntPtr.Zero)
				throw new ObjectDisposedException ("CompressionSession");
			if (imageBuffer == null)
				throw new ArgumentNullException ("imageBuffer");
			if (outputHandler == null)
				throw new ArgumentNullException ("outputHandler");

			unsafe {
				var block = new BlockLiteral ();
				var blockPtr = &block;
				block.SetupBlock (compressionOutputHandlerTrampoline, outputHandler);

				try {
					return VTCompressionSessionEncodeFrameWithOutputHandler (Handle,
						imageBuffer.Handle, presentationTimestamp, duration,
						frameProperties == null ? IntPtr.Zero : frameProperties.Handle,
						out infoFlags, blockPtr);
				} finally {
					blockPtr->CleanupBlock ();
				}
			}
		}
Пример #31
0
 extern static void dispatch_write(int fd, IntPtr dispatchData, IntPtr dispatchQueue, ref BlockLiteral handler);
Пример #32
0
		extern static unsafe VTStatus VTDecompressionSessionDecodeFrameWithOutputHandler (
			/* VTDecompressionSessionRef */ IntPtr session,
			/* CMSampleBufferRef */ IntPtr sampleBuffer,
			/* VTDecodeFrameFlags */ VTDecodeFrameFlags decodeFlags,
			/* VTDecodeInfoFlags */ out VTDecodeInfoFlags infoFlagsOut,
			/* VTDecompressionOutputHandler */ BlockLiteral *outputHandler);
Пример #33
0
 static extern void sec_protocol_options_set_key_update_block(sec_protocol_options_t options, ref BlockLiteral key_update_block, dispatch_queue_t key_update_queue);
Пример #34
0
		static unsafe void VTDecompressionOutputHandlerTrampoline (BlockLiteral *block,
			VTStatus status, VTDecodeInfoFlags infoFlags, IntPtr imageBuffer,
			CMTime presentationTimeStamp, CMTime presentationDuration)
		{
			var del = (VTDecompressionOutputHandler)(block->Target);
			if (del != null)
				del (status, infoFlags, new CVImageBuffer (imageBuffer), presentationTimeStamp, presentationDuration);
		}
		public unsafe virtual void SetDataReceivedBlock (BumpDataReceivedBlock dataReceivedBlock)
		{
			if (dataReceivedBlock == null)
				throw new ArgumentNullException ("dataReceivedBlock");
			BlockLiteral *block_ptr_dataReceivedBlock;
			BlockLiteral block_dataReceivedBlock;
			block_dataReceivedBlock = new BlockLiteral ();
			block_ptr_dataReceivedBlock = &block_dataReceivedBlock;
			block_dataReceivedBlock.SetupBlock (static_InnerBumpDataReceivedBlock, dataReceivedBlock);
			
			MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selSetDataReceivedBlock_, (IntPtr) block_ptr_dataReceivedBlock);
			block_ptr_dataReceivedBlock->CleanupBlock ();
			
		}
Пример #36
0
 static extern void nw_path_enumerate_interfaces(IntPtr handle, ref BlockLiteral callback);
		public unsafe virtual void SetVisible (bool showing, bool animated, [BlockProxy (typeof (MonoTouch.ObjCRuntime.Trampolines.NIDCompletionCallback))]CompletionCallback completion)
		{
			if (completion == null)
				throw new ArgumentNullException ("completion");
			BlockLiteral *block_ptr_completion;
			BlockLiteral block_completion;
			block_completion = new BlockLiteral ();
			block_ptr_completion = &block_completion;
			block_completion.SetupBlock (Trampolines.SDCompletionCallback.Handler, completion);
			
			if (IsDirectBinding) {
				ApiDefinition.Messaging.void_objc_msgSend_bool_bool_IntPtr (this.Handle, selSetVisibleAnimatedCompletion_Handle, showing, animated, (IntPtr) block_ptr_completion);
			} else {
				ApiDefinition.Messaging.void_objc_msgSendSuper_bool_bool_IntPtr (this.SuperHandle, selSetVisibleAnimatedCompletion_Handle, showing, animated, (IntPtr) block_ptr_completion);
			}
			block_ptr_completion->CleanupBlock ();
			
		}
Пример #38
0
			public unsafe NIDAction (BlockLiteral *block)
			{
				blockPtr = _Block_copy ((IntPtr) block);
				invoker = block->GetDelegateForBlock<DAction> ();
			}
Пример #39
0
		public VTStatus DecodeFrame (CMSampleBuffer sampleBuffer, VTDecodeFrameFlags decodeFlags,
			out VTDecodeInfoFlags infoFlags, VTDecompressionOutputHandler outputHandler)
		{
			if (Handle == IntPtr.Zero)
				throw new ObjectDisposedException ("DecompressionSession");
			if (sampleBuffer == null)
				throw new ArgumentNullException ("sampleBuffer");
			if (outputHandler == null)
				throw new ArgumentNullException ("outputHandler");

			unsafe {
				var block = new BlockLiteral ();
				var blockPtr = &block;
				block.SetupBlock (decompressionOutputHandlerTrampoline, outputHandler);

				try {
					return VTDecompressionSessionDecodeFrameWithOutputHandler (Handle,
						sampleBuffer.Handle, decodeFlags, out infoFlags, blockPtr);
				} finally {
					blockPtr->CleanupBlock ();
				}
			}
		}
Пример #40
0
		extern static unsafe VTStatus VTCompressionSessionEncodeFrameWithOutputHandler (
			/* VTCompressionSessionRef */ IntPtr session,
			/* CVImageBufferRef */ IntPtr imageBuffer,
			/* CMTime */ CMTime presentation,
			/* CMTime */ CMTime duration, // can ve CMTime.Invalid
			/* CFDictionaryRef */ IntPtr dict, // can be null, undocumented options
			/* VTEncodeInfoFlags */ out VTEncodeInfoFlags flags,
			/* VTCompressionOutputHandler */ BlockLiteral *outputHandler);
Пример #41
0
 static extern void nw_path_enumerate_gateways(IntPtr path, ref BlockLiteral enumerate_block);
			public unsafe NIDAuthSuccessBlock (BlockLiteral *block)
			{
				blockPtr = _Block_copy ((IntPtr) block);
				invoker = block->GetDelegateForBlock<DAuthSuccessBlock> ();
			}
Пример #43
0
 public virtual T applyToBlockLiteral(BlockLiteral operand)
 {
     return(applyToParseTreeNode(operand));
 }
Пример #44
0
 public override AbstractSyntaxTreeNode applyToBlockLiteral(BlockLiteral operand)
 {
     return(Context.newBlockLiteralNode((BlockDeclarationNode)operand.Declaration.valueBy(this)));
 }
Пример #45
0
 extern static void nw_protocol_stack_iterate_application_protocols(nw_protocol_stack_t stack, ref BlockLiteral completion);
Пример #46
0
		public unsafe virtual void SetCallback (XMUtilityCallback callback)
		{
			if (callback == null)
				throw new ArgumentNullException ("callback");
			BlockLiteral *block_ptr_callback;
			BlockLiteral block_callback;
			block_callback = new BlockLiteral ();
			block_ptr_callback = &block_callback;
			block_callback.SetupBlock (static_InnerXMUtilityCallback, callback);
			
			if (IsDirectBinding) {
				MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selSetCallback_, (IntPtr) block_ptr_callback);
			} else {
				MonoTouch.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selSetCallback_, (IntPtr) block_ptr_callback);
			}
			block_ptr_callback->CleanupBlock ();
			
		}
Пример #47
0
 static extern bool nw_framer_message_access_value(OS_nw_protocol_metadata message, string key, ref BlockLiteral access_value);
			public unsafe NIDBranchDeepLinkHandler (BlockLiteral *block)
			{
				blockPtr = _Block_copy ((IntPtr) block);
				invoker = block->GetDelegateForBlock<DBranchDeepLinkHandler> ();
			}
Пример #49
0
 static extern void nw_ethernet_channel_send(OS_nw_ethernet_channel ethernet_channel, OS_dispatch_data content, ushort vlan_tag, string remote_address, ref BlockLiteral completion);
Пример #50
0
        public unsafe virtual void HideToolbar(bool animated, PSPDFAnnotationToolbarCompletionDel completionBlock)
        {
            if (completionBlock == null)
            {
                MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_bool_IntPtr (this.Handle, Selector.GetHandle ("hideToolbarAnimated:completion:"), animated, IntPtr.Zero );
                return;
            }

            BlockLiteral *block_ptr_completionBlock;
            BlockLiteral block_completionBlock;
            block_completionBlock = new BlockLiteral ();
            block_ptr_completionBlock = &block_completionBlock;
            block_completionBlock.SetupBlock (static_InnerPSPDFAnnotationToolbarCompletionDel, completionBlock);

            MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_bool_IntPtr (this.Handle, Selector.GetHandle ("hideToolbarAnimated:completion:"), animated, (IntPtr) block_ptr_completionBlock);
            block_ptr_completionBlock->CleanupBlock ();
        }
Пример #51
0
 extern static void dispatch_read(int fd, nuint length, IntPtr dispatchQueue, ref BlockLiteral block);
Пример #52
0
 static extern void nw_connection_receive(IntPtr handle, /* uint32_t */ uint minimumIncompleteLength, /* uint32_t */ uint maximumLength, ref BlockLiteral callback);
Пример #53
0
 unsafe static extern void nw_data_transfer_report_collect(OS_nw_data_transfer_report report, IntPtr queue, ref BlockLiteral collect_block);
Пример #54
0
 public void Batch(Action method)
 {
     BlockLiteral.SimpleCall(method, (arg) => nw_connection_batch(GetCheckedHandle(), arg));
 }
Пример #55
0
 static extern void nw_connection_set_path_changed_handler(IntPtr handle, ref BlockLiteral callback);
	public unsafe virtual void GetRequest (string url, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDActionArity1V0))]global::System.Action<global::LISDKAPIResponse> success, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDActionArity1V1))]global::System.Action<global::LISDKAPIError> error)
	{
		if (url == null)
			throw new ArgumentNullException ("url");
		if (success == null)
			throw new ArgumentNullException ("success");
		if (error == null)
			throw new ArgumentNullException ("error");
		var nsurl = NSString.CreateNative (url);
		BlockLiteral *block_ptr_success;
		BlockLiteral block_success;
		block_success = new BlockLiteral ();
		block_ptr_success = &block_success;
		block_success.SetupBlock (Trampolines.SDActionArity1V0.Handler, success);
		BlockLiteral *block_ptr_error;
		BlockLiteral block_error;
		block_error = new BlockLiteral ();
		block_ptr_error = &block_error;
		block_error.SetupBlock (Trampolines.SDActionArity1V1.Handler, error);
		
		if (IsDirectBinding) {
			global::ApiDefinition.Messaging.void_objc_msgSend_IntPtr_IntPtr_IntPtr (this.Handle, Selector.GetHandle ("getRequest:success:error:"), nsurl, (IntPtr) block_ptr_success, (IntPtr) block_ptr_error);
		} else {
			global::ApiDefinition.Messaging.void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr (this.SuperHandle, Selector.GetHandle ("getRequest:success:error:"), nsurl, (IntPtr) block_ptr_success, (IntPtr) block_ptr_error);
		}
		NSString.ReleaseNative (nsurl);
		block_ptr_success->CleanupBlock ();
		block_ptr_error->CleanupBlock ();
		
	}
Пример #57
0
 static extern void nw_connection_receive_message(IntPtr handle, ref BlockLiteral callback);
Пример #58
0
 public static extern void void_objc_msgSend_IntPtr_ref_BlockLiteral(IntPtr receiver, IntPtr selector, IntPtr p1, ref BlockLiteral p2);
Пример #59
0
 unsafe static extern void nw_connection_access_establishment_report(IntPtr connection, IntPtr queue, ref BlockLiteral access_block);
		public unsafe virtual void SetConnectionStateChangedBlock (BumpConnectionStateChangedBlock connectionBlock)
		{
			if (connectionBlock == null)
				throw new ArgumentNullException ("connectionBlock");
			BlockLiteral *block_ptr_connectionBlock;
			BlockLiteral block_connectionBlock;
			block_connectionBlock = new BlockLiteral ();
			block_ptr_connectionBlock = &block_connectionBlock;
			block_connectionBlock.SetupBlock (static_InnerBumpConnectionStateChangedBlock, connectionBlock);
			
			MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selSetConnectionStateChangedBlock_, (IntPtr) block_ptr_connectionBlock);
			block_ptr_connectionBlock->CleanupBlock ();
			
		}