aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Main/ShiftOS/Apps/TextPad.cs
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-11-18 16:29:54 +0000
committerAlex-TIMEHACK <[email protected]>2017-11-18 16:29:54 +0000
commit4037be53b29a122732cfc10693e9c0027f606bb0 (patch)
tree8533ea9ee0ac8f5f7f696b85cb039f783657ada0 /ShiftOS.Main/ShiftOS/Apps/TextPad.cs
parent65b7ac2b8cbc4478f6d31a21f106048aeb075078 (diff)
parent97722fbe9d474adffbba0b92e9727c48a8205234 (diff)
downloadshiftos-rewind-4037be53b29a122732cfc10693e9c0027f606bb0.tar.gz
shiftos-rewind-4037be53b29a122732cfc10693e9c0027f606bb0.tar.bz2
shiftos-rewind-4037be53b29a122732cfc10693e9c0027f606bb0.zip
Updated my fork!
Conflicts: ShiftOS.Engine/ShiftOS.Engine.csproj ShiftOS.Engine/Terminal/Commands/Hello.cs ShiftOS.Engine/Terminal/TerminalBackend.cs ShiftOS.Engine/Terminal/TerminalCommand.cs ShiftOS.Main/ShiftOS.Main.csproj ShiftOS.Main/ShiftOS/Apps/Terminal.cs ShiftOS.Main/ShiftOS/Desktop.cs
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