This file contains 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 Dumpify; | |
Enumerable.Range(0, 10) | |
.Where(i => i % 2 == 0) | |
.Select(i => i == 6 ? throw new Exception("Oops") : i) | |
.Select(i => i * 2) | |
.CatchExceptions(ex => ex.Dump()) | |
.Dump(); | |
public static class TryCatchExtensions |
This file contains 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 Dumpify; | |
Enumerable.Range(0, 10) | |
.Where(i => i % 2 == 0) | |
.Select(i => i == 6 ? throw new Exception("Oops") : i) | |
.Select(i => i * 2) | |
.CatchExceptions(ex => ex.Dump()) | |
.Dump(); | |
public static class TryCatchExtensions |
This file contains 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
async Task Main() | |
{ | |
var queues = new AsyncQueue<int>[] | |
{ | |
new (100, TimeSpan.FromSeconds(1), Increment), | |
new (200, TimeSpan.FromSeconds(2), Increment), | |
new (300, TimeSpan.FromSeconds(3), Increment), | |
new (400, TimeSpan.FromSeconds(4), Increment), | |
}; | |
This file contains 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 Microsoft.AspNetCore.SignalR.Client; | |
using Microsoft.Extensions.Logging; | |
using System; | |
using System.Threading.Tasks; | |
namespace SignalRConsoleClient | |
{ | |
public static class Program | |
{ | |
public static async Task Main(string[] args) |
This file contains 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
void Main(string[] args) | |
{ | |
var mainTitle = args?.FirstOrDefault(); | |
var secondaryTitle = args?.Skip(1).FirstOrDefault(); | |
var processName = args?.Skip(2).FirstOrDefault(); | |
//Example | |
//(mainTitle, secondaryTitle, processName) = ("TechCrunch", "Startup", "chrome"); | |
This file contains 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
[assembly: DebuggerTypeProxy(typeof(ScientistTypeProxy), Target = typeof(Scientist))] | |
[assembly: DebuggerDisplay("Name: {Name}, Birthday: {Birthday}", Target = typeof(Scientist))] | |
[assembly: DebuggerVisualizer(typeof(ScientistVisualizer), Target = typeof(Scientist))] | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var scientists = new[] |
This file contains 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.Collections.Generic; | |
using System.Diagnostics.Contracts; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
namespace WPFLayoutTests |
This file contains 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 KnownTypes.Fody; | |
namespace AssemblyToProcess | |
{ | |
[KnowsDeriveTypes] | |
public class A | |
{ | |
} | |
public class B : A |
This file contains 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.IO; | |
using System.Reflection; | |
using System.Runtime.Serialization; | |
using KnownTypes.Fody; | |
using Mono.Cecil; | |
using NUnit.Framework; | |
[TestFixture] | |
public class WeaverTests |
This file contains 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
//For testing purposes...throws exception once per <ThrowExceptionForCount> | |
public class ExceptionThrowerAppender : ConsoleAppender | |
{ | |
public int ThrowExceptionForCount { get; set; } = 1; | |
private int _count; | |
public ExceptionThrowerAppender() | |
{ | |
ErrorHandler = new PropogateErrorHandler(); | |
} |
NewerOlder