This works with an abstract class:
Base class:
/// <summary>
/// Handles the Administration Form API backend tasks
/// </summary>
[Route("api/LocalizationAdministration")]
[UnhandledApiExceptionFilter]
// works in LinqPad | |
void Main() | |
{ | |
ExecuteCommandLine("wt"); // works - this is resolved | |
ExecuteCommandLine("bash"); // The system cannot find the file specified | |
// actual command line I'm trying to fire | |
ExecuteCommandLine("bash -c \"cd /mnt/c/projects/Test/jekyll/help; bundle exec jekyll serve\""); | |
} |
[TestMethod] | |
public void BitmapWpfPngSaveTest() | |
{ | |
Assert.IsTrue(System.Windows.Clipboard.ContainsImage(), "No image on clipboard"); | |
string of = "c:\\temp\\test_Bitmap.png"; | |
var bmpSource = System.Windows.Clipboard.GetImage(); | |
using (var fileStream = new FileStream(of, FileMode.Create)) |
void Main() | |
{ | |
var msg = $".NET Version: {Environment.Version.ToString()}"; | |
msg.Dump(); | |
StringFormat(); | |
BasicInterpolation(); | |
MultiLine(); |
This works with an abstract class:
Base class:
/// <summary>
/// Handles the Administration Form API backend tasks
/// </summary>
[Route("api/LocalizationAdministration")]
[UnhandledApiExceptionFilter]
void Main() | |
{ | |
string file = @"C:\temp\test.md"; | |
OpenFileInTextEditorRegistry(file); | |
//OpenEditorWithShellExecute(file); | |
//OpenWithProcessStartFailed(file); | |
} |
Defender's real time protection can significantly slow down disk and IO bound operations on Windows, so if you're doing disk intensive work or stress tests I find turning off Defenders Real Time Protection can improve performance drastically.
The following Powershell script provides a quick way to turn Powershell Real Time protection on and off quickly. Dump this file into a folder on your path to quickly turn.
##################################################
# Turn Defender Real Time Monitoring off
# turns defender real time monitoring -on or -off
# Has to run under an Admin prompt
public override void OnExecute(object sender) | |
{ | |
var editor = GetMarkdownEditor(); | |
if (editor == null) | |
return; | |
var gist = new GistItem() | |
{ | |
code = editor.AceEditor.getselection(false), | |
language = "cs" |
/// <summary> | |
/// Converts a bitmap source to a bitmap | |
/// Make sure to dispose the bitmap | |
/// </summary> | |
/// <param name="source"></param> | |
/// <returns></returns> | |
public static Bitmap BitmapSourceToBitmap(BitmapSource source) | |
{ | |
if (source == null) | |
return null; |
public void ImageSharpClipboardTest() | |
{ | |
string of = "c:\\temp\\test_imagesharp.png"; | |
Assert.IsTrue(Clipboard.ContainsImage(), "No image on clipboard"); | |
var img = Clipboard.GetImage(); | |
ImageConverter converter = new ImageConverter(); | |
byte[] bytes = (byte[])converter.ConvertTo(img, typeof(byte[])); |
[Registry] | |
; File Association for .md and .markdown | |
Root: HKCR; Subkey: ".md"; ValueData: "{#MyAppName}"; Flags: uninsdeletevalue; ValueType: string; ValueName: "" | |
Root: HKCR; Subkey: ".markdown"; ValueData: "{#MyAppName}"; Flags: uninsdeletevalue; ValueType: string; ValueName: "" | |
Root: HKCR; Subkey: "{#MyAppName}"; ValueData: "Program {#MyAppName}"; Flags: uninsdeletekey; ValueType: string; ValueName: "" | |
Root: HKCR; Subkey: "{#MyAppName}\DefaultIcon"; ValueData: "{app}\{#MyAppExeName},0"; ValueType: string; ValueName: "" | |
Root: HKCR; Subkey: "{#MyAppName}\shell\open\command"; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; ValueType: string; ValueName: "" |