diff options
| author | AShifter <[email protected]> | 2017-05-02 19:43:15 -0600 |
|---|---|---|
| committer | AShifter <[email protected]> | 2017-05-02 19:43:15 -0600 |
| commit | b06801028acc3b3da80ef5077abe8f0baaa82dac (patch) | |
| tree | 5c65cccdd17f8d89125841663749cbaf970ed52a /ShiftOS.WinForms/Applications/TriWrite.cs | |
| parent | bbb21a1b32ff2642eb3f9804ef653e57a8be7e41 (diff) | |
| parent | 8381c825b1c6d4d47af23e9461ece4f4a1f88cc5 (diff) | |
| download | shiftos_thereturn-b06801028acc3b3da80ef5077abe8f0baaa82dac.tar.gz shiftos_thereturn-b06801028acc3b3da80ef5077abe8f0baaa82dac.tar.bz2 shiftos_thereturn-b06801028acc3b3da80ef5077abe8f0baaa82dac.zip | |
Merge remote-tracking branch 'refs/remotes/shiftos-game/master'
Diffstat (limited to 'ShiftOS.WinForms/Applications/TriWrite.cs')
| -rw-r--r-- | ShiftOS.WinForms/Applications/TriWrite.cs | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/ShiftOS.WinForms/Applications/TriWrite.cs b/ShiftOS.WinForms/Applications/TriWrite.cs index 90add8d..6fb814f 100644 --- a/ShiftOS.WinForms/Applications/TriWrite.cs +++ b/ShiftOS.WinForms/Applications/TriWrite.cs @@ -1,15 +1,14 @@ -using System; +using ShiftOS.Objects.ShiftFS; +using System; using System.Collections.Generic; using System.ComponentModel; -using System.Drawing; using System.Data; +using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using ShiftOS.Engine; -using static ShiftOS.Objects.ShiftFS.Utils; -using Newtonsoft.Json; namespace ShiftOS.WinForms.Applications { @@ -20,9 +19,44 @@ namespace ShiftOS.WinForms.Applications public partial class TriWrite : UserControl, IShiftOSWindow { - public void OnLoad() + public TriWrite() + { + InitializeComponent(); + } + + private void newToolStripMenuItem_Click(object sender, EventArgs e) { + txtcontents.Text = ""; + } + + private void openToolStripMenuItem_Click(object sender, EventArgs e) + { + var txt = new List<string>(); + txt.Add(".txt"); + AppearanceManager.SetupDialog(new FileDialog(txt.ToArray(), FileOpenerStyle.Open, new Action<string>((file) => this.LoadFile(file)))); + } + + public void LoadFile(string file) + { + txtcontents.Text = Utils.ReadAllText(file); + } + + public void SaveFile(string file) + { + Utils.WriteAllText(file, txtcontents.Text); + } + + private void saveToolStripMenuItem_Click(object sender, EventArgs e) + { + var txt = new List<string>(); + txt.Add(".txt"); + + AppearanceManager.SetupDialog(new FileDialog(txt.ToArray(), FileOpenerStyle.Save, new Action<string>((file) => this.SaveFile(file)))); + } + + public void OnLoad() + { } public void OnSkinLoad() |
