Пример #1
0
        protected ScriptControlVM(IReplEditor replEditor, ReplSettings replSettings, IServiceLocator serviceLocator)
        {
            this.dispatcher   = Dispatcher.CurrentDispatcher;
            this.replSettings = replSettings;
            this.replSettings.PropertyChanged += ReplSettings_PropertyChanged;
            this.ReplEditor = replEditor;
            this.ReplEditor.CommandHandler = this;
            this.serviceLocator            = serviceLocator;

            ReplEditor.TextView.Options.OptionChanged += Options_OptionChanged;

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

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

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

            WordWrapStyle   = replSettings.WordWrapStyle;
            ShowLineNumbers = replSettings.ShowLineNumbers;
        }
Пример #2
0
 public RoslynTagger(IThemeClassificationTypes themeClassificationTypes)
 {
     if (themeClassificationTypes == null)
     {
         throw new ArgumentNullException(nameof(themeClassificationTypes));
     }
     this.defaultClassificationType = themeClassificationTypes.GetClassificationType(TextColor.Error);
     this.roslynClassificationTypes = RoslynClassificationTypes.GetClassificationTypeInstance(themeClassificationTypes);
 }
Пример #3
0
 public RoslynTagger(ITextBuffer textBuffer, IThemeClassificationTypeService themeClassificationTypeService, IRoslynDocumentChangedService roslynDocumentChangedService)
 {
     if (themeClassificationTypeService is null)
     {
         throw new ArgumentNullException(nameof(themeClassificationTypeService));
     }
     this.textBuffer                               = textBuffer ?? throw new ArgumentNullException(nameof(textBuffer));
     defaultClassificationType                     = themeClassificationTypeService.GetClassificationType(TextColor.Error);
     roslynClassificationTypes                     = RoslynClassificationTypes.GetClassificationTypeInstance(themeClassificationTypeService);
     this.roslynDocumentChangedService             = roslynDocumentChangedService ?? throw new ArgumentNullException(nameof(roslynDocumentChangedService));
     roslynDocumentChangedService.DocumentChanged += RoslynDocumentChangedService_DocumentChanged;
 }