Beispiel #1
0
        /// <summary>
        /// Print all contacts for the current user.
        /// </summary>
        /// <param name='service'>Authorized Mirror service.</param>
        public static void PrintAllContacts(MirrorService service)
        {
            try
            {
                ContactsListResponse contacts =
                    service.Contacts.List().Fetch();

                foreach (Contact contact in contacts.Items)
                {
                    Console.WriteLine("Contact ID: " + contact.Id);
                    Console.WriteLine("  > displayName: " + contact.DisplayName);
                    if (contact.ImageUrls != null)
                    {
                        foreach (String imageUrl in contact.ImageUrls)
                        {
                            Console.WriteLine("  > imageUrl: " + imageUrl);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("An error occurred: " + e.Message);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Print all contacts for the current user.
        /// </summary>
        /// <param name='service'>Authorized Mirror service.</param>
        public static void findSharedContactAndRemove(MirrorService service, String contactId)
        {
            try
            {
                ContactsListResponse contacts =
                    service.Contacts.List().Fetch();

                if (contacts.Items.Count > 0)
                {
                    foreach (Contact contact in contacts.Items)
                    {
                        if (contact.Id == contactId)
                        {
                            deleteContact(service, contactId);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("An error occurred: " + e.Message);
            }
        }