Skip to content

Commit 087e969

Browse files
committed
Added XWare page to X-Store. Not 100% working yet and has a few bugs.
1 parent 45c9000 commit 087e969

9 files changed

Lines changed: 224 additions & 11 deletions

NCX-Installer/MainWindow.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Label Content="v2.7" HorizontalAlignment="Left" Margin="707,0,0,0" VerticalAlignment="Top" Foreground="White"/>
1212
<Label x:Name="label2" Content="News:" HorizontalAlignment="Left" Margin="10,42,0,0" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Foreground="White"/>
1313
<Label Content="Quick Launch" HorizontalAlignment="Left" Margin="10,88,0,0" VerticalAlignment="Top" FontSize="18" FontWeight="Bold" Foreground="White"/>
14-
<Button x:Name="btn1" Content="" HorizontalAlignment="Left" Margin="12,209,0,0" VerticalAlignment="Top" Height="82" Width="82" Click="Button_Click_1" Visibility="Visible">
14+
<Button x:Name="btn1" Content="" HorizontalAlignment="Left" Margin="99,122,0,0" VerticalAlignment="Top" Height="82" Width="82" Click="Button_Click_1" Visibility="Visible">
1515
<Button.Background>
1616
<ImageBrush ImageSource="image/csharpcol.png"/>
1717
</Button.Background>
@@ -24,9 +24,9 @@
2424
<Button x:Name="btn8" Content="X-Store" HorizontalAlignment="Left" Margin="12,391,0,0" VerticalAlignment="Top" Height="36" Width="104" FontSize="16" Click="btn8_Click" Foreground="White" Background="Black" BorderBrush="#FFA6A6A6"/>
2525
<Button x:Name="btn9" Content="Archived Projects" HorizontalAlignment="Left" Margin="121,391,0,0" VerticalAlignment="Top" Height="36" Width="104" Visibility="Visible" Click="btn9_Click" Background="Black" Foreground="White"/>
2626
<TextBlock x:Name="label3" HorizontalAlignment="Left" Margin="65,49,0,0" Text="Fetching News... Please wait." TextWrapping="Wrap" VerticalAlignment="Top" Height="37" Width="635" FontSize="14" Foreground="White"/>
27-
<Button x:Name="btn1_Copy" Content="" HorizontalAlignment="Left" Margin="99,122,0,0" VerticalAlignment="Top" Height="82" Width="82" Click="Button_Click_1_Copy" Visibility="Visible">
27+
<Button x:Name="btn10" Content="" HorizontalAlignment="Left" Margin="186,122,0,0" VerticalAlignment="Top" Height="82" Width="82" Click="Button_Click_1_Copy" Visibility="Hidden">
2828
<Button.Background>
29-
<ImageBrush ImageSource="image/xwarelaunch.png"/>
29+
<ImageBrush ImageSource="image/ncxnewsplus.png"/>
3030
</Button.Background>
3131
</Button>
3232

NCX-Installer/MainWindow.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ public MainWindow()
6161
win.Show();
6262
win.Topmost = true;
6363
}
64+
if (File.Exists(System.IO.Path.Combine(SavePath, "NCX-Core/NCXNewsPlus/XWare.exe")))
65+
{
66+
btn10.Visibility = Visibility.Visible;
67+
}
6468
}
6569

6670
private void Button_Click(object sender, RoutedEventArgs e)

NCX-Installer/NCX-Installer.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<None Remove="image\c64titleloader.png" />
2323
<None Remove="image\dsidownloader.png" />
2424
<None Remove="image\firsttime.png" />
25+
<None Remove="image\ncxnewsplus.png" />
2526
<None Remove="image\screen\am1.png" />
2627
<None Remove="image\screen\am2.png" />
2728
<None Remove="image\screen\c64tl1.png" />
@@ -37,6 +38,7 @@
3738

3839
<ItemGroup>
3940
<Resource Include="image\c64titleloader.png" />
41+
<Resource Include="image\ncxnewsplus.png" />
4042
<Resource Include="image\screen\c64tl2.png" />
4143
</ItemGroup>
4244

NCX-Installer/XStoreHome.xaml.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using Microsoft.VisualBasic;
22
using System;
33
using System.Collections.Generic;
4+
using System.IO;
5+
using System.Net;
46
using System.Text;
57
using System.Windows;
68
using System.Windows.Controls;
@@ -11,6 +13,7 @@
1113
using System.Windows.Media.Imaging;
1214
using System.Windows.Navigation;
1315
using System.Windows.Shapes;
16+
using System.IO.Compression;
1417

1518
namespace NCX_Installer
1619
{
@@ -44,14 +47,8 @@ private void btn3_Click(object sender, RoutedEventArgs e)
4447

4548
private void Button_Click(object sender, RoutedEventArgs e)
4649
{
47-
string message = "XWare is still in development. It will be available in v2.8. Stay tuned!";
48-
string caption = "Coming Soon";
49-
MessageBoxButton buttons = MessageBoxButton.OK;
50-
MessageBoxImage icon = MessageBoxImage.Exclamation;
51-
if (MessageBox.Show(message, caption, buttons, icon) == MessageBoxResult.OK)
52-
{
53-
//no code here it just closes the box
54-
}
50+
XWareHome page = new XWareHome();
51+
NavigationService.Navigate(page);
5552
}
5653
}
5754
}

NCX-Installer/XWareHome.xaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Page x:Class="NCX_Installer.XWareHome"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:NCX_Installer"
7+
mc:Ignorable="d"
8+
d:DesignHeight="350" d:DesignWidth="600"
9+
Title="X-Store" Background="Black">
10+
11+
<Grid>
12+
<Label Content="XWare" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="26" FontWeight="Bold" Foreground="White"/>
13+
<Label Content="Stuff to add functionality to NCX-Core!" HorizontalAlignment="Left" Margin="0,36,0,0" VerticalAlignment="Top" FontSize="16" Foreground="White"/>
14+
<Label Content="XWare is still a work in progress. Many changes may occur in the future." HorizontalAlignment="Left" Margin="0,283,0,0" VerticalAlignment="Top" Foreground="White"/>
15+
<Button x:Name="btn1" Content="" HorizontalAlignment="Left" Margin="10,72,0,0" VerticalAlignment="Top" Width="100" Height="100" Click="Button_Click">
16+
<Button.Background>
17+
<ImageBrush ImageSource="image/ncxnewsplus.png"/>
18+
</Button.Background>
19+
</Button>
20+
<Button Content="Back" HorizontalAlignment="Left" Margin="10,263,0,0" VerticalAlignment="Top" Height="23" Width="75" Click="btn1_Click" Background="Black" Foreground="White"/>
21+
</Grid>
22+
</Page>

NCX-Installer/XWareHome.xaml.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using System.Windows;
5+
using System.Windows.Controls;
6+
using System.Windows.Data;
7+
using System.Windows.Documents;
8+
using System.Windows.Input;
9+
using System.Windows.Media;
10+
using System.Windows.Media.Imaging;
11+
using System.Windows.Navigation;
12+
using System.Windows.Shapes;
13+
14+
namespace NCX_Installer
15+
{
16+
/// <summary>
17+
/// Interaction logic for XWareHome.xaml
18+
/// </summary>
19+
public partial class XWareHome : Page
20+
{
21+
public XWareHome()
22+
{
23+
InitializeComponent();
24+
}
25+
26+
private void btn1_Click(object sender, RoutedEventArgs e)
27+
{
28+
XWareHome page = new XWareHome();
29+
NavigationService.Navigate(page);
30+
}
31+
32+
private void Button_Click(object sender, RoutedEventArgs e)
33+
{
34+
XWareNews page = new XWareNews();
35+
NavigationService.Navigate(page);
36+
}
37+
}
38+
}

