Exemple #1
0
        private IEnumerable <Project> OnLoadProjects()
        {
            var response = ProjectApi.List(Connection, Id);

            return(response.Data.Select(p => new Project
            {
                Id = p.Id,
                Name = p.Name,
                Connection = Connection
            }));
        }
Exemple #2
0
        private void LoadDetails()
        {
            var response = ProjectApi.Show(Connection, Id);

            if (response.Data != null)
            {
                _description = response.Data.Description ?? string.Empty;
                _projectType = new ProjectType {
                    Code = response.Data.ProjectType.Code, DisplayName = response.Data.ProjectType.Name
                };
                _stringCount = response.Data.StringCount;
                _wordCount   = response.Data.WordCount;
            }
        }
Exemple #3
0
        private Project OnCreateProject(Project newProject)
        {
            var response = ProjectApi.Create(Connection, Id, newProject.Name, newProject.Description, newProject.Type.Code);

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

            return(newProject);
        }
Exemple #4
0
 private bool OnDeleteProject(Project project)
 {
     return(ProjectApi.Delete(Connection, project.Id));
 }