protected FieldInformation SelectFieldBySpecifiedAtrribute(FieldInformation[] fields, string expectedAttributeValue, FieldAttributeType usedAttribute)
{
FieldInformation selectedField = this.FindOutTheField(fields, expectedAttributeValue, usedAttribute);
if (null == selectedField)
{
string errorMsg = string.Format(
"Could not find the expected field by specified value:[{0}] of [{1}] attribute.",
expectedAttributeValue,
usedAttribute);
throw new InvalidOperationException(errorMsg);
}
return selectedField;
}