diff --git a/src/condo/App.xaml.cs b/src/condo/App.xaml.cs index a3c5eac..1863066 100644 --- a/src/condo/App.xaml.cs +++ b/src/condo/App.xaml.cs @@ -1,9 +1,10 @@ -using System; -using System.Threading.Tasks; -using System.Windows; - -namespace condo +namespace condo { + using System; + using System.IO; + using System.Threading.Tasks; + using System.Windows; + /// /// Interaction logic for App.xaml /// @@ -11,6 +12,7 @@ public partial class App : Application { public App() { + ConsoleBuffer.Logger.Init(Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), @"Source\Repos\wincon\wincon.log")); AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; } diff --git a/src/condo/MainWindow.xaml.cs b/src/condo/MainWindow.xaml.cs index 41863a3..b3930b8 100644 --- a/src/condo/MainWindow.xaml.cs +++ b/src/condo/MainWindow.xaml.cs @@ -20,10 +20,7 @@ public MainWindow() InitializeComponent(); this.Loaded += this.OnLoaded; - - this.console = TerminalManager.Instance.GetOrCreate(0, "ping -t localhost"); System.Diagnostics.Debugger.Launch(); - this.console.PropertyChanged += this.UpdateContents; } private void UpdateContents(object sender, PropertyChangedEventArgs args) @@ -48,6 +45,7 @@ private Size DetermineSize() private void OnLoaded(object sender, RoutedEventArgs e) { this.dpiInfo = VisualTreeHelper.GetDpi(this); + this.console = TerminalManager.Instance.GetOrCreate(0, "ping -t localhost"); var stuffSize = this.DetermineSize(); this.stuff.Height = stuffSize.Height; @@ -55,6 +53,7 @@ private void OnLoaded(object sender, RoutedEventArgs e) this.characters = new ConsoleBuffer.Character[this.console.Height, this.console.Width]; this.Redraw(); + this.console.PropertyChanged += this.UpdateContents; } private void Redraw()