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 object GetService(Type serviceType) | |
{ | |
try | |
{ | |
return container.Resolve(serviceType); | |
} | |
catch | |
{ | |
return null; | |
} |
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 static MvcHtmlString ActionButton<T>(this HtmlHelper helper, Expression<Action<T>> action, string text) where T : Controller | |
{ | |
return ActionButton(helper, action, text, null); | |
} | |
public static MvcHtmlString ActionButton<T>(this HtmlHelper helper, Expression<Action<T>> action, string text, object htmlAttributes) where T : Controller | |
{ | |
var routing = ExpressionHelper.GetRouteValuesFromExpression(action); | |
var vpd = helper.RouteCollection.GetVirtualPath(helper.ViewContext.RequestContext, routing); |
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
Policies.EnrichCallsWith<UnitOfWorkActionBehavior>( | |
x => x.HandlerType.Name.EndsWith("Controller")); |
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 InputWrapperConvention : HtmlConventionRegistry | |
{ | |
public InputWrapperConvention() | |
{ | |
Editors.Always.Modify(h => h.WrapWith("div").AddClass("editor-field")); | |
} | |
} | |
//Added in the Registry |
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
$('input:checkbox').each(function () { | |
if($(this).attr('disabled') != 'disabled') | |
this.checked = 'checked'; | |
}); |
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
@model string | |
@{ | |
Layout = "_Layout.cshtml"; | |
} | |
@Html.TextBoxFor(x => 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
<div class="editor-label"> | |
@Html.LabelFor(x => x) | |
</div> | |
<div class="editor-field"> | |
@RenderBody() | |
@if (ViewData.ModelMetadata.IsRequired) | |
{ | |
<text><span class="required">*</span></text> | |
} | |
@Html.ValidationMessageFor(x => 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
public static void DrawRectangle(this CellSurface con, Rectangle rect,CellAppearance appearance) | |
{ | |
if (rect.Width > 0) | |
{ | |
con.DrawHorizontalLine(rect.Left, rect.Top, rect.Width, appearance); | |
con.DrawHorizontalLine(rect.Left, rect.Bottom, rect.Width, appearance); | |
} | |
if (rect.Width < 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
public ConfigureFubuMVC() | |
{ | |
// This line turns on the basic diagnostics and request tracing | |
IncludeDiagnostics(true); | |
// All public methods from concrete classes ending in "Controller" | |
// in this assembly are assumed to be action methods | |
Actions.IncludeClassesSuffixedWithController(); | |
// Policies |
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
@model Fubinator.App.Controllers.IndexViewModel | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello World</title> | |
</head> | |
<body> | |
@Model.Message |
OlderNewer