public IEnumerable <TRuleType> GetObjects(Architecture architecture)
 {
     try
     {
         return(architecture.GetOrCreateObjects(this, _ruleCreator.GetAnalyzedObjects));
     }
     catch (CannotGetObjectsOfCombinedArchRuleCreatorException exception)
     {
         throw new CannotGetObjectsOfCombinedArchRuleException(
                   "GetObjects() can't be used with CombinedArchRule \"" + ToString() +
                   "\" because the analyzed objects might be of different type. Try to use simple ArchRules instead.",
                   exception);
     }
 }
Exemple #2
0
            public override IEnumerable <IType> GetObjects(Architecture architecture)
            {
                IEnumerable <IType> CreateFunction(Architecture arch)
                {
                    var types = new List <IType>();

                    foreach (var pattern in Items)
                    {
                        types.AddRange(arch.Types.Where(type =>
                                                        type.FullNameMatches(pattern, _useRegularExpressions)));
                    }

                    return(types.Distinct());
                }

                return(architecture.GetOrCreateObjects(this, CreateFunction));
            }
Exemple #3
0
 public IEnumerable <T> GetObjects(Architecture architecture)
 {
     return(architecture.GetOrCreateObjects(this, _objects));
 }
Exemple #4
0
 public override IEnumerable <IType> GetObjects(Architecture architecture)
 {
     return(architecture.GetOrCreateObjects(this, arch => Items.Select(arch.GetITypeOfType).Distinct()));
 }