Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Debugging IsVisible WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
msawczyn committed Mar 16, 2020
1 parent ca181fd commit 1115f78
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 63 deletions.
2 changes: 2 additions & 0 deletions src/Dsl/CustomCode/Partials/AssociationConnector.cs
Expand Up @@ -16,6 +16,8 @@ protected override void InitializeResources(StyleSet classStyleSet)
AssociateValueWith(Store, Association.TargetDeleteActionDomainPropertyId);
AssociateValueWith(Store, Association.SourceMultiplicityDomainPropertyId);
AssociateValueWith(Store, Association.TargetMultiplicityDomainPropertyId);
AssociateValueWith(Store, Association.NameDomainPropertyId);
AssociateValueWith(Store, Association.FKPropertyNameDomainPropertyId);
AssociateValueWith(Store, Association.PersistentDomainPropertyId);
}

Expand Down
16 changes: 10 additions & 6 deletions src/Dsl/CustomCode/Rules/AssociationDeletingRules.cs
Expand Up @@ -19,13 +19,17 @@ public override void ElementDeleting(ElementDeletingEventArgs e)
return;

ModelAttribute[] fkProperties = element.Dependent.AllAttributes.Where(x => x.IsForeignKeyFor == element.Id).ToArray();
WarningDisplay.Show($"Removing foreign key attribute(s) {string.Join(", ", fkProperties.Select(x => x.GetDisplayText()))}");

foreach (ModelAttribute fkProperty in fkProperties)

if (fkProperties.Any())
{
fkProperty.ClearFKMods();
fkProperty.ModelClass.Attributes.Remove(fkProperty);
fkProperty.Delete();
WarningDisplay.Show($"Removing foreign key attribute(s) {string.Join(", ", fkProperties.Select(x => x.GetDisplayText()))}");

foreach (ModelAttribute fkProperty in fkProperties)
{
fkProperty.ClearFKMods();
fkProperty.ModelClass.Attributes.Remove(fkProperty);
fkProperty.Delete();
}
}
}
}
Expand Down

0 comments on commit 1115f78

Please sign in to comment.