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