Exemple #1
0
        async Task <string> PlatformGetRemoteId(NGContact contact)
        {
            var winContact = contact.ToContact();
            var store      = await ContactManager.RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType.AppAnnotationsReadWrite);

            var contactAnnotations = await store.FindAnnotationsForContactAsync(winContact);

            return(contactAnnotations.FirstOrDefault()?.RemoteId ?? string.Empty);
        }
Exemple #2
0
        async Task PlatformCreateContact(NGContact contact, string listName)
        {
            var winContact  = contact.ToContact();
            var contactList = await FindOrRegisterContactList(listName);

            await contactList.SaveContactAsync(winContact);

            contact.Id = winContact.Id;
        }
Exemple #3
0
        async Task PlatformDeleteContact(NGContact contact, string listName)
        {
            var winContact  = contact.ToContact();
            var contactList = await FindOrRegisterContactList(listName);

            if (contact != null)
            {
                await contactList.DeleteContactAsync(winContact);
            }
        }
Exemple #4
0
        async Task PlatformUnpin(NGContact contact)
        {
            var pinnedContactManager = PinnedContactManager.GetDefault();
            var winContact           = contact.ToContact();

            if (pinnedContactManager.IsContactPinned(winContact, PinnedContactSurface.Taskbar))
            {
                await pinnedContactManager.RequestUnpinContactAsync(winContact, PinnedContactSurface.Taskbar);
            }
        }
Exemple #5
0
        async Task PlatformPin(NGContact contact)
        {
            var pinnedContactManager = PinnedContactManager.GetDefault();

            // Check whether pinning to the Taskbar is supported.
            if (!pinnedContactManager.IsPinSurfaceSupported(PinnedContactSurface.Taskbar))
            {
                return;
            }

            var winContact = contact.ToContact();

            if (pinnedContactManager.IsContactPinned(winContact, PinnedContactSurface.Taskbar))
            {
                // Contact is already pinned
                return;
            }

            await pinnedContactManager.RequestPinContactAsync(winContact, PinnedContactSurface.Taskbar);
        }