Last active
May 11, 2018 06:59
-
-
Save trnktms/c1be1aa51f122d99bfde261ae45d9745 to your computer and use it in GitHub Desktop.
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
namespace Helix.Skeleton.Foundation.Pages.Validators | |
{ | |
using System; | |
using System.Runtime.Serialization; | |
using System.Web.Mvc; | |
using Base; | |
using Sitecore.Data.Validators; | |
using Sitecore.Data.Validators.FieldValidators; | |
[Serializable] | |
public class TemplateDependentRequiredValidator : RequiredFieldValidator | |
{ | |
public TemplateDependentRequiredValidator() : base() | |
{ | |
} | |
public TemplateDependentRequiredValidator(SerializationInfo info, StreamingContext context) | |
: base(info, context) | |
{ | |
} | |
protected IBaseTemplateDependentValidator BaseTemplateDependentValidator | |
{ | |
get | |
{ | |
return DependencyResolver.Current.GetService<IBaseTemplateDependentValidator>(); | |
} | |
} | |
protected override ValidatorResult Evaluate() | |
{ | |
return this.BaseTemplateDependentValidator.Evaluate<RequiredFieldValidator>( | |
this, | |
() => base.Evaluate(), | |
() => this.GetItem()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment