Beispiel #1
0
        private static void InternalEnumerateContactsBlock(/* CNContact */ IntPtr contact, out bool stop, IntPtr secondaryCallback)
        {
            if (PInvokeUtil.IsNull(secondaryCallback))
            {
                stop = true;
                return;
            }

            CNContact ct = PInvokeUtil.IsNotNull(contact) ? new CNContact(contact) : null;

            // Invoke consumer callback.
            stop = PInvokeCallbackUtil.PerformInternalFunction <CNContact, bool>(
                "CNContactStore#InternalEnumerateContactsBlock",
                PInvokeCallbackUtil.Type.Permanent, // make sure the callback can be called repeatedly
                ct,
                secondaryCallback);

            // Release callback handle if stopping.
            if (stop)
            {
                PInvokeCallbackUtil.UnpinCallbackHandle(secondaryCallback);
            }
        }