Skip to content

Commit

Permalink
get wpf app vaguely working again, back to delaying on writing escape…
Browse files Browse the repository at this point in the history
… sequence parser
  • Loading branch information
doubleyewdee committed Nov 14, 2018
1 parent baea9c1 commit 4315430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 7 additions & 5 deletions src/condo/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
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;

/// <summary>
/// Interaction logic for App.xaml
/// </summary>
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;
}
Expand Down
5 changes: 2 additions & 3 deletions src/condo/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -48,13 +45,15 @@ 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;
this.stuff.Width = stuffSize.Width;

this.characters = new ConsoleBuffer.Character[this.console.Height, this.console.Width];
this.Redraw();
this.console.PropertyChanged += this.UpdateContents;
}

private void Redraw()
Expand Down

0 comments on commit 4315430

Please sign in to comment.