Example #1
0
        private void OnTransformInput(ref TerminalLine terminalLine)
        {
            if (terminalLine.IsSystem)
            {
                return;
            }

            foreach (Interfaces.ITerminalTransformInput transformInput in TerminalTransformInputs)
            {
                foreach (string pattern in transformInput.Pattern)
                {
                    terminalLine.Text = OnReplace(terminalLine.Text, pattern, transformInput.Replacement.ToString());
                }
            }
        }
Example #2
0
        public void AddLine(TerminalLine terminalLine)
        {
            string commandOnly = terminalLine.Text.TrimStart();

            InputHistory.Add(commandOnly);
            OnTransformInput(ref terminalLine);

            var line = terminalLine;

            if (!line.IsSystem)
            {
                if (!string.IsNullOrWhiteSpace(ActiveNamespace))
                {
                    line.Text = GetActiveDisplayNamespace() + line.Text;
                }
            }

            TerminalLines.Insert(TerminalLines.Count - 1, line);
            OnCheckForKnownCommands(commandOnly);
        }