/// <summary> /// Create new group by group name /// </summary> /// <param name="GroupName"></param> /// <returns></returns> public Google.Contacts.Group AddContactGroup(string GroupName) { ContactGroupsInitialize(); Google.Contacts.Group newGroup = new Google.Contacts.Group(); newGroup.Title = GroupName; Google.Contacts.Group createdGroup = cr.Insert(new Uri("https://www.google.com/m8/feeds/groups/default/full"), newGroup); _groupList.Add(createdGroup.Title, createdGroup); return(createdGroup); }
/// <summary> /// Delete non-system group /// </summary> /// <param name="GroupName"></param> public void DeleteContactGroupName(string GroupName) { // Retrieving the contact group is required in order to get the Etag. Google.Contacts.Group group = GetContactGroupByName(GroupName); if (!group.ReadOnly) { try { cr.Delete(group); } catch (GDataVersionConflictException e) { LoggerProvider.Instance.Logger.Error("Can't delete Contact Group from Google {0}", GroupName); LoggerProvider.Instance.Logger.Error(e); } _groupList.Remove(GroupName); } }