diff options
| author | FloppyDiskDrive <[email protected]> | 2017-11-05 14:13:06 -0600 |
|---|---|---|
| committer | FloppyDiskDrive <[email protected]> | 2017-11-05 14:13:06 -0600 |
| commit | 019da5b9ebf67b758a31dd05c4b17de66fa682f2 (patch) | |
| tree | 9d2341a1e9ab8fe1216800265d70a18f5e7ac762 /ShiftOS.Main/ShiftOS/Apps/TextPad.cs | |
| parent | 70ccdd214ed90d7d3ec3b5c1f9d0e4414fbe4987 (diff) | |
| download | shiftos-rewind-019da5b9ebf67b758a31dd05c4b17de66fa682f2.tar.gz shiftos-rewind-019da5b9ebf67b758a31dd05c4b17de66fa682f2.tar.bz2 shiftos-rewind-019da5b9ebf67b758a31dd05c4b17de66fa682f2.zip | |
Began to add textpad, extra functionality to the infobox template
Diffstat (limited to 'ShiftOS.Main/ShiftOS/Apps/TextPad.cs')
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Apps/TextPad.cs | 54 |
1 files changed, 54 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..6c091df --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/TextPad.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.IO; +using ShiftOS.Engine; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + public partial class TextPad : UserControl + { + string editedText; + public TextPad() + { + InitializeComponent(); + editedText = textBox.Text; + } + private bool isEdited(string editedString) + { + editedString = editedText; + if(editedString != textBox.Text) + { + return true; + } + else + { + return false; + } + } + + private void openToolStripMenuItem_Click(object sender, EventArgs e) + { + if (openFileDialog1.ShowDialog() == DialogResult.OK) + { + var sr = new StreamReader(openFileDialog1.FileName); + textBox.Text = sr.ReadToEnd(); + sr.Close(); + } + } + + private void newToolStripMenuItem_Click(object sender, EventArgs e) + { + if (isEdited(textBox.Text)) + { + MessageBox.Show("yay it works"); + } + } + } +} |
