From 0925e5a05924e9d74acfb07ce39771cd05e07786 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Thu, 23 Nov 2017 18:25:57 +0000 Subject: [PATCH] Cleaned up that messy Clear function --- ShiftOS.Main/ShiftOS.Main.csproj | 2 +- ShiftOS.Main/Terminal/Commands/clear.cs | 8 +++----- ShiftOS.Main/Terminal/TerminalCommand.cs | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ShiftOS.Main/ShiftOS.Main.csproj b/ShiftOS.Main/ShiftOS.Main.csproj index 59351a4..4098fc9 100644 --- a/ShiftOS.Main/ShiftOS.Main.csproj +++ b/ShiftOS.Main/ShiftOS.Main.csproj @@ -99,7 +99,7 @@ Desktop.cs - + diff --git a/ShiftOS.Main/Terminal/Commands/clear.cs b/ShiftOS.Main/Terminal/Commands/clear.cs index cbabf88..c7c7d64 100644 --- a/ShiftOS.Main/Terminal/Commands/clear.cs +++ b/ShiftOS.Main/Terminal/Commands/clear.cs @@ -7,18 +7,16 @@ using System.Threading.Tasks; namespace ShiftOS.Main.Terminal.Commands { - public class clear : TerminalCommand + public class Clear : TerminalCommand { public override string Name { get; } = "clear"; public override string Summary { get; } = "Clears all text from the terminal."; public override string Usage { get; } = "clear"; public override bool Unlocked { get; set; } = false; - public static List trm = TerminalBackend.trm; + public override void Run(params string[] parameters) { - ShiftOS.Apps.Terminal trm = Array.Find(TerminalBackend.trm.ToArray(), w => w.TerminalID == TermID); - - trm.Clear(); + Clear(); } } } diff --git a/ShiftOS.Main/Terminal/TerminalCommand.cs b/ShiftOS.Main/Terminal/TerminalCommand.cs index 245f380..1aeb845 100644 --- a/ShiftOS.Main/Terminal/TerminalCommand.cs +++ b/ShiftOS.Main/Terminal/TerminalCommand.cs @@ -88,12 +88,12 @@ namespace ShiftOS.Main.Terminal // Input.Start(); // return Input; //} + /// /// Clears all text from the terminal. /// public virtual void Clear() { - ShiftOS.Apps.Terminal trm = Array.Find(TerminalBackend.trm.ToArray(), w => w.TerminalID == TermID); trm.Clear();