this really works. gonna merge soon

This commit is contained in:
Wyatt Miller 2018-11-30 02:15:46 -05:00
parent a75121e187
commit 3531728a07
14 changed files with 196 additions and 18 deletions

Binary file not shown.

View File

@ -10,6 +10,12 @@
<Label x:Name="lbl_title" Content="DeskHubSharp" HorizontalAlignment="Left" Margin="2,10,10,0" VerticalAlignment="Top" FontSize="24" Width="372"/>
<Button x:Name="btn_close" Content="Close" HorizontalAlignment="Left" Margin="307,389,0,0" VerticalAlignment="Top" Width="75" Click="btn_close_Click" Background="#FFFFBABA"/>
<TextBlock x:Name="txtblk_about1" HorizontalAlignment="Left" Margin="10,57,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="64" Width="372"><Run Text="Written and developed by Wyatt J. Miller"/><LineBreak/><Run Text="Copyright 2018, All rights reserved"/><LineBreak/><Run Text="Licensed under the MIT license"/></TextBlock>
<TextBlock x:Name="txtblk_about2" HorizontalAlignment="Left" Margin="10,121,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="117" Width="372"><Run Text="Using technologies including but not limited to Visual Studio, .NET, Newtonsoft, RestSharp, MailKit/Mimekit and WPF."/><LineBreak/><Run/><LineBreak/><Run Text="Want to help with development? "/><LineBreak/><Run Text="https://github.com/wymillerlinux/DeskHubSharp"/><LineBreak/><Run/></TextBlock>
<TextBlock x:Name="txtblk_about2" HorizontalAlignment="Left" Margin="10,121,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="36" Width="372"><Run Text="Using technologies including but not limited to Visual Studio, .NET, Newtonsoft, RestSharp, MailKit/Mimekit and WPF."/><LineBreak/><Run/></TextBlock>
<TextBlock HorizontalAlignment="Left" Margin="10,363,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="21" Width="372">
<!--The following came from the link: https://stackoverflow.com/questions/10238694/example-using-hyperlink-in-wpf-->
<Hyperlink NavigateUri="http://github.com/wymillerlinux/DeskhubSharp" RequestNavigate="Hyperlink_RequestNavigate" >
Want to help with development?
</Hyperlink>
</TextBlock>
</Grid>
</Window>

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -10,6 +11,7 @@ using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DeskHubSharp
@ -28,5 +30,11 @@ namespace DeskHubSharp
{
this.Close();
}
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
}
}

View File

@ -60,7 +60,7 @@ namespace DeskHubSharp
/// <summary>
/// Deprecated: Calls API for user data
/// Calls API for detailed user data
/// </summary>
public void UserRequest()
{
@ -69,8 +69,10 @@ namespace DeskHubSharp
RestRequest requestUser = new RestRequest($"users/{_query}", Method.GET);
var response = client.Execute(requestUser);
string x = response.ToString();
var deserialized = JsonConvert.DeserializeObject<User>(x);
string x = response.Content;
var deserailized = JsonConvert.DeserializeObject<User>(x);
RepoList.userDetail = deserailized;
}
}

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -19,9 +20,14 @@ namespace DeskHubSharp
/// </summary>
public partial class DetailWindow : Window
{
public DetailWindow()
private RepoDetail _repoDetail;
public DetailWindow(RepoDetail repoDetail)
{
InitializeComponent();
_repoDetail = repoDetail;
lbl_reponame.Content = _repoDetail.full_name;
}
private void btn_close_Click(object sender, RoutedEventArgs e)

View File

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DeskHubSharp"
mc:Ignorable="d"
Title="DeskHubSharp" Height="450" Width="800">
Title="DeskHubSharp" Height="450" Width="805.114">
<Grid>
<Button x:Name="btn_search" Content="Search" HorizontalAlignment="Left" Margin="10,389,0,0" VerticalAlignment="Top" Width="75" Background="#FFA1C8FF" Click="btn_search_Click"/>
<Button x:Name="btn_detail" Content="Detail" HorizontalAlignment="Left" Margin="90,389,0,0" VerticalAlignment="Top" Width="75" Background="#FFA1C8FF" Click="btn_detail_Click"/>
@ -13,9 +13,16 @@
<Button x:Name="btn_help" Content="Help" HorizontalAlignment="Left" Margin="250,389,0,0" VerticalAlignment="Top" Width="75" Background="#FFFFFF9D" Click="btn_help_Click"/>
<Button x:Name="btn_about" Content="About" HorizontalAlignment="Left" Margin="627,389,0,0" VerticalAlignment="Top" Width="75" Background="#FFAFFBAB" Click="btn_about_Click"/>
<DataGrid Name="DataGrid" AutoGenerateColumns="True" HorizontalAlignment="Left" Height="333" Margin="10,10,0,0" VerticalAlignment="Top" Width="772" SelectionChanged="DataGrid_SelectionChanged" IsReadOnly="True"/>
<DataGrid Name="DataGrid" AutoGenerateColumns="True" Height="333" Margin="10,10,415,0" VerticalAlignment="Top" SelectionChanged="DataGrid_SelectionChanged" IsReadOnly="True"/>
<Button x:Name="btn_exit" Content="Exit" HorizontalAlignment="Left" Margin="707,389,0,0" VerticalAlignment="Top" Width="75" Background="#FFFF9999" Click="btn_exit_Click"/>
<TextBlock x:Name="txtblk_username" Margin="387,50,0,0" TextWrapping="Wrap" Text="-" VerticalAlignment="Top" Height="35" FontSize="22" HorizontalAlignment="Left" Width="400"/>
<TextBlock x:Name="txtblk_url" HorizontalAlignment="Left" Margin="387,199,0,0" TextWrapping="Wrap" Text="-" VerticalAlignment="Top" Height="62" Width="217" FontSize="14"/>
<Image x:Name="img_avatar" HorizontalAlignment="Left" Height="176" Margin="609,90,0,0" VerticalAlignment="Top" Width="173"/>
<TextBlock x:Name="txtblk_bio" HorizontalAlignment="Left" Margin="387,90,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="109" Width="217" FontSize="14" Text="-"/>
<TextBlock x:Name="txtblk_email" HorizontalAlignment="Left" Margin="387,266,0,0" TextWrapping="Wrap" Text="-" VerticalAlignment="Top" Height="27" Width="217"/>
<TextBlock x:Name="txtblk_realname" HorizontalAlignment="Left" Margin="387,10,0,0" TextWrapping="Wrap" Text="-" VerticalAlignment="Top" Height="35
" Width="400" FontSize="22"/>
</Grid>
</Window>

View File

@ -21,6 +21,8 @@ namespace DeskHubSharp
/// </summary>
public partial class MainWindow : Window
{
private ObservableCollection<RepoDetail> _repoDetail;
public MainWindow()
{
InitializeComponent();
@ -29,7 +31,8 @@ namespace DeskHubSharp
private void btn_detail_Click(object sender, RoutedEventArgs e)
{
DetailWindow detail = new DetailWindow();
RepoDetail repo = _repoDetail[DataGrid.SelectedIndex];
DetailWindow detail = new DetailWindow(repo);
detail.ShowDialog();
}
@ -59,11 +62,22 @@ namespace DeskHubSharp
private void btn_search_Click(object sender, RoutedEventArgs e)
{
SearchWindow search = new SearchWindow();
RepoInfo info = new RepoInfo();
RepoDetail detail = new RepoDetail();
//RepoInfo info = new RepoInfo();
Owner owner = new Owner();
User user = new User();
search.ShowDialog();
//var stuff = info.GetRepoInfoDataGrid();
ObservableCollection<RepoDetail> test = RepoList.repoDetail;
DataGrid.ItemsSource = test;
_repoDetail = RepoList.repoDetail;
DataGrid.ItemsSource = _repoDetail;
txtblk_username.Text = RepoList.repoDetail[0].owner.login;
txtblk_url.Text = RepoList.repoDetail[0].owner.html_url;
txtblk_bio.Text = RepoList.userDetail.bio;
txtblk_email.Text = RepoList.userDetail.blog;
txtblk_realname.Text = RepoList.userDetail.name;
search.Close();
//img_avatar.Source = RepoList.repoDetail[0].owner.avatar_url;
}
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)

View File

@ -14,11 +14,11 @@ namespace DeskHubSharp
}
public ObservableCollection<RepoDetail> GetRepoInfoDataGrid()
public ObservableCollection<string> GetRepoInfoDataGrid()
{
ObservableCollection<RepoDetail> repoStuff = new ObservableCollection<RepoDetail>();
ObservableCollection<string> repoStuff = new ObservableCollection<string>();
RepoDetail repo = new RepoDetail();
//repoStuff.Add(RepoList.repoDetail[3]);
repoStuff.Add(Convert.ToString(RepoList.repoDetail.Select(x => x.name)));
//repoStuff.Add(repo.url);
return repoStuff;

View File

@ -9,7 +9,9 @@ namespace DeskHubSharp
{
class RepoList
{
public static ObservableCollection<RepoDetail> _repoDetail;
private static ObservableCollection<RepoDetail> _repoDetail;
public static User userDetail { get; set; }
public static ObservableCollection<RepoDetail> repoDetail
{

View File

@ -33,6 +33,7 @@ namespace DeskHubSharp
{
Request request = new Request(txtbox_query.Text);
request.SearchRequest();
request.UserRequest();
//MainWindow main = new MainWindow();
//main.ShowDialog();
}

View File

@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "27CBA43F396CB857DB0A7BC37CC204BAD58C13B8"
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7101FB12DCACC1F4D7F4356DF3A4B58361A07B85"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -96,6 +96,54 @@ namespace DeskHubSharp {
#line default
#line hidden
#line 19 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtblk_username;
#line default
#line hidden
#line 20 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtblk_url;
#line default
#line hidden
#line 21 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Image img_avatar;
#line default
#line hidden
#line 22 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtblk_bio;
#line default
#line hidden
#line 23 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtblk_email;
#line default
#line hidden
#line 24 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtblk_realname;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
@ -189,6 +237,24 @@ namespace DeskHubSharp {
#line default
#line hidden
return;
case 8:
this.txtblk_username = ((System.Windows.Controls.TextBlock)(target));
return;
case 9:
this.txtblk_url = ((System.Windows.Controls.TextBlock)(target));
return;
case 10:
this.img_avatar = ((System.Windows.Controls.Image)(target));
return;
case 11:
this.txtblk_bio = ((System.Windows.Controls.TextBlock)(target));
return;
case 12:
this.txtblk_email = ((System.Windows.Controls.TextBlock)(target));
return;
case 13:
this.txtblk_realname = ((System.Windows.Controls.TextBlock)(target));
return;
}
this._contentLoaded = true;
}

View File

@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "27CBA43F396CB857DB0A7BC37CC204BAD58C13B8"
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7101FB12DCACC1F4D7F4356DF3A4B58361A07B85"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -96,6 +96,54 @@ namespace DeskHubSharp {
#line default
#line hidden
#line 19 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtblk_username;
#line default
#line hidden
#line 20 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtblk_url;
#line default
#line hidden
#line 21 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Image img_avatar;
#line default
#line hidden
#line 22 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtblk_bio;
#line default
#line hidden
#line 23 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtblk_email;
#line default
#line hidden
#line 24 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtblk_realname;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
@ -189,6 +237,24 @@ namespace DeskHubSharp {
#line default
#line hidden
return;
case 8:
this.txtblk_username = ((System.Windows.Controls.TextBlock)(target));
return;
case 9:
this.txtblk_url = ((System.Windows.Controls.TextBlock)(target));
return;
case 10:
this.img_avatar = ((System.Windows.Controls.Image)(target));
return;
case 11:
this.txtblk_bio = ((System.Windows.Controls.TextBlock)(target));
return;
case 12:
this.txtblk_email = ((System.Windows.Controls.TextBlock)(target));
return;
case 13:
this.txtblk_realname = ((System.Windows.Controls.TextBlock)(target));
return;
}
this._contentLoaded = true;
}