blob: 081fdb43ec98728892840b0b373ab7db80ac6bfd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// This file contain implementations details that are subject to change without notice.
// Use at your own risk.
//
namespace Microsoft.VisualStudio.Text.EditorPrimitives.Implementation
{
using Microsoft.VisualStudio.Text.Editor;
internal sealed class ViewPrimitives : IViewPrimitives
{
private TextView _textView;
private LegacySelection _selection;
private Caret _caret;
private TextBuffer _textBuffer;
#region IViewPrimitives Members
internal ViewPrimitives(ITextView textView, IViewPrimitivesFactoryService viewPrimitivesFactory)
{
_textView = viewPrimitivesFactory.CreateTextView(textView);
_textBuffer = _textView.TextBuffer;
_selection = _textView.Selection;
_caret = _textView.Caret;
}
public TextView View
{
get { return _textView; }
}
public LegacySelection Selection
{
get { return _selection; }
}
public Caret Caret
{
get { return _caret; }
}
public TextBuffer Buffer
{
get { return _textBuffer; }
}
#endregion
}
}
|