示例#1
0
        }     // class ModeViewSettings

        #region Static methods

        public static UiBroadcastListSettings GetDefaultSettings()
        {
            var result = new UiBroadcastListSettings();

            result.CurrentMode          = View.Tile;
            result.ShowGridlines        = true;
            result.ShowInactiveServices = true;
            result.ShowOutOfPackage     = true;
            result.TilesPerRow          = 4;

            result.ViewSettings           = new ModeViewSettings();
            result.ViewSettings.Details   = UiBroadcastListModeSettings.GetDefaultSettings(View.Details);
            result.ViewSettings.LargeIcon = UiBroadcastListModeSettings.GetDefaultSettings(View.LargeIcon);
            result.ViewSettings.SmallIcon = UiBroadcastListModeSettings.GetDefaultSettings(View.SmallIcon);
            result.ViewSettings.List      = UiBroadcastListModeSettings.GetDefaultSettings(View.List);
            result.ViewSettings.Tile      = UiBroadcastListModeSettings.GetDefaultSettings(View.Tile);

            result.GlobalSortColumns    = ServiceSortComparer.GetSuggestedSortColumns(UiBroadcastListColumn.Number, true, 3);
            result.UseGlobalSortColumns = false;

            // force creation of ColumnWidth field
            var dummy = result.ColumnWidth[0];

            return(result);
        } // GetDefaultSettings
示例#2
0
        public static UiBroadcastListModeSettings GetDefaultSettings(View mode)
        {
            var result = new UiBroadcastListModeSettings();

            result.Sort = ServiceSortComparer.GetSuggestedSortColumns(UiBroadcastListColumn.Number, true, 3);

            switch (mode)
            {
            case View.Details:
                result.Columns = new List <UiBroadcastListColumn>(5);
                result.Columns.Add(UiBroadcastListColumn.Number);
                result.Columns.Add(UiBroadcastListColumn.Name);
                result.Columns.Add(UiBroadcastListColumn.Description);
                result.Columns.Add(UiBroadcastListColumn.DvbType);
                result.Columns.Add(UiBroadcastListColumn.LocationUrl);
                result.LogoSize = LogoSize.Size32;
                break;

            case View.LargeIcon:
                result.Columns = new List <UiBroadcastListColumn>(1);
                result.Columns.Add(UiBroadcastListColumn.NumberAndNameCrlf);
                result.LogoSize = LogoSize.Size48;
                break;

            case View.SmallIcon:
                result.Columns = new List <UiBroadcastListColumn>(1);
                result.Columns.Add(UiBroadcastListColumn.Number);
                result.LogoSize = LogoSize.Size32;
                break;

            case View.List:
                result.Columns = new List <UiBroadcastListColumn>(1);
                result.Columns.Add(UiBroadcastListColumn.NumberAndName);
                result.LogoSize = LogoSize.Size32;
                break;

            case View.Tile:
                result.Columns = new List <UiBroadcastListColumn>(2);
                result.Columns.Add(UiBroadcastListColumn.NumberAndName);
                result.Columns.Add(UiBroadcastListColumn.DvbType);
                result.LogoSize = LogoSize.Size48;
                break;

            default:
                throw new IndexOutOfRangeException();
            } // switch

            return(result);
        } // GetDefaultSettings