示例#1
0
        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);
        }
示例#2
0
        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);
            }
        }
示例#3
0
 /// <summary>
 /// Resets the layouts. They are re-loaded from storage on next request
 /// </summary>
 public void Reset()
 {
     _layouts = null;
 }