-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
228 additions
and
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Net.Http; | ||
using System.Net.Http.Headers; | ||
using System.Net.Http.Json; | ||
|
||
namespace KOAStudio.Core.Helpers | ||
{ | ||
public record GithubTagInfo(string html_url, string tag_name, string name, string published_at, string body); | ||
public static class GithubVersion | ||
{ | ||
public static Task<IList<GithubTagInfo>?> GetRepoTagInfos(string Username, string Repository) | ||
{ | ||
// 깃헙 릴리즈 태그에서 가져오기 | ||
HttpClient client = new(); | ||
var pih = ProductInfoHeaderValue.Parse(Repository); | ||
client.DefaultRequestHeaders.UserAgent.Add(pih); | ||
return client.GetFromJsonAsync<IList<GithubTagInfo>>($"https://api.github.com/repos/{Username}/{Repository}/releases"); | ||
} | ||
} | ||
} |
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,52 @@ | ||
<Window | ||
x:Class="KOAStudio.Core.Views.VersionView" | ||
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:local="clr-namespace:KOAStudio.Core.Views" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
Title="VersionView" | ||
Width="600" | ||
Height="410" | ||
ResizeMode="NoResize" | ||
WindowStartupLocation="CenterOwner" | ||
mc:Ignorable="d"> | ||
<Grid Margin="10"> | ||
<TextBlock | ||
Margin="0,0,0,10" | ||
FontSize="20" | ||
FontWeight="Bold" | ||
Text="Version Infos" /> | ||
<ScrollViewer Margin="0,30,0,0"> | ||
<ItemsControl d:ItemsSource="{d:SampleData ItemCount=20}" ItemsSource="{Binding TagInfos}"> | ||
<ItemsControl.ItemTemplate> | ||
<DataTemplate> | ||
<GroupBox Margin="0,5" Header="{Binding}"> | ||
<StackPanel> | ||
<TextBlock Margin="0,5" Text="{Binding published_at}" /> | ||
<TextBox | ||
Height="50" | ||
AcceptsReturn="True" | ||
HorizontalScrollBarVisibility="Auto" | ||
IsReadOnly="True" | ||
Text="{Binding body}" | ||
VerticalScrollBarVisibility="Auto" /> | ||
</StackPanel> | ||
<GroupBox.HeaderTemplate> | ||
<DataTemplate> | ||
<TextBlock> | ||
<Hyperlink NavigateUri="{Binding html_url}" RequestNavigate="Hyperlink_RequestNavigate"> | ||
<Hyperlink.Inlines> | ||
<Run Text="{Binding tag_name}" /> | ||
</Hyperlink.Inlines> | ||
</Hyperlink> | ||
</TextBlock> | ||
</DataTemplate> | ||
</GroupBox.HeaderTemplate> | ||
</GroupBox> | ||
</DataTemplate> | ||
</ItemsControl.ItemTemplate> | ||
</ItemsControl> | ||
</ScrollViewer> | ||
</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,34 @@ | ||
using KOAStudio.Core.Helpers; | ||
using System.Diagnostics; | ||
using System.Windows; | ||
using System.Windows.Navigation; | ||
|
||
namespace KOAStudio.Core.Views | ||
{ | ||
/// <summary> | ||
/// Interaction logic for VersionView.xaml | ||
/// </summary> | ||
public partial class VersionView : Window | ||
{ | ||
public IList<GithubTagInfo> TagInfos { get; } | ||
|
||
public VersionView(IList<GithubTagInfo> tagInfos) | ||
{ | ||
InitializeComponent(); | ||
Owner = Application.Current.MainWindow; | ||
TagInfos = tagInfos; | ||
|
||
this.DataContext = this; | ||
} | ||
|
||
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) | ||
{ | ||
var sInfo = new ProcessStartInfo(e.Uri.AbsoluteUri) | ||
{ | ||
UseShellExecute = true, | ||
}; | ||
Process.Start(sInfo); | ||
e.Handled = 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
Oops, something went wrong.