예제 #1
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion, ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);
            LabelViewHelper copyLabelViewHelper = (LabelViewHelper)copyComponent;

            copyLabelViewHelper.LabelVisible = LabelVisible;
        }
예제 #2
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PSMSchemaClass copyPSMSchemaClass = (PSMSchemaClass)copyComponent;
        }
예제 #3
0
        public IExolutioCloneable CreateCopy(ProjectVersion projectVersion, ElementCopiesMap createdCopies)
        {
            IExolutioCloneable copyElement = Clone(projectVersion, createdCopies);

            FillCopy(copyElement, projectVersion, createdCopies);
            return(copyElement);
        }
예제 #4
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            AttributeType copyAttributeType = (AttributeType)copyComponent;

            copyAttributeType.Name          = this.Name;
            copyAttributeType.IsSealed      = this.IsSealed;
            copyAttributeType.XSDDefinition = this.XSDDefinition;
            copyAttributeType.XSDAtomic     = this.XSDAtomic;
            if (BaseType != null)
            {
                copyAttributeType.baseTypeGuid = createdCopies.GetGuidForCopyOf(BaseType);
            }
            if (Schema != null)
            {
                copyAttributeType.schemaGuid = createdCopies.GetGuidForCopyOf(Schema);
            }
            if (Component != null)
            {
                copyAttributeType.componentGuid = createdCopies.GetGuidForCopyOf(Component);
            }
            if (RepresentedPIMType != null)
            {
                copyAttributeType.representedPIMTypeGuid = RepresentedPIMType;
            }
            this.CopyCollection(Operations, copyAttributeType.Operations, projectVersion, createdCopies);
            copyAttributeType.SetProjectVersion(projectVersion);
        }
예제 #5
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);
            PIMAssociation copyPIMAssociation = (PIMAssociation)copyComponent;

            this.CopyCollection(PIMAssociationEnds, copyPIMAssociation.PIMAssociationEnds, projectVersion, createdCopies);
        }
예제 #6
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PIMComponent copyPIMComponent = (PIMComponent)copyComponent;
            // TODO: FillCopy Interpreted components
        }
예제 #7
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PIMDiagram copyPIMDiagram = (PIMDiagram)copyComponent;

            copyPIMDiagram.SetProjectVersion(projectVersion);
        }
예제 #8
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PSMContentModel copyPSMContentModel = (PSMContentModel)copyComponent;

            copyPSMContentModel.Type = this.Type;
        }
예제 #9
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion, ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PSMAssociationViewHelper copyAssociationViewHelper = (PSMAssociationViewHelper)copyComponent;

            MainLabelViewHelper.FillCopy(copyAssociationViewHelper.MainLabelViewHelper, projectVersion, createdCopies);
            CardinalityLabelViewHelper.FillCopy(copyAssociationViewHelper.CardinalityLabelViewHelper, projectVersion, createdCopies);
        }
예제 #10
0
파일: Schema.cs 프로젝트: mff-uk/exolutio
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            Schema copySchema = (Schema)copyComponent;

            copySchema.SetProjectVersion(projectVersion);
        }
예제 #11
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);
            Component _copyComponent = (Component)copyComponent;

            _copyComponent.schemaGuid = createdCopies.GetGuidForCopyOf(Schema);
            _copyComponent.Name       = this.Name;
        }
예제 #12
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            OCLScript copyOCLScript = (OCLScript)copyComponent;

            copyOCLScript.Contents = this.Contents;
        }
예제 #13
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PSMDiagram copyPSMDiagram = (PSMDiagram)copyComponent;

            copyPSMDiagram.SetProjectVersion(projectVersion);
            copyPSMDiagram.LoadSchemaToDiagram(copyPSMDiagram.PSMSchema, true);
        }
예제 #14
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            StereotypeInstance copyStereotypeInstance = (StereotypeInstance)copyComponent;

            copyStereotypeInstance.componentGuid  = createdCopies.GetGuidForCopyOf(Component);
            copyStereotypeInstance.stereotypeGuid = this.stereotypeGuid;
        }
예제 #15
0
 /// <summary>
 /// Clones all the members of <paramref name="sourceCollection"/>, calls FillCopy for each cloned member and
 /// </summary>
 public static void CopyCollection <T>(this IExolutioCloneable cloneable, UndirectCollection <T> sourceCollection, UndirectCollection <T> targetCollection, ProjectVersion projectVersion, ElementCopiesMap createdCopies)
     where T : ExolutioObject
 {
     foreach (T collectionItem in sourceCollection)
     {
         T itemCopy = (T)collectionItem.Clone(projectVersion, createdCopies);
         collectionItem.FillCopy(itemCopy, projectVersion, createdCopies);
         targetCollection.Add(itemCopy);
     }
 }
