Example #1
0
 public void Reset()
 {
     if (_class == null) return;
     if (cursor != null) cursor.Dispose();
     cursor = _class.Search(new QueryFilter());
     _count=0;
 }
Example #2
0
        async private void btnCompleteList_Click(object sender, EventArgs e)
        {
            if (_tc == null || lstFields.SelectedItems == null)
            {
                return;
            }
            string fieldName = lstFields.SelectedItem.ToString().Replace("[", String.Empty).Replace("]", String.Empty); // Joined Fields [...]
            IField field     = _tc.FindField(fieldName);

            DistinctFilter filter = new DistinctFilter(field.name);

            lstUniqueValues.Items.Clear();

            this.Cursor = Cursors.WaitCursor;

            ICursor cursor = await _tc.Search(filter);

            if (cursor == null)
            {
                return;
            }

            _cancelTracker.Reset();
            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork             += new DoWorkEventHandler(CompleteList_DoWork);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CompleteList_RunWorkerCompleted);
            bw.RunWorkerAsync(cursor);
        }
Example #3
0
        async private void FormDataTable_Load(object sender, System.EventArgs e)
        {
            var value = _tableClass;

            _maxNewSelectedRows = 200;
            _selectedRowIndices = new List <int>();
            grid.DataSource     = null;

            _tableClass = value;
            if (_tableClass == null)
            {
                return;
            }

            grid.DefaultCellStyle.BackColor = Color.White;

            gView.Framework.Data.QueryFilter filter = new gView.Framework.Data.QueryFilter();
            foreach (IField field in _tableClass.Fields.ToEnumerable())
            {
                if (field.type == FieldType.binary || field.type == FieldType.Shape)
                {
                    continue;
                }
                filter.AddField(field.name);
            }
            //filter.SubFields="*";

            ICursor cursor = await _tableClass.Search(filter);

            if (cursor is IFeatureCursor)
            {
                _result = new FeatureTable((IFeatureCursor)cursor, _tableClass.Fields, _tableClass);
            }
            else if (cursor is IRowCursor)
            {
                _result = new RowTable((IRowCursor)cursor, _tableClass.Fields);
            }
            else
            {
                return;
            }

            _result.RowsAddedToTable -= new RowsAddedToTableEvent(RowsAddedToTable);

            progress1.Minimum = 0;
            progress1.Visible = true;
            progress1.Value   = 0;
            await _result.Fill(progress1.Maximum = 200);

            _result.RowsAddedToTable += new RowsAddedToTableEvent(RowsAddedToTable);

            _viewTable = null;         // in PrepareDataView neu anlegen...
            PrepareDataView(_result.Table);
            cmbShow.SelectedIndex = 0; // hier wird auch MarkSelected durchgeführt
            progress1.Visible     = false;
        }
Example #4
0
        public FormQueryBuilder(ITableClass tc)
        {
            _tc = tc;

            InitializeComponent();
            if (_tc == null)
            {
                return;
            }

            gView.Framework.Data.QueryFilter filter = new gView.Framework.Data.QueryFilter();
            filter.SubFields = "*";

            using (ICursor cursor = _tc.Search(filter))
            {
                if (cursor is IFeatureCursor)
                {
                    _table = new FeatureTable((IFeatureCursor)cursor, _tc.Fields, _tc);
                }
                else if (cursor is IRowCursor)
                {
                    _table = new RowTable((IRowCursor)cursor, _tc.Fields);
                }
                else
                {
                    return;
                }
                _table.Fill(2000);
            }

            cmbMethod.SelectedIndex = 0;
            foreach (IField field in _tc.Fields.ToEnumerable())
            {
                if (field.type == FieldType.binary ||
                    field.type == FieldType.Shape)
                {
                    continue;
                }

                lstFields.Items.Add(Field.WhereClauseFieldName(field.name));
            }
        }
Example #5
0
 public TableClassBindingSource(ITableClass Class)
 {
     _class = Class;
     if (_class == null) return;
     cursor = Class.Search(new QueryFilter());
 }