Skip to content

Commit b58b9ff

Browse files
committed
Commiting all of my .NET Core conversion stuff thus far
1 parent 5ac767f commit b58b9ff

22 files changed

Lines changed: 761 additions & 0 deletions

NCX-Installer/About.xaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Window x:Class="NCX_Installer.About"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:NCX_Installer"
7+
mc:Ignorable="d"
8+
Title="About" Height="206" Width="353">
9+
<Grid>
10+
<Label Content="NCX-Installer" HorizontalContentAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Top" Height="38" Width="314" FontWeight="Bold" FontSize="24"/>
11+
<Label Content="v2.4 Public Beta 2" HorizontalAlignment="Center" Margin="0,32,0,0" VerticalAlignment="Top" FontSize="16"/>
12+
<Label Content="Created and Written by NinjaCheetah" HorizontalAlignment="Center" Margin="0,51,0,0" VerticalAlignment="Top" FontSize="16"/>
13+
<Label Content="Written in C Sharp using Visual Studio 2019" HorizontalAlignment="Center" Margin="0,73,0,0" VerticalAlignment="Top" FontSize="16"/>
14+
<Label Content="Powered by the .NET Core 3.1" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="16" Margin="0,95,0,0"/>
15+
<Button Content="GitHub Page" HorizontalAlignment="Left" Margin="10,138,0,0" VerticalAlignment="Top" Height="23" Width="84" Click="Button_Click"/>
16+
</Grid>
17+
</Window>

NCX-Installer/About.xaml.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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.Shapes;
12+
using System.IO;
13+
using System.Diagnostics;
14+
15+
namespace NCX_Installer
16+
{
17+
/// <summary>
18+
/// Interaction logic for About.xaml
19+
/// </summary>
20+
public partial class About : Window
21+
{
22+
public About()
23+
{
24+
InitializeComponent();
25+
}
26+
27+
private void Button_Click(object sender, RoutedEventArgs e)
28+
{
29+
string message = "Haven't figured out how to open web pages in .NET Core yet so, uh, yeah.";
30+
string caption = "Currently Unavailable";
31+
MessageBoxButton buttons = MessageBoxButton.OK;
32+
MessageBoxImage icon = MessageBoxImage.Error;
33+
if (MessageBox.Show(message, caption, buttons, icon) == MessageBoxResult.OK)
34+
{
35+
36+
}
37+
}
38+
}
39+
}

NCX-Installer/App.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Application x:Class="NCX_Installer.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:NCX_Installer"
5+
StartupUri="MainWindow.xaml"
6+
ShutdownMode="OnLastWindowClose">
7+
<Application.Resources>
8+
9+
</Application.Resources>
10+
</Application>

NCX-Installer/App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace NCX_Installer
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}

NCX-Installer/AssemblyInfo.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Windows;
2+
3+
[assembly: ThemeInfo(
4+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5+
//(used if a resource is not found in the page,
6+
// or application resource dictionaries)
7+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8+
//(used if a resource is not found in the page,
9+
// app, or any theme specific resource dictionaries)
10+
)]

NCX-Installer/FirstTime1.xaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Window x:Class="NCX_Installer.FirstTime1"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:gif="http://wpfanimatedgif.codeplex.com"
7+
xmlns:local="clr-namespace:NCX_Installer"
8+
mc:Ignorable="d"
9+
Title="Welcome to NCX-Installer!" Height="407" Width="344">
10+
<Grid>
11+
<Image HorizontalAlignment="Left" Source="image/firsttime.png" Height="155" Margin="10,10,0,0" VerticalAlignment="Top" Width="309"/>
12+
<Label Content="Welcome to NCX-Installer!" HorizontalAlignment="Left" Margin="0,143,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold"/>
13+
<TextBlock HorizontalAlignment="Left" Margin="10,185,0,0" Text="It appears you've never been here before. We just need to set a few things up, and then you're ready to download all of the latest NCX Software!" TextWrapping="Wrap" VerticalAlignment="Top" Height="125" Width="300" FontSize="18"/>
14+
<Button x:Name="btn1" Content="Exit" HorizontalAlignment="Left" Margin="10,329,0,0" VerticalAlignment="Top" Height="23" Width="75" Click="btn1_Click"/>
15+
<Button x:Name="btn2" Content="Next" HorizontalAlignment="Left" Margin="235,329,0,0" VerticalAlignment="Top" Height="23" Width="75" Click="btn2_Click"/>
16+
</Grid>
17+
</Window>

