ShowSaveDialog() public static méthode

Show Save dialog
public static ShowSaveDialog ( ExportData exportData, String &returnFileName, int &filterIndex ) : DialogResult
exportData ExportData Data to export
returnFileName String File name will be returned
filterIndex int Selected filter index will be returned
Résultat DialogResult
Exemple #1
0
        /// <summary>
        /// Show save dialog when button Browser is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonBrowser_Click(object sender, EventArgs e)
        {
            String fileName    = String.Empty;
            int    filterIndex = -1;

            DialogResult result = MainData.ShowSaveDialog(m_data, ref fileName, ref filterIndex);

            if (result != DialogResult.Cancel)
            {
                textBoxSaveAs.Text = fileName;
            }
        }
        /// <summary>
        /// Specify a file to export into
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonBrowser_Click(object sender, EventArgs e)
        {
            String fileName    = String.Empty;
            int    filterIndex = -1;

            DialogResult result = MainData.ShowSaveDialog(m_exportData, ref fileName, ref filterIndex);

            if (result != DialogResult.Cancel)
            {
                textBoxSaveAs.Text = fileName;
                if (m_exportData.ExportFormat == ExportFormat.DWG)
                {
                    ExportDWGData exportDWGData = m_exportData as ExportDWGData;
                    exportDWGData.ExportFileVersion = exportDWGData.EnumFileVersion[filterIndex - 1];
                }
                else if (m_exportData.ExportFormat == ExportFormat.DXF)
                {
                    ExportDXFData exportDXFData = m_exportData as ExportDXFData;
                    exportDXFData.ExportFileVersion = exportDXFData.EnumFileVersion[filterIndex - 1];
                }
            }
        }