예제 #16
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PSMGeneralization copyPSMGeneralization = (PSMGeneralization)copyComponent;

            copyPSMGeneralization.generalGuid  = createdCopies.GetGuidForCopyOf(General);
            copyPSMGeneralization.specificGuid = createdCopies.GetGuidForCopyOf(Specific);
        }
예제 #17
0
 public virtual void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion, ElementCopiesMap createdCopies)
 {
     if (copyComponent == null)
     {
         throw new ArgumentNullException("copyComponent");
     }
     if (this.GetType() != copyComponent.GetType())
     {
         throw new ExolutioModelException(string.Format("FillCopy called on objects of different type '{0}' and '{1}'.", this.GetType().FullName, copyComponent.GetType().FullName));
     }
 }
예제 #18
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PSMComponent copyPSMComponent = (PSMComponent)copyComponent;

            if (Interpretation != null)
            {
                copyPSMComponent.interpretationGuid = createdCopies.GetGuidForCopyOf(Interpretation);
            }
        }
예제 #19
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PSMAssociation copyPSMAssociation = (PSMAssociation)copyComponent;

            copyPSMAssociation.Lower      = this.Lower;
            copyPSMAssociation.Upper      = this.Upper;
            copyPSMAssociation.parentGuid = createdCopies.GetGuidForCopyOf(Parent);
            copyPSMAssociation.childGuid  = createdCopies.GetGuidForCopyOf(Child);
        }
예제 #20
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            Diagram copyDiagram = (Diagram)copyComponent;

            copyDiagram.SetProjectVersion(projectVersion);
            copyDiagram.Caption    = this.Caption;
            copyDiagram.schemaGuid = createdCopies.GetGuidForCopyOf(this.Schema);
            this.CopyRefCollection(Components, copyDiagram.Components, projectVersion, createdCopies);
            this.CopyDictionary(ViewHelpers, copyDiagram.ViewHelpers, projectVersion, createdCopies);
        }
예제 #21
0
 /// <summary>
 /// Clones all the members of <paramref name="sourceCollection"/>, calls FillCopy for each cloned member and
 /// </summary>
 public static void CopyDictionary <TKey, TValue>(this IExolutioCloneable cloneable, Dictionary <TKey, TValue> sourceDictionary,
                                                  Dictionary <TKey, TValue> targetDictionary, ProjectVersion projectVersion, ElementCopiesMap createdCopies)
     where TKey : ExolutioObject
     where TValue : IExolutioCloneable
 {
     foreach (KeyValuePair <TKey, TValue> collectionItem in sourceDictionary)
     {
         TValue itemCopy = (TValue)collectionItem.Value.Clone(projectVersion, createdCopies);
         collectionItem.Value.FillCopy(itemCopy, projectVersion, createdCopies);
         Guid keyGuid = createdCopies.GetGuidForCopyOf(collectionItem.Key);
         targetDictionary.Add(projectVersion.Project.TranslateComponent <TKey>(keyGuid), itemCopy);
     }
 }
예제 #22
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PSMSchemaReference copyPSMSchemaReference = (PSMSchemaReference)copyComponent;

            copyPSMSchemaReference.Namespace            = this.Namespace;
            copyPSMSchemaReference.NamespacePrefix      = this.NamespacePrefix;
            copyPSMSchemaReference.SchemaLocation       = this.SchemaLocation;
            copyPSMSchemaReference.ReferenceType        = this.ReferenceType;
            copyPSMSchemaReference.referencedSchemaGuid = createdCopies.GetGuidForCopyOf(ReferencedPSMSchema);
        }
예제 #23
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PSMAssociationMember copyPSMAssociationMember = (PSMAssociationMember)copyComponent;

            if (ParentAssociation != null)
            {
                copyPSMAssociationMember.parentAssociationGuid = createdCopies.GetGuidForCopyOf(ParentAssociation);
            }

            this.CopyRefCollection(ChildPSMAssociations, copyPSMAssociationMember.ChildPSMAssociations, projectVersion, createdCopies, true);
        }
예제 #24
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            ProjectVersion copyProjectVersion = (ProjectVersion)copyComponent;

            copyProjectVersion.versionGuid = projectVersion.versionGuid;

            this.CopyCollection(PIMAttributeTypes, copyProjectVersion.PIMAttributeTypes, projectVersion, createdCopies);
            copyProjectVersion.PIMSchema = PIMSchema.CreateTypedCopy(projectVersion, createdCopies);
            this.CopyCollection(PSMSchemas, copyProjectVersion.PSMSchemas, projectVersion, createdCopies);
            this.CopyCollection(PIMDiagrams, copyProjectVersion.PIMDiagrams, projectVersion, createdCopies);
            this.CopyCollection(PSMDiagrams, copyProjectVersion.PSMDiagrams, projectVersion, createdCopies);
        }
