Пример #1
0
        public static ILineContainer <C> SubContainer <T, C>(this ILineContainer <T> container, Expression <Func <T, C> > property, TreeScope scope = TreeScope.Descendants)
            where T : ModifiableEntity
            where C : ModifiableEntity
        {
            PropertyRoute route = property.Body.NodeType != ExpressionType.Convert ? container.GetRoute(property) :
                                  container.GetRoute(Expression.Lambda <Func <T, IEntity> >(((UnaryExpression)property.Body).Operand, property.Parameters));

            string str = route.PropertyRouteType == PropertyRouteType.LiteEntity ? route.Parent.ToString() : route.ToString();

            var subContainer = container.Element.Element(scope, a => a.Current.Name == str);

            return(new LineContainer <C> {
                Element = subContainer, PreviousRoute = typeof(C).IsEmbeddedEntity() ? route : null
            });
        }
Пример #2
0
        public static ValueLineProxy ValueLine <T, V>(this ILineContainer <T> lineContainer, Expression <Func <T, V> > property)
            where T : ModifiableEntity
        {
            string        newPrefix;
            PropertyRoute newRoute = lineContainer.GetRoute(property, out newPrefix);

            return(new ValueLineProxy(lineContainer.Selenium, newPrefix, newRoute));
        }
Пример #3
0
        public static bool HasError <T, S>(this ILineContainer <T> lineContainer, Expression <Func <T, S> > property)
            where T : ModifiableEntity
        {
            string        newPrefix;
            PropertyRoute newRoute = lineContainer.GetRoute(property, out newPrefix);

            return(lineContainer.Selenium.HasError(newPrefix));
        }
Пример #4
0
        public static QueryTokenBuilderProxy QueryTokenBuilder <T>(this ILineContainer <T> lineContainer, Expression <Func <T, QueryTokenEmbedded> > property)
            where T : ModifiableEntity
        {
            string        newPrefix;
            PropertyRoute newRoute = lineContainer.GetRoute(property, out newPrefix);

            return(new QueryTokenBuilderProxy(lineContainer.Selenium, newPrefix + "_"));
        }
Пример #5
0
        public static DetailGridProxy DetailGrid(this ILineContainer <OrderEntity> container)
        {
            PropertyRoute route = container.GetRoute((OrderEntity o) => o.Details);

            var grid = container.Element.Element(TreeScope.Descendants, a => a.Current.ClassName == "ImmediateGrid" && a.Current.Name == route.ToString());

            return(new DetailGridProxy(grid));
        }//DetailGrid
Пример #6
0
        public static ILineContainer <S> EntityDetailControl <T, S>(this ILineContainer <T> container, Expression <Func <T, S> > property, TreeScope scope = TreeScope.Descendants)
            where T : ModifiableEntity
            where S : ModifiableEntity
        {
            PropertyRoute route = container.GetRoute(property);

            return(container.EntityDetail(route, scope).GetDetailControl <S>());
        }
Пример #7
0
        public static V EntityComboValue <T, V>(this ILineContainer <T> container, Expression <Func <T, V> > property, TreeScope scope = TreeScope.Descendants) where T : ModifiableEntity
        {
            PropertyRoute route = container.GetRoute(property);

            var lite = container.EntityCombo(route, scope).LiteValue;

            return(lite is V ? (V)lite : (V)lite.Retrieve());
        }
Пример #8
0
        public static LineContainer <S> SubContainer <T, S>(this ILineContainer <T> lineContainer, Expression <Func <T, S> > property)
            where T : ModifiableEntity
            where S : ModifiableEntity
        {
            string        newPrefix;
            PropertyRoute newRoute = lineContainer.GetRoute(property, out newPrefix);

            return(new LineContainer <S>(lineContainer.Selenium, newPrefix, newRoute));
        }
Пример #9
0
        public static EntityRepeaterProxy EntityRepeater <T>(this ILineContainer <T> container, Expression <Func <T, object> > property, TreeScope scope = TreeScope.Descendants) where T : ModifiableEntity
        {
            PropertyRoute route = container.GetRoute(property);

            return(container.EntityRepeater(route, scope));
        }
Пример #10
0
        public static void EntityComboValue <T, V>(this ILineContainer <T> container, Expression <Func <T, V> > property, V value, TreeScope scope = TreeScope.Descendants) where T : ModifiableEntity
        {
            PropertyRoute route = container.GetRoute(property);

            container.EntityCombo(route, scope).LiteValue = value as Lite <IEntity> ?? ((IEntity)value).ToLite();
        }
Пример #11
0
        public static void ValueLineValue <T, V>(this ILineContainer <T> container, Expression <Func <T, V> > property, V value, TreeScope scope = TreeScope.Descendants) where T : ModifiableEntity
        {
            PropertyRoute route = container.GetRoute(property);

            container.ValueLine(route, scope).Value = value;
        }