NCX-Installer/XWareNews.xaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Page x:Class="NCX_Installer.XWareNews"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:NCX_Installer"
7+
mc:Ignorable="d"
8+
d:DesignHeight="350" d:DesignWidth="600"
9+
Title="X-Store" Background="Black">
10+
11+
<Grid>
12+
<Image HorizontalAlignment="Left" Height="175" Margin="10,10,0,0" VerticalAlignment="Top" Width="175" Source="image/ncxnewsplus.png"/>
13+
<Label Content="NCX News Plus" HorizontalAlignment="Left" Margin="185,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="26" Foreground="White"/>
14+
<Label Content="By NinjaCheetah" HorizontalAlignment="Left" Margin="185,42,0,0" VerticalAlignment="Top" FontSize="20" Foreground="White"/>
15+
<Button x:Name="btn1" Content="User Page" HorizontalAlignment="Left" Margin="190,79,0,0" VerticalAlignment="Top" Width="74" Height="23" Click="Button_Click_1" Background="{x:Null}" Foreground="White"/>
16+
<Button x:Name="btn2" Content="GitHub" HorizontalAlignment="Left" Margin="269,79,0,0" VerticalAlignment="Top" Width="74" Height="23" Click="Button_Click" Background="{x:Null}" Foreground="White"/>
17+
<ProgressBar x:Name="progressBar1" HorizontalAlignment="Left" Height="19" Margin="10,198,0,0" VerticalAlignment="Top" Width="175" Background="#FF323232"/>
18+
<Label x:Name="label1" Content="Downloading... Please wait." HorizontalAlignment="Left" Margin="10,217,0,0" VerticalAlignment="Top" Width="175" FontSize="13" Visibility="Hidden" Foreground="White"/>
19+
<Button x:Name="btn5" Content="Install" HorizontalAlignment="Left" Margin="10,198,0,0" VerticalAlignment="Top" Width="175" Click="Button_Click_4" Foreground="White" Background="Black"/>
20+
<TextBlock HorizontalAlignment="Left" Margin="190,107,0,0" Text="NCX News Plus provides full news stories when I release them, along with the ability to see the edition and date of each article." TextWrapping="Wrap" VerticalAlignment="Top" Height="84" Width="290" FontSize="15" Foreground="White"/>
21+
<Button x:Name="btn3" Content="Back" HorizontalAlignment="Left" Margin="10,279,0,0" VerticalAlignment="Top" Width="74" Height="23" Click="Button_Click_2" Background="{x:Null}" Foreground="White"/>
22+
<Button x:Name="btn6" Content="Launch" HorizontalAlignment="Left" Margin="10,251,0,0" VerticalAlignment="Top" Width="74" Height="23" Click="btn6_Click" Background="{x:Null}" Visibility="Hidden" Foreground="White"/>
23+
24+
</Grid>
25+
</Page>

