Ejemplo n.º 1
0
        public static TPropertyData GetPropertyGroupProperty <TPageTypePropertyGroup, TPropertyData>(this TPageTypePropertyGroup propertyGroup, Expression <Func <TPageTypePropertyGroup, object> > expression)
            where TPageTypePropertyGroup : PageTypePropertyGroup
            where TPropertyData : PropertyData
        {
            MemberExpression memberExpression = GetMemberExpression(expression);
            string           propertyName     = PageTypePropertyGroupHierarchy.ResolvePropertyName(propertyGroup.Hierarchy.Value, memberExpression.Member.Name);
            PropertyData     propertyData     = propertyGroup.TypedPageData.Property[propertyName];

            return((TPropertyData)propertyData);
        }
Ejemplo n.º 2
0
        public static TProperty GetPropertyGroupPropertyValue <TPageTypePropertyGroup, TProperty>(this TPageTypePropertyGroup propertyGroup, Expression <Func <TPageTypePropertyGroup, TProperty> > expression,
                                                                                                  bool usePropertyGetHandler) where TPageTypePropertyGroup : PageTypePropertyGroup
        {
            MemberExpression memberExpression = GetMemberExpression(expression);
            string           propertyName     = PageTypePropertyGroupHierarchy.ResolvePropertyName(propertyGroup.Hierarchy.Value, memberExpression.Member.Name);

            object value;

            if (usePropertyGetHandler)
            {
                value = propertyGroup.TypedPageData[propertyName];
            }
            else
            {
                value = propertyGroup.TypedPageData.GetValue(propertyName);
            }

            return(ConvertToRequestedType <TProperty>(value));
        }
Ejemplo n.º 3
0
 public static string GetPropertyGroupPropertyName <TPageTypePropertyGroup>(this TPageTypePropertyGroup propertyGroup, Expression <Func <TPageTypePropertyGroup, object> > expression)
     where TPageTypePropertyGroup : PageTypePropertyGroup
 {
     return(PageTypePropertyGroupHierarchy.ResolvePropertyName(propertyGroup.Hierarchy.Value, GetMemberExpression(expression).Member.Name));
 }