ShiftOS_TheReturn/ShiftOS.Frontend/Apps/TextPad.cs

51 lines
1.1 KiB
C#
Raw Permalink Normal View History

2017-07-19 17:06:39 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShiftOS.Engine;
namespace ShiftOS.Frontend.Apps
{
[FileHandler("TextPad", ".txt", "")]
[DefaultTitle("TextPad")]
[WinOpen("textpad")]
[Launcher("TextPad", false, null, "Accessories")]
public class TextPad : GUI.Control, IShiftOSWindow, IFileHandler
{
private TerminalControl contentsLabel = null;
public TextPad()
{
contentsLabel = new TerminalControl();
contentsLabel.Dock = GUI.DockStyle.Fill;
contentsLabel.PerformTerminalBehaviours = false;
2017-07-19 17:06:39 +00:00
AddControl(contentsLabel);
}
public void OnLoad()
{
}
public void OnSkinLoad()
{
}
public bool OnUnload()
{
return true;
}
public void OnUpgrade()
{
}
public void OpenFile(string file)
{
contentsLabel.Text = Objects.ShiftFS.Utils.ReadAllText(file);
2017-07-19 17:06:39 +00:00
AppearanceManager.SetupWindow(this);
}
}
}