NCX-Installer/XWareNews.xaml.cs

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.IO;
5+
using System.IO.Compression;
6+
using System.Net;
7+
using System.Text;
8+
using System.Windows;
9+
using System.Windows.Controls;
10+
using System.Windows.Data;
11+
using System.Windows.Documents;
12+
using System.Windows.Input;
13+
using System.Windows.Media;
14+
using System.Windows.Media.Imaging;
15+
using System.Windows.Navigation;
16+
using System.Windows.Shapes;
17+
18+
namespace NCX_Installer
19+
{
20+
/// <summary>
21+
/// Interaction logic for XWareNews.xaml
22+
/// </summary>
23+
public partial class XWareNews : Page
24+
{
25+
static readonly string SavePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
26+
27+
public XWareNews()
28+
{
29+
InitializeComponent();
30+
}
31+
32+
private void Button_Click_2(object sender, RoutedEventArgs e)
33+
{
34+
XWareHome page = new XWareHome();
35+
NavigationService.Navigate(page);
36+
}
37+
38+
private void Button_Click(object sender, RoutedEventArgs e)
39+
{
40+
string url = "https://github.com/NinjaCheetah/NCX-XWare";
41+
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
42+
}
43+
44+
private void Button_Click_1(object sender, RoutedEventArgs e)
45+
{
46+
string url = "https://github.com/NinjaCheetah";
47+
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
48+
}
49+
50+
private void Button_Click_4(object sender, RoutedEventArgs e)
51+
{
52+
if (Directory.Exists(System.IO.Path.Combine(SavePath, "NCX-Core/")))
53+
{
54+
if (Directory.Exists(System.IO.Path.Combine(SavePath,"NCX-Core/NCXNewsPlus/")))
55+
{
56+
using (WebClient wc = new WebClient())
57+
{
58+
btn5.Visibility = Visibility.Hidden;
59+
label1.Visibility = Visibility.Visible;
60+
wc.DownloadProgressChanged += wc_DownloadProgressChanged;
61+
wc.DownloadFileCompleted += DownloadCompleted;
62+
wc.DownloadFileAsync(
63+
// Param1 = Link of file
64+
new System.Uri("https://github.com/NinjaCheetah/NCX-XWare/releases/latest/download/NCXNewsPlus.zip"),
65+
// Param2 = Path to save
66+
System.IO.Path.Combine(SavePath, "NCX-Core/NCXNewsPlus/NCXNewsPlus.zip")
67+
);
68+
}
69+
}
70+
else
71+
{
72+
Directory.CreateDirectory(System.IO.Path.Combine(SavePath, "NCX-Core/NCXNewsPlus"));
73+
using (WebClient wc = new WebClient())
74+
{
75+
btn5.Visibility = Visibility.Hidden;
76+
label1.Visibility = Visibility.Visible;
77+
wc.DownloadFileCompleted += DownloadCompleted;
78+
wc.DownloadFileAsync(
79+
// Param1 = Link of file
80+
new System.Uri("https://github.com/NinjaCheetah/NCX-XWare/releases/latest/download/NCXNewsPlus.zip"),
81+
// Param2 = Path to save
82+
System.IO.Path.Combine(SavePath, "NCX-Core/NCXNewsPlus/NCXNewsPlus.zip")
83+
);
84+
}
85+
}
86+
}
87+
else
88+
{
89+
Directory.CreateDirectory(System.IO.Path.Combine(SavePath, "NCX-Core"));
90+
Directory.CreateDirectory(System.IO.Path.Combine(SavePath, "NCX-Core/NCXNewsPlus"));
91+
Directory.CreateDirectory(System.IO.Path.Combine(SavePath, "NCX-Core/NCXNewsPlus"));
92+
using (WebClient wc = new WebClient())
93+
{
94+
wc.DownloadFileCompleted += DownloadCompleted;
95+
wc.DownloadFileAsync(
96+
// Param1 = Link of file
97+
new System.Uri("https://github.com/NinjaCheetah/NCX-XWare/releases/latest/download/NCXNewsPlus.zip"),
98+
// Param2 = Path to save
99+
System.IO.Path.Combine(SavePath, "NCX-Core/NCXNewsPlus/NCXNewsPlus.zip")
100+
);
101+
}
102+
}
103+
}
104+
105+
public void DownloadCompleted(object sender, EventArgs e)
106+
{
107+
ZipFile.ExtractToDirectory(System.IO.Path.Combine(SavePath, "NCX-Core/NCXNewsPlus/NCXNewsPlus.zip"), System.IO.Path.Combine(SavePath, "NCX-Core/NCXNewsPlus"), true);
108+
File.Delete(System.IO.Path.Combine(SavePath, "NCX-Core/NCXNewsPlus/NCXNewsPlus.zip"));
109+
label1.Content = "Download Complete";
110+
}
111+
112+
void wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
113+
{
114+
progressBar1.Value = e.ProgressPercentage;
115+
}
116+
117+
private void btn6_Click(object sender, RoutedEventArgs e)
118+
{
119+
if (File.Exists("C:/Program Files/NCX/CSharp Collection/CSharpCollectionVol1.exe"))
120+
{
121+
Process.Start("C:/Program Files/NCX/CSharp Collection/CSharpCollectionVol1.exe");
122+
}
123+
}
124+
}
125+
}
9.66 KB
Loading

0 commit comments

Comments
 (0)