Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }
Example #7
0
        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);
        }
Example #8
0
 public ChangePropertiesAttribute(EChangeScope scope, EEditType editType)
 {
     this.scope             = scope;
     this.editType          = editType;
     MayRequireRevalidation = true;
 }