private string ValidateFeedColumnLayout(LayoutType type, FeedColumnLayout defaultLayout) { foreach (var key in _layouts.Keys) { if (_layouts[key].LayoutType == type) { return(key); } } string newkey = FeedColumnLayoutCollection.CreateNewKey(); _layouts.Add(newkey, defaultLayout); // feedHandler.SaveColumLayouts(); return(newkey); }
private static void SaveLayouts(IClientDataService dataService, FeedColumnLayoutCollection layouts) { if (dataService == null) { throw new ArgumentNullException("dataService"); } if (!layouts.Modified) { return; } try { dataService.SaveColumnLayouts(layouts); layouts.Modified = false; } catch (Exception ex) { _log.Error("Could not save column layouts", ex); } }
/// <summary> /// Resets the layouts. They are re-loaded from storage on next request /// </summary> public void Reset() { _layouts = null; }