/// ------------------------------------------------------------------------------------ public CIEOptionsDropDown(CIEOptions.CIEType cieType) { Canceled = false; InitializeComponent(); _groupUncertainties.Visible = false; lnkCancel.Visible = false; lnkOk.Visible = false; SetupControls(); CIEOptions = (App.Project != null ? App.Project.CIEOptions.Clone() : new CIEOptions()); _cieType = cieType; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Refreshes the search results by performing the search again and rebuilding the /// grid contents. /// </summary> /// <param name="cieType"></param> /// ------------------------------------------------------------------------------------ public void RefreshResults(CIEOptions.CIEType cieType) { int savCurrRowIndex = 0; int savCurrColIndex = 0; int savFirstRowIndex = 0; SortOptions savSortOptions = null; CIEOptions savCIEOptions = null; if (_errorControl != null) { Controls.Remove(_errorControl); _errorControl.Dispose(); _errorControl = null; } if (_grid != null) { // Save the index of the row and column that's current, the // index of the first visible row, and the current sort options. savCurrRowIndex = (_grid.CurrentRow != null ? _grid.CurrentRow.Index : 0); savCurrColIndex = (_grid.CurrentCell != null ? _grid.CurrentCell.ColumnIndex : 0); savFirstRowIndex = _grid.FirstDisplayedScrollingRowIndex; savSortOptions = _grid.SortOptions; savCIEOptions = _grid.CIEOptions; if (savCIEOptions != null) { savCIEOptions.CieType = cieType; } } App.InitializeProgressBar(App.kstidQuerySearchingMsg); var resultCache = App.Search(_query); if (resultCache != null) { resultCache.SearchQuery = _query; Initialize(resultCache); } // Restore the current row to what it was before // rebuilding. Then make sure the row is visible. if (_grid != null) { _grid.PostDataSourceModifiedRestore(savCurrRowIndex, savCurrColIndex, savFirstRowIndex, savSortOptions, savCIEOptions); } App.UninitializeProgressBar(); }