public void EqualsTest()
        {
            AtomId a        = new AtomId("www.a.com");
            AtomId b        = new AtomId("www.b.com");
            bool   expected = false; // TODO: Initialize to an appropriate value
            bool   actual;

            actual = a.Equals(b);
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        private Contact LoadGoogleContacts(AtomId id)
        {
            string message = "Error Loading Google Contacts. Cannot connect to Google.\r\nPlease ensure you are connected to the internet. If you are behind a proxy, change your proxy configuration!";

            Contact ret = null;

            try
            {
                GoogleContacts = new Collection <Contact>();

                ContactsQuery query = new ContactsQuery(ContactsQuery.CreateContactsUri("default"));
                query.NumberToRetrieve = 256;
                query.StartIndex       = 0;

                //Group group = GetGoogleGroupByName(myContactsGroup);
                //if (group != null)
                //    query.Group = group.Id;

                //query.ShowDeleted = false;
                //query.OrderBy = "lastmodified";

                Feed <Contact> feed = ContactsRequest.Get <Contact>(query);

                while (feed != null)
                {
                    foreach (Contact a in feed.Entries)
                    {
                        GoogleContacts.Add(a);
                        if (id != null && id.Equals(a.ContactEntry.Id))
                        {
                            ret = a;
                        }
                    }
                    query.StartIndex += query.NumberToRetrieve;
                    feed              = ContactsRequest.Get <Contact>(feed, FeedRequestType.Next);
                }

                Logger.Log(UserName + " : " + GoogleContacts.Count + " contact(s)", EventType.Debug);
            }
            catch (System.Net.WebException ex)
            {
                Logger.Log(ex.Message, EventType.Error);

                //throw new GDataRequestException(message, ex);
            }
            catch (System.NullReferenceException ex)
            {
                Logger.Log(ex.Message, EventType.Error);

                //Logger.Log(message, EventType.Error);
                //throw new GDataRequestException(message, new System.Net.WebException("Error accessing feed", ex));
            }

            return(ret);
        }