Exemplo n.º 1
0
        private void mnuFileOpenXmi_Click(object sender, EventArgs e)
        {
            OpenFileDialog openDialog = new OpenFileDialog {
                CheckFileExists = true,
                CheckPathExists = true,
                DefaultExt      = "xml",
                Filter          = "XMI (*.xml)|*.xml",
                Multiselect     = false,
                ShowReadOnly    = true,
                ReadOnlyChecked = true,
                Title           = "Open XMI File"
            };

            openDialog.ShowDialog();
            string fileName = openDialog.FileName;

            if (string.IsNullOrWhiteSpace(fileName))
            {
                return;
            }

            try {
                Model.EAModel loadModel = Model.EAModel.LoadXmi(fileName);
                mnuFileExport.Enabled = true;
                mnuEditSearch.Enabled = true;
                eaModel = loadModel;
                BuildTree();
            } catch (System.Exception exception) {
                EATrace.XmiImport(System.Diagnostics.TraceEventType.Warning, "EAExport Load Failure: {0}", exception.Message);
                MessageBox.Show(exception.Message, "EAExport Load Failure");
            }
        }
Exemplo n.º 2
0
        private void mnuFileExportDB45Chapters_Click(object sender, EventArgs e)
        {
            Model.EATree element = GetElement();
            if (element == null)
            {
                return;
            }

            string fileName = GetFileName("xml", "DocBook 4.5 (*.xml)|*.xml", "Save As DocBook 4.5 with Chapters");

            if (fileName == null)
            {
                return;
            }

            try {
                using (Model.ITreeExport exportFormat = new Model.DocBook45ChapterExport(fileName)) {
                    exportFormat.ExportTree(element, false);
                }
            } catch (System.Exception exception) {
                EATrace.XmiImport(System.Diagnostics.TraceEventType.Warning, "EAExport DocBook 4.5 Chapter Export Failure: {0}", exception.Message);
                MessageBox.Show(exception.Message, "EAExport DocBook 4.5 Chapter Export Failure");
            }
        }
Exemplo n.º 3
0
        private void mnuFileExportCsvPlain_Click(object sender, EventArgs e)
        {
            Model.EATree element = GetElement();
            if (element == null)
            {
                return;
            }

            string fileName = GetFileName("csv", "CSV (*.csv)|*.csv", "Save As CSV Plain Text File");

            if (fileName == null)
            {
                return;
            }

            try {
                using (Model.ITreeExport exportFormat = new Model.CsvDoorsTreePlainExport(fileName)) {
                    exportFormat.ExportTree(element, false);
                }
            } catch (System.Exception exception) {
                EATrace.XmiImport(System.Diagnostics.TraceEventType.Warning, "EAExport CSV Export Failure: {0}", exception.Message);
                MessageBox.Show(exception.Message, "EAExport CSV Export Failure");
            }
        }