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 class SelectedColumIDsModelBinder : DefaultModelBinder | |
{ | |
public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) | |
{ | |
//bind up the object using the base method | |
var queryRequest = (QueryRequest) base.BindModel(controllerContext, bindingContext); | |
if(queryRequest!=null) | |
{ | |
//get the attempted value from the value provider, in this case a comma-delimited string | |
Expression<Func<QueryRequest, int[]>> expression = x => queryRequest.SelectColumnIDs; |
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
ko.bindingHandlers.jqValidation = { | |
update: function (element, valueAccessor, allBindingsAccessor, viewModel) { | |
var accessor = valueAccessor(); | |
if (accessor.enforce) { | |
$(element).find(':submit').removeClass('cancel'); | |
$(element).validate({ | |
submitHandler: function () { | |
if ($.isFunction(accessor.submitHandler)) |
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 interface IGeoLocationService | |
{ | |
Location GetLocation(string street, string city, string state, string zip); | |
Location GetLocation(string address); | |
} | |
public class GoogleGeoLocationService : IGeoLocationService | |
{ | |
public Location GetLocation(string street, string city, string state, string zip) | |
{ |
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 class Parent | |
{ | |
public virtual int Id { get; set; } | |
public virtual string Name { get; set; } | |
public virtual ICollection<Child> MyChildren { get; set; } | |
} | |
public class Child | |
{ |
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
//all should be wrapped in jquery func | |
var my = my || {}; | |
//routes setup | |
my.routes = (function () { | |
var hashBang = '#!/', //here could check if browser supports pushstate and avoid the hashbang | |
createRoute = function (route) { |
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
//todo make this a plugin for ko | |
function makeAllPropsObservable(jsonData) { | |
////console.log(jsonData.DivisionSummaries); | |
for (x in jsonData) { | |
////console.log(x + ' ' + jsonData[x]); | |
if (!$.isFunction(jsonData[x])) { | |
if (!$.isArray(jsonData[x])) { | |
if (!$.isPlainObject(jsonData[x])) |
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
Imports System | |
Imports EnvDTE | |
Imports EnvDTE80 | |
Imports EnvDTE90 | |
Imports EnvDTE90a | |
Imports EnvDTE100 | |
Imports System.Diagnostics | |
Public Module Module1 |
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 Image ScaleImage(Image image, int maxWidth, int maxHeight) | |
{ | |
var ratioX = (double)maxWidth / image.Width; | |
var ratioY = (double)maxHeight / image.Height; | |
var ratio = Math.Min(ratioX, ratioY); | |
var newWidth = (int)(image.Width * ratio); | |
var newHeight = (int)(image.Height * ratio); | |
var newImage = new Bitmap(newWidth, newHeight); |
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 class MatchesController : ApiController | |
{ | |
private static IMatchRepository _repository; | |
public MatchesController(IMatchRepository repository) | |
{ | |
_repository = repository; | |
} | |
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
<system.net> | |
<mailSettings> | |
<smtp deliveryMethod="SpecifiedPickupDirectory"> | |
<specifiedPickupDirectory pickupDirectoryLocation="c:\temp\maildrop\"/> | |
</smtp> | |
</mailSettings> | |
</system.net> |
OlderNewer