/// <summary>
 /// Initializes a new instance of the <see cref="FigureSort"/> class.
 /// </summary>
 /// <param name="figures">The figures<see cref="IFigures"/>.</param>
 public FigureSort(IFigures figures)
 {
     this.Figures = figures;
     Terms        = new SortTerms(figures);
 }
Exemple #2
0
        /// <summary>
        /// The Query.
        /// </summary>
        /// <param name="figures">The figures<see cref="IFigures"/>.</param>
        /// <param name="stage">The stage<see cref="int"/>.</param>
        /// <param name="filter">The filter<see cref="FilterTerms"/>.</param>
        /// <param name="sort">The sort<see cref="SortTerms"/>.</param>
        /// <param name="saveonly">The saveonly<see cref="bool"/>.</param>
        /// <param name="clearonend">The clearonend<see cref="bool"/>.</param>
        /// <returns>The <see cref="IFigures"/>.</returns>
        public static IFigures Query(this IFigures figures, int stage = 1, FilterTerms filter = null, SortTerms sort = null, bool saveonly = false, bool clearonend = false)
        {
            FigureFilter Filter = figures.Filter;
            FigureSort   Sort   = figures.Sort;

            if (filter != null)
            {
                Filter.Terms.Renew(filter.ToArray());
            }
            if (sort != null)
            {
                Sort.Terms.Renew(sort.ToArray());
            }
            if (!saveonly)
            {
                IFigures result = ResolveQuery(figures, Filter, Sort, stage);
                if (clearonend)
                {
                    figures.Filter.Terms.Clear();
                    figures.Filter.Evaluator  = null;
                    figures.View.QueryFormula = null;
                }
                return(result);
            }
            return(null);
        }
Exemple #3
0
        /// <summary>
        /// The Clone.
        /// </summary>
        /// <returns>The <see cref="SortTerms"/>.</returns>
        public SortTerms Clone()
        {
            SortTerms mx = (SortTerms)this.MemberwiseClone();

            return(mx);
        }