Beispiel #1
0
        /// <summary>Parse string representation from ToString.</summary>
        /// <param name="data"></param>
        /// <param name="list"></param>
        /// <returns></returns>
        public static bool TryParse(string data, out PpsDataQuery list)
        {
            var arguments = HttpUtility.ParseQueryString(data, Encoding.UTF8);
            var viewId    = arguments["v"];

            if (String.IsNullOrEmpty(viewId))
            {
                list = null;
                return(false);
            }

            list = new PpsDataQuery(viewId);

            var f = arguments["f"];

            if (!String.IsNullOrEmpty(f))
            {
                list.Filter = PpsDataFilterExpression.Parse(f);
            }

            var l = arguments["l"];

            if (!String.IsNullOrEmpty(l))
            {
                list.Columns = PpsDataColumnExpression.Parse(l).ToArray();
            }

            var o = arguments["o"];

            if (!String.IsNullOrEmpty(o))
            {
                list.Order = PpsDataOrderExpression.Parse(o).ToArray();
            }

            var s = arguments["s"];

            if (!String.IsNullOrEmpty(s))
            {
                list.Start = Int32.Parse(s);
            }
            var c = arguments["c"];

            if (!String.IsNullOrEmpty(c))
            {
                list.Count = Int32.Parse(c);
            }

            var a = arguments["a"];

            if (!String.IsNullOrEmpty(a))
            {
                list.AttributeSelector = a;
            }

            return(true);
        }         // func TryParse
Beispiel #2
0
        }         // ctor

        /// <summary>Copy parameter.</summary>
        /// <param name="copy"></param>
        public PpsDataQuery(PpsDataQuery copy)
        {
            if (copy == null)
            {
                copy = Empty;
            }

            ViewId = copy.ViewId;
            Filter = copy.Filter;
            Order  = copy.Order;
            Start  = copy.Start;
            Count  = copy.Count;
        }         // ctor