Ancestry.Daisy.Statements.StaticAnalysis.IsStatementController C# (CSharp) Method

IsStatementController() public static method

public static IsStatementController ( Type type ) : bool
type System.Type
return bool
        public static bool IsStatementController(Type type)
        {
            if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(StatementController<>)) return true;
            return type.BaseType != null && IsStatementController(type.BaseType);
        }

Usage Example

Beispiel #1
0
 public StatementSet FromAssembly(Assembly assembly)
 {
     foreach (var t in assembly.GetTypes()
              .Where(x => !x.IsAbstract &&
                     StaticAnalysis.IsStatementController(x)))
     {
         FromController(t);
     }
     return(this);
 }