Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-03-14 19:21:06 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-03-14 19:21:06 +0300
commite611921d01a88946b13931cf83e17713e950e96d (patch)
tree58d1c11bc33c84311a5862439aa3f31620aaff1d /WaitingClovershellForm.cs
parent56a9336cab8361650aa3190e56e1f6620e9f79c7 (diff)
Games uploading via Clovershell
Diffstat (limited to 'WaitingClovershellForm.cs')
-rw-r--r--WaitingClovershellForm.cs90
1 files changed, 90 insertions, 0 deletions
diff --git a/WaitingClovershellForm.cs b/WaitingClovershellForm.cs
new file mode 100644
index 00000000..41991175
--- /dev/null
+++ b/WaitingClovershellForm.cs
@@ -0,0 +1,90 @@
+using com.clusterrr.FelLib;
+using com.clusterrr.hakchi_gui.Properties;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Management;
+using System.Windows.Forms;
+
+namespace com.clusterrr.hakchi_gui
+{
+ public partial class WaitingClovershellForm : Form
+ {
+ public WaitingClovershellForm()
+ {
+ InitializeComponent();
+ timer.Enabled = true;
+ }
+
+ public static bool WaitForDevice()
+ {
+ if (DeviceExists()) return true;
+ var form = new WaitingClovershellForm();
+ form.ShowDialog();
+ return form.DialogResult == DialogResult.OK;
+ }
+
+ static bool DeviceExists()
+ {
+ return MainForm.Clovershell.IsOnline;
+ }
+
+ private void timer_Tick(object sender, EventArgs e)
+ {
+ if (DeviceExists())
+ {
+ DialogResult = DialogResult.OK;
+ timer.Enabled = false;
+ }
+ }
+
+ private void WaitingForm_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ if (!DeviceExists())
+ {
+ if (MessageBox.Show(this, Resources.DoYouWantCancel, Resources.AreYouSure, MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
+ == System.Windows.Forms.DialogResult.No)
+ e.Cancel = true;
+ else
+ {
+ DialogResult = DialogResult.Abort;
+ }
+ }
+ }
+
+ private void buttonDriver_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ // XP?
+ if (System.Environment.OSVersion.Version.Major == 5 && System.Environment.OSVersion.Version.Minor <= 1)
+ {
+ MessageBox.Show(this, Resources.XpZadig, "Windows XP/2000", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ var process = new Process();
+ var fileName = "http://zadig.akeo.ie/";
+ process.StartInfo.FileName = fileName;
+ process.Start();
+ }
+ else
+ {
+ var process = new Process();
+ var fileName = Path.Combine(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "driver"), "nesmini_driver.exe");
+ process.StartInfo.FileName = fileName;
+ process.Start();
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(this, ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void WaitingForm_FormClosed(object sender, FormClosedEventArgs e)
+ {
+ timer.Enabled = false;
+ }
+ }
+}
+
+