diff --git a/.vs/DeskHubSharp/v15/.suo b/.vs/DeskHubSharp/v15/.suo index 8fbe526..606aacc 100644 Binary files a/.vs/DeskHubSharp/v15/.suo and b/.vs/DeskHubSharp/v15/.suo differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide index c1cb1ca..a0ba93e 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm index ba7265d..e034d9c 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal index 8c45de2..b8abb09 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal differ diff --git a/DeskHubSharp/BusinessLayer/Request.cs b/DeskHubSharp/BusinessLayer/Request.cs index 73b1e56..4675efe 100644 --- a/DeskHubSharp/BusinessLayer/Request.cs +++ b/DeskHubSharp/BusinessLayer/Request.cs @@ -7,48 +7,60 @@ using System.Net.Mail; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; +using System.Collections.ObjectModel; namespace DeskHubSharp { class Request { // TODO: this is rudimentary, fix it - // i.e. try catch statements + // i.e. try catch statements\ + // TODO: find how to access a list index + // TODO: find how to access the deserialized private string _apiEndpoint = "https://api.github.com/"; private string _query; + public List RepoDetail { get; set; } + public Request(string query) { _query = query; } + //public Request(string query, Object function) + //{ + // _query = query; + //} + + /// + /// Calls API for repo and user data an stores it in RepoList + /// + /// public void SearchRequest() { var client = new RestClient(_apiEndpoint); + RestRequest requestRepo = new RestRequest($"users/{_query}/repos", Method.GET); - RestRequest requestRepo = new RestRequest($"users//{_query}//repos", Method.GET); - - var response = client.Execute(requestRepo).ToString(); - - Deserialize(response); + var response = client.Execute(requestRepo); + var x = response.Content; + var deserialized = JsonConvert.DeserializeObject>(x); + RepoList.repoDetail = deserialized; } + /// + /// Deprecated: Calls API for user data + /// public void UserRequest() { var client = new RestClient(_apiEndpoint); - RestRequest requestUser = new RestRequest($"users//{_query}", Method.GET); + RestRequest requestUser = new RestRequest($"users/{_query}", Method.GET); - string response = client.Execute(requestUser).ToString(); - - Deserialize(response); - } - - private void Deserialize(string response) - { - var deserialized = JsonConvert.DeserializeObject(response); + var response = client.Execute(requestUser); + string x = response.ToString(); + var deserialized = JsonConvert.DeserializeObject(x); } } diff --git a/DeskHubSharp/MainWindow.xaml.cs b/DeskHubSharp/MainWindow.xaml.cs index e3cccb0..dc2c2e1 100644 --- a/DeskHubSharp/MainWindow.xaml.cs +++ b/DeskHubSharp/MainWindow.xaml.cs @@ -23,6 +23,8 @@ namespace DeskHubSharp public MainWindow() { InitializeComponent(); + + } private void btn_detail_Click(object sender, RoutedEventArgs e) diff --git a/DeskHubSharp/Models/Email.cs b/DeskHubSharp/Models/Email.cs index 48caa9a..22630a2 100644 --- a/DeskHubSharp/Models/Email.cs +++ b/DeskHubSharp/Models/Email.cs @@ -4,7 +4,7 @@ namespace DeskHubSharp { private string _toEmail = "wjmiller2016@gmail.com"; private string _fromEmail = "wjmiller2016@gmail.com"; - private string _passwordEmail = "IhaveanAMDRX580"; + private string _passwordEmail = "password"; public string Password { diff --git a/DeskHubSharp/Models/RepoDetail.cs b/DeskHubSharp/Models/RepoDetail.cs index 5ff579a..92d0ef5 100644 --- a/DeskHubSharp/Models/RepoDetail.cs +++ b/DeskHubSharp/Models/RepoDetail.cs @@ -77,7 +77,7 @@ namespace DeskHubSharp /// public string site_admin { get; set; } } - + public class License { /// @@ -101,294 +101,297 @@ namespace DeskHubSharp /// public string node_id { get; set; } } - - /// - /// - /// - public int id { get; set; } - /// - /// - /// - public string node_id { get; set; } - /// - /// - /// - public string name { get; set; } - /// - /// - /// - public string full_name { get; set; } - /// - /// - /// - public string privates { get; set; } - /// - /// - /// - public Owner owner { get; set; } - /// - /// - /// - public string html_url { get; set; } - /// - /// - /// - public string description { get; set; } - /// - /// - /// - public string fork { get; set; } - /// - /// - /// - public string url { get; set; } - /// - /// - /// - public string forks_url { get; set; } - /// - /// - /// - public string keys_url { get; set; } - /// - /// - /// - public string collaborators_url { get; set; } - /// - /// - /// - public string teams_url { get; set; } - /// - /// - /// - public string hooks_url { get; set; } - /// - /// - /// - public string issue_events_url { get; set; } - /// - /// - /// - public string events_url { get; set; } - /// - /// - /// - public string assignees_url { get; set; } - /// - /// - /// - public string branches_url { get; set; } - /// - /// - /// - public string tags_url { get; set; } - /// - /// - /// - public string blobs_url { get; set; } - /// - /// - /// - public string git_tags_url { get; set; } - /// - /// - /// - public string git_refs_url { get; set; } - /// - /// - /// - public string trees_url { get; set; } - /// - /// - /// - public string statuses_url { get; set; } - /// - /// - /// - public string languages_url { get; set; } - /// - /// - /// - public string stargazers_url { get; set; } - /// - /// - /// - public string contributors_url { get; set; } - /// - /// - /// - public string subscribers_url { get; set; } - /// - /// - /// - public string subscription_url { get; set; } - /// - /// - /// - public string commits_url { get; set; } - /// - /// - /// - public string git_commits_url { get; set; } - /// - /// - /// - public string comments_url { get; set; } - /// - /// - /// - public string issue_comment_url { get; set; } - /// - /// - /// - public string contents_url { get; set; } - /// - /// - /// - public string compare_url { get; set; } - /// - /// - /// - public string merges_url { get; set; } - /// - /// - /// - public string archive_url { get; set; } - /// - /// - /// - public string downloads_url { get; set; } - /// - /// - /// - public string issues_url { get; set; } - /// - /// - /// - public string pulls_url { get; set; } - /// - /// - /// - public string milestones_url { get; set; } - /// - /// - /// - public string notifications_url { get; set; } - /// - /// - /// - public string labels_url { get; set; } - /// - /// - /// - public string releases_url { get; set; } - /// - /// - /// - public string deployments_url { get; set; } - /// - /// - /// - public string created_at { get; set; } - /// - /// - /// - public string updated_at { get; set; } - /// - /// - /// - public string pushed_at { get; set; } - /// - /// - /// - public string git_url { get; set; } - /// - /// - /// - public string ssh_url { get; set; } - /// - /// - /// - public string clone_url { get; set; } - /// - /// - /// - public string svn_url { get; set; } - /// - /// - /// - public string homepage { get; set; } - /// - /// - /// - public int size { get; set; } - /// - /// - /// - public int stargazers_count { get; set; } - /// - /// - /// - public int watchers_count { get; set; } - /// - /// - /// - public string language { get; set; } - /// - /// - /// - public string has_issues { get; set; } - /// - /// - /// - public string has_projects { get; set; } - /// - /// - /// - public string has_downloads { get; set; } - /// - /// - /// - public string has_wiki { get; set; } - /// - /// - /// - public string has_pages { get; set; } - /// - /// - /// - public int forks_count { get; set; } - /// - /// - /// - public string mirror_url { get; set; } - /// - /// - /// - public string archived { get; set; } - /// - /// - /// - public int open_issues_count { get; set; } - /// - /// - /// - public License license { get; set; } - /// - /// - /// - public int forks { get; set; } - /// - /// - /// - public int open_issues { get; set; } - /// - /// - /// - public int watchers { get; set; } - /// - /// - /// - public string default_branch { get; set; } + + public class Root + { + /// + /// + /// + public int id { get; set; } + /// + /// + /// + public string node_id { get; set; } + /// + /// + /// + public string name { get; set; } + /// + /// + /// + public string full_name { get; set; } + /// + /// + /// + //public string private { get; set; } + /// + /// + /// + public Owner owner { get; set; } + /// + /// + /// + public string html_url { get; set; } + /// + /// + /// + public string description { get; set; } + /// + /// + /// + public string fork { get; set; } + /// + /// + /// + public string url { get; set; } + /// + /// + /// + public string forks_url { get; set; } + /// + /// + /// + public string keys_url { get; set; } + /// + /// + /// + public string collaborators_url { get; set; } + /// + /// + /// + public string teams_url { get; set; } + /// + /// + /// + public string hooks_url { get; set; } + /// + /// + /// + public string issue_events_url { get; set; } + /// + /// + /// + public string events_url { get; set; } + /// + /// + /// + public string assignees_url { get; set; } + /// + /// + /// + public string branches_url { get; set; } + /// + /// + /// + public string tags_url { get; set; } + /// + /// + /// + public string blobs_url { get; set; } + /// + /// + /// + public string git_tags_url { get; set; } + /// + /// + /// + public string git_refs_url { get; set; } + /// + /// + /// + public string trees_url { get; set; } + /// + /// + /// + public string statuses_url { get; set; } + /// + /// + /// + public string languages_url { get; set; } + /// + /// + /// + public string stargazers_url { get; set; } + /// + /// + /// + public string contributors_url { get; set; } + /// + /// + /// + public string subscribers_url { get; set; } + /// + /// + /// + public string subscription_url { get; set; } + /// + /// + /// + public string commits_url { get; set; } + /// + /// + /// + public string git_commits_url { get; set; } + /// + /// + /// + public string comments_url { get; set; } + /// + /// + /// + public string issue_comment_url { get; set; } + /// + /// + /// + public string contents_url { get; set; } + /// + /// + /// + public string compare_url { get; set; } + /// + /// + /// + public string merges_url { get; set; } + /// + /// + /// + public string archive_url { get; set; } + /// + /// + /// + public string downloads_url { get; set; } + /// + /// + /// + public string issues_url { get; set; } + /// + /// + /// + public string pulls_url { get; set; } + /// + /// + /// + public string milestones_url { get; set; } + /// + /// + /// + public string notifications_url { get; set; } + /// + /// + /// + public string labels_url { get; set; } + /// + /// + /// + public string releases_url { get; set; } + /// + /// + /// + public string deployments_url { get; set; } + /// + /// + /// + public string created_at { get; set; } + /// + /// + /// + public string updated_at { get; set; } + /// + /// + /// + public string pushed_at { get; set; } + /// + /// + /// + public string git_url { get; set; } + /// + /// + /// + public string ssh_url { get; set; } + /// + /// + /// + public string clone_url { get; set; } + /// + /// + /// + public string svn_url { get; set; } + /// + /// + /// + public string homepage { get; set; } + /// + /// + /// + public int size { get; set; } + /// + /// + /// + public int stargazers_count { get; set; } + /// + /// + /// + public int watchers_count { get; set; } + /// + /// + /// + public string language { get; set; } + /// + /// + /// + public string has_issues { get; set; } + /// + /// + /// + public string has_projects { get; set; } + /// + /// + /// + public string has_downloads { get; set; } + /// + /// + /// + public string has_wiki { get; set; } + /// + /// + /// + public string has_pages { get; set; } + /// + /// + /// + public int forks_count { get; set; } + /// + /// + /// + public string mirror_url { get; set; } + /// + /// + /// + public string archived { get; set; } + /// + /// + /// + public int open_issues_count { get; set; } + /// + /// + /// + public License license { get; set; } + /// + /// + /// + public int forks { get; set; } + /// + /// + /// + public int open_issues { get; set; } + /// + /// + /// + public int watchers { get; set; } + /// + /// + /// + public string default_branch { get; set; } + } } } \ No newline at end of file diff --git a/DeskHubSharp/Models/RepoList.cs b/DeskHubSharp/Models/RepoList.cs index a7a7e59..3758271 100644 --- a/DeskHubSharp/Models/RepoList.cs +++ b/DeskHubSharp/Models/RepoList.cs @@ -7,8 +7,14 @@ using System.Threading.Tasks; namespace DeskHubSharp { - class RepoList : ObservableCollection + class RepoList { + private static ObservableCollection _repoDetail; + public static ObservableCollection repoDetail + { + get { return _repoDetail; } + set { _repoDetail = value; } + } } } diff --git a/DeskHubSharp/SearchWindow.xaml b/DeskHubSharp/SearchWindow.xaml index 6cdfa18..f432035 100644 --- a/DeskHubSharp/SearchWindow.xaml +++ b/DeskHubSharp/SearchWindow.xaml @@ -10,7 +10,7 @@