Пример #1
0
        private ProjectGroup OnCreateProjectGroup(ProjectGroup newProjectGroup)
        {
            var response = ProjectGroupApi.Create(this, newProjectGroup.Name, newProjectGroup.BaseCultureName);

            if (response.Meta.Status == 201 && response.Data != null)
            {
                newProjectGroup.Id         = response.Data.Id;
                newProjectGroup.Connection = this;
            }
            else
            {
                newProjectGroup = null;
            }

            return(newProjectGroup);
        }
Пример #2
0
        private IEnumerable <ProjectGroup> OnLoadProjectGroups(int page, int itemsPerPage)
        {
            var response = ProjectGroupApi.List(this, page, itemsPerPage);

            if (response != null)
            {
                foreach (var projectGroupInfo in response.Data)
                {
                    yield return(new ProjectGroup
                    {
                        Id = projectGroupInfo.Id,
                        Name = new string(projectGroupInfo.Name.TakeWhile(c => c != '\0').ToArray()),
                        Connection = this
                    });
                }
            }
        }
Пример #3
0
 private bool OnDeleteProjectGroup(ProjectGroup projectGroup)
 {
     return(ProjectGroupApi.Delete(this, projectGroup.Id));
 }