public void TestMethodWithSimpleProcessName()
        {
            XmlDocumentBuilder documentBuilder=new XmlDocumentBuilder();
            MscDiagramInterpreter interpreter=new MscDiagramInterpreter(mscGenerator,documentBuilder);
            XmlDocument createdDocument=interpreter.InterpretMscDiagram();
            XmlElement documentElement=createdDocument.DocumentElement;

            System.Console.Write(createdDocument.OuterXml);
        }
示例#2
0
        //LG
        protected override void ExportToXmi()
        {
            MscDiagramInterpreter diagramInterpreter;
            XmlDocumentBuilder documentBuilder = null;

            //ändern wenn GUI fertig ist
            int xmiExportType = XmiExportTypes.PAPYRUS_XMI_EXPORT;

            switch (xmiExportType) {
                case XmiExportTypes.STANDARD_XMI_EXPORT:
                    documentBuilder = new XmlDocumentBuilder();
                    break;

                case XmiExportTypes.PAPYRUS_XMI_EXPORT:
                    documentBuilder = new PapyrusXmiDocumentBuilder();
                    break;
                default:
                    break;
            }

            diagramInterpreter = new MscDiagramInterpreter(this.generator, documentBuilder);
            XmlDocument createdDocument = diagramInterpreter.InterpretMscDiagram();
            // Call SaveFileDialog
            string fullFileName 			= SaveFileDialog();

            if(fullFileName != "") {
                string fileNameWithoutExtension	= System.IO.Path.GetFileNameWithoutExtension(fullFileName);
                string fileName 				= System.IO.Path.GetFileName(fullFileName);
                string pathName 				= fullFileName.Substring(0, fullFileName.LastIndexOf("\\"));
                string newPathName 				= pathName + "\\" + fileNameWithoutExtension;
                string newFileName  			= newPathName + "\\" + fileName;
                if (!Directory.Exists(newPathName))
                {
                    Directory.CreateDirectory(newPathName);
                    var eclipseProjectFile = new EclipseProject(newPathName, fileNameWithoutExtension);
                    eclipseProjectFile.Export();
                }
                createdDocument.Save(newFileName);
            }
        }