Пример #1
0
        internal PpsActionDefinition(PpsEnvironment environment, XElement xCur, ref int priority)
            : base(environment, xCur.GetAttribute("name", String.Empty))
        {
            displayName  = xCur.GetAttribute("displayName", Name);
            displayImage = xCur.GetAttribute("displayImage", "star");
            description  = xCur.GetAttribute("description", null);
            isHidden     = xCur.GetAttribute("isHidden", false);
            Priority     = priority = xCur.GetAttribute("priority", priority + 1);

            // compile condition
            condition = environment.CreateChunk(xCur.Element(xnCondition), true);
            // compile action
            code = environment.CreateChunk(xCur.Element(xnCode), true);
        }         // ctor
Пример #2
0
        internal PpsViewDefinition(PpsEnvironment environment, XElement xDefinition)
            : base(environment, xDefinition.GetAttribute("name", null))
        {
            viewId = xDefinition.GetAttribute("view", String.Empty);
            if (String.IsNullOrEmpty(viewId))
            {
                throw new ArgumentException("List viewId is missing.");
            }

            viewBaseFilter = PpsDataFilterExpression.Parse(xDefinition.GetAttribute("filter", String.Empty));
            displayName    = xDefinition.GetAttribute("displayName", this.Name);
            displayImage   = xDefinition.GetAttribute("displayImage", this.Name);

            visibleCondition = environment.CreateChunk(xDefinition.Element(xnVisible), true);

            // parse the filters
            var priority = 0;

            this.filters = (
                from c in xDefinition.Elements(xnFilter)
                select new PpsViewFilter(c, ref priority)
                ).OrderBy(c => c.Priority).ToArray();

            // parse orders
            priority        = 0;
            this.sortOrders = (
                from c in xDefinition.Elements(xnOrder)
                select new PpsViewOrder(c, ref priority)
                ).OrderBy(c => c.Priority).ToArray();
        }         // ctor