/// <summary> /// Merges the disconnect layer. /// </summary> /// <param name="sourceElement">The source element.</param> private void MergeDisconnectLayer(Microsoft.VisualStudio.Modeling.ModelElement sourceElement) { SoftwareLayer layer = sourceElement as SoftwareLayer; if (layer != null) { foreach (ElementLink link in SoftwareComponentHasLayers.GetLinks(this, layer)) { // Delete the link, but without possible delete propagation to the element since it's moving to a new location. link.Delete(SoftwareComponentHasLayers.SoftwareComponentDomainRoleId, SoftwareComponentHasLayers.SoftwareLayerDomainRoleId); } } }
/// <summary> /// Merges the disconnect interface layer. /// </summary> /// <param name="sourceElement">The source element.</param> private void MergeDisconnectInterfaceLayer(ModelElement sourceElement) { InterfaceLayer layer = sourceElement as InterfaceLayer; if (layer != null) { foreach (ElementLink link in LayerPackageReferencesInterfaceLayer.GetLinks(this, layer)) { // Delete the link, but without possible delete propagation to the element since it's moving to a new location. link.Delete(LayerPackageReferencesInterfaceLayer.InterfaceLayerDomainRoleId, LayerPackageReferencesInterfaceLayer.LayerPackageDomainRoleId); } foreach (ElementLink link in SoftwareComponentHasLayers.GetLinks(Component, layer)) { // Delete the link, but without possible delete propagation to the element since it's moving to a new location. link.Delete(SoftwareComponentHasLayers.SoftwareComponentDomainRoleId, SoftwareComponentHasLayers.SoftwareLayerDomainRoleId); } } }