Server.Commands.CategoryEntry.IsMatch C# (CSharp) Méthode

IsMatch() public méthode

public IsMatch ( Type type ) : bool
type System.Type
Résultat bool
		public bool IsMatch( Type type )
		{
			bool isMatch = false;

			for ( int i = 0; !isMatch && i < m_Matches.Length; ++i )
				isMatch = ( type == m_Matches[i] || type.IsSubclassOf( m_Matches[i] ) );

			return isMatch;
		}

Usage Example

        private static CategoryEntry GetDeepestMatch( CategoryEntry root, Type type )
        {
            if( !root.IsMatch( type ) )
                return null;

            for( int i = 0; i < root.SubCategories.Length; ++i )
            {
                CategoryEntry check = GetDeepestMatch( root.SubCategories[i], type );

                if( check != null )
                    return check;
            }

            return root;
        }
All Usage Examples Of Server.Commands.CategoryEntry::IsMatch