added sort and search interactivity

This commit is contained in:
Wyatt Miller 2018-12-06 15:06:13 -05:00
parent 425bb6113d
commit 1e8d6b4b25
23 changed files with 201 additions and 47 deletions

Binary file not shown.

View File

@ -5,19 +5,13 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DeskHubSharp"
mc:Ignorable="d"
Title="About - DeskHubSharp" Height="450" Width="400" ResizeMode="NoResize">
Title="About - DeskHubSharp" Height="300" Width="400" ResizeMode="NoResize">
<Grid>
<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="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_4" >
Want to help with development?
</Hyperlink>
</TextBlock>
<TextBlock HorizontalAlignment="Left" Margin="10,162,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="44" Width="364">
<Button x:Name="btn_close" Content="Close" HorizontalAlignment="Left" Margin="309,241,0,0" VerticalAlignment="Top" Width="75" Click="btn_close_Click" Background="#FFFFBABA"/>
<TextBlock x:Name="txtblk_about1" HorizontalAlignment="Left" Margin="10,81,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,139,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,180,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="44" Width="364">
This project cannot be done without the help of
<Hyperlink NavigateUri="https://github.com/johnvelis" RequestNavigate="Hyperlink_RequestNavigate">
johnvelis
@ -35,5 +29,6 @@
tarkowr.
</Hyperlink>
</TextBlock>
<TextBlock HorizontalAlignment="Left" Margin="10,57,0,0" TextWrapping="Wrap" Text="A desktop GitHub application developed in three weeks." VerticalAlignment="Top" Height="19" Width="364"/>
</Grid>
</Window>

View File

