namespace Zinnia.Rule { /// /// Simplifies implementing s that only accept s. /// public abstract class IntRule : Rule { /// public override bool Accepts(object target) { if (ShouldAutoRejectDueToState()) { return false; } int? targetInt = target as int?; return targetInt != null && Accepts((int)targetInt); } /// /// Determines whether a is accepted. /// /// The to check. /// if is accepted, otherwise. protected abstract bool Accepts(int targetInt); } }