2017-11-19 11:21:34 -05:00
|
|
|
|
using ShiftOS.Engine.ShiftFS.FileGUI;
|
|
|
|
|
using ShiftOS.Engine.WindowManager;
|
|
|
|
|
using System;
|
2017-11-05 15:13:06 -05:00
|
|
|
|
using System.IO;
|
2017-11-05 18:47:46 -05:00
|
|
|
|
using System.Windows.Forms;
|
2017-11-05 15:13:06 -05:00
|
|
|
|
|
2018-12-23 20:15:07 -05:00
|
|
|
|
namespace ShiftOS.Main.Apps
|
2017-11-05 15:13:06 -05:00
|
|
|
|
{
|
2017-11-05 18:47:46 -05:00
|
|
|
|
public partial class TextPad : UserControl
|
|
|
|
|
{
|
|
|
|
|
readonly string _editedText;
|
|
|
|
|
|
|
|
|
|
public TextPad()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
_editedText = textBox.Text;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IsEdited() => _editedText != textBox.Text;
|
2017-11-05 15:13:06 -05:00
|
|
|
|
|
2017-11-05 18:47:46 -05:00
|
|
|
|
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();
|
|
|
|
|
}
|
2017-11-05 15:13:06 -05:00
|
|
|
|
|
2017-11-05 18:47:46 -05:00
|
|
|
|
void newToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (IsEdited())
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("yay it works");
|
|
|
|
|
}
|
2017-11-19 11:21:34 -05:00
|
|
|
|
var f = new FileOpener();
|
|
|
|
|
ShiftWM.Init(f, "testing", null);
|
2017-11-05 18:47:46 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|