@ -13,9 +13,6 @@ namespace DeskHubSharp
{
class EmailBLL
{
// TODO: finish this class
// TODO: debug feedback form
private string _name;
private string _message;
private string _emailText;

View File

@ -11,27 +11,44 @@ namespace DeskHubSharp
private ApiDataService _api;
private string _query;
/// <summary>
/// Constructor for the class
/// </summary>
/// <param name="query"></param>
public Request(string query)
{
_query = query;
_api = new ApiDataService(_query);
}
/// <summary>
/// Performs the search request
/// </summary>
public void PerformSearchRequest()
{
_api.SearchRequest();
}
/// <summary>
/// Performs the user request
/// </summary>
public void PerformUserRequest()
{
_api.UserRequest();
}
/// <summary>
/// Performs the branch request
/// </summary>
public void PerformBranchRequest()
{
_api.BranchRequest();
}
/// <summary>
/// Performs the local owner request
/// </summary>
/// <returns></returns>
public Owner GetUserData()
{
Owner owner = new Owner();

View File

@ -78,6 +78,7 @@
<Compile Include="Models\License.cs" />
<Compile Include="Models\Owner.cs" />
<Compile Include="BusinessLayer\RepoList.cs" />
<Compile Include="Models\Sort.cs" />
<Compile Include="SearchWindow.xaml.cs">
<DependentUpon>SearchWindow.xaml</DependentUpon>
</Compile>

View File

@ -10,7 +10,7 @@
<Grid>
<Button x:Name="btn_close" Content="Close" HorizontalAlignment="Left" Margin="307,389,0,0" VerticalAlignment="Top" Width="75" Background="#FFFFBDBD" Click="btn_close_Click"/>
<Label x:Name="lbl_title" Content="Need some help?" HorizontalAlignment="Left" Margin="3,10,0,0" VerticalAlignment="Top" FontSize="20"/>
<TextBlock HorizontalAlignment="Left" Margin="10,52,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="332" Width="372"><Run Text="No worries friend! We have you covered!"/><LineBreak/><Run/><LineBreak/><Run Text="If you have a blank data grid when you first start the program, that's normal! You just have to search for somebody."/><LineBreak/><Run/><LineBreak/><Run Text="Click on the Search button and type away in the name field! If you get an error in response to your search query, that means that user doesn't exist."/><LineBreak/><Run/><LineBreak/><Run Text="If the search finds a user, the data grid will populate. Click on a repository of interest and click on the Detail button to view it in action."/><LineBreak/><Run/><LineBreak/><Run Text="You found a problem with the program? Great! Click on the Feedback button to send an email to me and I will respond to said email as soon as possible."/><LineBreak/><LineBreak/><Run Text="Want to know more about this program? Click on the About program to view stuff."/></TextBlock>
<TextBlock HorizontalAlignment="Left" Margin="10,52,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="332" Width="372"><Run Text="No worries friend! We have you covered!"/><LineBreak/><Run/><LineBreak/><Run Text="If you have a blank list when you first start the program, that's normal! You just have to search for somebody."/><LineBreak/><Run/><LineBreak/><Run Text="Click on the Search button and type away in the name field! If you get an error in response to your search query, that means that user doesn't exist."/><LineBreak/><Run/><LineBreak/><Run Text="If the search finds a user, the list will populate. Click on a repository of interest and click on the Detail button to view it in action."/><LineBreak/><Run/><LineBreak/><Run Text="You found a problem with the program? Great! Click on the Feedback button to send an email to me and I will respond to said email as soon as possible."/><LineBreak/><LineBreak/><Run Text="Want to know more about this program? Click on the About program to view stuff."/></TextBlock>
</Grid>
</Window>

View File

@ -7,7 +7,7 @@
mc:Ignorable="d"
Title="DeskHubSharp" Height="450" Width="805" ResizeMode="NoResize">
<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_searchuser" Content="Search User" 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"/>
<Button x:Name="btn_feedback" Content="Feedback" HorizontalAlignment="Left" Margin="170,389,0,0" VerticalAlignment="Top" Width="75" Background="#FFD9A1FF" Click="btn_feedback_Click"/>
<Button x:Name="btn_help" Content="Help" HorizontalAlignment="Left" Margin="250,389,0,0" VerticalAlignment="Top" Width="75" Background="#FFFFFF9D" Click="btn_help_Click"/>
@ -25,7 +25,11 @@
<Label x:Name="lbl_email" Content="Email:" HorizontalAlignment="Left" Margin="563,192,0,0" VerticalAlignment="Top" Padding="2,5,5,5" FontSize="11"/>
<Label x:Name="lbl_bio" Content="Bio:" HorizontalAlignment="Left" Margin="563,249,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.079,0.397" Padding="2,5,5,5"/>
<ListBox x:Name="ListBox" HorizontalAlignment="Left" Height="265" Margin="10,10,0,0" VerticalAlignment="Top" Width="519"/>
<TextBlock x:Name="txtblk_repocount" HorizontalAlignment="Left" Margin="10,280,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="65" Width="519" RenderTransformOrigin="0.496,0.482"/>
<TextBlock x:Name="txtblk_repocount" HorizontalAlignment="Left" Margin="10,280,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="65" Width="235" RenderTransformOrigin="0.496,0.482"/>
<ComboBox x:Name="cmbbox_sort" HorizontalAlignment="Left" Margin="330,280,0,0" VerticalAlignment="Top" Width="199"/>
<Button x:Name="btn_sort" Content="Sort" HorizontalAlignment="Left" Margin="250,280,0,0" VerticalAlignment="Top" Width="75" Click="btn_sort_Click" Height="22"/>
<Button x:Name="btn_searchrepo" Content="Search Repository" HorizontalAlignment="Left" Margin="250,307,0,0" VerticalAlignment="Top" Width="109"/>
<TextBox x:Name="txtbox_searchbox" HorizontalAlignment="Left" Height="20" Margin="364,307,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="165" RenderTransformOrigin="0.131,-0.913"/>
</Grid>
</Window>

View File

@ -25,7 +25,6 @@ namespace DeskHubSharp
private User _userDetail;
private Request _request;
private RepoInfo _repoInfo;
public MainWindow()
{
InitializeComponent();
@ -59,6 +58,7 @@ namespace DeskHubSharp
private void btn_exit_Click(object sender, RoutedEventArgs e)
{
this.Close();
Environment.Exit(0);
}
private void btn_about_Click(object sender, RoutedEventArgs e)
@ -114,5 +114,10 @@ namespace DeskHubSharp
err.txtblk_error.Text = message;
err.ShowDialog();
}
private void btn_sort_Click(object sender, RoutedEventArgs e)
{
}
}
}

View File

@ -24,6 +24,9 @@ namespace DeskHubSharp
set { _toEmail = value; }
}
/// <summary>
/// Constructor for the Email class
/// </summary>
public Email()
{

View File

@ -6,6 +6,9 @@ using System.Threading.Tasks;
namespace DeskHubSharp
{
/// <summary>
/// Class from a JSON to a C# converter
/// </summary>
public class License
{
/// <summary>

View File

@ -6,8 +6,9 @@ using System.Threading.Tasks;
namespace DeskHubSharp
{
// TODO: The Owner class is called by code behind, fix it
/// <summary>
/// Class from a JSON to a C# converter
/// </summary>
public class Owner
{
/// <summary>

View File

@ -10,10 +10,19 @@ namespace DeskHubSharp
// TODO: The RequestList class is called from code behind, fix it
public class RequestList
{
/// <summary>
/// Stores everything in User, typically from the request
/// </summary>
public static User userDetail { get; set; }
/// <summary>
/// Stores everything sent in Branch, typically from request
/// </summary>
public static ObservableCollection<Branch> branchDetail { get; set; }
/// <summary>
/// Stores everything sent in RepoDetail, typically from request
/// </summary>
public static ObservableCollection<RepoDetail> repoDetail { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeskHubSharp
{
public static class Sort
{
public enum SortBox
{
Alphabettically,
MostStars,
MostForks,
MostWatchers
}
}
}

View File

@ -1,4 +1,4 @@
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8924CF88FE4A7948C7314277251E7D79D8D8F350"
#pragma checksum "..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "5E7C2DBB667F025FC5CA90C6A4E4064F"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.

View File

@ -1,4 +1,4 @@
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8924CF88FE4A7948C7314277251E7D79D8D8F350"
#pragma checksum "..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "5E7C2DBB667F025FC5CA90C6A4E4064F"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.

View File

@ -1 +1 @@
126931593991507bb071b2be67ad4cd72eeb0287
17ecdc8fee3d6393cca5a22f6abf5748d0b3401c

View File

@ -4,16 +4,16 @@
winexe
C#
.cs
C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\obj\Debug\
C:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\obj\Debug\
DeskHubSharp
none
false
DEBUG;TRACE
C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\App.xaml
C:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\App.xaml
7-86569338
26-1609030936
20415715258
27-1010967837
20-856998346
AboutWindow.xaml;DetailWindow.xaml;ErrorWindow.xaml;FeedbackWindow.xaml;HelpWindow.xaml;MainWindow.xaml;SearchWindow.xaml;
False

View File

@ -4,17 +4,17 @@
winexe
C#
.cs
C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\obj\Debug\
C:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\obj\Debug\
DeskHubSharp
none
false
DEBUG;TRACE
C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\App.xaml
C:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\App.xaml
7-86569338
30-1807549293
20415715258
312052675278
20-856998346
AboutWindow.xaml;DetailWindow.xaml;ErrorWindow.xaml;FeedbackWindow.xaml;HelpWindow.xaml;MainWindow.xaml;SearchWindow.xaml;
False
True

View File

@ -1,10 +1,10 @@

FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\AboutWindow.xaml;;
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\DetailWindow.xaml;;
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\ErrorWindow.xaml;;
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\FeedbackWindow.xaml;;
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\HelpWindow.xaml;;
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\MainWindow.xaml;;
FC:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\SearchWindow.xaml;;
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\AboutWindow.xaml;;
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\DetailWindow.xaml;;
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\ErrorWindow.xaml;;
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\FeedbackWindow.xaml;;
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\HelpWindow.xaml;;
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\MainWindow.xaml;;
FC:\Users\mill1159\Desktop\DeskHubSharp\DeskHubSharp\SearchWindow.xaml;;

View File

@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0EAA4E5953DD54A83EF84C8979256F95CA55AC47"
#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "1E01AC040AC8F24B3F0ED293B159302B"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -51,7 +51,7 @@ namespace DeskHubSharp {
#line 10 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button btn_search;
internal System.Windows.Controls.Button btn_searchuser;
#line default
#line hidden
@ -192,6 +192,38 @@ namespace DeskHubSharp {
#line default
#line hidden
#line 29 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ComboBox cmbbox_sort;
#line default
#line hidden
#line 30 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button btn_sort;
#line default
#line hidden
#line 31 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button btn_searchrepo;
#line default
#line hidden
#line 32 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtbox_searchbox;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
@ -226,10 +258,10 @@ namespace DeskHubSharp {
this.window_main = ((DeskHubSharp.MainWindow)(target));
return;
case 2:
this.btn_search = ((System.Windows.Controls.Button)(target));
this.btn_searchuser = ((System.Windows.Controls.Button)(target));
#line 10 "..\..\MainWindow.xaml"
this.btn_search.Click += new System.Windows.RoutedEventHandler(this.btn_search_Click);
this.btn_searchuser.Click += new System.Windows.RoutedEventHandler(this.btn_search_Click);
#line default
#line hidden
@ -315,6 +347,24 @@ namespace DeskHubSharp {
case 19:
this.txtblk_repocount = ((System.Windows.Controls.TextBlock)(target));
return;
case 20:
this.cmbbox_sort = ((System.Windows.Controls.ComboBox)(target));
return;
case 21:
this.btn_sort = ((System.Windows.Controls.Button)(target));
#line 30 "..\..\MainWindow.xaml"
this.btn_sort.Click += new System.Windows.RoutedEventHandler(this.btn_sort_Click);
#line default
#line hidden
return;
case 22:
this.btn_searchrepo = ((System.Windows.Controls.Button)(target));
return;
case 23:
this.txtbox_searchbox = ((System.Windows.Controls.TextBox)(target));
return;
}
this._contentLoaded = true;
}

View File

@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0EAA4E5953DD54A83EF84C8979256F95CA55AC47"
#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "1E01AC040AC8F24B3F0ED293B159302B"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -51,7 +51,7 @@ namespace DeskHubSharp {
#line 10 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button btn_search;
internal System.Windows.Controls.Button btn_searchuser;
#line default
#line hidden
@ -192,6 +192,38 @@ namespace DeskHubSharp {
#line default
#line hidden
#line 29 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ComboBox cmbbox_sort;
#line default
#line hidden
#line 30 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button btn_sort;
#line default
#line hidden
#line 31 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button btn_searchrepo;
#line default
#line hidden
#line 32 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtbox_searchbox;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
@ -226,10 +258,10 @@ namespace DeskHubSharp {
this.window_main = ((DeskHubSharp.MainWindow)(target));
return;
case 2:
this.btn_search = ((System.Windows.Controls.Button)(target));
this.btn_searchuser = ((System.Windows.Controls.Button)(target));
#line 10 "..\..\MainWindow.xaml"
this.btn_search.Click += new System.Windows.RoutedEventHandler(this.btn_search_Click);
this.btn_searchuser.Click += new System.Windows.RoutedEventHandler(this.btn_search_Click);
#line default
#line hidden
@ -315,6 +347,24 @@ namespace DeskHubSharp {
case 19:
this.txtblk_repocount = ((System.Windows.Controls.TextBlock)(target));
return;
case 20:
this.cmbbox_sort = ((System.Windows.Controls.ComboBox)(target));
return;
case 21:
this.btn_sort = ((System.Windows.Controls.Button)(target));
#line 30 "..\..\MainWindow.xaml"
this.btn_sort.Click += new System.Windows.RoutedEventHandler(this.btn_sort_Click);
#line default
#line hidden
return;
case 22:
this.btn_searchrepo = ((System.Windows.Controls.Button)(target));
return;
case 23:
this.txtbox_searchbox = ((System.Windows.Controls.TextBox)(target));
return;
}
this._contentLoaded = true;
}