Esempio n. 1
0
        internal void finalize()
        {
            XmlDocument xmlDoc = MocaTreeUtil.createMocaXMLDoc();

            xmlDoc.DocumentElement.AppendChild(this.MocaTree.serializeToXmlTree(xmlDoc));
            writeDocumentToFile(xmlDoc, null);

            //track changes
            XmlDocument xmlRefactorDoc = MocaTreeUtil.createMocaXMLDoc();

            xmlRefactorDoc.DocumentElement.AppendChild(this.ChangesTree.serializeToXmlTree(xmlRefactorDoc));
            writeDocumentToFile(xmlRefactorDoc, "changes");

            ExportRunning = false;
        }
Esempio n. 2
0
        public String getXMLDocumentString()
        {
            //create xml stub with a single root node
            XmlDocument xmlDocStub = MocaTreeUtil.createMocaXMLDoc();
            //parse this object to moca element tree
            MocaNode treeElement = this.serializeToMocaTree();

            //parse moca element to xmlElement tree
            XmlElement serializedMocaRoot = treeElement.serializeToXmlTree(xmlDocStub);

            //append new xmlElement to xmlDocument
            xmlDocStub.FirstChild.AppendChild(serializedMocaRoot);

            String documentString = MocaTreeUtil.xmlDocumentToString(xmlDocStub);

            return(documentString);
        }
        /// <summary>
        /// Serializes the current Object 1. to MocaTree and 2. to XmlDocument and saves the XmlDocument
        /// represented as String to a TaggedValue. Last some EA GUI stuff is done which is used to make sure that
        /// the visualization in EA works correctly.
        /// </summary>
        public void saveTreeToEATaggedValue(Boolean updateEaGui)
        {
            String documentString = "";

            if (!this.isIgnored())
            {
                //create xml stub with a single root node
                XmlDocument xmlDocStub = MocaTreeUtil.createMocaXMLDoc();
                //parse this object to moca element tree
                MocaNode treeElement = this.serializeToMocaTree();

                //parse moca element to xmlElement tree
                XmlElement serializedMocaRoot = treeElement.serializeToXmlTree(xmlDocStub);

                //append new xmlElement to xmlDocument
                xmlDocStub.FirstChild.AppendChild(serializedMocaRoot);

                documentString = MocaTreeUtil.xmlDocumentToString(xmlDocStub);
            }

            if (Import.MainImport.ImportBusy)
            {
                foreach (String oldGuid in Import.MainImport.getInstance(Repository, null).OldGuidToNewGuid.Keys)
                {
                    documentString = documentString.Replace(oldGuid, Import.MainImport.getInstance(Repository, null).OldGuidToNewGuid[oldGuid]);
                }
            }
            if (!isLocked())
            {
                EAEcoreAddin.Util.EAUtil.setTaggedValueNotes(Repository, getObjectToBeTagged(), Main.MoflonExportTreeTaggedValueName, documentString);
                if (updateEaGui)
                {
                    doEaGuiStuff();
                }
            }

            refreshSQLObject();
        }