internal SearchViewState SetSearchViewFlags(SearchViewFlags flags)
        {
            context.options |= ToSearchFlags(flags);

            this.flags = flags;

            if (flags.HasAny(SearchViewFlags.CompactView))
            {
                itemSize      = 0;
                forceViewMode = true;
            }
            if (flags.HasAny(SearchViewFlags.ListView))
            {
                itemSize      = (float)DisplayMode.List;
                forceViewMode = true;
            }
            if (flags.HasAny(SearchViewFlags.GridView))
            {
                itemSize      = (float)DisplayMode.Grid;
                forceViewMode = true;
            }
            if (flags.HasAny(SearchViewFlags.TableView))
            {
                itemSize      = (float)DisplayMode.Table;
                forceViewMode = true;
            }
            return(this);
        }
        internal static SearchFlags ToSearchFlags(SearchViewFlags flags)
        {
            var sf = SearchFlags.None;

            if (flags.HasAny(SearchViewFlags.Debug))
            {
                sf |= SearchFlags.Debug;
            }
            if (flags.HasAny(SearchViewFlags.NoIndexing))
            {
                sf |= SearchFlags.NoIndexing;
            }
            if (flags.HasAny(SearchViewFlags.Packages))
            {
                sf |= SearchFlags.Packages;
            }
            return(sf);
        }