This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var matches = Regex.Matches(content, @"<exec cmd=\""(?<command>.+?)\"">(?<label>.+?)</exec>"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dispatcher.InvokeAsync(() => ContentTextBox.ScrollToEnd(), DispatcherPriority.ApplicationIdle); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class DmlCommand : ICommand | |
{ | |
private readonly Action _command; | |
public DmlCommand(Action command) | |
{ | |
_command = command; | |
} | |
public event EventHandler CanExecuteChanged; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private readonly IDbgConsole _console; | |
public CommandControl(IDbgConsole console, IHistoryManager historyManager, string content) | |
{ | |
_console = console; | |
InitializeComponent(); | |
AppendDmlOutput(content); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async void CommandTextBox_KeyDown(object sender, KeyEventArgs e) | |
{ | |
if (e.Key == Key.Return) | |
{ | |
var textBox = (TextBox)sender; | |
if (string.IsNullOrWhiteSpace(textBox.Text)) | |
{ | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DllExport("compileandrun")] | |
public static void Script(IntPtr client, [MarshalAs(UnmanagedType.LPStr)] string args) | |
{ | |
if (!InitApi(client)) | |
{ | |
return; | |
} | |
try | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Starvation | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Starvation | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |