コード例 #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="modelName"></param>
        /// <param name="props"></param>
        /// <param name="item"></param>
        /// <param name="attrs"></param>
        protected virtual void GetModelProperties(string modelName, PropertyDescriptorCollection props, object item, ConfigItemCollection attrs)
        {
            var model = Ext.Net.Model.Get(modelName);
            if (model == null)
            {
                return;
            }

            foreach (var field in model.Fields)
            {
                object value = this.GetFieldValue(props, item, field);
                if (value != null)
                {
                    attrs.Add(new ConfigItem(string.IsNullOrEmpty(field.Mapping) ? field.Name : field.Mapping, JSON.Serialize(value), ParameterMode.Raw));
                }
            }
        }