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