예제 #1
0
        public async Task <ContactGroup> ContactGroupsCreate(ContactGroup group)
        {
            await AuthenticateAsync(new[] { PeopleServiceService.Scope.Contacts });

            var body = new CreateContactGroupRequest();

            body.ContactGroup = group;
            var request  = service.ContactGroups.Create(body);
            var response = await request.ExecuteAsync();

            return(response);
        }
        public string CreateLabel(Label label)
        {
            if (!IsLoggedIn())
            {
                return(null);
            }

            var createContactGroupRequest = new CreateContactGroupRequest
            {
                ContactGroup = new ContactGroup
                {
                    Name = label.Name
                }
            };

            var groupRequest = _service.ContactGroups.Create(createContactGroupRequest);
            var response     = groupRequest.Execute();

            ReloadContacts();

            return(response.ResourceName);
        }
예제 #3
0
        /// <summary>
        /// Create group.
        /// </summary>
        /// <param name="groupName">Name of group.</param>
        public void CreateGroup(string groupName)
        {
            var contactGroup = new ContactGroup {
                Name = groupName
            };
            var contactGroupRequest = new CreateContactGroupRequest {
                ContactGroup = contactGroup
            };

            var request = PeopleService.ContactGroups.Create(contactGroupRequest);

            try
            {
                request.Execute();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
                return;
            }

            GetGroups();
        }