ATMLCommonLibrary.controls.ATMLControl.CheckForErrors C# (CSharp) Method

CheckForErrors() protected static method

protected static CheckForErrors ( ICollection controls ) : bool
controls ICollection
return bool
        protected static bool CheckForErrors( ICollection controls )
        {
            bool hasError = false;
            foreach (Control control in controls)
            {
                PropertyInfo pi = control.GetType().GetProperty( "HasErrors" );
                if (pi != null)
                {
                    object obj = pi.GetValue( control, null );
                    if (obj is bool)
                        hasError |= (bool) obj;
                }
                hasError |= CheckForErrors( control.Controls );
                if (hasError)
                    break;
            }
            return hasError;
        }