protected SavedListConfig ExtractItem(string name, SavedListConfigurationList obj) { var item = obj.Configs.FirstOrDefault(i => i.Name == name); if (item == null) { item = new SavedListConfig(); item.Name = name; obj.Configs.Add(item); } return item; }
protected SavedListConfigurationList ExtractConfigurationObject(SavedListConfiguration config) { SavedListConfigurationList obj; try { obj = !string.IsNullOrEmpty(config.Configuration) ? config.Configuration.FromXmlString<SavedListConfigurationList>() : new SavedListConfigurationList(); } catch (Exception ex) { Logging.Client.Warn("Error during deserializing SavedListConfigurationList, creating a new one", ex); obj = new SavedListConfigurationList(); } return obj; }