Beispiel #1
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            SearhProgressState _stateobj;

            _searchResult = new List <MDSearch_ResultDataIndex>();
            List <MDSearch_Column> _searchColumns = new List <MDSearch_Column>();

            using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient())
            {
                foreach (MD_QueryModel _qm in _selectModels)
                {
                    List <MDSearch_Column> _columns = _msc.GetSearchResultColumn(_searchText, _searchType, _searchConceptGroup,
                                                                                 _qm.FullName).ToList <MDSearch_Column>();
                    foreach (MDSearch_Column _sc in _columns)
                    {
                        _sc.QueryModel = _qm;
                        _searchColumns.Add(_sc);
                    }
                }
            }
            decimal i      = 0;
            decimal _count = Convert.ToDecimal(_searchColumns.Count);
            List <MDSearch_ResultDataIndex> _resultData = null;

            using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient())
            {
                foreach (MDSearch_Column _sc in _searchColumns)
                {
                    string  _str      = string.Format("正在搜索:[{0}]数据源中的{1} ....", _sc.QueryModel.DisplayTitle, string.Format("[{0}].[{1}]", _sc.TableTitle, _sc.ColumnTitle));
                    decimal _progress = i / _count * 100;
                    _stateobj = new SearhProgressState(_str, null);
                    this.backgroundWorker1.ReportProgress(Convert.ToInt32(_progress), _stateobj);
                    _resultData = _msc.GetSearchResult(_searchText, _searchType, _sc).ToList <MDSearch_ResultDataIndex>();
                    _stateobj   = new SearhProgressState(_str, _resultData);
                    this.backgroundWorker1.ReportProgress(Convert.ToInt32(_progress), _stateobj);
                    i++;
                }
            }
        }