diff --git a/.vs/DeskHubSharp/v15/.suo b/.vs/DeskHubSharp/v15/.suo
index 439d2ea..5205686 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 b8faaf4..3ec4c19 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 00c9850..01adc60 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 50d6117..2e66870 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 8e297aa..a2d6c89 100644
--- a/DeskHubSharp/BusinessLayer/Request.cs
+++ b/DeskHubSharp/BusinessLayer/Request.cs
@@ -15,8 +15,7 @@ namespace DeskHubSharp
{
// TODO: this is rudimentary, fix it
// i.e. try catch statements\
- // TODO: find how to access a list index
- // TODO: find how to access the deserialized
+ // TODO: Add BranchRequest function
private string _apiEndpoint = "https://api.github.com/";
private string _query;
@@ -34,7 +33,7 @@ namespace DeskHubSharp
//}
///
- /// Calls API for repo and user data an stores it in RepoList
+ /// Calls API for repo and basic user data
///
///
public void SearchRequest()
@@ -63,7 +62,7 @@ namespace DeskHubSharp
}
else
{
- RepoList.repoDetail = deserialized;
+ RequestList.repoDetail = deserialized;
}
}
catch (Exception)
@@ -95,7 +94,7 @@ namespace DeskHubSharp
}
else
{
- RepoList.userDetail = deserailized;
+ RequestList.userDetail = deserailized;
}
}
@@ -107,5 +106,29 @@ namespace DeskHubSharp
}
+ ///
+ /// Calls API for detailed branch data
+ ///
+ public void BranchRequest()
+ {
+ try
+ {
+ var client = new RestClient(_apiEndpoint);
+
+ RestRequest requestUser = new RestRequest($"/repos/{RequestList.userDetail.login}/{_query}/branches", Method.GET);
+
+ var response = client.Execute(requestUser);
+ string x = response.Content;
+ var deserailized = JsonConvert.DeserializeObject>(x);
+
+ RequestList.branchDetail = deserailized;
+ }
+ catch (Exception)
+ {
+ ErrorWindow err = new ErrorWindow();
+ err.txtblk_error.Text = "We couldn't gather user data. Please try again.";
+ }
+ }
+
}
}
diff --git a/DeskHubSharp/DeskHubSharp.csproj b/DeskHubSharp/DeskHubSharp.csproj
index de886c3..3332ad6 100644
--- a/DeskHubSharp/DeskHubSharp.csproj
+++ b/DeskHubSharp/DeskHubSharp.csproj
@@ -72,6 +72,7 @@
MSBuild:Compile
+
@@ -132,7 +133,7 @@
-
+
diff --git a/DeskHubSharp/DetailWindow.xaml b/DeskHubSharp/DetailWindow.xaml
index 71e3fd9..bab7521 100644
--- a/DeskHubSharp/DetailWindow.xaml
+++ b/DeskHubSharp/DetailWindow.xaml
@@ -5,12 +5,24 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DeskHubSharp"
mc:Ignorable="d"
- Title="Detail - DeskHubSharp" Height="450" Width="800" ResizeMode="NoResize">
+ Title="Detail - DeskHubSharp" Height="450" Width="400" ResizeMode="NoResize">
-
-
-
-
-
+
+
+
+
+
+ Clone
+
+
+
+
+ GitHub Page
+
+
+
+
+
+
diff --git a/DeskHubSharp/DetailWindow.xaml.cs b/DeskHubSharp/DetailWindow.xaml.cs
index 6c8e563..b2ddc32 100644
--- a/DeskHubSharp/DetailWindow.xaml.cs
+++ b/DeskHubSharp/DetailWindow.xaml.cs
@@ -25,14 +25,34 @@ namespace DeskHubSharp
public DetailWindow(RepoDetail repoDetail)
{
InitializeComponent();
- _repoDetail = repoDetail;
- lbl_reponame.Content = _repoDetail.full_name;
+ _repoDetail = repoDetail;
+
+ Request request = new Request(_repoDetail.name);
+ RepoInfo info = new RepoInfo();
+ request.BranchRequest();
+ var stuff = info.GetBranchNameComboBox();
+
+ cmbbox_branches.ItemsSource = stuff;
+
+ lbl_reponame.Content = _repoDetail.full_name;
+ txtblk_language.Text = $"This repo is mostly {_repoDetail.language} code.";
+ txtblk_stargazers.Text = $"This repo has {_repoDetail.stargazers_count} stargazers.";
}
private void btn_close_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
+
+ private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
+ {
+
+ }
+
+ private void Hyperlink_RequestNavigate_1(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
+ {
+
+ }
}
}
diff --git a/DeskHubSharp/MainWindow.xaml.cs b/DeskHubSharp/MainWindow.xaml.cs
index a44c660..41661ae 100644
--- a/DeskHubSharp/MainWindow.xaml.cs
+++ b/DeskHubSharp/MainWindow.xaml.cs
@@ -66,14 +66,14 @@ namespace DeskHubSharp
Owner owner = new Owner();
search.ShowDialog();
var stuff = info.GetRepoInfoDataGrid();
- _repoDetail = RepoList.repoDetail;
+ _repoDetail = RequestList.repoDetail;
ListBox.ItemsSource = stuff;
- txtblk_username.Text = RepoList.userDetail.login;
- txtblk_url.Text = RepoList.userDetail.html_url;
- txtblk_bio.Text = RepoList.userDetail.bio;
- txtblk_email.Text = RepoList.userDetail.blog;
- txtblk_realname.Text = RepoList.userDetail.name;
- txtblk_repocount.Text = $"{RepoList.userDetail.login} has {RepoList.userDetail.public_repos} public repositories.";
+ txtblk_username.Text = RequestList.userDetail.login;
+ txtblk_url.Text = RequestList.userDetail.html_url;
+ txtblk_bio.Text = RequestList.userDetail.bio;
+ txtblk_email.Text = RequestList.userDetail.blog;
+ txtblk_realname.Text = RequestList.userDetail.name;
+ txtblk_repocount.Text = $"{RequestList.userDetail.login} has {RequestList.userDetail.public_repos} public repositories.";
//img_avatar.Source = RepoList.repoDetail[0].owner.avatar_url;
}
diff --git a/DeskHubSharp/Models/Branch.cs b/DeskHubSharp/Models/Branch.cs
new file mode 100644
index 0000000..51fa4f4
--- /dev/null
+++ b/DeskHubSharp/Models/Branch.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DeskHubSharp
+{
+ public class Branch
+ {
+ public string name { get; set; }
+
+ public Commit commit { get; set; }
+
+ public class Commit
+ {
+ public string sha { get; set; }
+ public string url { get; set; }
+ }
+
+ }
+}
diff --git a/DeskHubSharp/Models/RepoInfo.cs b/DeskHubSharp/Models/RepoInfo.cs
index 35fe22d..68a4614 100644
--- a/DeskHubSharp/Models/RepoInfo.cs
+++ b/DeskHubSharp/Models/RepoInfo.cs
@@ -9,6 +9,8 @@ namespace DeskHubSharp
{
class RepoInfo
{
+ // TODO: Rename this to something more generic
+
public RepoInfo()
{
@@ -16,10 +18,16 @@ namespace DeskHubSharp
public List GetRepoInfoDataGrid()
{
- List stuff = RepoList.repoDetail.Select(x => x.full_name).ToList();
+ List stuff = RequestList.repoDetail.Select(x => x.full_name).ToList();
//stuff =+ RepoList.repoDetail.Select(x => x.name).ToList();
return stuff;
}
+ // validation
+ public List GetBranchNameComboBox()
+ {
+ List stuff = RequestList.branchDetail.Select(x => x.name).ToList();
+ return stuff;
+ }
}
}
diff --git a/DeskHubSharp/Models/RepoList.cs b/DeskHubSharp/Models/RequestList.cs
similarity index 62%
rename from DeskHubSharp/Models/RepoList.cs
rename to DeskHubSharp/Models/RequestList.cs
index 47b841b..e0aeeaa 100644
--- a/DeskHubSharp/Models/RepoList.cs
+++ b/DeskHubSharp/Models/RequestList.cs
@@ -7,16 +7,12 @@ using System.Threading.Tasks;
namespace DeskHubSharp
{
- class RepoList
+ class RequestList
{
- private static ObservableCollection _repoDetail;
-
public static User userDetail { get; set; }
- public static ObservableCollection repoDetail
- {
- get { return _repoDetail; }
- set { _repoDetail = value; }
- }
+ public static ObservableCollection branchDetail { get; set; }
+
+ public static ObservableCollection repoDetail { get; set; }
}
}
diff --git a/DeskHubSharp/obj/Debug/DeskHubSharp.csproj.CoreCompileInputs.cache b/DeskHubSharp/obj/Debug/DeskHubSharp.csproj.CoreCompileInputs.cache
index a8ad283..0cacc02 100644
--- a/DeskHubSharp/obj/Debug/DeskHubSharp.csproj.CoreCompileInputs.cache
+++ b/DeskHubSharp/obj/Debug/DeskHubSharp.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-5719003caa9368fdbade249bbbe98f747b8af257
+2c7ff99ba6851f1d8f8b2fc7b402b53f44c00e4f
diff --git a/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.cache b/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.cache
index 8366d71..e330ea4 100644
--- a/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.cache
+++ b/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.cache
@@ -12,7 +12,7 @@ DEBUG;TRACE
C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\App.xaml
7-86569338
-25696652050
+2688390562
20415715258
AboutWindow.xaml;DetailWindow.xaml;ErrorWindow.xaml;FeedbackWindow.xaml;HelpWindow.xaml;MainWindow.xaml;SearchWindow.xaml;
diff --git a/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.i.cache b/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.i.cache
index 48ed846..e1f8d5c 100644
--- a/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.i.cache
+++ b/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.i.cache
@@ -12,9 +12,9 @@ DEBUG;TRACE
C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\App.xaml
7-86569338
-29498133693
+30-110127795
20415715258
AboutWindow.xaml;DetailWindow.xaml;ErrorWindow.xaml;FeedbackWindow.xaml;HelpWindow.xaml;MainWindow.xaml;SearchWindow.xaml;
-False
+True