Esempio n. 1
0
        public async Task <bool> FileExistsAsync(GitHubRepoSearchItem repo, string filePath)
        {
            var wc  = new WebClient();
            var url = Invariant($"https://raw.githubusercontent.com/{repo.FullName}/master/{filePath}");

            try {
                var json = await wc.DownloadDataTaskAsync(url);

                return(true);
            } catch (WebException) {
                return(false);
            }
        }
Esempio n. 2
0
        public Task <GitHubRepoSearchItem> GetDescription(string owner, string name)
        {
            string description;

            if (Descriptions.TryGetValue(Tuple.Create(owner, name), out description))
            {
                var item = new GitHubRepoSearchItem();
                item.Description = description;

                return(Task.FromResult(item));
            }

            throw new WebException();
        }
Esempio n. 3
0
        public Task <GitHubRepoSearchItem> GetRepositoryDetails(string owner, string name)
        {
            if (Descriptions.TryGetValue(Tuple.Create(owner, name), out global::System.String description))
            {
                var item = new GitHubRepoSearchItem
                {
                    Description = description
                };

                return(Task.FromResult(item));
            }

            throw new WebException();
        }
Esempio n. 4
0
 public Task <bool> FileExistsAsync(GitHubRepoSearchItem repo, string filePath)
 {
     throw new NotImplementedException();
 }