architecture changes; application has hit beta
This commit is contained in:
parent
7222766e81
commit
425bb6113d
Binary file not shown.
Binary file not shown.
@ -1,133 +1,41 @@
|
|||||||
using RestSharp;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
|
||||||
using System.Net.Mail;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
|
|
||||||
namespace DeskHubSharp
|
namespace DeskHubSharp
|
||||||
{
|
{
|
||||||
class Request
|
public class Request
|
||||||
{
|
{
|
||||||
// TODO: this is rudimentary, fix it
|
private ApiDataService _api;
|
||||||
// i.e. try catch statements\
|
|
||||||
// TODO: Add BranchRequest function
|
|
||||||
|
|
||||||
private string _apiEndpoint = "https://api.github.com/";
|
|
||||||
private string _query;
|
private string _query;
|
||||||
|
|
||||||
public List<RepoDetail> RepoDetail { get; set; }
|
|
||||||
|
|
||||||
public Request(string query)
|
public Request(string query)
|
||||||
{
|
{
|
||||||
_query = query;
|
_query = query;
|
||||||
|
_api = new ApiDataService(_query);
|
||||||
}
|
}
|
||||||
|
|
||||||
//public Request(string query, Object function)
|
public void PerformSearchRequest()
|
||||||
//{
|
|
||||||
// _query = query;
|
|
||||||
//}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Calls API for repo and basic user data
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public void SearchRequest()
|
|
||||||
{
|
{
|
||||||
try
|
_api.SearchRequest();
|
||||||
{
|
|
||||||
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<ObservableCollection<RepoDetail>>(x);
|
|
||||||
|
|
||||||
//ObservableCollection<RepoDetail> test = new ObservableCollection<RepoDetail>()
|
|
||||||
//{
|
|
||||||
// new RepoDetail()
|
|
||||||
// {
|
|
||||||
// Login = "John",
|
|
||||||
// Password = "pw"
|
|
||||||
// }
|
|
||||||
//};
|
|
||||||
|
|
||||||
if (deserialized.Count == 0)
|
|
||||||
{
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RequestList.repoDetail = deserialized;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
ErrorWindow err = new ErrorWindow();
|
|
||||||
err.txtblk_error.Text = "We couldn't gather repository data. Please try again";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void PerformUserRequest()
|
||||||
/// <summary>
|
|
||||||
/// Calls API for detailed user data
|
|
||||||
/// </summary>
|
|
||||||
public void UserRequest()
|
|
||||||
{
|
{
|
||||||
try
|
_api.UserRequest();
|
||||||
{
|
|
||||||
var client = new RestClient(_apiEndpoint);
|
|
||||||
|
|
||||||
RestRequest requestUser = new RestRequest($"users/{_query}", Method.GET);
|
|
||||||
|
|
||||||
var response = client.Execute(requestUser);
|
|
||||||
string x = response.Content;
|
|
||||||
var deserailized = JsonConvert.DeserializeObject<User>(x);
|
|
||||||
|
|
||||||
if (deserailized == null)
|
|
||||||
{
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RequestList.userDetail = deserailized;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (NullReferenceException)
|
|
||||||
{
|
|
||||||
ErrorWindow err = new ErrorWindow();
|
|
||||||
err.txtblk_error.Text = "We couldn't gather user data. Please try again.";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public void PerformBranchRequest()
|
||||||
/// Calls API for detailed branch data
|
|
||||||
/// </summary>
|
|
||||||
public void BranchRequest()
|
|
||||||
{
|
{
|
||||||
try
|
_api.BranchRequest();
|
||||||
{
|
}
|
||||||
var client = new RestClient(_apiEndpoint);
|
|
||||||
|
|
||||||
RestRequest requestUser = new RestRequest($"/repos/{RequestList.userDetail.login}/{_query}/branches", Method.GET);
|
public Owner GetUserData()
|
||||||
|
{
|
||||||
var response = client.Execute(requestUser);
|
Owner owner = new Owner();
|
||||||
string x = response.Content;
|
return owner;
|
||||||
var deserailized = JsonConvert.DeserializeObject<ObservableCollection<Branch>>(x);
|
|
||||||
|
|
||||||
RequestList.branchDetail = deserailized;
|
|
||||||
}
|
|
||||||
catch (NullReferenceException)
|
|
||||||
{
|
|
||||||
ErrorWindow err = new ErrorWindow();
|
|
||||||
err.txtblk_error.Text = "We couldn't gather user data. Please try again.";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
135
DeskHubSharp/DAL/ApiDataService.cs
Normal file
135
DeskHubSharp/DAL/ApiDataService.cs
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
using RestSharp;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Mail;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
|
||||||
|
namespace DeskHubSharp
|
||||||
|
{
|
||||||
|
class ApiDataService : IDataService
|
||||||
|
{
|
||||||
|
// TODO: this is rudimentary, fix it
|
||||||
|
// i.e. try catch statements\
|
||||||
|
// TODO: Add BranchRequest function
|
||||||
|
|
||||||
|
private string _apiEndpoint;
|
||||||
|
private string _query;
|
||||||
|
|
||||||
|
public List<RepoDetail> RepoDetail { get; set; }
|
||||||
|
|
||||||
|
public ApiDataService(string query)
|
||||||
|
{
|
||||||
|
_query = query;
|
||||||
|
_apiEndpoint = DataConfig.dataConfString;
|
||||||
|
}
|
||||||
|
|
||||||
|
//public Request(string query, Object function)
|
||||||
|
//{
|
||||||
|
// _query = query;
|
||||||
|
//}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calls API for repo and basic user data
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public void SearchRequest()
|
||||||
|
{
|
||||||
|
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<ObservableCollection<RepoDetail>>(x);
|
||||||
|
|
||||||
|
//ObservableCollection<RepoDetail> test = new ObservableCollection<RepoDetail>()
|
||||||
|
//{
|
||||||
|
// new RepoDetail()
|
||||||
|
// {
|
||||||
|
// Login = "John",
|
||||||
|
// Password = "pw"
|
||||||
|
// }
|
||||||
|
//};
|
||||||
|
|
||||||
|
if (deserialized.Count == 0)
|
||||||
|
{
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RequestList.repoDetail = deserialized;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
ErrorWindow err = new ErrorWindow();
|
||||||
|
err.txtblk_error.Text = "We couldn't gather repository data. Please try again";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calls API for detailed user data
|
||||||
|
/// </summary>
|
||||||
|
public void UserRequest()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var client = new RestClient(_apiEndpoint);
|
||||||
|
|
||||||
|
RestRequest requestUser = new RestRequest($"users/{_query}", Method.GET);
|
||||||
|
|
||||||
|
var response = client.Execute(requestUser);
|
||||||
|
string x = response.Content;
|
||||||
|
var deserailized = JsonConvert.DeserializeObject<User>(x);
|
||||||
|
|
||||||
|
if (deserailized == null)
|
||||||
|
{
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RequestList.userDetail = deserailized;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (NullReferenceException)
|
||||||
|
{
|
||||||
|
ErrorWindow err = new ErrorWindow();
|
||||||
|
err.txtblk_error.Text = "We couldn't gather user data. Please try again.";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calls API for detailed branch data
|
||||||
|
/// </summary>
|
||||||
|
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<ObservableCollection<Branch>>(x);
|
||||||
|
|
||||||
|
RequestList.branchDetail = deserailized;
|
||||||
|
}
|
||||||
|
catch (NullReferenceException)
|
||||||
|
{
|
||||||
|
ErrorWindow err = new ErrorWindow();
|
||||||
|
err.txtblk_error.Text = "We couldn't gather user data. Please try again.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -8,7 +8,11 @@ namespace DeskHubSharp
|
|||||||
{
|
{
|
||||||
public interface IDataService
|
public interface IDataService
|
||||||
{
|
{
|
||||||
List<Search> ReadAll();
|
//List<Search> ReadAll();
|
||||||
void WriteAll(List<Search> user);
|
//void WriteAll(List<Search> user);
|
||||||
|
|
||||||
|
void SearchRequest();
|
||||||
|
void UserRequest();
|
||||||
|
void BranchRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,66 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Serialization;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace DeskHubSharp
|
|
||||||
{
|
|
||||||
class XmlDataService
|
|
||||||
{
|
|
||||||
private readonly string _dataFilePath;
|
|
||||||
|
|
||||||
public List<User> ReadAll()
|
|
||||||
{
|
|
||||||
List<User> Users = new List<User>();
|
|
||||||
XmlSerializer serializer = new XmlSerializer(typeof(List<User>), new XmlRootAttribute("Users"));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
StreamReader reader = new StreamReader(_dataFilePath);
|
|
||||||
using (reader)
|
|
||||||
{
|
|
||||||
Users = (List<User>)serializer.Deserialize(reader);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Users;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void WriteAll(List<User> Users)
|
|
||||||
{
|
|
||||||
XmlSerializer serializer = new XmlSerializer(typeof(List<User>), new XmlRootAttribute("Users"));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
StreamWriter writer = new StreamWriter(_dataFilePath);
|
|
||||||
using (writer)
|
|
||||||
{
|
|
||||||
serializer.Serialize(writer, Users);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public XmlDataService()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public XmlDataService(string datafile)
|
|
||||||
{
|
|
||||||
_dataFilePath = datafile;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -8,6 +8,6 @@ namespace DeskHubSharp
|
|||||||
{
|
{
|
||||||
class DataConfig
|
class DataConfig
|
||||||
{
|
{
|
||||||
public string dataConfString = "";
|
public static string dataConfString = "https://api.github.com/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@
|
|||||||
<ApplicationDefinition Include="App.xaml">
|
<ApplicationDefinition Include="App.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
|
<Compile Include="BusinessLayer\Request.cs" />
|
||||||
<Compile Include="DAL\JsonDataService.cs" />
|
<Compile Include="DAL\JsonDataService.cs" />
|
||||||
<Compile Include="Models\Branch.cs" />
|
<Compile Include="Models\Branch.cs" />
|
||||||
<Compile Include="Models\Email.cs" />
|
<Compile Include="Models\Email.cs" />
|
||||||
@ -107,9 +108,8 @@
|
|||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="BusinessLayer\EmailBLL.cs" />
|
<Compile Include="BusinessLayer\EmailBLL.cs" />
|
||||||
<Compile Include="BusinessLayer\Request.cs" />
|
<Compile Include="DAL\ApiDataService.cs" />
|
||||||
<Compile Include="DAL\IDataService.cs" />
|
<Compile Include="DAL\IDataService.cs" />
|
||||||
<Compile Include="DAL\XmlDataService.cs" />
|
|
||||||
<Compile Include="Data\DataConfig.cs" />
|
<Compile Include="Data\DataConfig.cs" />
|
||||||
<Compile Include="DetailWindow.xaml.cs">
|
<Compile Include="DetailWindow.xaml.cs">
|
||||||
<DependentUpon>DetailWindow.xaml</DependentUpon>
|
<DependentUpon>DetailWindow.xaml</DependentUpon>
|
||||||
|
@ -10,19 +10,13 @@
|
|||||||
<Label x:Name="lbl_reponame" Content="Repository Name" HorizontalAlignment="Left" Margin="10,57,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.603,-0.2" Width="374" FontSize="20"/>
|
<Label x:Name="lbl_reponame" Content="Repository Name" HorizontalAlignment="Left" Margin="10,57,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.603,-0.2" Width="374" FontSize="20"/>
|
||||||
<Label x:Name="lbl_title" Content="Details" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="81" FontSize="24"/>
|
<Label x:Name="lbl_title" Content="Details" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="81" FontSize="24"/>
|
||||||
<Button x:Name="btn_close" Content="Close" HorizontalAlignment="Left" Margin="309,389,0,0" VerticalAlignment="Top" Width="75" Background="#FFFFABAB" Click="btn_close_Click"/>
|
<Button x:Name="btn_close" Content="Close" HorizontalAlignment="Left" Margin="309,389,0,0" VerticalAlignment="Top" Width="75" Background="#FFFFABAB" Click="btn_close_Click"/>
|
||||||
<TextBlock x:Name="txtblk_clonelnk" Margin="147,377,195,12" FontSize="20" RenderTransformOrigin="0.238,1.236">
|
<TextBlock x:Name="txtblk_language" HorizontalAlignment="Left" Margin="13,120,0,0" TextWrapping="Wrap" Text="This repo is mostly some code." VerticalAlignment="Top" Height="25" Width="223" FontSize="14"/>
|
||||||
<Hyperlink NavigateUri="{Binding}" RequestNavigate="Hyperlink_RequestNavigate">
|
<TextBlock x:Name="txtblk_stargazers" HorizontalAlignment="Left" Margin="13,150,0,0" TextWrapping="Wrap" Text="This repo has 0 stargazers." VerticalAlignment="Top" Height="24" Width="186" FontSize="14"/>
|
||||||
Clone
|
<ComboBox x:Name="cmbbox_branches" HorizontalAlignment="Left" Margin="13,389,0,0" VerticalAlignment="Top" Width="120" Height="19"/>
|
||||||
</Hyperlink>
|
<Label x:Name="lbl_branch" Content="What branch do you want to download?" HorizontalAlignment="Left" Margin="13,358,0,0" VerticalAlignment="Top" Width="223" Padding="1,5,5,5" RenderTransformOrigin="0.537,0.517"/>
|
||||||
</TextBlock>
|
<TextBlock x:Name="txtblk_watchers" HorizontalAlignment="Left" Margin="13,179,0,0" TextWrapping="Wrap" Text="This repo has 0 watchers." VerticalAlignment="Top" Width="209" FontSize="14" Height="24"/>
|
||||||
<TextBlock Margin="204,386,118,17">
|
<TextBlock x:Name="txtblk_forks" HorizontalAlignment="Left" Margin="13,208,0,0" TextWrapping="Wrap" Text="This repo has 0 forks." VerticalAlignment="Top" FontSize="14" Height="20" Width="223"/>
|
||||||
<Hyperlink NavigateUri="{Binding}" RequestNavigate="Hyperlink_RequestNavigate_1">
|
<Button x:Name="btn_page" Content="GitHub Page" HorizontalAlignment="Left" Margin="13,333,0,0" VerticalAlignment="Top" Width="88" RenderTransformOrigin="0.29,1.69" Click="btn_page_Click"/>
|
||||||
GitHub Page
|
<Button x:Name="btn_clone" Content="Clone" HorizontalAlignment="Left" Margin="147,388,0,0" VerticalAlignment="Top" Width="75" Click="btn_clone_Click"/>
|
||||||
</Hyperlink>
|
|
||||||
</TextBlock>
|
|
||||||
<TextBlock x:Name="txtblk_language" HorizontalAlignment="Left" Margin="13,99,0,0" TextWrapping="Wrap" Text="This repo is mostly crappy code!" VerticalAlignment="Top" Height="25" Width="223" FontSize="14"/>
|
|
||||||
<TextBlock x:Name="txtblk_stargazers" HorizontalAlignment="Left" Margin="13,129,0,0" TextWrapping="Wrap" Text="This repo has 0 stargazers!" VerticalAlignment="Top" Height="24" Width="186" FontSize="14"/>
|
|
||||||
<ComboBox x:Name="cmbbox_branches" HorizontalAlignment="Left" Margin="13,377,0,0" VerticalAlignment="Top" Width="120" Height="32"/>
|
|
||||||
<Label x:Name="lbl_branch" Content="What branch do you want to download?" HorizontalAlignment="Left" Margin="13,346,0,0" VerticalAlignment="Top" Width="223"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
@ -4,6 +4,7 @@ using System.Collections.ObjectModel;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
@ -21,23 +22,37 @@ namespace DeskHubSharp
|
|||||||
public partial class DetailWindow : Window
|
public partial class DetailWindow : Window
|
||||||
{
|
{
|
||||||
private RepoDetail _repoDetail;
|
private RepoDetail _repoDetail;
|
||||||
|
private Request _request;
|
||||||
|
private Owner _owner;
|
||||||
|
|
||||||
public DetailWindow(RepoDetail repoDetail)
|
public DetailWindow(RepoDetail repoDetail)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
_repoDetail = repoDetail;
|
_repoDetail = repoDetail;
|
||||||
|
_request = new Request(_repoDetail.name);
|
||||||
Request request = new Request(_repoDetail.name);
|
|
||||||
RepoInfo info = new RepoInfo();
|
RepoInfo info = new RepoInfo();
|
||||||
request.BranchRequest();
|
|
||||||
|
_request.PerformBranchRequest();
|
||||||
var stuff = info.GetBranchNameComboBox();
|
var stuff = info.GetBranchNameComboBox();
|
||||||
|
|
||||||
cmbbox_branches.ItemsSource = stuff;
|
cmbbox_branches.ItemsSource = stuff;
|
||||||
|
|
||||||
|
if (_repoDetail.language != null)
|
||||||
|
{
|
||||||
|
txtblk_language.Text = $"This repo is mostly {_repoDetail.language} code.";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
txtblk_language.Text = "This repo doesn't have any code.";
|
||||||
|
}
|
||||||
|
|
||||||
lbl_reponame.Content = _repoDetail.full_name;
|
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.";
|
txtblk_stargazers.Text = $"This repo has {_repoDetail.stargazers_count} stargazers.";
|
||||||
|
txtblk_watchers.Text = $"This repo has {_repoDetail.watchers_count} watchers.";
|
||||||
|
txtblk_forks.Text = $"This repo has {_repoDetail.forks_count} forks.";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btn_close_Click(object sender, RoutedEventArgs e)
|
private void btn_close_Click(object sender, RoutedEventArgs e)
|
||||||
@ -45,14 +60,26 @@ namespace DeskHubSharp
|
|||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
|
private void btn_clone_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (cmbbox_branches.Text == "")
|
||||||
|
{
|
||||||
|
ErrorWindow err = new ErrorWindow();
|
||||||
|
err.txtblk_error.Text = "Please select a branch to clone.";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_owner = new Owner();
|
||||||
|
string link = "https://github.com/" + _repoDetail.owner.login + "/" + _repoDetail.name + "/archive/" + cmbbox_branches.Text + ".zip";
|
||||||
|
|
||||||
|
Process.Start(link);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Hyperlink_RequestNavigate_1(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
|
private void btn_page_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
Process.Start($"{_repoDetail.html_url}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,8 @@ namespace DeskHubSharp
|
|||||||
{
|
{
|
||||||
private ObservableCollection<RepoDetail> _repoDetail;
|
private ObservableCollection<RepoDetail> _repoDetail;
|
||||||
private User _userDetail;
|
private User _userDetail;
|
||||||
|
private Request _request;
|
||||||
|
private RepoInfo _repoInfo;
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
@ -41,15 +43,15 @@ namespace DeskHubSharp
|
|||||||
}
|
}
|
||||||
catch (IndexOutOfRangeException)
|
catch (IndexOutOfRangeException)
|
||||||
{
|
{
|
||||||
ErrorWindow err = new ErrorWindow();
|
ShowErrorMessage("Please pick a repository!");
|
||||||
err.txtblk_error.Text = "Please pick a repository!";
|
|
||||||
err.ShowDialog();
|
|
||||||
}
|
}
|
||||||
catch (NullReferenceException)
|
catch (NullReferenceException)
|
||||||
{
|
{
|
||||||
ErrorWindow err = new ErrorWindow();
|
ShowErrorMessage("Please search for a user with the Search button!");
|
||||||
err.txtblk_error.Text = "Please search for a user with the Search button!";
|
}
|
||||||
err.ShowDialog();
|
catch (ArgumentOutOfRangeException)
|
||||||
|
{
|
||||||
|
ShowErrorMessage("MEME REVIEW!");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -82,7 +84,6 @@ namespace DeskHubSharp
|
|||||||
SearchWindow search = new SearchWindow();
|
SearchWindow search = new SearchWindow();
|
||||||
search.ShowDialog();
|
search.ShowDialog();
|
||||||
RepoInfo info = new RepoInfo();
|
RepoInfo info = new RepoInfo();
|
||||||
Owner owner = new Owner();
|
|
||||||
|
|
||||||
var stuff = info.GetRepoInfoList();
|
var stuff = info.GetRepoInfoList();
|
||||||
|
|
||||||
@ -106,5 +107,12 @@ namespace DeskHubSharp
|
|||||||
txtblk_repocount.Text = $"{_userDetail.login} has {_userDetail.public_repos} public repositories.";
|
txtblk_repocount.Text = $"{_userDetail.login} has {_userDetail.public_repos} public repositories.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ShowErrorMessage(string message)
|
||||||
|
{
|
||||||
|
ErrorWindow err = new ErrorWindow();
|
||||||
|
err.txtblk_error.Text = message;
|
||||||
|
err.ShowDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ namespace DeskHubSharp
|
|||||||
{
|
{
|
||||||
|
|
||||||
// TODO: The RepoDetail class is called from the code behind, fix it
|
// TODO: The RepoDetail class is called from the code behind, fix it
|
||||||
|
|
||||||
public class RepoDetail
|
public class RepoDetail
|
||||||
{
|
{
|
||||||
public Owner Owner { get; set; }
|
public Owner Owner { get; set; }
|
||||||
|
@ -19,6 +19,9 @@ namespace DeskHubSharp
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class SearchWindow : Window
|
public partial class SearchWindow : Window
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private Request _request;
|
||||||
|
|
||||||
public SearchWindow()
|
public SearchWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -39,9 +42,9 @@ namespace DeskHubSharp
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Request request = new Request(txtbox_query.Text);
|
_request = new Request(txtbox_query.Text);
|
||||||
request.SearchRequest();
|
_request.PerformSearchRequest();
|
||||||
request.UserRequest();
|
_request.PerformUserRequest();
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "5E7C2DBB667F025FC5CA90C6A4E4064F"
|
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8924CF88FE4A7948C7314277251E7D79D8D8F350"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "5E7C2DBB667F025FC5CA90C6A4E4064F"
|
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8924CF88FE4A7948C7314277251E7D79D8D8F350"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
Binary file not shown.
@ -1 +1 @@
|
|||||||
c5d282543c3b37678a7432b9472aa380cdfd2ea1
|
126931593991507bb071b2be67ad4cd72eeb0287
|
||||||
|
@ -4,16 +4,16 @@
|
|||||||
winexe
|
winexe
|
||||||
C#
|
C#
|
||||||
.cs
|
.cs
|
||||||
C:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\obj\Debug\
|
C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\obj\Debug\
|
||||||
DeskHubSharp
|
DeskHubSharp
|
||||||
none
|
none
|
||||||
false
|
false
|
||||||
DEBUG;TRACE
|
DEBUG;TRACE
|
||||||
C:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\App.xaml
|
C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\App.xaml
|
||||||
7-86569338
|
7-86569338
|
||||||
|
|
||||||
261659884516
|
26-1609030936
|
||||||
20-856998346
|
20415715258
|
||||||
AboutWindow.xaml;DetailWindow.xaml;ErrorWindow.xaml;FeedbackWindow.xaml;HelpWindow.xaml;MainWindow.xaml;SearchWindow.xaml;
|
AboutWindow.xaml;DetailWindow.xaml;ErrorWindow.xaml;FeedbackWindow.xaml;HelpWindow.xaml;MainWindow.xaml;SearchWindow.xaml;
|
||||||
|
|
||||||
False
|
False
|
||||||
|
@ -4,16 +4,16 @@
|
|||||||
winexe
|
winexe
|
||||||
C#
|
C#
|
||||||
.cs
|
.cs
|
||||||
C:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\obj\Debug\
|
C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\obj\Debug\
|
||||||
DeskHubSharp
|
DeskHubSharp
|
||||||
none
|
none
|
||||||
false
|
false
|
||||||
DEBUG;TRACE
|
DEBUG;TRACE
|
||||||
C:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\App.xaml
|
C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\App.xaml
|
||||||
7-86569338
|
7-86569338
|
||||||
|
|
||||||
30428560335
|
30-1807549293
|
||||||
20-856998346
|
20415715258
|
||||||
AboutWindow.xaml;DetailWindow.xaml;ErrorWindow.xaml;FeedbackWindow.xaml;HelpWindow.xaml;MainWindow.xaml;SearchWindow.xaml;
|
AboutWindow.xaml;DetailWindow.xaml;ErrorWindow.xaml;FeedbackWindow.xaml;HelpWindow.xaml;MainWindow.xaml;SearchWindow.xaml;
|
||||||
|
|
||||||
False
|
False
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
|
|
||||||
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\AboutWindow.xaml;;
|
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\AboutWindow.xaml;;
|
||||||
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\DetailWindow.xaml;;
|
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\DetailWindow.xaml;;
|
||||||
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\ErrorWindow.xaml;;
|
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\ErrorWindow.xaml;;
|
||||||
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\FeedbackWindow.xaml;;
|
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\FeedbackWindow.xaml;;
|
||||||
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\HelpWindow.xaml;;
|
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\HelpWindow.xaml;;
|
||||||
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\MainWindow.xaml;;
|
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\MainWindow.xaml;;
|
||||||
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\SearchWindow.xaml;;
|
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\SearchWindow.xaml;;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "3C69E49B02EA13170DBA0849627181DA"
|
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0EAA4E5953DD54A83EF84C8979256F95CA55AC47"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "3C69E49B02EA13170DBA0849627181DA"
|
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0EAA4E5953DD54A83EF84C8979256F95CA55AC47"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
Reference in New Issue
Block a user