NCX-Installer/FirstTime1.xaml.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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.Shapes;
12+
using WpfAnimatedGif;
13+
14+
namespace NCX_Installer
15+
{
16+
/// <summary>
17+
/// Interaction logic for FirstTime1.xaml
18+
/// </summary>
19+
public partial class FirstTime1 : Window
20+
{
21+
public FirstTime1()
22+
{
23+
InitializeComponent();
24+
}
25+
26+
private void btn1_Click(object sender, RoutedEventArgs e)
27+
{
28+
Environment.Exit(0);
29+
}
30+
31+
private void btn2_Click(object sender, RoutedEventArgs e)
32+
{
33+
34+
}
35+
}
36+
}

NCX-Installer/Icon.ico

33.1 KB
Binary file not shown.

NCX-Installer/MainWindow.xaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<Window x:Class="NCX_Installer.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:NCX_Installer"
7+
mc:Ignorable="d"
8+
Title="Main Menu" Height="420" Width="758">
9+
<Grid>
10+
<Label x:Name="label1" Content="placeholder text" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold"/>
11+
<Label Content="v2.4" HorizontalAlignment="Left" Margin="707,0,0,0" VerticalAlignment="Top"/>
12+
<Label x:Name="label2" Content="News:" HorizontalAlignment="Left" Margin="10,42,0,0" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Foreground="Blue"/>
13+
<Label x:Name="label3" Content="Fetching News... Please wait." HorizontalAlignment="Left" Margin="60,42,0,0" VerticalAlignment="Top" FontSize="16"/>
14+
<Label Content="Installed" HorizontalAlignment="Left" Margin="10,88,0,0" VerticalAlignment="Top" FontSize="18" FontWeight="Bold"/>
15+
<Label Content="Click to Launch" HorizontalAlignment="Left" Margin="88,94,0,0" VerticalAlignment="Top"/>
16+
<Button x:Name="btn1" Content="" HorizontalAlignment="Left" Margin="12,122,0,0" VerticalAlignment="Top" Height="175" Width="175" Click="Button_Click_1" Visibility="Hidden">
17+
<Button.Background>
18+
<ImageBrush ImageSource="image/csharpcol.png"/>
19+
</Button.Background>
20+
</Button>
21+
<Button x:Name="btn2" Content="" HorizontalAlignment="Left" Margin="204,122,0,0" VerticalAlignment="Top" Height="175" Width="175" Click="Button_Click_2" Visibility="Hidden">
22+
<Button.Background>
23+
<ImageBrush ImageSource="image/automod.png"/>
24+
</Button.Background>
25+
</Button>
26+
<Button x:Name="btn3" Content="Show All Installed" HorizontalAlignment="Left" Margin="563,122,0,0" VerticalAlignment="Top" Height="175" Width="175" FontSize="16" FontWeight="Bold" Background="{x:Null}" Click="Button_Click_3"/>
27+
<Button x:Name="btn6" Content="Exit" HorizontalAlignment="Left" Margin="663,351,0,0" VerticalAlignment="Top" Height="23" Width="75" Click="Button_Click"/>
28+
<Button x:Name="btn5" Content="Updates" HorizontalAlignment="Left" Margin="584,351,0,0" VerticalAlignment="Top" Height="23" Width="74" Click="btn5_Click"/>
29+
<Button x:Name="btn4" Content="About" HorizontalAlignment="Left" Margin="505,351,0,0" VerticalAlignment="Top" Height="23" Width="74" Click="btn4_Click"/>
30+
<Button x:Name="btn7" Content="" HorizontalAlignment="Left" Margin="706,314,0,0" VerticalAlignment="Top" Height="32" Width="32">
31+
<Button.Background>
32+
<ImageBrush ImageSource="image/settings.png"/>
33+
</Button.Background>
34+
</Button>
35+
<Button x:Name="btn8" Content="X-Store" HorizontalAlignment="Left" Margin="12,338,0,0" VerticalAlignment="Top" Height="36" Width="104" FontSize="16"/>
36+
<Button x:Name="btn9" Content="Archived Projects" HorizontalAlignment="Left" Margin="121,338,0,0" VerticalAlignment="Top" Height="36" Width="104"/>
37+
38+
</Grid>
39+
</Window>

