private static void DelayValidateSchemaNameChanged(ModelElement element) { if (!element.IsDeleted) { Schema schema = (Schema)element; // Disable customization tracking during any name change to // avoid redundant processing. SchemaCustomization customization = SchemaCustomization.SetCustomization(schema, null); AbstractionModel abstractionModel; string schemaName; if (customization != null && null != (schemaName = customization.CustomizedSchemaName)) { schema.Name = schemaName; } else if (null != (abstractionModel = SchemaIsForAbstractionModel.GetAbstractionModel(schema))) { schema.Name = abstractionModel.Name; } if (customization != null) { // Don't regenerate the customization object for a schema name change, // just use the previous settings. SchemaCustomization.SetCustomization(schema, customization); } } }
private static void DelayValidateSchemaNamesChanged(ModelElement element) { if (!element.IsDeleted) { Schema schema = (Schema)element; // Disable customization tracking during name generation, and // reset customizations on completion. SchemaCustomization customization = SchemaCustomization.SetCustomization(schema, null); NameGeneration.GenerateAllNames(schema, customization); SchemaCustomization.SetCustomization(schema, new SchemaCustomization(schema)); } }
private static void RebuildForAbstractionModelDelayed(ModelElement element) { if (!element.IsDeleted) { AbstractionModel model = (AbstractionModel)element; Schema schema = SchemaIsForAbstractionModel.GetSchema(model); if (schema != null) { // Clear any customizations to stop rules and events from modifying // the customizations during rebuild. SchemaCustomization initialCustomization = SchemaCustomization.SetCustomization(schema, null); schema.TableCollection.Clear(); schema.DomainCollection.Clear(); FullyGenerateConceptualDatabaseModel(schema, model, initialCustomization, null); SchemaCustomization.SetCustomization(schema, new SchemaCustomization(schema)); } } }