public MainViewContent(string fileName, IWorkbenchWindow workbenchWindow)
        {
            codeEditor = new CodeEditor();

            textEditor = new TextEditor();
            textEditor.FontFamily = new FontFamily("Consolas");

            textEditor.TextArea.TextEntering += TextAreaOnTextEntering;
            textEditor.TextArea.TextEntered += TextAreaOnTextEntered;
            textEditor.ShowLineNumbers = true;

            var ctrlSpace = new RoutedCommand();
            ctrlSpace.InputGestures.Add(new KeyGesture(Key.Space, ModifierKeys.Control));
            var cb = new CommandBinding(ctrlSpace, OnCtrlSpaceCommand);
            // this.CommandBindings.Add(cb);

            adapter = new SharpSnippetTextEditorAdapter(textEditor);
            this.WorkbenchWindow = workbenchWindow;
            textEditor.TextArea.TextView.Services.AddService(typeof (ITextEditor), adapter);
            LoadFile(fileName);

            iconBarManager = new IconBarManager();
            textEditor.TextArea.LeftMargins.Insert(0, new IconBarMargin(iconBarManager));

            var textMarkerService = new TextMarkerService(textEditor.Document);
            textEditor.TextArea.TextView.BackgroundRenderers.Add(textMarkerService);
            textEditor.TextArea.TextView.LineTransformers.Add(textMarkerService);
            textEditor.TextArea.TextView.Services.AddService(typeof (ITextMarkerService), textMarkerService);
            textEditor.TextArea.TextView.Services.AddService(typeof (IBookmarkMargin), iconBarManager);
        }
Пример #2
0
        public MainViewContent(string fileName, IWorkbenchWindow workbenchWindow)
        {
            codeEditor = new CodeEditor();

            textEditor            = new TextEditor();
            textEditor.FontFamily = new FontFamily("Consolas");

            textEditor.TextArea.TextEntering += TextAreaOnTextEntering;
            textEditor.TextArea.TextEntered  += TextAreaOnTextEntered;
            textEditor.ShowLineNumbers        = true;


            var ctrlSpace = new RoutedCommand();

            ctrlSpace.InputGestures.Add(new KeyGesture(Key.Space, ModifierKeys.Control));
            var cb = new CommandBinding(ctrlSpace, OnCtrlSpaceCommand);

            // this.CommandBindings.Add(cb);

            adapter = new SharpSnippetTextEditorAdapter(textEditor);
            this.WorkbenchWindow = workbenchWindow;
            textEditor.TextArea.TextView.Services.AddService(typeof(ITextEditor), adapter);
            LoadFile(fileName);

            iconBarManager = new IconBarManager();
            textEditor.TextArea.LeftMargins.Insert(0, new IconBarMargin(iconBarManager));

            var textMarkerService = new TextMarkerService(textEditor.Document);

            textEditor.TextArea.TextView.BackgroundRenderers.Add(textMarkerService);
            textEditor.TextArea.TextView.LineTransformers.Add(textMarkerService);
            textEditor.TextArea.TextView.Services.AddService(typeof(ITextMarkerService), textMarkerService);
            textEditor.TextArea.TextView.Services.AddService(typeof(IBookmarkMargin), iconBarManager);
        }
Пример #3
0
		public MainViewContent(string fileName, IWorkbenchWindow workbenchWindow)
		{
			this.textEditor = new TextEditor();
			this.textEditor.FontFamily = new FontFamily("Consolas");
			this.adapter = new SharpSnippetTextEditorAdapter(textEditor);
			this.workbenchWindow = workbenchWindow;
			textEditor.TextArea.TextView.Services.AddService(typeof(ITextEditor), adapter);
			this.LoadFile(fileName);
			
			iconBarManager = new IconBarManager();
			this.textEditor.TextArea.LeftMargins.Insert(0, new IconBarMargin(iconBarManager));
			
			var textMarkerService = new TextMarkerService(textEditor.Document);
			textEditor.TextArea.TextView.BackgroundRenderers.Add(textMarkerService);
			textEditor.TextArea.TextView.LineTransformers.Add(textMarkerService);
			textEditor.TextArea.TextView.Services.AddService(typeof(ITextMarkerService), textMarkerService);
			textEditor.TextArea.TextView.Services.AddService(typeof(IBookmarkMargin), iconBarManager);
			
			BookmarkManager.Added += BookmarkManager_Added;
			BookmarkManager.Removed += BookmarkManager_Removed;
		}
Пример #4
0
        public MainViewContent(string fileName, IWorkbenchWindow workbenchWindow)
        {
            this.textEditor            = new TextEditor();
            this.textEditor.FontFamily = new FontFamily("Consolas");
            this.adapter         = new SharpSnippetTextEditorAdapter(textEditor);
            this.workbenchWindow = workbenchWindow;
            textEditor.TextArea.TextView.Services.AddService(typeof(ITextEditor), adapter);
            this.LoadFile(fileName);

            iconBarManager = new IconBarManager();
            this.textEditor.TextArea.LeftMargins.Insert(0, new IconBarMargin(iconBarManager));

            var textMarkerService = new TextMarkerService(textEditor.Document);

            textEditor.TextArea.TextView.BackgroundRenderers.Add(textMarkerService);
            textEditor.TextArea.TextView.LineTransformers.Add(textMarkerService);
            textEditor.TextArea.TextView.Services.AddService(typeof(ITextMarkerService), textMarkerService);
            textEditor.TextArea.TextView.Services.AddService(typeof(IBookmarkMargin), iconBarManager);

            BookmarkManager.Added   += BookmarkManager_Added;
            BookmarkManager.Removed += BookmarkManager_Removed;
        }