aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Main/ShiftOS/Apps/TextPad.cs
diff options
context:
space:
mode:
authorAShifter <[email protected]>2017-11-17 20:29:46 -0700
committerAShifter <[email protected]>2017-11-17 20:29:46 -0700
commitebdc09fe679b4b06fd149c8fc6539244100ce896 (patch)
tree65dfe45bbfd194ddb534cc80107ab8e6d80cf5bc /ShiftOS.Main/ShiftOS/Apps/TextPad.cs
parent1d0b393e6969d9671daead8049973a374421046f (diff)
parent97722fbe9d474adffbba0b92e9727c48a8205234 (diff)
downloadshiftos-rewind-ebdc09fe679b4b06fd149c8fc6539244100ce896.tar.gz
shiftos-rewind-ebdc09fe679b4b06fd149c8fc6539244100ce896.tar.bz2
shiftos-rewind-ebdc09fe679b4b06fd149c8fc6539244100ce896.zip
Merge remote-tracking branch 'refs/remotes/ShiftOS-Rewind/master'
Diffstat (limited to 'ShiftOS.Main/ShiftOS/Apps/TextPad.cs')
-rw-r--r--ShiftOS.Main/ShiftOS/Apps/TextPad.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/ShiftOS.Main/ShiftOS/Apps/TextPad.cs b/ShiftOS.Main/ShiftOS/Apps/TextPad.cs
new file mode 100644
index 0000000..e86b1be
--- /dev/null
+++ b/ShiftOS.Main/ShiftOS/Apps/TextPad.cs
@@ -0,0 +1,36 @@
+using System;
+using System.IO;
+using System.Windows.Forms;
+
+namespace ShiftOS.Main.ShiftOS.Apps
+{
+ public partial class TextPad : UserControl
+ {
+ readonly string _editedText;
+
+ public TextPad()
+ {
+ InitializeComponent();
+ _editedText = textBox.Text;
+ }
+
+ bool IsEdited() => _editedText != textBox.Text;
+
+ void openToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
+
+ var sr = new StreamReader(openFileDialog1.FileName);
+ textBox.Text = sr.ReadToEnd();
+ sr.Close();
+ }
+
+ void newToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (IsEdited())
+ {
+ MessageBox.Show("yay it works");
+ }
+ }
+ }
+} \ No newline at end of file