Beispiel #1
0
        protected PFModelConfig GetModelPropertyConfig <TModel, TProperty>(HtmlHelper htmlHelper, Expression <Func <TModel, TProperty> > expression)
        {
            var modelType = typeof(TModel);
            //var modelConfig = PFDataHelper.GetModelConfig(modelType.Name, modelType.FullName);
            //if (modelConfig == null)
            //{
            //    modelConfig = htmlHelper.ViewData["modelConfig"] as PFModelConfigCollection;
            //}
            var modelConfig = PFDataHelper.MergeModelConfig(
                PFDataHelper.GetModelConfig(modelType.Name, modelType.FullName),
                htmlHelper.ViewData["modelConfig"] as PFModelConfigCollection
                );

            if (modelConfig == null)
            {
                return(null);
            }
            var propertyName = ExpressionHelper.GetExpressionText(expression);
            var config       = modelConfig[propertyName];

            return(config);
        }
Beispiel #2
0
 public void SetModelConfig(string name, string fullName)
 {
     _modelConfig = PFDataHelper.GetModelConfig(name, fullName);
 }