コード例 #1
0
        public static ModelViewProperty CreateInstance(IModelType parent, string name)
        {
            if (parent == null)
            {
                return(null);
            }

            if (string.IsNullOrWhiteSpace(name))
            {
                return(null);
            }

            name = name.Trim();
            IModelProperty modelProperty = parent.GetProperty(name);

            if (modelProperty == null)
            {
                throw new EtkException($"Cannot find property '{name}' for model type {parent.Name}");
            }

            return(new ModelViewProperty(parent, modelProperty));
        }