void updatePreset() { PresetMetadata preset = new PresetMetadata(); preset.Id = selectedPreset.Id; preset.Name = Name; preset.Rating = Rating; preset.IsRatingEnabled = RatingEnabled; preset.Title = Title; preset.IsTitleEnabled = TitleEnabled; preset.Author = Author; preset.IsAuthorEnabled = AuthorEnabled; preset.Description = Description; preset.IsDescriptionEnabled = DescriptionEnabled; preset.Copyright = Copyright; preset.IsCopyrightEnabled = CopyrightEnabled; preset.CreationDate = Creation; preset.IsCreationDateEnabled = CreationEnabled; using (PresetMetadataDbCommands presetMetaDataCommands = new PresetMetadataDbCommands()) { try { PresetMetadata result = presetMetaDataCommands.update(preset); MetadataPresets.Remove(SelectedPreset); CollectionsSort.insertIntoSortedCollection <PresetMetadata>(MetadataPresets, result); clear(); } catch (Exception e) { Logger.Log.Error("Error updating presetMetadata", e); } } }
void deletePreset() { using (PresetMetadataDbCommands presetMetaDataCommands = new PresetMetadataDbCommands()) { try { presetMetaDataCommands.delete(SelectedPreset); MetadataPresets.Remove(SelectedPreset); clear(); } catch (Exception e) { Logger.Log.Error("Error deleting presetMetadata", e); } } }