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 NestedRemoteRuleGraphActivator : IActivator | |
{ | |
private readonly ITypeDescriptorCache _properties; | |
private readonly RemoteRuleGraph _remoteGraph; | |
private readonly ValidationGraph _validationGraph; | |
private readonly IRemoteRuleQuery _remotes; | |
private readonly BehaviorGraph _behaviorGraph; | |
public NestedRemoteRuleGraphActivator(ITypeDescriptorCache properties, RemoteRuleGraph remoteGraph, | |
ValidationGraph validationGraph, IRemoteRuleQuery remotes, |
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
abstract class Shape { | |
def area: Double | |
} | |
val rectangle = new Shape{ | |
val w:Int = 10 | |
val h:Int = 20 | |
def area: Double = w*h | |
} | |
println(rectangle.area) |
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
var adults = Persons.Where(_.Age > 18) |
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 RegexFieldRule : IRemoteFieldValidationRule | |
{ | |
private readonly Regex _regex; | |
public RegexFieldRule(Regex regex) | |
{ | |
_regex = regex; | |
} | |
public void Validate(Accessor accessor, ValidationContext context) |
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 InputQueryModel : InputCommandModel | |
{ | |
} | |
public class InputCommandModel | |
{ | |
public string Name { 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
public class InputQueryModel | |
{ | |
public string Name { get; set; } | |
} | |
public class InputCommandModel : InputQueryModel | |
{ | |
} |
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
context.Notification.RegisterMessage(accessor, ValidationKeys.Required); |
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 FormValidationSummaryModifier : ITagModifier<FormRequest> | |
{ | |
public bool Matches(FormRequest token) | |
{ | |
return token.Chain.ValidationNode().Contains(RenderingStrategies.Summary); | |
} | |
public void Modify(FormRequest request) | |
{ | |
var summary = request.Services.GetInstance<IPartialInvoker>().Invoke<ValidationSummary>(); |
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
AlterSettings<ValidationSettings>(e => | |
{ | |
e.ForInputTypesMatching(x => true, | |
x => | |
{ | |
x.Clear(); | |
x.RegisterStrategy(RenderingStrategies.Highlight); | |
// TODO: PLUG IN CUSTOM STRATEGIES | |
}); | |
}); |
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
$.fn.activateAjaxForms = $.fn.activateAjaxForms || function () { | |
return this.each(function () { | |
var container = $(this); | |
$('form.validated-form', container).each(function () { | |
var mode = $(this).data('validationMode'); | |
$(this).validate({ | |
ajax: mode == 'ajax', | |
continuationSuccess: function (continuation) { | |
continuation.form.trigger('validation:success', continuation); | |
} |