Beispiel #1
0
        private void AddInterpreterClick(object sender, EventArgs e)
        {
            var newInterp = new NewInterpreter();

            newInterp.Font = Font;
            if (newInterp.ShowDialog() == DialogResult.OK)
            {
                if (!_showSettingsFor.Enabled)
                {
                    // previously we had no interpreters, re-enable the control
                    _showSettingsFor.Items.Clear();
                    _defaultInterpreter.Items.Clear();
                    _defaultInterpreter.Enabled = true;
                    _showSettingsFor.Enabled    = true;
                }
                var id         = Guid.NewGuid();
                var factory    = new InterpreterPlaceholder(id, newInterp.InterpreterDescription);
                var newOptions = new InterpreterOptions(_serviceProvider.GetPythonToolsService(), factory)
                {
                    Display              = newInterp.InterpreterDescription,
                    Added                = true,
                    IsConfigurable       = true,
                    SupportsCompletionDb = true,
                    Id                 = id,
                    Factory            = factory,
                    InteractiveOptions = new PythonInteractiveOptions(
                        _serviceProvider,
                        _serviceProvider.GetPythonToolsService(),
                        "Interactive Windows",
                        ""
                        )
                };

                _serviceProvider.GetPythonToolsService().AddInterpreterOptions(newOptions.Factory, newOptions, true);
                _showSettingsFor.BeginUpdate();
                UpdateInterpreters();
                _showSettingsFor.SelectedItem = newOptions.Factory;
                _showSettingsFor.EndUpdate();
            }
        }
        private void AddInterpreterClick(object sender, EventArgs e) {
            var newInterp = new NewInterpreter();
            newInterp.Font = Font;
            if (newInterp.ShowDialog() == DialogResult.OK) {
                if (!_showSettingsFor.Enabled) {
                    // previously we had no interpreters, re-enable the control
                    _showSettingsFor.Items.Clear();
                    _defaultInterpreter.Items.Clear();
                    _defaultInterpreter.Enabled = true;
                    _showSettingsFor.Enabled = true;
                }
                var id = Guid.NewGuid();
                var factory = new InterpreterPlaceholder(id, newInterp.InterpreterDescription);
                var newOptions = new InterpreterOptions(_serviceProvider.GetPythonToolsService(), factory) {
                    Display = newInterp.InterpreterDescription,
                    Added = true,
                    IsConfigurable = true,
                    SupportsCompletionDb = true,
                    Id = id,
                    Factory = factory,
                    InteractiveOptions = new PythonInteractiveOptions(
                        _serviceProvider,
                        _serviceProvider.GetPythonToolsService(), 
                        "Interactive Windows", 
                        ""
                    )
                };

                _serviceProvider.GetPythonToolsService().AddInterpreterOptions(newOptions.Factory, newOptions, true);
                _showSettingsFor.BeginUpdate();
                UpdateInterpreters();
                _showSettingsFor.SelectedItem = newOptions.Factory;
                _showSettingsFor.EndUpdate();
            }
        }