예제 #25
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PIMSchema copyPIMSchema = (PIMSchema)copyComponent;

            copyPIMSchema.SetProjectVersion(projectVersion);

            this.CopyCollection(PIMClasses, copyPIMSchema.PIMClasses, projectVersion, createdCopies);
            this.CopyCollection(PIMGeneralizations, copyPIMSchema.PIMGeneralizations, projectVersion, createdCopies);
            this.CopyCollection(PIMAssociations, copyPIMSchema.PIMAssociations, projectVersion, createdCopies);
            this.CopyRefCollection(PIMAttributes, copyPIMSchema.PIMAttributes, projectVersion, createdCopies);
            this.CopyRefCollection(PIMAssociationEnds, copyPIMSchema.PIMAssociationEnds, projectVersion, createdCopies);
        }
예제 #26
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PIMAssociationEnd copyPIMAssociationEnd = (PIMAssociationEnd)copyComponent;

            copyPIMAssociationEnd.Lower              = this.Lower;
            copyPIMAssociationEnd.Upper              = this.Upper;
            copyPIMAssociationEnd.IsNavigable        = this.IsNavigable;
            copyPIMAssociationEnd.IsShared           = this.IsShared;
            copyPIMAssociationEnd.isComposite        = this.IsComposite;
            copyPIMAssociationEnd.pimClassGuid       = createdCopies.GetGuidForCopyOf(PIMClass);
            copyPIMAssociationEnd.pimAssociationGuid = createdCopies.GetGuidForCopyOf(PIMAssociation);
        }
예제 #27
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PSMClass copyPSMClass = (PSMClass)copyComponent;

            if (RepresentedClass != null)
            {
                copyPSMClass.representedClassGuid = createdCopies.GetGuidForCopyOf(RepresentedClass);
            }
            this.CopyCollection(PSMAttributes, copyPSMClass.PSMAttributes, projectVersion, createdCopies);
            copyPSMClass.Abstract = this.Abstract;
            copyPSMClass.Final    = this.Final;
        }
예제 #28
0
 /// <summary>
 /// Registers (already existing) copies of the members of <paramref name="sourceCollection"/> into <paramref name="targetCollection"/>.
 /// </summary>
 public static void CopyRefCollection <T>(this IExolutioCloneable cloneable, IEnumerable <T> sourceCollection, UndirectCollection <T> targetCollection,
                                          ProjectVersion projectVersion, ElementCopiesMap createdCopies, bool asGuid = false)
     where T : ExolutioObject
 {
     foreach (T collectionItem in sourceCollection)
     {
         Guid guid = createdCopies.GetGuidForCopyOf(collectionItem);
         if (!asGuid)
         {
             targetCollection.Add(targetCollection.Project.TranslateComponent <T>(guid));
         }
         else
         {
             targetCollection.AddAsGuidSilent(guid);
         }
     }
 }
예제 #29
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PIMAttribute copyPIMAttribute = (PIMAttribute)copyComponent;

            copyPIMAttribute.Lower        = this.Lower;
            copyPIMAttribute.Upper        = this.Upper;
            copyPIMAttribute.DefaultValue = this.DefaultValue;

            if (AttributeType != null)
            {
                copyPIMAttribute.attributeTypeGuid = createdCopies.GetGuidForCopyOf(AttributeType);
            }
            copyPIMAttribute.pimClassGuid = createdCopies.GetGuidForCopyOf(PIMClass);
        }
예제 #30
0
파일: PIMClass.cs 프로젝트: mff-uk/exolutio
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PIMClass copyPIMClass = (PIMClass)copyComponent;

            this.CopyCollection(PIMAttributes, copyPIMClass.PIMAttributes, projectVersion, createdCopies);
            this.CopyCollection(PIMOperations, copyPIMClass.PIMOperations, projectVersion, createdCopies);
            this.CopyRefCollection(GeneralizationsAsGeneral, copyPIMClass.GeneralizationsAsGeneral, projectVersion, createdCopies, true);
            if (GeneralizationAsSpecific != null)
            {
                copyPIMClass.generalizationAsSpecificGuid = createdCopies.GetGuidForCopyOf(GeneralizationAsSpecific);
            }
            this.CopyRefCollection(PIMAssociationEnds, copyPIMClass.PIMAssociationEnds, projectVersion, createdCopies, true);
            copyPIMClass.Abstract = this.Abstract;
            copyPIMClass.Final    = this.Final;
        }