Exemple #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;
        }
Exemple #2
0
		protected ScriptContent(IReplEditorProvider replEditorProvider, ReplEditorOptions replOpts, ReplSettings replSettings, IServiceLocator serviceLocator, string appearanceCategory) {
			replOpts.Roles.Add(PredefinedDsTextViewRoles.RoslynRepl);
			replEditor = replEditorProvider.Create(replOpts);
			replEditor.TextView.Options.SetOptionValue(DefaultWpfViewOptions.AppearanceCategory, appearanceCategory);
			scriptControl = new ScriptControl();
			scriptControl.SetTextEditorObject(replEditor.UIObject);
			scriptControlVM = CreateScriptControlVM(replEditor, serviceLocator, replSettings);
			scriptControlVM.OnCommandExecuted += ScriptControlVM_OnCommandExecuted;
			RoslynReplEditorUtils.AddInstance(scriptControlVM, replEditor.TextView);
			replEditor.Tag = this;
			scriptControl.DataContext = scriptControlVM;
		}
Exemple #3
0
		protected override ScriptControlVM CreateScriptControlVM(IReplEditor replEditor, IServiceLocator serviceLocator, ReplSettings replSettings) =>
			new CSharpControlVM(replEditor, replSettings, serviceLocator);
Exemple #4
0
		protected abstract ScriptControlVM CreateScriptControlVM(IReplEditor replEditor, IServiceLocator serviceLocator, ReplSettings replSettings);
Exemple #5
0
 protected abstract ScriptControlVM CreateScriptControlVM(IReplEditor replEditor, IServiceLocator serviceLocator, ReplSettings replSettings);
Exemple #6
0
 protected ScriptContent(IReplEditorProvider replEditorProvider, ReplEditorOptions replOpts, ReplSettings replSettings, IServiceLocator serviceLocator, string appearanceCategory)
 {
     replOpts.Roles.Add(PredefinedDsTextViewRoles.RoslynRepl);
     replEditor = replEditorProvider.Create(replOpts);
     replEditor.TextView.Options.SetOptionValue(DefaultWpfViewOptions.AppearanceCategory, appearanceCategory);
     scriptControl = new ScriptControl();
     scriptControl.SetTextEditorObject(replEditor.UIObject);
     scriptControlVM = CreateScriptControlVM(replEditor, serviceLocator, replSettings);
     scriptControlVM.OnCommandExecuted += ScriptControlVM_OnCommandExecuted;
     RoslynReplEditorUtils.AddInstance(scriptControlVM, replEditor.TextView);
     replEditor.Tag            = this;
     scriptControl.DataContext = scriptControlVM;
 }