コード例 #1
0
        public virtual void Schedule(ScheduleBlock block)
        {
            if (block == null)
            {
                throw new ArgumentNullException(nameof(block));
            }

            var blocklit = new BlockLiteral();

            blocklit.SetupBlock(scheduleBlockProxy, block);
            try
            {
                unsafe
                {
                    var blockref = &blocklit;
                    LibObjc.void_objc_msgSend_IntPtr(this.Handle, selScheduleWithBlock, (IntPtr)blockref);
                }
            }
            finally
            {
                blocklit.CleanupBlock();
            }
        }
コード例 #2
0
 public NSBackgroundActivityScheduler(string identifier)
     : base(LibObjc.IntPtr_objc_msgSend_IntPtr(
                Class.GetHandle(className), selAlloc, new NSString(identifier).Handle))
 {
     LibObjc.void_objc_msgSend_IntPtr(Handle, selInitWithIdentifier, new NSString(identifier).Handle);
 }