public unsafe virtual void SwipeToOriginWithCompletion([BlockProxy(typeof(MonoTouch.ObjCRuntime.Trampolines.NIDMCSwipeCompletionBlock))] MCSwipeCompletionBlock 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.SDMCSwipeCompletionBlock.Handler, completion);

            if (IsDirectBinding)
            {
                ApiDefinition.Messaging.void_objc_msgSend_IntPtr(this.Handle, selSwipeToOriginWithCompletion_Handle, (IntPtr)block_ptr_completion);
            }
            else
            {
                ApiDefinition.Messaging.void_objc_msgSendSuper_IntPtr(this.SuperHandle, selSwipeToOriginWithCompletion_Handle, (IntPtr)block_ptr_completion);
            }
            block_ptr_completion->CleanupBlock();
        }
Ejemplo n.º 2
0
        public static void SetSwipeGestureWithView(this MCSwipeTableViewCell cell, UIImage Image, UIColor Color, MCCellMode Mode, MCCellState State, MCSwipeCompletionBlock Completion)
        {
            switch (State)
            {
            case MCCellState.One:
                cell.Color1           = Color;
                cell.View1            = ViewWithImage(Image);
                cell.ModeForState1    = Mode;
                cell.CompletionBlock1 = Completion;
                break;

            case MCCellState.Two:
                cell.Color2           = Color;
                cell.View2            = ViewWithImage(Image);
                cell.ModeForState2    = Mode;
                cell.CompletionBlock2 = Completion;
                break;

            case MCCellState.Three:
                cell.Color3           = Color;
                cell.View3            = ViewWithImage(Image);
                cell.ModeForState3    = Mode;
                cell.CompletionBlock3 = Completion;
                break;

            case MCCellState.Four:
                cell.Color4           = Color;
                cell.View4            = ViewWithImage(Image);
                cell.ModeForState4    = Mode;
                cell.CompletionBlock4 = Completion;
                break;
            }
        }