This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.Web.Mvc; | |
| using System.Web.Mvc.Html; | |
| public static class HtmlHelperEnumExtensions | |
| { | |
| public static IHtmlString EnumDropDownListFor<TModel, TEnum>(this HtmlHelper<TModel> helper, Expression<Func<TModel, TEnum>> field, TEnum selectedValue = default(TEnum)) | |
| where TEnum : struct | |
| { | |
| var name = (field.Body as MemberExpression).Member.Name; |
This file contains hidden or 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.Web.Script.Serialization; | |
| public class Roles : List<Role> | |
| { | |
| public Roles(IEnumerable<Role> roles = null) | |
| : base(roles ?? Enumerable.Empty<Role>()) |
This file contains hidden or 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
| function status() { | |
| if(Test-Path .svn) { | |
| Write-Host | |
| svn status | |
| Write-Host | |
| } | |
| if(Test-Path .git) { | |
| git status | |
| } |
This file contains hidden or 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
| param($installPath, $toolsPath, $package, $project) | |
| Write-Host "Setting Application to DowJones.Web.Mvc.HttpApplication..." | |
| # Read the transformed text from the custom template included in the package | |
| $customGlobalAsax = $project.ProjectItems | where { $_.Name -eq "Global.asax.cs.custom" } | |
| $customGlobalAsax.Open() | |
| $customGlobalAsax.Document.Activate() | |
| $customGlobalAsax.Document.Selection.SelectAll(); | |
| $replacementGlobalAsax = $customGlobalAsax.Document.Selection.Text; |
This file contains hidden or 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.Mvc; | |
| public static class UrlExtensions | |
| { | |
| public static string ExternalAction(this UrlHelper url, string actionName, string controllerName, object routeValues = null) | |
| { | |
| var requestUrl = url.Action(actionName, controllerName, routeValues); | |
| return ExternalUrl(url, requestUrl); |