private async void GetRepos() { IReadOnlyList <Repository> repos = await GitHubClientActions.GetUserRepos(); foreach (var repo in repos) { Console.WriteLine("Checking repo: " + repo.FullName); } }
/// <summary> /// OnLoad Method /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { bool haveKey = GitHubClientActions.CheckForToken(); Console.WriteLine("Have key?: " + haveKey); if (haveKey) { gitHubLogin1.Visible = false; GetRepos(); } }
private async void searchButton_Click(object sender, EventArgs e) { var term = searchBox.Text; var results = await GitHubClientActions.SearchGitHub(term); searchResults = results; foreach (var res in searchResults.Items) { SearchResultGrid result = new SearchResultGrid { FullName = res.FullName, URL = new Uri(res.Url), Stars = res.StargazersCount.ToString(), Language = res.Language, OpenIssues = res.OpenIssuesCount.ToString() }; gridData.Add(result); } resultsGrid.DataSource = gridData; }