private static void UpdateTablesForConceptType(ConceptType conceptType, Predicate <ConceptType> conceptTypeFilter, Predicate <Table> tableFilter)
        {
            Table primaryTable = TableIsPrimarilyForConceptType.GetTable(conceptType);
            LinkedElementCollection <Table> secondaryTables = TableIsAlsoForConceptType.GetTable(conceptType);

            if (primaryTable != null && (tableFilter == null || !tableFilter(primaryTable)))
            {
                UpdateTablePresentationSize(primaryTable);
            }
            foreach (Table secondaryTable in secondaryTables)
            {
                if (tableFilter == null || !tableFilter(secondaryTable))
                {
                    UpdateTablePresentationSize(secondaryTable);
                }
            }
            Predicate <ConceptType> recurseConceptTypeFilter =
                delegate(ConceptType testConceptType)
            {
                return(testConceptType == conceptType ||
                       (conceptTypeFilter != null && conceptTypeFilter(testConceptType)));
            };
            Predicate <Table> recurseTableFilter =
                delegate(Table testTable)
            {
                return(testTable == primaryTable || secondaryTables.Contains(testTable));
            };

            foreach (ConceptType relatingConceptType in ConceptTypeRelatesToConceptType.GetRelatingConceptTypeCollection(conceptType))
            {
                if (relatingConceptType == conceptType || (conceptTypeFilter != null && conceptTypeFilter(relatingConceptType)))
                {
                    continue;
                }
                UpdateTablesForConceptType(
                    relatingConceptType,
                    recurseConceptTypeFilter,
                    recurseTableFilter);
            }
            foreach (ConceptType assimilatedConceptType in ConceptTypeAssimilatesConceptType.GetAssimilatedConceptTypeCollection(conceptType))
            {
                if (assimilatedConceptType == conceptType || (conceptTypeFilter != null && conceptTypeFilter(assimilatedConceptType)))
                {
                    continue;
                }
                UpdateTablesForConceptType(
                    assimilatedConceptType,
                    recurseConceptTypeFilter,
                    recurseTableFilter);
            }
        }
Beispiel #2
0
        private static void UpdateEntitiesForConceptType(ConceptType conceptType, Predicate <ConceptType> conceptTypeFilter, Predicate <EntityType> entityFilter)
        {
            EntityType primaryEntity = EntityTypeIsPrimarilyForConceptType.GetEntityType(conceptType);

            if (primaryEntity != null && (entityFilter == null || !entityFilter(primaryEntity)))
            {
                UpdateEntityPresentationSize(primaryEntity);
            }
            Predicate <ConceptType> recurseConceptTypeFilter =
                delegate(ConceptType testConceptType)
            {
                return(testConceptType == conceptType ||
                       (conceptTypeFilter != null && conceptTypeFilter(testConceptType)));
            };
            Predicate <EntityType> recurseEntityFilter =
                delegate(EntityType testEntity)
            {
                return(testEntity == primaryEntity);
            };

            foreach (ConceptType relatingConceptType in ConceptTypeRelatesToConceptType.GetRelatingConceptTypeCollection(conceptType))
            {
                if (relatingConceptType == conceptType || (conceptTypeFilter != null && conceptTypeFilter(relatingConceptType)))
                {
                    continue;
                }
                UpdateEntitiesForConceptType(
                    relatingConceptType,
                    recurseConceptTypeFilter,
                    recurseEntityFilter);
            }
            foreach (ConceptType assimilatedConceptType in ConceptTypeAssimilatesConceptType.GetAssimilatedConceptTypeCollection(conceptType))
            {
                if (assimilatedConceptType == conceptType || (conceptTypeFilter != null && conceptTypeFilter(assimilatedConceptType)))
                {
                    continue;
                }
                UpdateEntitiesForConceptType(
                    assimilatedConceptType,
                    recurseConceptTypeFilter,
                    recurseEntityFilter);
            }
        }