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.Data; | |
using System.Data.Entity; | |
using System.Diagnostics; | |
public class Animal | |
{ | |
public long Id { get; set; } | |
} | |
public class Dog : Animal |
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.Linq; | |
public static class Parser | |
{ | |
public static readonly IDictionary<Type, Func<string, object>> Parsers = | |
new Dictionary<Type, Func<string, object>> | |
{ | |
{typeof (char), source => char.Parse(source)}, |
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
<Window x:Class="StoryboardDemo.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" Height="350" Width="525"> | |
<Grid> | |
<TextBlock x:Name="CountdownDisplay" FontFamily="Calibri" FontSize="60"/> | |
</Grid> | |
</Window> |
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.Data; | |
using System.Data.SqlClient; | |
using System.Dynamic; | |
public class DynamicSqlDataReader | |
{ | |
private static dynamic ToExpando(IDataRecord record) | |
{ |
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; | |
using System.Messaging; | |
using NLog; | |
/// <summary> | |
/// A facade over Microsoft's MSMQ | |
/// </summary> | |
public abstract class QueuedService : IDisposable |
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
// Yeah, this is crazy, right? Stupid Visual Studio test runner... | |
var testPathReplacer = new System.Text.RegularExpressions.Regex(@"\\(?:(TestResults\\[^\\]*\\Out)|([^\\]*\\bin\\[^\\]*))"); | |
var assemblyDirectory = Path.GetDirectoryName(GetType().Assembly.Location); | |
assemblyDirectory = testPathReplacer.Replace(assemblyDirectory, string.Empty); | |
assemblyDirectory = Path.Combine(assemblyDirectory, PROJECT_DIRECTORY); |
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
private static void PromoteElementToAttribute(XElement element, string xname) | |
{ | |
var names = element.Descendants(xname).ToArray(); | |
foreach(var name in names) | |
{ | |
if (name != null && name.Parent != null) | |
{ | |
name.Parent.SetAttributeValue(xname, name.Value); | |
name.Remove(); | |
} |
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.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using System.Web.Mvc; | |
using MarkdownDeep; | |
public class MarkdownRazorViewEngine : RazorViewEngine | |
{ |
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.Web; | |
using System.Web.Hosting; | |
using System.IO; | |
public class InMemoryAspNet | |
{ | |
public string PhysicalDirectory { get; set; } | |
public InMemoryAspNet() |
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
public struct ControlCommand | |
{ | |
public static readonly ControlCommand Message = 0; | |
private readonly int _value; | |
public ControlCommand(int value) | |
{ | |
_value = value; | |
} |