Data class which stores the information for importing dwg format
Inheritance: ImportData
示例#1
0
        /// <summary>
        /// Export according to selected format
        /// </summary>
        /// <param name="selectedFormat">Selected format</param>
        /// <returns></returns>
        public DialogResult Import(string selectedFormat)
        {
            DialogResult dialogResult = DialogResult.OK;
            ImportFormat format       = GetSelectedImportFormat(selectedFormat);

            try
            {
                switch (format)
                {
                case ImportFormat.DWG:
                    ImportDWGData importDWGData = new ImportDWGData(m_commandData, format);
                    using (ImportDWGForm importForm = new ImportDWGForm(importDWGData))
                    {
                        dialogResult = importForm.ShowDialog();
                    }
                    break;

                case ImportFormat.IMAGE:
                    ImportImageData importIMAGEData = new ImportImageData(m_commandData, format);
                    dialogResult = Import(importIMAGEData);
                    break;

                case ImportFormat.GBXML:
                    ImportGBXMLData importGBXMLData = new ImportGBXMLData(m_commandData, format);
                    dialogResult = Import(importGBXMLData);
                    break;

                case ImportFormat.Inventor:
                    ImportInventorData importInventorData = new ImportInventorData(m_commandData, format);
                    dialogResult = Import(importInventorData);
                    break;

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

            return(dialogResult);
        }
示例#2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="importData"></param>
 public ImportDWGForm(ImportDWGData importData)
 {
     InitializeComponent();
     m_importData = importData;
     InitializeControls();
 }
示例#3
0
        /// <summary>
        /// Export according to selected format
        /// </summary>
        /// <param name="selectedFormat">Selected format</param>
        /// <returns></returns>
        public DialogResult Import(string selectedFormat)
        {
            DialogResult dialogResult = DialogResult.OK;
            ImportFormat format = GetSelectedImportFormat(selectedFormat);

            try
            {
                switch (format)
                {
                    case ImportFormat.DWG:
                        ImportDWGData importDWGData = new ImportDWGData(m_commandData, format);
                        using (ImportDWGForm importForm = new ImportDWGForm(importDWGData))
                        {
                            dialogResult = importForm.ShowDialog();
                        }
                        break;
                    case ImportFormat.IMAGE:
                        ImportImageData importIMAGEData = new ImportImageData(m_commandData, format);
                        dialogResult = Import(importIMAGEData);
                        break;
                    case ImportFormat.GBXML:
                        ImportGBXMLData importGBXMLData = new ImportGBXMLData(m_commandData, format);
                        dialogResult = Import(importGBXMLData);
                        break;
                    case ImportFormat.Inventor:
                        ImportInventorData importInventorData = new ImportInventorData(m_commandData, format);
                        dialogResult = Import(importInventorData);
                        break;
                    default:
                        break;
                }
            }
            catch (Exception)
            {
                String errorMessage = "Failed to import " + format + " format";
                TaskDialog.Show("Error", errorMessage, TaskDialogCommonButtons.Ok);
            }

            return dialogResult;
        }
示例#4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="importData"></param>
 public ImportDWGForm(ImportDWGData importData)
 {
     InitializeComponent();
     m_importData = importData;
     InitializeControls();
 }