2021-03-04 11:25:36 +03:00
|
|
|
|
using ProxySU_Core.Models;
|
|
|
|
|
using System;
|
2021-02-25 04:59:06 +03:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace ProxySU_Core.ViewModels
|
|
|
|
|
{
|
2021-03-04 11:25:36 +03:00
|
|
|
|
public class Terminal : BaseViewModel
|
2021-02-25 04:59:06 +03:00
|
|
|
|
{
|
|
|
|
|
private string outputText;
|
|
|
|
|
|
|
|
|
|
public Terminal(Host host)
|
|
|
|
|
{
|
|
|
|
|
Host = host;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Host Host { get; set; }
|
|
|
|
|
|
|
|
|
|
public string CommandText { get; set; }
|
|
|
|
|
|
|
|
|
|
public string OutputText
|
|
|
|
|
{
|
|
|
|
|
get => outputText;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ClearOutput()
|
|
|
|
|
{
|
|
|
|
|
outputText = "";
|
|
|
|
|
Notify("OutputText");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddOutput(string text)
|
|
|
|
|
{
|
|
|
|
|
outputText += text;
|
|
|
|
|
|
|
|
|
|
if (!text.EndsWith("\n"))
|
|
|
|
|
{
|
|
|
|
|
outputText += "\n";
|
|
|
|
|
}
|
|
|
|
|
Notify("OutputText");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|