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);
     }
 }
Beispiel #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));
            }
Beispiel #3
0
 public IEnumerable <T> GetObjects(Architecture architecture)
 {
     return(architecture.GetOrCreateObjects(this, _objects));
 }
Beispiel #4
0
 public override IEnumerable <IType> GetObjects(Architecture architecture)
 {
     return(architecture.GetOrCreateObjects(this, arch => Items.Select(arch.GetITypeOfType).Distinct()));
 }