Exemplo n.º 1
0
        protected ScriptControlVM(IReplEditor replEditor, ReplSettings replSettings, IServiceLocator serviceLocator)
        {
            dispatcher        = Dispatcher.CurrentDispatcher;
            this.replSettings = replSettings;
            this.replSettings.PropertyChanged += ReplSettings_PropertyChanged;
            ReplEditor = replEditor;
            ReplEditor.CommandHandler = this;
            this.serviceLocator       = serviceLocator;

            ReplEditor.TextView.Options.OptionChanged += Options_OptionChanged;

            var themeClassificationTypeService = serviceLocator.Resolve <IThemeClassificationTypeService>();

            roslynClassificationTypes = RoslynClassificationTypes2.GetClassificationTypeInstance(themeClassificationTypeService);
            defaultClassificationType = themeClassificationTypeService.GetClassificationType(TextColor.Error);

            toScriptCommand = new Dictionary <string, IScriptCommand>(StringComparer.Ordinal);
            foreach (var sc in CreateScriptCommands())
            {
                foreach (var name in sc.Names)
                {
                    toScriptCommand.Add(name, sc);
                }
            }

            WordWrapStyle   = replSettings.WordWrapStyle;
            ShowLineNumbers = replSettings.ShowLineNumbers;
        }
Exemplo n.º 2
0
 public RoslynTagger(ITextBuffer textBuffer, IThemeClassificationTypeService themeClassificationTypeService, IRoslynDocumentChangedService roslynDocumentChangedService)
 {
     if (themeClassificationTypeService == null)
     {
         throw new ArgumentNullException(nameof(themeClassificationTypeService));
     }
     this.textBuffer                               = textBuffer ?? throw new ArgumentNullException(nameof(textBuffer));
     defaultClassificationType                     = themeClassificationTypeService.GetClassificationType(TextColor.Error);
     roslynClassificationTypes                     = RoslynClassificationTypes2.GetClassificationTypeInstance(themeClassificationTypeService);
     this.roslynDocumentChangedService             = roslynDocumentChangedService ?? throw new ArgumentNullException(nameof(roslynDocumentChangedService));
     roslynDocumentChangedService.DocumentChanged += RoslynDocumentChangedService_DocumentChanged;
 }