View Runner.cs
[DllExport("compileandrun")]
public static void Script(IntPtr client, [MarshalAs(UnmanagedType.LPStr)] string args)
{
if (!InitApi(client))
{
return;
}
try
{
View CommandControl.xaml.cs
private async void CommandTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return)
{
var textBox = (TextBox)sender;
if (string.IsNullOrWhiteSpace(textBox.Text))
{
return;
}
View CommandControl.xaml.cs
private async Task ExecuteCommand(string command)
{
ContentTextBox.Document.Blocks.Add(new Paragraph(new Run(command)));
ContentTextBox.ScrollToEnd();
var result = await _console.ExecuteCommandAndCaptureOutputAsync(command);
_historyManager.LogCommand(command, result);
AppendDmlOutput(result);
View CommandControl.xaml.cs
private readonly IDbgConsole _console;
public CommandControl(IDbgConsole console, IHistoryManager historyManager, string content)
{
_console = console;
InitializeComponent();
AppendDmlOutput(content);
}
View CommandControl.xaml.cs
private class DmlCommand : ICommand
{
private readonly Action _command;
public DmlCommand(Action command)
{
_command = command;
}
public event EventHandler CanExecuteChanged;
View CommandControl.xaml.cs
Dispatcher.InvokeAsync(() => ContentTextBox.ScrollToEnd(), DispatcherPriority.ApplicationIdle);
View CommandControl.xaml.cs
int index = 0;
foreach (Match match in matches)
{
paragraph.Inlines.Add(new Run(System.Net.WebUtility.HtmlDecode(content.Substring(index, match.Index - index))));
var hyperLink = new Hyperlink(new Run(match.Groups["label"].Value));
var command = match.Groups["command"].Value;
View CommandControl.xaml.cs
var matches = Regex.Matches(content, @"<exec cmd=\""(?<command>.+?)\"">(?<label>.+?)</exec>");
View CommandControl.xaml.cs
private void AppendDmlOutput(string content)
{
var paragraph = new Paragraph();
ContentTextBox.Document.Blocks.Add(paragraph);
View CommandControl.xaml
<UserControl x:Class="WinDbgExt.History.CommandControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />