Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ToolTipProviderFactory.cs « Legacy « WpfToolTipAdornment « Impl « Text « VSEditor « MonoDevelop.SourceEditor2 « addins « src « main - github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7b1e38e59d54cbeb167ea33b6af0397209acd711 (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
//
//  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.AdornmentLibrary.ToolTip.Implementation
{
    using System;
    using Microsoft.VisualStudio.Text;
    using Microsoft.VisualStudio.Text.Adornments;
    using Microsoft.VisualStudio.Text.Editor;
    using Microsoft.VisualStudio.Utilities;
    using System.ComponentModel.Composition;

    [Export(typeof(IToolTipProviderFactory))]
    [Obsolete]
    internal sealed class ToolTipProviderFactory : IToolTipProviderFactory
    {
        //Specify the view layer definitions for the view.
        [Export]
        [Name("ToolTip")]
        [Order()]
        internal SpaceReservationManagerDefinition tooltipManager;

        public IToolTipProvider GetToolTipProvider(ITextView textView)
        {
            var wpfTextView = textView as IMdTextView;
            if (wpfTextView == null)
                throw new ArgumentException("Invalid TextView");

            return CreateToolTipProviderInternal(wpfTextView);
        }

        internal static ToolTipProvider CreateToolTipProviderInternal(IMdTextView view)
        {
            ToolTipProvider toolTipAdornmentProvider = view.Properties.GetOrCreateSingletonProperty (
                delegate {
                    return new ToolTipProvider (view);
                });

            return toolTipAdornmentProvider;
        }
    }
}