bool IElementEquivalence.MapEquivalentElements(Store foreignStore, IEquivalentElementTracker elementTracker) { CustomPropertyDefinition definition; CustomPropertyDefinition otherDefinition; ORMModelElement extendedElement; ORMModelElement otherExtendedElement; if (null != (definition = CustomPropertyDefinition) && null != (otherDefinition = CopyMergeUtility.GetEquivalentElement(definition, foreignStore, elementTracker)) && null != (extendedElement = ORMModelElementHasExtensionElement.GetExtendedElement(this)) && null != (otherExtendedElement = CopyMergeUtility.GetEquivalentElement(extendedElement, foreignStore, elementTracker))) { // UNDONE: COPYMERGE This will not work for custom properties on a model, // but these are not currently selectable and all other contained elements should work correctly. foreach (ModelElement element in otherExtendedElement.ExtensionCollection) { CustomProperty otherProperty = element as CustomProperty; if (otherProperty != null && otherProperty.CustomPropertyDefinition == otherDefinition) { elementTracker.AddEquivalentElement(this, otherProperty); return(true); } } } return(false); }
/// <summary> /// Map groups by name /// </summary> bool IElementEquivalence.MapEquivalentElements(Store foreignStore, IEquivalentElementTracker elementTracker) { CustomPropertyGroup otherGroup; if (null != (otherGroup = CopyMergeUtility.GetEquivalentElement(CustomPropertyGroup, foreignStore, elementTracker))) { string testName = Name; foreach (CustomPropertyDefinition otherDefinition in otherGroup.CustomPropertyDefinitionCollection) { if (otherDefinition.Name == testName) { elementTracker.AddEquivalentElement(this, otherDefinition); return(true); } } } return(false); }