save() публичный Метод

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
Результат void
Пример #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);
        }
        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)
                    {
                        TSF_EA.NoteComment newNote = this.model.factory.createNewElement <TSF_EA.NoteComment>(parentElement, string.Empty);
                        newNote.ownedComments.FirstOrDefault().body = mdDiagramNote.text;
                        newNote.save();

                        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 note '{1}' for '{2}'"
                                                               , DateTime.Now.ToLongTimeString()
                                                               , newNote.ownedComments.FirstOrDefault().body
                                                               , getElementByMDid(mdDiagramNote.linkedElement).name)
                                               , newNote.id
                                               , LogTypeEnum.log);
                        }
                        else
                        {
                            EAOutputLogger.log(this.model, this.outputName
                                               , string.Format("{0} Create note '{1}'"
                                                               , DateTime.Now.ToLongTimeString()
                                                               , newNote.ownedComments.FirstOrDefault().body)

                                               , newNote.id
                                               , LogTypeEnum.log);
                        }
                    }
                    else
                    {
                        EAOutputLogger.log(this.model, this.outputName
                                           , string.Format("{0} No parent for note '{1}'"
                                                           , DateTime.Now.ToLongTimeString()
                                                           , mdDiagramNote.text)

                                           , 0
                                           , LogTypeEnum.log);
                    }
                }
            }


            //Log finished
            EAOutputLogger.log(this.model, this.outputName
                               , string.Format("{0} Finished fix notes"
                                               , DateTime.Now.ToLongTimeString())
                               , 0
                               , LogTypeEnum.log);
        }