internal bool ElementOfPossibleControlType(
string[] controlType,
string elementControlType)
{
bool result = false;
if (null == controlType || 0 == controlType.Length) {
return result;
}
if (string.IsNullOrEmpty(elementControlType)) {
return result;
}
// if all the item are empty strings
string tempString = controlType.Aggregate(string.Empty, (current, t) => current + t);
/*
for (int i = 0; i < controlType.Length; i++)
{
tempString += controlType[i];
}
*/
if (tempString.Length == 0) {
result = true;
return result;
}
elementControlType =
elementControlType.Substring(
elementControlType.IndexOf('.') + 1);
foreach (string controlTypeName in controlType.Where(controlTypeName => String.Equals(controlTypeName, elementControlType, StringComparison.CurrentCultureIgnoreCase)))
{
result = true;
}
return result;
}