-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from daredloco/update-net5
Update to NET5
- Loading branch information
Showing
28 changed files
with
1,725 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<Window x:Class="GitInstaller.LicenseWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:GitInstaller" | ||
mc:Ignorable="d" | ||
Title="LicenseWindow" Height="450" Width="800"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="0.05*"/> | ||
<RowDefinition Height="*"/> | ||
<RowDefinition Height="0.05*"/> | ||
<RowDefinition Height="0.15*"/> | ||
<RowDefinition Height="0.05*"/> | ||
</Grid.RowDefinitions> | ||
|
||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="0.1*"/> | ||
<ColumnDefinition Width="0.3*"/> | ||
<ColumnDefinition Width="0.05*"/> | ||
<ColumnDefinition Width="0.3*"/> | ||
<ColumnDefinition Width="0.1*"/> | ||
</Grid.ColumnDefinitions> | ||
<RichTextBox Name="rtb_license" Grid.Row="1" Grid.ColumnSpan="5" Margin="5,0,5,0" VerticalScrollBarVisibility="Visible"> | ||
<RichTextBox.Resources> | ||
<Style TargetType="{x:Type Paragraph}"> | ||
<Setter Property="Margin" Value="0" /> | ||
</Style> | ||
</RichTextBox.Resources> | ||
<FlowDocument> | ||
<Paragraph>Loading License</Paragraph> | ||
<Paragraph>Please wait...</Paragraph> | ||
</FlowDocument> | ||
</RichTextBox> | ||
<Button Name="bt_accept" Content="Accept" Grid.Row="3" Grid.Column="3"/> | ||
<Button Name="bt_decline" Content="Decline" Grid.Row="3" Grid.Column="1"/> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Shapes; | ||
|
||
namespace GitInstaller | ||
{ | ||
/// <summary> | ||
/// Interaktionslogik für LicenseWindow.xaml | ||
/// </summary> | ||
public partial class LicenseWindow : Window | ||
{ | ||
public LicenseWindow() | ||
{ | ||
InitializeComponent(); | ||
LoadLicense(); | ||
bt_accept.Click += AcceptClick; | ||
bt_decline.Click += DeclineClick; | ||
|
||
bt_accept.IsEnabled = false; | ||
} | ||
|
||
private void DeclineClick(object sender, RoutedEventArgs e) | ||
{ | ||
DialogResult = false; | ||
Close(); | ||
} | ||
|
||
private void AcceptClick(object sender, RoutedEventArgs e) | ||
{ | ||
DialogResult = true; | ||
Close(); | ||
} | ||
|
||
async void LoadLicense() | ||
{ | ||
using (var client = new WebClient()) | ||
{ | ||
client.Headers.Add("user-agent", "GitInstaller"); | ||
string licenseJson = await client.DownloadStringTaskAsync(Settings.LicenseUrl.AbsoluteUri); | ||
JObject job = JsonConvert.DeserializeObject<JObject>(licenseJson); | ||
//License | ||
JToken license = job.Value<JToken>("license"); | ||
client.Headers["user-agent"] = "gitinstaller"; | ||
client.Headers.Add("accept", "application/vnd.github.v3+json"); | ||
string licJson = await client.DownloadStringTaskAsync(new Uri(license.Value<string>("url")).AbsoluteUri); | ||
JObject licobj = JsonConvert.DeserializeObject<JObject>(licJson); | ||
string licenseBody = licobj.Value<string>("body"); | ||
rtb_license.Document.Blocks.Clear(); | ||
Paragraph para = new Paragraph(); | ||
para.Inlines.Add(licenseBody); | ||
rtb_license.Document.Blocks.Add(para); | ||
} | ||
|
||
bt_accept.IsEnabled = true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Application x:Class="GitInstallerNET5.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:GitInstallerNET5" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
|
||
namespace GitInstallerNET5 | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Windows; | ||
|
||
[assembly: ThemeInfo( | ||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | ||
//(used if a resource is not found in the page, | ||
// or application resource dictionaries) | ||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | ||
//(used if a resource is not found in the page, | ||
// app, or any theme specific resource dictionaries) | ||
)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net5.0-windows</TargetFramework> | ||
<UseWPF>true</UseWPF> | ||
<UseWindowsForms>true</UseWindowsForms> | ||
<AssemblyName>GitInstaller</AssemblyName> | ||
<RootNamespace>GitInstallerNET5</RootNamespace> | ||
<Authors>Roman Wanner</Authors> | ||
<Company>Roman Wanner</Company> | ||
<Description>Simple Installer for Github</Description> | ||
<Copyright>© Roman Wanner 2020</Copyright> | ||
<PackageProjectUrl>https://github.com/daredloco/GitInstaller/</PackageProjectUrl> | ||
<AssemblyVersion>1.9.0.0</AssemblyVersion> | ||
<FileVersion>1.9.0.0</FileVersion> | ||
<ApplicationIcon>icon.ico</ApplicationIcon> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="icon.ico" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="icon.ico" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Update="LicenseWindow.xaml.cs"> | ||
<DependentUpon>LicenseWindow.xaml</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="config.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Page Update="LicenseWindow.xaml"> | ||
<SubType>Designer</SubType> | ||
</Page> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.