private void SaveTransformations(object argument) { var dialog = new SaveFileDialog(); dialog.Title = "Please select the transformation list (*.xml) to save."; dialog.Filter = "XML Files (*.xml)|*.xml"; var result = dialog.ShowDialog(Application.Current.MainWindow); if (result == true) { try { SerializationProvider.Write <WorkItemConfigurationTransformationItem[]>(this.Transformations.ToArray(), dialog.FileName); } catch (Exception exc) { this.Logger.Log(string.Format(CultureInfo.CurrentCulture, "An error occurred while saving the transformation list to \"{0}\"", dialog.FileName), exc); MessageBox.Show("An error occurred while saving the transformation list. See the log file for details", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); } } }
public static void Save(string fileName, IList <PermissionChangePersistenceData> data) { SerializationProvider.Write <PermissionChangePersistenceData[]>(data.ToArray(), fileName); }