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);
            }
        }
Example #2
0
 private static void DelayValidateConceptTypeNameChanged(ModelElement element)
 {
     if (!element.IsDeleted)
     {
         ConceptType conceptType = (ConceptType)element;
         Table       table1      = TableIsPrimarilyForConceptType.GetTable(conceptType);
         if (null != table1)
         {
             ValidateSchemaNamesChanged(table1.Schema);
         }
         foreach (Table table2 in TableIsAlsoForConceptType.GetTable(conceptType))
         {
             ValidateSchemaNamesChanged(table2.Schema);
         }
     }
 }
Example #3
0
        /// <summary>
        /// Implements <see cref="IVerbalize.GetVerbalization"/>
        /// </summary>
        protected bool GetVerbalization(TextWriter writer, IDictionary <Type, IVerbalizationSets> snippetsDictionary, IVerbalizationContext verbalizationContext, VerbalizationSign sign)
        {
            // We are redirected to this point by the associated Table element
            ConceptType conceptType = this.ConceptType;
            ObjectType  objectType;

            if (null != (objectType = ConceptTypeIsForObjectType.GetObjectType(conceptType)))
            {
                verbalizationContext.DeferVerbalization(objectType, DeferVerbalizationOptions.None, null);
                foreach (ConceptType alsoForConceptType in TableIsAlsoForConceptType.GetConceptType(this.Table))
                {
                    if (null != (objectType = ConceptTypeIsForObjectType.GetObjectType(alsoForConceptType)))
                    {
                        writer.WriteLine();
                        verbalizationContext.DeferVerbalization(objectType, DeferVerbalizationOptions.None, null);
                    }
                }
            }
            return(false);
        }