Exemple #1
0
 public async Task<bool> FileExistsAsync(GitHubRepoSearchItem repo, string filePath) {
     var wc = new WebClient();
     var url = $"https://raw.githubusercontent.com/{repo.FullName}/master/{filePath}";
     try {
         var json = await wc.DownloadDataTaskAsync(url);
         return true;
     } catch (WebException) {
         return false;
     }
 }
Exemple #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();
        }
Exemple #3
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);
            }
        }
Exemple #4
0
 public Task<bool> FileExistsAsync(GitHubRepoSearchItem repo, string filePath) {
     throw new NotImplementedException();
 }