Example #1
0
 public void EndSession()
 {
     ConControl.Invoke(() =>
     {
         ConControl.Cout.PrintLine();
         ConControl.Cout.PrintLine(String.Format("Session ended. Session taken: {0}", DateTime.Now - sessionStart));
         ConControl.Cout.GetScintilla().ReadOnly = true;
         System.Console.Out.Dispose();
         System.Console.In.Dispose();
         System.Console.SetOut(conOut);
         System.Console.SetIn(conIn);
     });
     OnContentChanged(ViewEventArgs.None);
 }
Example #2
0
 public void StartSession(ConsoleSessionInfo sessionInfo)
 {
     ConControl.Invoke(() =>
     {
         ConControl.Cout.Clear();
         ConControl.Cout.GetScintilla().ReadOnly = false;
         conOut = System.Console.Out;
         conIn  = System.Console.In;
         System.Console.SetOut(new ConsoleTextWriter(ConControl.Cout));
         System.Console.SetIn(new ConsoleTextReader(ConControl.Cout));
         ConControl.Cout.PrintHeader(sessionInfo.Banner);
     });
     sessionStart = DateTime.Now;
     OnContentChanged(new ViewEventArgs(true, sessionInfo.SessionName));
 }