public List <EvolutionChange> Translate(PSMDiagram diagramOldVersion, PSMDiagram diagramNewVersion) { ChangesDetectorContext context = new ChangesDetectorContext { NewVersion = diagramNewVersion.Version, OldVersion = diagramOldVersion.Version, Diagram = diagramNewVersion }; Diagram = diagramNewVersion; context.ScopeStack.Push(EChangeScope.Diagram); ChangesLookupManager.DetectLocalChanges(context); foreach (PSMClass rootClass in diagramNewVersion.Roots) { TranslateClass(rootClass, context); } EChangeScope pop = context.ScopeStack.Pop(); Debug.Assert(pop == EChangeScope.Diagram); EvolutionChangeSet set = new EvolutionChangeSet(context.Diagram, context.DetectedChanges, diagramOldVersion.Version, diagramNewVersion.Version); set.Verify(); return(context.DetectedChanges); }
private static void TranslateAttribute(PSMAttribute psmAttribute, ChangesDetectorContext context) { context.ScopeStack.Push(EChangeScope.Attribute); context.CurrentPSMElement = psmAttribute; ChangesLookupManager.DetectLocalChanges(context); EChangeScope pop = context.ScopeStack.Pop(); Debug.Assert(pop == EChangeScope.Attribute); }
protected override void TranslateContentChoice(PSMContentChoice contentChoice, ChangesDetectorContext context) { context.ScopeStack.Push(EChangeScope.ContentChoice); context.CurrentPSMElement = contentChoice; ChangesLookupManager.DetectLocalChanges(context); TranslateComponents(contentChoice, context); EChangeScope pop = context.ScopeStack.Pop(); Debug.Assert(pop == EChangeScope.ContentChoice); }
protected override void TranslateAttributeContainer(PSMAttributeContainer attributeContainer, ChangesDetectorContext context) { context.ScopeStack.Push(EChangeScope.AttributeContainer); context.CurrentPSMElement = attributeContainer; ChangesLookupManager.DetectLocalChanges(context); TranslateAttributes(attributeContainer, context); EChangeScope pop = context.ScopeStack.Pop(); Debug.Assert(pop == EChangeScope.AttributeContainer); }
protected override void TranslateAssociation(PSMAssociation association, ChangesDetectorContext context) { context.ScopeStack.Push(EChangeScope.Association); context.CurrentPSMElement = association; ChangesLookupManager.DetectLocalChanges(context); TranslateAssociationChild(association.Child, context); EChangeScope pop = context.ScopeStack.Pop(); Debug.Assert(pop == EChangeScope.Association); }
private void TranslateClassUnion(PSMClassUnion classUnion, ChangesDetectorContext context) { context.ScopeStack.Push(EChangeScope.ClassUnion); context.CurrentPSMElement = classUnion; ChangesLookupManager.DetectLocalChanges(context); foreach (PSMAssociationChild psmAssociationChild in classUnion.Components) { TranslateAssociationChild(psmAssociationChild, context); } EChangeScope pcu = context.ScopeStack.Pop(); Debug.Assert(pcu == EChangeScope.ClassUnion); }
protected override string TranslateClass(PSMClass psmClass, ChangesDetectorContext context) { context.ScopeStack.Push(EChangeScope.Class); context.CurrentPSMElement = psmClass; ChangesLookupManager.DetectLocalChanges(context); TranslateAttributes(psmClass, context); TranslateComponents(psmClass, context); EChangeScope pop = context.ScopeStack.Pop(); Debug.Assert(pop == EChangeScope.Class); return(string.Empty); }