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
bool IsAppHarbor | |
{ | |
get { return !string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["appharbor.commit_id"]); } | |
} |
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; | |
public static class EventHandlerExtensions | |
{ | |
public static void SafeInvoke(this EventHandler handler, EventArgs args = null, object sender = null) | |
{ | |
if (handler != null) | |
handler(sender, args ?? EventArgs.Empty); | |
} |
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; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class ConcurrentList<T> : ICollection<T> | |
{ | |
private readonly ConcurrentDictionary<T, object> _store; |
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.Messaging; | |
using System.Text; | |
using Newtonsoft.Json; | |
public class JsonMessageFormatter : IMessageFormatter | |
{ | |
private static readonly JsonSerializerSettings DefaultSerializerSettings = | |
new JsonSerializerSettings { |
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; | |
} |
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
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
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
// 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
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 |