Esempio n. 1
0
        private void ShowFieldChanged(DBTableInfoEx tableInfoEx)
        {
            if (tableInfoEx.ShowField)
            {
                this._tableFieldList.AddRange(tableInfoEx.DbFieldInfos);
            }
            else
            {
                this._tableFieldList.RemoveAll(t => tableInfoEx.DbFieldInfos.Contains(t));
            }

            this.txtTableFieldFilter_TextChanged(this, null);
        }
Esempio n. 2
0
        internal FTableField(DBTableInfoEx tableInfoEx)
            : this()
        {
            this.Text         = tableInfoEx.Name;
            this._tableInfoEx = tableInfoEx;
            this._tableFieldList.AddRange(tableInfoEx.DbFieldInfos);
            this._fieldInfoBindingList = new BindingCollection <DBFieldInfo>(this);
            this._indexInfoBindingList = new BindingCollection <DBIndexInfo>(this);
            this._indexInfoBindingList.AddRange(tableInfoEx.Indexs);

            this.txtTableFieldFilter_TextChanged(this, null);
            dgvTableFields.GridControl.SelectionMode = DataGridViewSelectionMode.CellSelect;
            dgvIndex.GridControl.SelectionMode       = DataGridViewSelectionMode.CellSelect;
        }
Esempio n. 3
0
        private void txtTableFieldFilter_TextChanged(object sender, EventArgs e)
        {
            try
            {
                string filter = txtTableFieldFilter.Text;
                this._fieldInfoBindingList.Clear();
                if (string.IsNullOrWhiteSpace(filter))
                {
                    this._fieldInfoBindingList.AddRange(this._tableFieldList);
                }
                else
                {
                    //字段忽略大小写相等的
                    var list = this._tableFieldList.Where(t => { return(string.Equals(t.FieldName, filter, StringComparison.OrdinalIgnoreCase)); }).ToList();

                    //包含区分大小写
                    var tmpList        = this._tableFieldList.Where(t => { return(DBTableInfoEx.StringContains(t.FieldName, filter, false)); });
                    var intersectItems = list.Intersect(tmpList);
                    list.RemoveAll(t => intersectItems.Contains(t));
                    list.AddRange(tmpList);

                    //忽略大小写
                    tmpList        = this._tableFieldList.Where(t => { return(DBTableInfoEx.StringContains(t.FieldName, filter, true)); });
                    intersectItems = list.Intersect(tmpList);
                    list.RemoveAll(t => intersectItems.Contains(t));
                    list.AddRange(tmpList);

                    //备注忽略大小写包含
                    tmpList        = this._tableFieldList.Where(t => { return(DBTableInfoEx.StringContains(t.Comments, filter, true)); });
                    intersectItems = list.Intersect(tmpList);
                    list.RemoveAll(t => intersectItems.Contains(t));
                    list.AddRange(tmpList);

                    this._fieldInfoBindingList.AddRange(list);
                }
            }
            catch (Exception ex)
            {
                Loger.Error(ex);
            }
        }