private void Export(int extension) { try { var dlg = new SaveFileDialog(); dlg.Filter = C1.WPF.Olap.Resources.Resources.ExportDialogFilter; dlg.FilterIndex = extension; if (dlg.ShowDialog().Value == true) { using (var sw = dlg.OpenFile()) { var ext = System.IO.Path.GetExtension(dlg.SafeFileName).ToLower(); switch (ext) { case ".html": OlapGrid.Save(sw, FileFormat.Html); break; case ".csv": OlapGrid.Save(sw, FileFormat.Csv); break; case ".txt": default: OlapGrid.Save(sw, FileFormat.Text); break; } } } } catch (Exception x) { MessageBox.Show(x.Message, "Error", MessageBoxButton.OK); } }
public LoadLayoutFileDialog(OlapGrid grid) { Grid = grid; }