⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 abstractrecord.cs

📁 一种.net实现ajax方法的类库
💻 CS
📖 第 1 页 / 共 5 页
字号:
            {                PropertyInfo pi = this.GetType().GetProperty(Name);                if (pi == null)                {                    return null;                }                return pi.GetValue(this, null);            }            set            {                PropertyInfo pi = this.GetType().GetProperty(Name);                if (pi == null)                {                    return;                }                pi.SetValue(this, PropertyConverter.Convert(value, pi.PropertyType), null);                if (NotifyPropertyChangedHandlers.ContainsKey(Name))                {                    NotifyPropertyChangedHandlers[Name]();                }                FireChangeEvents();            }        }        protected void FireChangeEvents()        {            if (OnChange != null)                OnChange(this);            if (changedRecordListeners.ContainsKey(this.GetType()))                changedRecordListeners[this.GetType()](this);        }        public virtual int ComputeRecordWeight()        {            return 1;        }        virtual public ColumnInfo[] Fields        {            get            {                if (!ColumnInfoManager.TypeIsRegistered(this.GetType()))                {                    List<PropertyInfo> props = DiscoverDerivedProperties(this.GetType());                    List<ColumnInfo> fs = new List<ColumnInfo>();                    foreach (PropertyInfo pi in props)                    {                        ColumnInfo fi = new ColumnInfo();                        fi.Name = pi.Name;                        fi.Type = pi.PropertyType;                        PropertyTypeAttribute pta = getPropertyTypeAttribute(pi);                        if (pta != null)                            fi.DataType = pta.Type;                        else                        {                            fi.DataType = DataType.None;                            if (TypeIsRecordList(fi.Type))                                fi.DataType = DataType.RecordList;                            else                                fi.DataType = DataType.None;                        }                        fs.Add(fi);                    }                    ColumnInfoManager.RegisterColumns(this.GetType(), fs.ToArray());                }                return ColumnInfoManager.RequestColumns(this.GetType());            }			set			{				throw new System.NotImplementedException("That feature is not implemented.");			}        }        public virtual Type GetFieldTypeFromName(string name)        {            return GetFieldInfoFromName(name).Type;        }        public ColumnInfo GetFieldInfoFromName(string name)        {            foreach (ColumnInfo fi in Fields)                if (fi.Name == name)                    return fi;            return null;        }        virtual public string toJSON(JSON.Type transportType, List<DataGridColumn> columns)        {            string open = "[", close = "]";            if (transportType == JSON.Type.Object)            {                open = "{";                close = "}";            }            List<string> props = new List<string>();            foreach (DataGridColumn col in columns)            {                string val;                if (this[col.Name] != null)                {                    val = JSON.PrepareValueForJSON(this[col.Name]);                }                else                {                    val = "null";                }                switch (transportType)                {                    case JSON.Type.Object:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -