diff --git a/.vs/DeskHubSharp/v15/.suo b/.vs/DeskHubSharp/v15/.suo index 34eed78..a688f67 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 c07338d..d1ea0d1 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-wal b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal index f062606..63a2449 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/AboutWindow.xaml b/DeskHubSharp/AboutWindow.xaml index 75240c2..74fc316 100644 --- a/DeskHubSharp/AboutWindow.xaml +++ b/DeskHubSharp/AboutWindow.xaml @@ -13,9 +13,27 @@ - + Want to help with development? + + This project cannot be done without the help of + + johnvelis + + , + + NoahFlowa + + , + + ericgi231 + + , and + + tarkowr. + + diff --git a/DeskHubSharp/AboutWindow.xaml.cs b/DeskHubSharp/AboutWindow.xaml.cs index 46b6ff9..4d1633d 100644 --- a/DeskHubSharp/AboutWindow.xaml.cs +++ b/DeskHubSharp/AboutWindow.xaml.cs @@ -36,5 +36,29 @@ namespace DeskHubSharp Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); e.Handled = true; } + + private void Hyperlink_RequestNavigate_1(object sender, RequestNavigateEventArgs e) + { + Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); + e.Handled = true; + } + + private void Hyperlink_RequestNavigate_2(object sender, RequestNavigateEventArgs e) + { + Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); + e.Handled = true; + } + + private void Hyperlink_RequestNavigate_3(object sender, RequestNavigateEventArgs e) + { + Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); + e.Handled = true; + } + + private void Hyperlink_RequestNavigate_4(object sender, RequestNavigateEventArgs e) + { + Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); + e.Handled = true; + } } } diff --git a/DeskHubSharp/BusinessLayer/Request.cs b/DeskHubSharp/BusinessLayer/Request.cs index a6fe40b..3a39068 100644 --- a/DeskHubSharp/BusinessLayer/Request.cs +++ b/DeskHubSharp/BusinessLayer/Request.cs @@ -39,23 +39,38 @@ namespace DeskHubSharp /// public void SearchRequest() { - var client = new RestClient(_apiEndpoint); - RestRequest requestRepo = new RestRequest($"users/{_query}/repos", Method.GET); + try + { + var client = new RestClient(_apiEndpoint); + RestRequest requestRepo = new RestRequest($"users/{_query}/repos", Method.GET); - var response = client.Execute(requestRepo); - var x = response.Content; - var deserialized = JsonConvert.DeserializeObject>(x); + var response = client.Execute(requestRepo); + var x = response.Content; + var deserialized = JsonConvert.DeserializeObject>(x); - //ObservableCollection test = new ObservableCollection() - //{ - // new RepoDetail() - // { - // Login = "John", - // Password = "pw" - // } - //}; + //ObservableCollection test = new ObservableCollection() + //{ + // new RepoDetail() + // { + // Login = "John", + // Password = "pw" + // } + //}; - RepoList.repoDetail = deserialized; + if (deserialized.Count() == 0) + { + throw new Exception(); + } + else + { + RepoList.repoDetail = deserialized; + } + } + catch (Exception) + { + ErrorWindow err = new ErrorWindow(); + err.txtblk_error.Text = "We can't gather repository data. Please try again"; + } } @@ -64,15 +79,32 @@ namespace DeskHubSharp /// public void UserRequest() { - var client = new RestClient(_apiEndpoint); + try + { + var client = new RestClient(_apiEndpoint); - RestRequest requestUser = new RestRequest($"users/{_query}", Method.GET); + RestRequest requestUser = new RestRequest($"users/{_query}", Method.GET); - var response = client.Execute(requestUser); - string x = response.Content; - var deserailized = JsonConvert.DeserializeObject(x); + var response = client.Execute(requestUser); + string x = response.Content; + var deserailized = JsonConvert.DeserializeObject(x); + + if (deserailized == null) + { + throw new Exception(); + } + else + { + RepoList.userDetail = deserailized; + } + + } + catch (Exception) + { + ErrorWindow err = new ErrorWindow(); + err.txtblk_error.Text = "We can't gather user data. Please try again."; + } - RepoList.userDetail = deserailized; } } diff --git a/DeskHubSharp/DetailWindow.xaml b/DeskHubSharp/DetailWindow.xaml index fde7ff1..c62ff20 100644 --- a/DeskHubSharp/DetailWindow.xaml +++ b/DeskHubSharp/DetailWindow.xaml @@ -10,6 +10,7 @@