/// <summary> /// Called by the Merge process to create a relationship between /// this target element and the specified source element. /// Typically, a parent-child relationship is established /// between the target element (the parent) and the source element /// (the child), but any relationship can be established. /// </summary> /// <param name="sourceElement">The element that is to be related to this model element.</param> /// <param name="elementGroup">The group of source ModelElements that have been rehydrated into the target store.</param> /// <remarks> /// This method is overriden to create the relationship between the target element and the specified source element. /// The base method does nothing. /// </remarks> protected override void MergeRelate(DslModeling::ModelElement sourceElement, DslModeling::ElementGroup elementGroup) { // In general, sourceElement is allowed to be null, meaning that the elementGroup must be parsed for special cases. // However this is not supported in generated code. Use double-deriving on this class and then override MergeRelate completely if you // need to support this case. if (sourceElement == null) { throw new global::System.ArgumentNullException("sourceElement"); } global::ORMSolutions.ORMArchitect.ORMAbstraction.InformationTypeFormat sourceInformationTypeFormat1 = sourceElement as global::ORMSolutions.ORMArchitect.ORMAbstraction.InformationTypeFormat; if (sourceInformationTypeFormat1 != null) { // Create link for path AbstractionModelHasInformationTypeFormat.InformationTypeFormatCollection this.InformationTypeFormatCollection.Add(sourceInformationTypeFormat1); return; } global::ORMSolutions.ORMArchitect.ORMAbstraction.ConceptType sourceConceptType2 = sourceElement as global::ORMSolutions.ORMArchitect.ORMAbstraction.ConceptType; if (sourceConceptType2 != null) { // Create link for path AbstractionModelHasConceptType.ConceptTypeCollection this.ConceptTypeCollection.Add(sourceConceptType2); return; } // Fall through to base class if this class hasn't handled the merge. base.MergeRelate(sourceElement, elementGroup); }
/// <summary> /// Called by the Merge process to create a relationship between /// this target element and the specified source element. /// Typically, a parent-child relationship is established /// between the target element (the parent) and the source element /// (the child), but any relationship can be established. /// </summary> /// <param name="sourceElement">The element that is to be related to this model element.</param> /// <param name="elementGroup">The group of source ModelElements that have been rehydrated into the target store.</param> /// <remarks> /// This method is overriden to create the relationship between the target element and the specified source element. /// The base method does nothing. /// </remarks> protected override void MergeRelate(DslModeling::ModelElement sourceElement, DslModeling::ElementGroup elementGroup) { // In general, sourceElement is allowed to be null, meaning that the elementGroup must be parsed for special cases. // However this is not supported in generated code. Use double-deriving on this class and then override MergeRelate completely if you // need to support this case. if (sourceElement == null) { throw new global::System.ArgumentNullException("sourceElement"); } global::ORMSolutions.ORMArchitect.ORMAbstraction.InformationTypeFormat sourceInformationTypeFormat1 = sourceElement as global::ORMSolutions.ORMArchitect.ORMAbstraction.InformationTypeFormat; if (sourceInformationTypeFormat1 != null) { // Create link for path AbstractionModelHasInformationTypeFormat.InformationTypeFormatCollection this.InformationTypeFormatCollection.Add(sourceInformationTypeFormat1); return; } global::ORMSolutions.ORMArchitect.ORMAbstraction.ConceptType sourceConceptType2 = sourceElement as global::ORMSolutions.ORMArchitect.ORMAbstraction.ConceptType; if (sourceConceptType2 != null) { // Create link for path AbstractionModelHasConceptType.ConceptTypeCollection this.ConceptTypeCollection.Add(sourceConceptType2); return; } // Sdk workaround to runtime bug #879350 (DSL: can't copy and paste a MEL that has a MEX). Avoid MergeRelate on ModelElementExtension // during a "Paste". if (sourceElement is DslModeling::ExtensionElement && sourceElement.Store.TransactionManager.CurrentTransaction.TopLevelTransaction.Context.ContextInfo.ContainsKey("{9DAFD42A-DC0E-4d78-8C3F-8266B2CF8B33}")) { return; } // Fall through to base class if this class hasn't handled the merge. base.MergeRelate(sourceElement, elementGroup); }
protected override void MergeDisconnect(DslModeling::ModelElement sourceElement) { if (sourceElement == null) { throw new global::System.ArgumentNullException("sourceElement"); } global::ORMSolutions.ORMArchitect.ORMAbstraction.InformationTypeFormat sourceInformationTypeFormat1 = sourceElement as global::ORMSolutions.ORMArchitect.ORMAbstraction.InformationTypeFormat; if (sourceInformationTypeFormat1 != null) { // Delete link for path AbstractionModelHasInformationTypeFormat.InformationTypeFormatCollection foreach (DslModeling::ElementLink link in global::ORMSolutions.ORMArchitect.ORMAbstraction.AbstractionModelHasInformationTypeFormat.GetLinks((global::ORMSolutions.ORMArchitect.ORMAbstraction.AbstractionModel) this, sourceInformationTypeFormat1)) { // Delete the link, but without possible delete propagation to the element since it's moving to a new location. link.Delete(global::ORMSolutions.ORMArchitect.ORMAbstraction.AbstractionModelHasInformationTypeFormat.ModelDomainRoleId, global::ORMSolutions.ORMArchitect.ORMAbstraction.AbstractionModelHasInformationTypeFormat.InformationTypeFormatDomainRoleId); } return; } global::ORMSolutions.ORMArchitect.ORMAbstraction.ConceptType sourceConceptType2 = sourceElement as global::ORMSolutions.ORMArchitect.ORMAbstraction.ConceptType; if (sourceConceptType2 != null) { // Delete link for path AbstractionModelHasConceptType.ConceptTypeCollection foreach (DslModeling::ElementLink link in global::ORMSolutions.ORMArchitect.ORMAbstraction.AbstractionModelHasConceptType.GetLinks((global::ORMSolutions.ORMArchitect.ORMAbstraction.AbstractionModel) this, sourceConceptType2)) { // Delete the link, but without possible delete propagation to the element since it's moving to a new location. link.Delete(global::ORMSolutions.ORMArchitect.ORMAbstraction.AbstractionModelHasConceptType.ModelDomainRoleId, global::ORMSolutions.ORMArchitect.ORMAbstraction.AbstractionModelHasConceptType.ConceptTypeDomainRoleId); } return; } // Fall through to base class if this class hasn't handled the unmerge. base.MergeDisconnect(sourceElement); }