Пример #1
0
        public override void SaveSettingsToStorage()
        {
            var defaultInterpreter = GetWindow().DefaultInterpreter;

            if (defaultInterpreter != null)
            {
                Version ver;
                if (defaultInterpreter is InterpreterPlaceholder)
                {
                    ver = Version.Parse(PyService.GetInterpreterOptions(defaultInterpreter).Version ?? "2.7");
                }
                else
                {
                    ver = defaultInterpreter.Configuration.Version;
                }

                PyService.GlobalInterpreterOptions.DefaultInterpreter        = defaultInterpreter.Id;
                PyService.GlobalInterpreterOptions.DefaultInterpreterVersion = ver;
            }
            else
            {
                PyService.GlobalInterpreterOptions.DefaultInterpreter        = Guid.Empty;
                PyService.GlobalInterpreterOptions.DefaultInterpreterVersion = new Version();
            }

            PyService.SaveInterpreterOptions();
            PyService.GlobalInterpreterOptions.Save();
        }
        public override void SaveSettingsToStorage()
        {
            var defaultInterpreter = GetWindow().DefaultInterpreter;

            PyService.GlobalInterpreterOptions.DefaultInterpreter = defaultInterpreter?.Id ?? string.Empty;

            PyService.SaveInterpreterOptions();
            PyService.GlobalInterpreterOptions.Save();
        }