Пример #1
0
        // Load AutocompleteItem ( after Lexer changed )
        private void ReloadAutocompleteMenu()
        {
            _autocompleteMenu.Clear();

            switch (ScintillaEditor.Lexer)
            {
            case Lexer.Container:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Container.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Container.txt");
                }
                break;

            case Lexer.Null:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Null.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Null.txt");
                }
                break;

            case Lexer.Ada:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Ada.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Ada.txt");
                }
                break;

            case Lexer.Asm:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Asm.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Asm.txt");
                }
                break;

            case Lexer.Batch:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Batch.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Batch.txt");
                }
                break;

            case Lexer.Cpp:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Cpp.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Cpp.txt");
                }
                break;

            case Lexer.Css:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Css.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Css.txt");
                }
                break;

            case Lexer.Fortran:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Fortran.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Fortran.txt");
                }
                break;

            case Lexer.FreeBasic:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\FreeBasic.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\FreeBasic.txt");
                }
                break;

            case Lexer.Html:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Html.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Html.txt");
                }
                break;

            case Lexer.Json:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Json.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Json.txt");
                }
                break;

            case Lexer.Lisp:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Lisp.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Lisp.txt");
                }
                break;

            case Lexer.Lua:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Lua.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Lua.txt");
                }
                break;

            case Lexer.Pascal:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Pascal.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Pascal.txt");
                }
                break;

            case Lexer.Perl:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Perl.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Perl.txt");
                }
                break;

            case Lexer.PhpScript:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\PhpScript.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\PhpScript.txt");
                }
                break;

            case Lexer.PowerShell:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\PowerShell.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\PowerShell.txt");
                }
                break;

            case Lexer.Properties:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Properties.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Properties.txt");
                }
                break;

            case Lexer.PureBasic:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\PureBasic.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\PureBasic.txt");
                }
                break;

            case Lexer.Python:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Python.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Python.txt");
                }
                break;

            case Lexer.Ruby:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Ruby.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Ruby.txt");
                }
                break;

            case Lexer.Smalltalk:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Smalltalk.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Cpp.txt");
                }
                break;

            case Lexer.Sql:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Sql.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Sql.txt");
                }
                break;

            case Lexer.Vb:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Vb.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Vb.txt");
                }
                break;

            case Lexer.VbScript:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\VbScript.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\VbScript.txt");
                }
                break;

            case Lexer.Verilog:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Verilog.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Verilog.txt");
                }
                break;

            case Lexer.Xml:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Xml.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Xml.txt");
                }
                break;

            case Lexer.BlitzBasic:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\BlitzBasic.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\BlitzBasic.txt");
                }
                break;

            case Lexer.Markdown:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Markdown.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\Markdown.txt");
                }
                break;

            case Lexer.R:
                if (File.Exists($"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\R.txt"))
                {
                    _autocompleteMenu.LoadSuggestions(
                        $"{ResourcesDirectory}\\{CodeSuggestionsDirectoryName}\\R.txt");
                }
                break;

            default:
                break;
            }
        }