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 MvcHtmlString TextBox<TProperty>(Expression<Func<TModel, TProperty>> zeroIndexedExpression, string value, object htmlAttributes = null) | |
| { | |
| TagBuilder text = input(HtmlHelper.GetInputTypeString(InputType.Text), zeroIndexedExpression, value, htmlAttributes); | |
| return MvcHtmlString.Create(text.ToString(TagRenderMode.SelfClosing)); | |
| } | |
| private TagBuilder input<TProperty>(string type, Expression<Func<TModel, TProperty>> zeroIndexedExpression, string value, object htmlAttributes = null) | |
| { | |
| var input = new TagBuilder("input"); | |
| setNonTemplatedAttributes(input, type, value, htmlAttributes); |
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 class IndexedExpressionConventions | |
| { | |
| private readonly string _replacement; | |
| private static readonly Regex _idMatcher = new Regex("(?<array>[a-z]+_)(?<index>\\d+)(?<property>__[a-z]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); | |
| private static readonly Regex _nameMatcher = new Regex("(?<array>[a-z]+\\[)(?<index>\\d+)(?<property>\\]\\.[a-z]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); | |
| public IndexedExpressionConventions(string indexReplacement) | |
| { | |
| _replacement = "${array}" + indexReplacement + "${property}"; ; | |
| } |
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
| DGON_DOTNET.ClientInteraction = | |
| { | |
| addTemplatedRow: function (tableSelector, templateSelector, options) { | |
| options = optionsWithDefaults(options, { | |
| templateIndexer: 'NewIndex', | |
| indexSelector: '.data-index', | |
| }); | |
| var last = calculateLast(tableSelector); |
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 calculateLast(tableSelector) { | |
| var last = { $row: null, index: 0 }; | |
| $(tableSelector + ' tbody tr').each(function () { | |
| last.$row = $(this); | |
| last.index++; | |
| }); | |
| return last; | |
| } |
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
| [HttpPost] | |
| public override ActionResult Index(string save, string discard, AddViewModel posted) | |
| { | |
| if (isSave(save, discard)) | |
| { | |
| _repository.Save(AddableThing.ToThings(posted.Things)); | |
| } | |
| IEnumerable<Thing> updatedThings = _repository.Find(); | |
| var model = new AddViewModel |
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
| <?xml version="1.0"?> | |
| <configuration> | |
| <connectionStrings> | |
| <add name="foo" connectionString="dev-value"/> | |
| </connectionStrings> | |
| </configuration> |
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
| <?xml version="1.0"?> | |
| <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> | |
| <connectionStrings> | |
| <add name="foo" connectionString="qaa-value" xdt:Transform="SetAttributes(connectionString)" /> | |
| </connectionStrings> | |
| </configuration> |
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
| task TransformConfig_HappyPath { | |
| $transformer = ".\tools\WebConfigTransformRunner.1.0.0.1\WebConfigTransformRunner.exe" | |
| $config = ".\src\LoveButSometimes.config" | |
| $transformation = ".\src\LoveButSometimes.QA.config" | |
| $target = ".\deploy\LoveButSometimes.config" | |
| exec { &$transformer $config $transformation $target } | |
| } |
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
| > .\tools\psake.4.2.0.1\psake.ps1 .\LoveButSometimes.build.ps1 TransformConfig_HappyPath | |
| psake version 4.2.0 | |
| Copyright (c) 2010 James Kovacs | |
| Executing TransformConfig_HappyPath | |
| Build Succeeded! | |
| ---------------------------------------------------------------------- | |
| Build Time Report |
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
| task TransformConfig_CloudsAndThunders { | |
| $transformer = ".\tools\WebConfigTransformRunner.1.0.0.1\WebConfigTransformRunner.exe" | |
| $config = ".\src\LoveButSometimes.config" | |
| $transformation = ".\src\LoveButSometimes.QAA.config" | |
| $target = ".\deploy\LoveButSometimes.config" | |
| exec { &$transformer $config $transformation $target } | |
| } |