private void Entity_NameChanged(object sender, EntityNameChangedEventArgs e) { if (this.TargetEntityName == e.OldName) { bool save = this.Entity != null && this.Entity.OwningMetadataFile != null && !this.Entity.OwningMetadataFile.IsDirty; this.TargetEntityName = e.NewName; if (save) this.Entity.OwningMetadataFile.Save(); } }
private void Entity_PluralNameChanged(object sender, EntityNameChangedEventArgs e) { if (sender is Entity && this.TargetEntityName == ((Entity)sender).Name) { bool save = this.Entity != null && this.Entity.OwningMetadataFile != null && !this.Entity.OwningMetadataFile.IsDirty; if (LinkDerivesName(e.OldName)) { this.Name = this.Name.Replace(e.OldName, e.NewName); if (save) this.Entity.OwningMetadataFile.Save(); } } }