~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/Scripting/Test/Utils/MockEditableViewContent.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 ICSharpCode.AvalonEdit;
 
6
using ICSharpCode.SharpDevelop;
 
7
using ICSharpCode.SharpDevelop.Editor;
 
8
using ICSharpCode.SharpDevelop.Gui;
 
9
 
 
10
namespace ICSharpCode.Scripting.Tests.Utils
 
11
{
 
12
        /// <summary>
 
13
        /// Mock implementation of the IEditable and IViewContent.
 
14
        /// </summary>
 
15
        public class MockEditableViewContent : MockViewContent, IEditable, ITextEditorProvider
 
16
        {
 
17
                public MockTextEditor MockTextEditor = new MockTextEditor();
 
18
                
 
19
                public MockEditableViewContent()
 
20
                {
 
21
                        Text = String.Empty;
 
22
                }
 
23
                
 
24
                public string Text { get; set; }
 
25
                
 
26
                public ITextBuffer CreateSnapshot()
 
27
                {
 
28
                        return new StringTextBuffer(Text);
 
29
                }
 
30
                
 
31
                public ITextEditorOptions TextEditorOptions {
 
32
                        get { return MockTextEditor.Options; }
 
33
                }
 
34
                
 
35
                public MockTextEditorOptions MockTextEditorOptions {
 
36
                        get { return MockTextEditor.MockTextEditorOptions; }
 
37
                        set { MockTextEditor.MockTextEditorOptions = value; }
 
38
                }
 
39
                
 
40
                public ITextEditor TextEditor {
 
41
                        get { return MockTextEditor; }
 
42
                }
 
43
                
 
44
                public IDocument GetDocumentForFile(OpenedFile file)
 
45
                {
 
46
                        throw new NotImplementedException();
 
47
                }
 
48
        }
 
49
}