Esempio n. 1
0
        /// <summary>
        /// プロジェクトの取得
        /// </summary>
        /// <param name="id">プロジェクトID</param>
        /// <returns>プロジェクト情報</returns>
        public async Task <Project> RequestProjectAsync(string id)
        {
            Project project = null;

            try
            {
                string uri = string.Format(URI_PREFIX + this.Version + "/projects/{1}?private_token={2}", this.host, id, this.private_token);

                string responseBody = await this.HttopGet(uri);

                project = ProjectsFactory.Create(responseBody);
            }
            catch (HttpRequestException ex)
            {
                // 例外処理
                this.NotifyException(ex);
            }
            return(project);
        }
Esempio n. 2
0
        /// <summary>
        /// プロジェクトリストの取得
        /// </summary>
        /// <returns>プロジェクトリスト</returns>
        public async Task <List <Project> > RequestProjectsAsync()
        {
            List <Project> projects = new List <Project>();

            try
            {
                string uri = string.Format(URI_PREFIX + this.Version + "/projects?private_token={1}", this.host, this.private_token);

                string responseBody = await this.HttopGet(uri);

                projects = ProjectsFactory.Creates(responseBody);
            }
            catch (HttpRequestException ex)
            {
                // 例外処理
                this.NotifyException(ex);
            }
            return(projects);
        }