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); } }
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(); }
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(); }
public Task <bool> FileExistsAsync(GitHubRepoSearchItem repo, string filePath) { throw new NotImplementedException(); }