コード例 #1
0
 public RangeExtent GetExtent(FacetConfig2 config, int default_interval_count = 120)
 {
     var(lower, upper) = GetUpperLowerBounds(config.Facet);    // Fetch from database
     return(new RangeExtent
     {
         Lower = lower,
         Upper = upper,
         Count = default_interval_count
     });
 }
コード例 #2
0
        public static FacetConfig2 Create(Facet facet, int position)
        {
            var config = new FacetConfig2
            {
                Facet     = facet,
                Picks     = new List <FacetConfigPick>(),
                FacetCode = facet.FacetCode,
                Position  = position
            };

            return(config);
        }
コード例 #3
0
        private RangeExtent GetPickExtent(FacetConfig2 config, int default_interval_count = 120)
        {
            var picks = config.GetPickValues(true);                                  // get client picked bound if exists...

            if (picks.Count >= 2)
            {
                return(new RangeExtent
                {
                    Lower = picks[0],
                    Upper = picks[1],
                    Count = ((picks.Count > 2) && ((int)picks[2] > 0)) ? (int)picks[2] : default_interval_count
                });
            }
            return(null);
        }
コード例 #4
0
 public static bool ContainsFacetConfig(this IEnumerable <FacetConfig2> facetConfigs, FacetConfig2 facetConfig)
 {
     return(facetConfigs.Contains(facetConfig));
 }