TSF.UmlToolingFramework.Wrappers.EA.ConnectorWrapper.save C# (CSharp) Method

save() public method

Due to a bug in EA we first need to save the end with aggregation kind none, and then the other end. If not then the aggregationkind of the other set is reset to none.
public save ( ) : void
return void
        public override void save()
        {
            this.WrappedConnector.Update();
            if (this.sourceEnd.aggregation == UML.Classes.Kernel.AggregationKind.none)
            {
            this.sourceEnd.save();
            this.targetEnd.save();
            }else
            {
            this.targetEnd.save();
            this.sourceEnd.save();
            }
        }

Usage Example

コード例 #1
0
        public override void correct()
        {
            EAOutputLogger.log(this.model, this.outputName
                               , string.Format("{0} Starting fix notes'"
                                               , DateTime.Now.ToLongTimeString())
                               , 0
                               , LogTypeEnum.log);

            // get al the diagrams
            foreach (var mdDiagramKeyValue in magicDrawReader.allDiagrams)
            {
                var mdDiagram     = mdDiagramKeyValue.Value;
                var ownerID       = magicDrawReader.getDiagramOnwerID(mdDiagramKeyValue.Key);
                var parentElement = getElementByMDid(ownerID);

                foreach (var mdDiagramNote in mdDiagram.diagramNotes)
                {
                    if (parentElement != null)
                    {
                        //create a new note
                        TSF_EA.NoteComment newNote = this.model.factory.createNewElement <TSF_EA.NoteComment>(parentElement, string.Empty);
                        //add the comments to the note
                        newNote.ownedComments.FirstOrDefault().body = model.convertToEANotes(mdDiagramNote.text, "HTML");
                        //save the note
                        newNote.save();
                        //add the tagged value md_guid
                        newNote.addTaggedValue("md_guid", mdDiagramNote.note_Id);

                        //links
                        var linkedElement = getElementByMDid(mdDiagramNote.linkedElement);
                        if (linkedElement != null)
                        {
                            TSF_EA.ConnectorWrapper noteLink = newNote.addOwnedElement <TSF_EA.ConnectorWrapper>(string.Empty, "NoteLink");
                            noteLink.target = linkedElement;
                            noteLink.save();
                        }

                        EAOutputLogger.log(this.model, this.outputName
                                           , string.Format("{0} Create new note '{1}'"
                                                           , DateTime.Now.ToLongTimeString()
                                                           , newNote.ownedComments.FirstOrDefault().body)

                                           , parentElement.id
                                           , LogTypeEnum.log);
                    }
                }
            }


            //Log finished
            EAOutputLogger.log(this.model, this.outputName
                               , string.Format("{0} Finished fix notes"
                                               , DateTime.Now.ToLongTimeString())
                               , 0
                               , LogTypeEnum.log);
        }
All Usage Examples Of TSF.UmlToolingFramework.Wrappers.EA.ConnectorWrapper::save