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); }
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 }); } } }
private bool OnDeleteProjectGroup(ProjectGroup projectGroup) { return(ProjectGroupApi.Delete(this, projectGroup.Id)); }