diff --git a/ShiftOS.WinForms/Applications/Shiftnet.cs b/ShiftOS.WinForms/Applications/Shiftnet.cs index 22eeec1..af14f27 100644 --- a/ShiftOS.WinForms/Applications/Shiftnet.cs +++ b/ShiftOS.WinForms/Applications/Shiftnet.cs @@ -35,36 +35,33 @@ using ShiftOS.Engine; using Newtonsoft.Json; using static ShiftOS.Engine.SkinEngine; -namespace ShiftOS.WinForms.Applications -{ +namespace ShiftOS.WinForms.Applications { [Launcher("Shiftnet", false, null, "Networking")] [DefaultIcon("iconShiftnet")] - public partial class Shiftnet : UserControl, IShiftOSWindow - { - public Shiftnet() - { + public partial class Shiftnet : UserControl, IShiftOSWindow { + public Shiftnet() { InitializeComponent(); - ServerManager.MessageReceived += (msg) => - { - try - { - if (msg.Name == "shiftnet_file") - { - this.Invoke(new Action(() => - { - wbcanvas.DocumentText = ConstructHtml(msg.Contents); - })); + ServerManager.MessageReceived += (msg) => { + try { + if (msg.Name == "shiftnet_file") { + if (Objects.ShiftFS.Utils.FileExists("0:/md.txt")) { + this.Invoke(new Action(() => { + wbcanvas.DocumentText = ConstructHtml(Objects.ShiftFS.Utils.ReadAllText("0:/md.txt")); + })); + } else { + this.Invoke(new Action(() => + { + wbcanvas.DocumentText = ConstructHtml(msg.Contents); + })); + } } - } - catch - { + } catch { } }; } - public string ConstructHtml(string markdown) - { + public string ConstructHtml(string markdown) { string html = $@"