public TextPatternRange FindAttribute(AutomationTextAttribute attribute, object value, bool backward)
{
Utility.ValidateArgumentNonNull(attribute, "attribute");
Utility.ValidateArgumentNonNull(value, "value");
if ((attribute == TextPattern.CultureAttribute) && (value is CultureInfo))
{
value = ((CultureInfo)value).LCID;
}
try
{
return(TextPatternRange.Wrap(
this._range.FindAttribute(attribute.Id, value, Utility.ConvertToInt(backward)), this._pattern));
}
catch (System.Runtime.InteropServices.COMException e)
{
Exception newEx; if (Utility.ConvertException(e, out newEx))
{
throw newEx;
}
else
{
throw;
}
}
}