Ejemplo n.º 1
0
 public static IEnumerable <ITypeDependency> GetFieldTypeDependencies(this IHasDependencies type,
                                                                      bool getBackwardsDependencies = false)
 {
     return(getBackwardsDependencies
         ? type.BackwardsDependencies.OfType <FieldTypeDependency>()
         : type.Dependencies.OfType <FieldTypeDependency>());
 }
Ejemplo n.º 2
0
 public static IEnumerable <AttributeMemberDependency> GetAttributeMemberDependencies(
     this IHasDependencies member, bool getBackwardsDependencies = false)
 {
     return(getBackwardsDependencies
         ? member.BackwardsDependencies.OfType <AttributeMemberDependency>()
         : member.Dependencies.OfType <AttributeMemberDependency>());
 }
Ejemplo n.º 3
0
 public static IEnumerable <MethodCallDependency> GetMethodCallDependencies(this IHasDependencies type,
                                                                            bool getBackwardsDependencies = false)
 {
     return(getBackwardsDependencies
         ? type.BackwardsDependencies.OfType <MethodCallDependency>()
         : type.Dependencies.OfType <MethodCallDependency>());
 }
Ejemplo n.º 4
0
 public static IEnumerable <IType> GetTypeDependencies(this IHasDependencies c, Architecture architecture)
 {
     return(c.Dependencies.Select(dependency => dependency.Target).Intersect(architecture.Types));
 }
Ejemplo n.º 5
0
 public static IEnumerable <IType> GetTypeDependencies(this IHasDependencies c)
 {
     return(c.Dependencies.Select(dependency => dependency.Target));
 }
Ejemplo n.º 6
0
 public static bool OnlyDependsOn(this IHasDependencies c, string pattern, bool useRegularExpressions = false)
 {
     return(c.GetTypeDependencies().All(d => d.FullNameMatches(pattern, useRegularExpressions)));
 }
Ejemplo n.º 7
0
 public static IEnumerable <MethodMember> GetCalledMethods(this IHasDependencies type)
 {
     return(type.Dependencies.OfType <MethodCallDependency>()
            .Select(dependency => (MethodMember)dependency.TargetMember));
 }
Ejemplo n.º 8
0
 public static bool CallsMethod(this IHasDependencies type, string pattern, bool useRegularExpressions = false)
 {
     return(type.GetCalledMethods().Any(member => member.FullNameMatches(pattern, useRegularExpressions)));
 }
Ejemplo n.º 9
0
 public static IEnumerable <FieldMember> GetAccessedFieldMembers(this IHasDependencies type)
 {
     return(type.Dependencies.OfType <AccessFieldDependency>()
            .Select(dependency => (FieldMember)dependency.TargetMember));
 }
Ejemplo n.º 10
0
 public static bool CallsAnyMethodFromType(this IHasDependencies type, string pattern,
                                           bool useRegularExpressions = false)
 {
     return(type.GetMethodCallDependencies().Select(dependency => dependency.Target)
            .Any(member => member.FullNameMatches(pattern, useRegularExpressions)));
 }
Ejemplo n.º 11
0
 public static IEnumerable <Interface> GetInterfaceDependencies(this IHasDependencies c,
                                                                Architecture architecture)
 {
     return(c.GetTypeDependencies(architecture).OfType <Interface>());
 }
Ejemplo n.º 12
0
 public static IEnumerable <Interface> GetInterfaceDependencies(this IHasDependencies c)
 {
     return(c.GetTypeDependencies().OfType <Interface>());
 }
Ejemplo n.º 13
0
 public static IEnumerable <Class> GetClassDependencies(this IHasDependencies c, Architecture architecture)
 {
     return(c.GetTypeDependencies(architecture).OfType <Class>());
 }
Ejemplo n.º 14
0
 public static IEnumerable <Class> GetClassDependencies(this IHasDependencies c)
 {
     return(c.GetTypeDependencies().OfType <Class>());
 }
Ejemplo n.º 15
0
 public static bool DependsOn(this IHasDependencies c, IType type)
 {
     return(c.GetTypeDependencies().Contains(type));
 }
Ejemplo n.º 16
0
 public static bool CallsMethod(this IHasDependencies type, MethodMember method)
 {
     return(type.GetCalledMethods().Contains(type));
 }