private void FigureOutGlobalsAndAutoComplete() { var factory = new FilterUIOptionsFactory(); var options = factory.Create(_extractionFilter); var autoCompleteFactory = new AutoCompleteProviderFactory(Activator); _autoCompleteProvider = autoCompleteFactory.Create(_extractionFilter.GetQuerySyntaxHelper()); foreach (var t in options.GetTableInfos()) { _autoCompleteProvider.Add(t); } foreach (var c in options.GetIColumnsInFilterScope()) { _autoCompleteProvider.Add(c); } GlobalFilterParameters = options.GetGlobalParametersInFilterScope(); foreach (ISqlParameter parameter in GlobalFilterParameters) { _autoCompleteProvider.Add(parameter); } _autoCompleteProvider.RegisterForEvents(QueryEditor); }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { _collection = (IViewSQLAndResultsCollection)collection; CommonFunctionality.ClearToolStrip(); btnExecuteSql.Image = activator.CoreIconProvider.GetImage(RDMPConcept.SQL, OverlayKind.Execute); var overlayer = new IconOverlayProvider(); btnResetSql.Image = overlayer.GetOverlay(FamFamFamIcons.text_align_left, OverlayKind.Problem); if (_autoComplete == null) { _autoComplete = new AutoCompleteProviderFactory(activator).Create(_collection.GetQuerySyntaxHelper()); _collection.AdjustAutocomplete(_autoComplete); _autoComplete.RegisterForEvents(_scintilla); } SetItemActivator(activator); CommonFunctionality.Add(btnExecuteSql); CommonFunctionality.Add(btnResetSql); foreach (var c in _timeoutControls.GetControls()) { CommonFunctionality.Add(c); } foreach (DatabaseEntity d in _collection.GetToolStripObjects()) { CommonFunctionality.AddToMenu(new ExecuteCommandShow(activator, d, 0, true)); } CommonFunctionality.Add(new ToolStripSeparator()); CommonFunctionality.Add(_serverHeader); try { var dap = _collection.GetDataAccessPoint(); _serverHeader.Text = $"Server: {dap.Server} Database: {dap.Database}"; _serverHeader.Image = _databaseTypeIconProvider.GetImage(dap.DatabaseType); } catch (Exception) { _serverHeader.Text = "Server:Unknown"; } RefreshUIFromDatabase(); }
private void SetupAutocomplete() { //if there's an old one dispose it if (_autoComplete == null) { _autoComplete = new AutoCompleteProviderFactory(Activator).Create(_processTask.LoadMetadata.GetQuerySyntaxHelper()); } else { _autoComplete.Clear(); } foreach (var table in _processTask.LoadMetadata.GetDistinctTableInfoList(false)) { _autoComplete.Add(table, _processTask.LoadStage); } _autoComplete.RegisterForEvents(_scintilla); }