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.Build.Framework; | |
using Microsoft.Build.Utilities; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
public class FindFilesInList : Task | |
{ | |
[Required] | |
public ITaskItem[] Items { get; set; } |
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
Option Explicit | |
' AcCloseSave | |
Const acSavePrompt = 0 | |
Const acSaveYes = 1 | |
Const acSaveNo = 2 | |
' AcObjectType | |
Const acDefault = -1 | |
Const acTable = 0 |
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 Dapper; | |
using System; | |
using System.Reflection; | |
public class QualifiedTypeMap : SqlMapper.ITypeMap | |
{ | |
private static string Unqualify(string columnName) | |
{ | |
return columnName.Substring(columnName.LastIndexOf('.') + 1); | |
} |
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; | |
public static class IOExtensions | |
{ | |
public static FileInfo GetTemporaryFile(string extension = null) | |
{ | |
string path = Path.GetTempPath(); | |
FileInfo file; | |
do |
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.ComponentModel.DataAnnotations; | |
[AttributeUsage(AttributeTargets.Property)] | |
public sealed class NotEmptyAttribute : RequiredAttribute | |
{ | |
public override bool IsValid(object value) | |
{ | |
ICollection valueCollection = value as ICollection; |
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.Web; | |
using System.Web.Mvc; | |
using System.Web.WebPages; | |
public static class HtmlHelperExtensions | |
{ | |
public static HtmlString Once(this HtmlHelper @this, Func<dynamic, HelperResult> template) | |
{ |
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.IO; | |
using System.Web.Mvc; | |
public class ControllerBase : Controller | |
{ | |
protected string RenderResult(ViewEngineResult result, object model) | |
{ | |
ViewData.Model = model; | |
using (StringWriter writer = new StringWriter()) | |
{ |
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.Collections.Generic; | |
using System.IO; | |
using System.Web.UI; | |
public class HtmlTextWriter : System.Web.UI.HtmlTextWriter | |
{ | |
private ICollection<string> cssClasses; | |
public HtmlTextWriter(TextWriter writer) | |
: base(writer) |
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.ComponentModel.DataAnnotations; | |
using System.Reflection; | |
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] | |
public sealed class LaterThanAttribute : ValidationAttribute | |
{ | |
public override bool RequiresValidationContext | |
{ | |
get { return true; } |
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.Mvc; | |
public class Global : HttpApplication | |
{ | |
protected void Application_Start(object sender, EventArgs e) | |
{ | |
ModelBinders.Binders.DefaultBinder = new ModelBinderBase(); | |
} |