Esempio n. 1
0
 public QcProTaskJobDescriptor(DynamicDataRowObject DynamicObject)
     : base(DynamicObject
            , readonlyfields
            , catetory
            , converter
            )
 {
 }
 public QcStandardDescriptor(DynamicDataRowObject DynamicObject)
     : base(DynamicObject
            , readonlyfields
            , catetory
            , converter
            )
 {
 }
Esempio n. 3
0
 public QcElementDescriptor(DynamicDataRowObject DynamicObject)
     : base(DynamicObject)
 {
     if (DynamicObject is QcCheckEntry)
     {
         this._readonlyfields = CheckEntryreadonlyfields;
         this._dicconverter   = checkentryconverter;
     }
 }
 /// <summary>
 ///  从指定的行构建一个动态对象
 /// </summary>
 /// <param name="row">数据行</param>
 /// <param name="tablename">数据表名</param>
 public DynamicDataRowObject(DataRow row, string tablename = null)
 {
     if (row == null)
     {
         if (tablename == null)
         {
             return;
         }
         row = DynamicDataRowObject.GetNewDataRow(tablename);
     }
     this.row = row;
     if (tablename == null)
     {
         tablename = row.Table.TableName;
     }
     this.tablename = tablename;
 }
Esempio n. 5
0
        public static bool CloneFields(this DynamicDataRowObject dest, DynamicDataRowObject src)
        {
            if (src.GetRow().Table.TableName != dest.GetRow().Table.TableName)
            {
                return(false);
            }
            var cols = src.GetRow().Table.Columns;

            foreach (DataColumn c in cols)
            {
                if (fieldfilter.Any(t => c.ColumnName.Contains(t)))
                {
                    continue;
                }
                dest[c.ColumnName] = src[c.ColumnName];
            }
            return(true);
        }
        /// <summary>
        ///  构建一个动态数据类描述器
        /// </summary>
        /// <param name="DynamicObject">动态数据行对象</param>
        /// <param name="readonlyfields">只读字段集合</param>
        /// <param name="diccatetory">分类集合</param>
        /// <param name="dicconverter">转换器集合</param>
        public DynamicTypeDescriptor(DynamicDataRowObject DynamicObject,
                                     IEnumerable <string> readonlyfields                = null
                                     , IDictionary <string, string> diccatetory         = null
                                     , IDictionary <string, TypeConverter> dicconverter = null
                                     )
        {
            RowObject = DynamicObject;


            if (readonlyfields == null)
            {
                this._readonlyfields = DynamicTypeDescriptor._defaultreadonly;
            }
            else
            {
                this._readonlyfields = readonlyfields;
            }
            if (diccatetory == null)
            {
                this._diccatetory = DynamicTypeDescriptor._defaultdiccatedory;
            }
            else
            {
                this._diccatetory = diccatetory;
            }
            if (dicconverter == null)
            {
                this._dicconverter = DynamicTypeDescriptor._defaultconverter;
            }
            else
            {
                this._dicconverter = dicconverter;
            }

            //可见性初始化
            foreach (DataColumn c in row.Table.Columns)
            {
                if (!propertyBrowsable.Keys.Contains(c.ColumnName))
                {
                    propertyBrowsable.Add(c.ColumnName, true);
                }
            }
        }
 /// <summary>
 /// 构建一个属性描述其
 /// </summary>
 /// <param name="row"></param>
 /// <param name="name"></param>
 /// <param name="readonlyflag"></param>
 /// <param name="catetory"></param>
 /// <param name="converter"></param>
 public DynamicPropertyDescriptor(DynamicDataRowObject obj, string name
                                  , bool readonlyflag       = false
                                  , string catetory         = ""
                                  , TypeConverter converter = null
                                  , bool isBrowsable        = false
                                  , Attribute[] atts        = null)
     : base(name, atts)
 {
     this.obj        = obj;
     _name           = name;
     this._readonly  = readonlyflag;
     this._catetory  = catetory;
     this._converter = converter;
     _isBrowsable    = isBrowsable;
     if (this._converter == null)
     {
         this._converter = base.Converter;
     }
 }
Esempio n. 8
0
 /// <summary>
 /// 构建针对对象的检查结果
 /// </summary>
 /// <param name="obj"></param>
 public QcCheckResult(DynamicDataRowObject obj)
     : base()
 {
     m_CheckObject = obj;
 }
 public QcProductLevelDescriptor(DynamicDataRowObject DynamicObject)
     : base(DynamicObject
            , DynamicObject.IsNew()?QcProductLevelDescriptor.readonlyfields:null)
 {
 }