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
| // Override jQuery Validate methods to be aware of different cultures. | |
| // This will use Globalize (https://github.com/jquery/globalize) methods. | |
| $.validator.methods.number = function (value, element) { | |
| return this.optional(element) || !isNaN(Globalize.parseFloat(value)); | |
| }; | |
| $.validator.methods.range = function (value, element, param) { | |
| value = Globalize.parseFloat(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
| (function ($) { | |
| $.fn.clickOutsideToRemove = function () { | |
| return this.each(function () { | |
| var $this = $(this); | |
| $(document).on("mouseup.clickOutsideToRemove", function (e) { | |
| if ($this.has(e.target).length === 0) { |
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 string Test() | |
| { | |
| TextWriter tw = TextWriter.Null; | |
| HtmlHelper<TestViewModel> htmlHelper = new HtmlHelper<TestViewModel>(new ViewContext(ControllerContext, | |
| new RazorView(ControllerContext, "asd", "sdsd", false, null), | |
| new ViewDataDictionary(), | |
| new TempDataDictionary(), tw), new ViewPage()); | |
| return htmlHelper.TextBoxFor(m => m.Name).ToString(); | |
| } |
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 Castle.MicroKernel.Registration; | |
| using Castle.MicroKernel.SubSystems.Configuration; | |
| using Castle.Windsor; | |
| using MyApp.BusinessLogic.Facades; | |
| namespace MyApp.Web.PresentationLogic.Container | |
| { | |
| public class BusinessLogicInstaller : IWindsorInstaller | |
| { | |
| public void Install(IWindsorContainer container, IConfigurationStore 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
| /// <summary> | |
| /// Verifies the controller action, contains an attribute of the specified attributeType. | |
| /// </summary> | |
| /// <param name="controller">The controller.</param> | |
| /// <param name="action">The action method.</param> | |
| /// <param name="attributeType">Type of the attribute to look for.</param> | |
| /// <returns>Returns true if the attribute was present on the action. Otherwise false.</returns> | |
| public static bool VerifyControllerActionAttribute(this Controller controller, Func<ActionResult> action, Type attributeType) | |
| { | |
| MethodInfo methodInfo = action.Method; |
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.Linq; | |
| using System.Reflection; | |
| using System.Xml; | |
| using System.Xml.Linq; | |
| /// <summary> | |
| /// Extension methods for the dynamic object. | |
| /// </summary> |
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
| MailDefinition md = new MailDefinition(); | |
| md.From = "test@domain.com"; | |
| md.IsBodyHtml = true; | |
| md.Subject = "Test of MailDefinition"; | |
| ListDictionary replacements = new ListDictionary(); | |
| replacements.Add("<%Name%>", "Martin"); | |
| replacements.Add("<%Country%>", "Denmark"); | |
| string body = String.Empty; |
NewerOlder