NCX-Installer/MainWindow.xaml.cs

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.IO;
5+
using System.Linq;
6+
using System.Net;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
using System.Windows;
10+
using System.Windows.Controls;
11+
using System.Windows.Data;
12+
using System.Windows.Documents;
13+
using System.Windows.Input;
14+
using System.Windows.Media;
15+
using System.Windows.Media.Imaging;
16+
using System.Windows.Navigation;
17+
using System.Windows.Shapes;
18+
19+
namespace NCX_Installer
20+
{
21+
/// <summary>
22+
/// Interaction logic for MainWindow.xaml
23+
/// </summary>
24+
public partial class MainWindow : Window
25+
{
26+
static readonly string SavePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
27+
public string newstext;
28+
29+
public MainWindow()
30+
{
31+
InitializeComponent();
32+
using (WebClient wc = new WebClient())
33+
{
34+
wc.DownloadFileCompleted += DownloadCompleted;
35+
wc.DownloadFileAsync(
36+
// Param1 = Link of file
37+
new System.Uri("https://github.com/NinjaCheetah/NCX-Installer-News/releases/latest/download/newsLatest.txt"),
38+
// Param2 = Path to save
39+
System.IO.Path.Combine(SavePath, "newsLatest.txt")
40+
);
41+
}
42+
if (File.Exists("C:/Program Files/NCX/CSharp Collection/CSharpCollectionVol1.exe"))
43+
{
44+
btn1.Visibility = Visibility.Visible;
45+
}
46+
if (File.Exists("C:/Program Files/NCX/AutoMod/AutoMod.exe"))
47+
{
48+
btn2.Visibility = Visibility.Visible;
49+
}
50+
if (Settings1.Default.firstTime == true)
51+
{
52+
FirstTime1 win = new FirstTime1();
53+
win.Show();
54+
win.Topmost = true;
55+
}
56+
}
57+
58+
private void Button_Click(object sender, RoutedEventArgs e)
59+
{
60+
Environment.Exit(0);
61+
}
62+
63+
private void Button_Click_1(object sender, RoutedEventArgs e)
64+
{
65+
if (File.Exists("C:/Program Files/NCX/CSharp Collection/CSharpCollectionVol1.exe"))
66+
{
67+
Process.Start("C:/Program Files/NCX/CSharp Collection/CSharpCollectionVol1.exe");
68+
}
69+
}
70+
71+
private void Button_Click_2(object sender, RoutedEventArgs e)
72+
{
73+
if (File.Exists("C:/Program Files/NCX/AutoMod/AutoMod.exe"))
74+
{
75+
Process.Start("C:/Program Files/NCX/AutoMod/AutoMod.exe");
76+
}
77+
}
78+
79+
public void DownloadCompleted(object sender, EventArgs e)
80+
{
81+
TextReader tr = new StreamReader(System.IO.Path.Combine(SavePath, "newsLatest.txt"));
82+
string newsString = tr.ReadLine();
83+
newstext = Convert.ToString(newsString);
84+
tr.Close();
85+
label3.Content = newsString;
86+
}
87+
88+
private void Button_Click_3(object sender, RoutedEventArgs e)
89+
{
90+
Window1 win = new Window1();
91+
win.Show();
92+
Hide();
93+
}
94+
95+
private void btn5_Click(object sender, RoutedEventArgs e)
96+
{
97+
Updates win = new Updates();
98+
win.Show();
99+
Hide();
100+
}
101+
102+
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
103+
{
104+
base.OnClosing(e);
105+
Environment.Exit(0);
106+
}
107+
108+
private void btn4_Click(object sender, RoutedEventArgs e)
109+
{
110+
About win = new About();
111+
win.Show();
112+
}
113+
}
114+
}

0 commit comments

Comments
 (0)