Data class which stores the information for exporting gbxml format
Inheritance: ExportData
Exemplo n.º 1
0
        /// <summary>
        /// Export according to selected format
        /// </summary>
        /// <param name="selectedFormat">Selected format</param>
        public DialogResult Export(string selectedFormat)
        {
            ExportFormat format = GetSelectedExportFormat(selectedFormat);
            DialogResult dialogResult = DialogResult.OK;

            try
            {
                switch (format)
                {
                    case ExportFormat.DWG:
                        ExportDWGData exportDWGData = new ExportDWGData(m_commandData, format);
                        using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportDWGData))
                        {
                            dialogResult = exportForm.ShowDialog();
                        }
                        break;
                    case ExportFormat.DXF:
                        ExportDXFData exportDXFData = new ExportDXFData(m_commandData, format);
                        using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportDXFData))
                        {
                            dialogResult = exportForm.ShowDialog();
                        }
                        break;
                    case ExportFormat.SAT:
                        ExportSATData exportSATData = new ExportSATData(m_commandData, format);
                        using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportSATData))
                        {
                            dialogResult = exportForm.ShowDialog();
                        }
                        break;
                    case ExportFormat.DWF:
                    case ExportFormat.DWFx:
                        ExportDWFData exportDWFData = new ExportDWFData(m_commandData, format);
                        using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportDWFData))
                        {
                            dialogResult = exportForm.ShowDialog();
                        }
                        break;
                    case ExportFormat.GBXML:
                        ExportGBXMLData exportGBXMLData = new ExportGBXMLData(m_commandData, format);
                        dialogResult = Export(exportGBXMLData);
                        break;
                    case ExportFormat.FBX:
                        ExportFBXData exportFBXData = new ExportFBXData(m_commandData, format);
                        dialogResult = Export(exportFBXData);
                        break;
                    case ExportFormat.DGN:
                        ExportDGNData exportDGNData = new ExportDGNData(m_commandData, format);
                        using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportDGNData))
                        {
                            dialogResult = exportForm.ShowDialog();
                        }
                        break;
                    case ExportFormat.Civil3D:
                        ExportCivil3DData exportCivil3DData = new ExportCivil3DData(m_commandData, format);
                        if (exportCivil3DData.DataValidated)
                        {
                            using (ExportCivil3DForm exportForm = new ExportCivil3DForm(exportCivil3DData))
                            {
                                dialogResult = exportForm.ShowDialog();
                            }
                        }
                        break;
                    case ExportFormat.Image:
                        ExportIMGData exportIMGdata = new ExportIMGData(m_commandData, format);
                        using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportIMGdata))
                        {
                            dialogResult = DialogResult.OK;
                        }
                        break;
                    default:
                        break;
                }
            }
            catch (Exception ex)
            {
                String errorMessage = "Failed to export " + format + " format" + ex.ToString(); ;
                TaskDialog.Show("Error", errorMessage, TaskDialogCommonButtons.Ok);
            }

            return dialogResult;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Export according to selected format
        /// </summary>
        /// <param name="selectedFormat">Selected format</param>
        public DialogResult Export(string selectedFormat)
        {
            ExportFormat format       = GetSelectedExportFormat(selectedFormat);
            DialogResult dialogResult = DialogResult.OK;

            try
            {
                switch (format)
                {
                case ExportFormat.DWG:
                    ExportDWGData exportDWGData = new ExportDWGData(m_commandData, format);
                    using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportDWGData))
                    {
                        dialogResult = exportForm.ShowDialog();
                    }
                    break;

                case ExportFormat.DXF:
                    ExportDXFData exportDXFData = new ExportDXFData(m_commandData, format);
                    using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportDXFData))
                    {
                        dialogResult = exportForm.ShowDialog();
                    }
                    break;

                case ExportFormat.SAT:
                    ExportSATData exportSATData = new ExportSATData(m_commandData, format);
                    using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportSATData))
                    {
                        dialogResult = exportForm.ShowDialog();
                    }
                    break;

                case ExportFormat.DWF:
                case ExportFormat.DWFx:
                    ExportDWFData exportDWFData = new ExportDWFData(m_commandData, format);
                    using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportDWFData))
                    {
                        dialogResult = exportForm.ShowDialog();
                    }
                    break;

                case ExportFormat.GBXML:
                    ExportGBXMLData exportGBXMLData = new ExportGBXMLData(m_commandData, format);
                    dialogResult = Export(exportGBXMLData);
                    break;

                case ExportFormat.FBX:
                    ExportFBXData exportFBXData = new ExportFBXData(m_commandData, format);
                    dialogResult = Export(exportFBXData);
                    break;

                case ExportFormat.DGN:
                    ExportDGNData exportDGNData = new ExportDGNData(m_commandData, format);
                    using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportDGNData))
                    {
                        dialogResult = exportForm.ShowDialog();
                    }
                    break;

                case ExportFormat.Civil3D:
                    ExportCivil3DData exportCivil3DData = new ExportCivil3DData(m_commandData, format);
                    if (exportCivil3DData.DataValidated)
                    {
                        using (ExportCivil3DForm exportForm = new ExportCivil3DForm(exportCivil3DData))
                        {
                            dialogResult = exportForm.ShowDialog();
                        }
                    }
                    break;

                case ExportFormat.Image:
                    ExportIMGData exportIMGdata = new ExportIMGData(m_commandData, format);
                    using (ExportWithViewsForm exportForm = new ExportWithViewsForm(exportIMGdata))
                    {
                        dialogResult = DialogResult.OK;
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                String errorMessage = "Failed to export " + format + " format" + ex.ToString();;
                TaskDialog.Show("Error", errorMessage, TaskDialogCommonButtons.Ok);
            }

            return(dialogResult);
        }