コード例 #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
ファイル: ScriptContent.cs プロジェクト: manojdjoshi/dnSpy
		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;
		}
コード例 #3
0
ファイル: CSharpContent.cs プロジェクト: manojdjoshi/dnSpy
		protected override ScriptControlVM CreateScriptControlVM(IReplEditor replEditor, IServiceLocator serviceLocator, ReplSettings replSettings) =>
			new CSharpControlVM(replEditor, replSettings, serviceLocator);
コード例 #4
0
ファイル: ScriptContent.cs プロジェクト: manojdjoshi/dnSpy
		protected abstract ScriptControlVM CreateScriptControlVM(IReplEditor replEditor, IServiceLocator serviceLocator, ReplSettings replSettings);
コード例 #5
0
ファイル: ScriptContent.cs プロジェクト: azureidea/dnSpy-1
 protected abstract ScriptControlVM CreateScriptControlVM(IReplEditor replEditor, IServiceLocator serviceLocator, ReplSettings replSettings);
コード例 #6
0
ファイル: ScriptContent.cs プロジェクト: azureidea/dnSpy-1
 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;
 }