Beispiel #1
0
        public void RefreshAutocompleteForDatabase()
        {
            //create autocomplete popup menu

            var actTables       = StaticTreeClass.GetAllTableObjects(_dbReg);
            var actSystemTables = StaticTreeClass.GetSystemTableObjects(_dbReg);
            var actViews        = StaticTreeClass.GetViewObjects(_dbReg);

            _popupMenu = new AutocompleteMenu(_txtBox)
            {
                MinFragmentLength = 1
            };

            var words = new List <string>();

            words.AddRange(SqlCommands());
            words.AddRange(DatabaseTables(actTables));
            words.AddRange(DatabaseViews(actViews));
            words.AddRange(DatabaseSystemTables(actSystemTables));

            if (actTables != null)
            {
                words.AddRange(DatabaseTableFields(actTables));
            }
            if (actViews != null)
            {
                words.AddRange(DatabaseViewFields(actViews));
            }
            if (actSystemTables != null)
            {
                words.AddRange(DatabaseSystemTableFields(actSystemTables));
            }

            _popupMenu.SearchPattern = @"[\w\.$]";
            _popupMenu.Items.SetAutocompleteItems(words);
            _popupMenu.AllowTabKey = true;

            //size of popupmenu
            _popupMenu.Items.MaximumSize = new System.Drawing.Size(400, 500);
            _popupMenu.Items.Width       = 400;
        }
Beispiel #2
0
        public string[] DatabaseTables()
        {
            var actTables = StaticTreeClass.GetAllTableObjects(_dbReg);

            return(DatabaseTables(actTables));
        }