Beispiel #1
0
        private void btnExport_Click(object sender, EventArgs e)
        {
            if (cmbBoxType.SelectedItem == null)
            {
                MessageBox.Show("Please select the type of file from combo box !");
            }
            else
            {
                string          _selectedName = cmbBoxType.Text;
                IPersonExporter _exporter     = m_exporterFactory.CreateExporter(_selectedName);
                string          _filter       = _exporter.Name + "|*" + _exporter.FileExtension;
                string          _filePath     = selectFileForOpen(_filter);

                if (_filePath != null)
                {
                    _exporter.Save(_filePath, personList);
                    MessageBox.Show("Data serialized successfully");
                }
            }
        }