Instantly share code, notes, and snippets.

View StringBuffer.cs
/*
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, with no condition.
*/
View WebServer.cs
/// ProcessRequest is called for every new request
public void ProcessRequest()
{
DoSomethingAsync().Wait();
}
View Program.cs
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Starvation
{
class Program
{
static void Main(string[] args)
{
View Program.cs
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Starvation
{
class Program
{
static void Main(string[] args)
{
View Program.cs
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Starvation
{
class Program
{
static void Main(string[] args)
{
View Program.cs
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Starvation
{
class Program
{
static void Main(string[] args)
{
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);
}