41 lines
811 B
C#
41 lines
811 B
C#
using System;
|
|
namespace SPSolutions.SharePoint.Administration
|
|
{
|
|
public class CommandLineParameterRangeValidator : CommandLineParameterValidator
|
|
{
|
|
private string[] m_validValues;
|
|
public string[] ValidValues
|
|
{
|
|
get
|
|
{
|
|
return this.m_validValues;
|
|
}
|
|
protected set
|
|
{
|
|
this.m_validValues = value;
|
|
}
|
|
}
|
|
public CommandLineParameterRangeValidator(string[] validValues)
|
|
{
|
|
this.m_validValues = validValues;
|
|
}
|
|
public override bool Validate(string value)
|
|
{
|
|
if (string.IsNullOrEmpty(value))
|
|
{
|
|
return true;
|
|
}
|
|
string[] validValues = this.ValidValues;
|
|
for (int i = 0; i < validValues.Length; i++)
|
|
{
|
|
string value2 = validValues[i];
|
|
if (value.Equals(value2, StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|