1
0
mirror of synced 2024-12-11 07:16:05 +01:00
Switch-Toolbox/File_Format_Library/GUI/KeySelection.cs
KillzXGaming 7cf2e9c571 Cleanup
2019-07-16 17:45:10 -04:00

66 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Toolbox.Library.Forms;
using LibHac;
namespace Toolbox
{
public partial class KeySelectionForm : STForm
{
public KeySelectionForm()
{
InitializeComponent();
}
public string ProdKeyPath;
public string TitleKeyPath;
private void setProdKeyPath_Click(object sender, EventArgs e)
{
ProdKeyPath = GetOpenedFileName();
TextBoxProdKeyPath.Text = ProdKeyPath;
if (File.Exists(ProdKeyPath))
TextBoxProdKeyPath.BackColor = Color.White;
CheckKeys();
}
private void setTitleKeyPath_Click(object sender, EventArgs e)
{
TitleKeyPath = GetOpenedFileName();
TextBoxTitleKey.Text = TitleKeyPath;
if (File.Exists(TitleKeyPath))
TextBoxTitleKey.BackColor = Color.White;
CheckKeys();
}
private void CheckKeys()
{
if (File.Exists(ProdKeyPath) && File.Exists(TitleKeyPath))
btnOk.Enabled = true;
else
btnOk.Enabled = false;
}
private string GetOpenedFileName()
{
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == DialogResult.OK)
return ofd.FileName;
else return null;
}
private void btnOk_Click(object sender, EventArgs e)
{
}
}
}