/// <summary> /// Exports the data in the model of this instance of the user control /// </summary> private void Export() { if (GetExportData != null) { ImportExportData data = GetExportData(); mControlModel.Export(data); } else { MessageBox.Show(SqlConnectionInfoControlRx.warSCICNoExportDelegate, SqlConnectionInfoControlRx.warTitle, MessageBoxButton.OK, MessageBoxImage.Warning); } }
/// <summary> /// Gets the export data. /// </summary> /// <returns></returns> private ImportExportData GetExportData() { ImportExportData ieData = null; SaveFileDialog sfd = new SaveFileDialog(); sfd.Title = SqlGetConnectionsWindowRx.txtSGCWExportTitle; sfd.DefaultExt = EXT_Dnwx; sfd.Filter = TXT_Filters; sfd.FilterIndex = 2; sfd.CheckFileExists = false; sfd.CheckPathExists = true; bool?ret = sfd.ShowDialog(); if (ret.HasValue && ret.Value) { bool isEncrypted = Path.GetExtension(sfd.FileName).ToLower() == EXT_Dnwx; ieData = new ImportExportData(sfd.FileName, isEncrypted); } return(ieData); }