~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/Scripting/Project/Src/TextEditorFactory.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using System.Windows.Media;
 
6
using ICSharpCode.AvalonEdit;
 
7
using ICSharpCode.Core.WinForms;
 
8
using ICSharpCode.SharpDevelop.Editor;
 
9
 
 
10
namespace ICSharpCode.Scripting
 
11
{
 
12
        public static class TextEditorFactory
 
13
        {
 
14
                public static TextEditor CreateTextEditor()
 
15
                {
 
16
                        object control;
 
17
                        EditorControlService.CreateEditor(out control);
 
18
                        var textEditor = (TextEditor)control;
 
19
                        
 
20
                        textEditor.Options = new TextEditorOptions();
 
21
                        textEditor.Options.AllowScrollBelowDocument = false;
 
22
                        textEditor.FontFamily = new FontFamily(WinFormsResourceService.DefaultMonospacedFont.Name);
 
23
                        textEditor.FontSize = 13.0;
 
24
                        
 
25
                        return textEditor;
 
26
                }
 
27
        }
 
28
}