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

IClassificationTypeRegistryService.cs « Classification « TextLogic « Def « Text « Editor « src - github.com/microsoft/vs-editor-api.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b7f21719cb7879811ed5c068efd1b6ec1cf7cfec (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
//
//  Copyright (c) Microsoft Corporation. All rights reserved.
//  Licensed under the MIT License. See License.txt in the project root for license information.
//
namespace Microsoft.VisualStudio.Text.Classification
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// The service that maintains the collection of all known classification types.
    /// </summary>
    /// <remarks>This is a MEF component part, and should be imported as follows:
    /// [Import]
    /// IClassificationTypeRegistryService registry = null;
    /// </remarks>
    public interface IClassificationTypeRegistryService
    {
        /// <summary>
        /// Gets the <see cref="IClassificationType"></see> object identified by the specified <paramref name="type"/>.
        /// </summary>
        /// <param name="type">
        /// The name of the classification type.
        /// </param>
        /// <returns>
        /// The classification type, <c>null</c> if there is no classification type of that name.
        /// </returns>
        IClassificationType GetClassificationType(string type);

        /// <summary>
        /// Initializes a new instance of a <see cref="IClassificationType"/> and adds it to the registry.
        /// </summary>
        /// <param name="type">The name of the classification type to create.</param>
        /// <param name="baseTypes">The base types of the classification.</param>
        /// <returns>A new <see cref="IClassificationType"/>.</returns>
        /// <exception cref="InvalidOperationException"><paramref name="type"/> is already in the registry.</exception>
        IClassificationType CreateClassificationType(string type, IEnumerable<IClassificationType> baseTypes);

        /// <summary>
        /// Creates an <see cref="IClassificationType"/> that persists only for the duration of
        /// this session. This <see cref="IClassificationType"/> must inherit from at least one
        /// <see cref="IClassificationType"/>.
        /// </summary>
        /// <param name="baseTypes">
        /// The base types for this <see cref="IClassificationType"/>.
        /// </param>
        /// <returns>
        /// A new <see cref="IClassificationType"/> that inherits from all of <paramref name="baseTypes"/>.
        /// </returns>
        /// <exception cref="ArgumentNullException"><paramref name="baseTypes"/> is null.</exception>
        /// <exception cref="InvalidOperationException"><paramref name="baseTypes"/> has zero items.</exception>
        /// <remarks>
        /// <para>
        /// This function is intended primarily to aid in the runtime display of overlapping classifications.
        /// </para>
        /// <para>
        /// The classification names generated by this function are determined at run time and are subject to
        /// change in future revisions. The only guarantee made is that if two transient <see cref="IClassificationType"/> objects
        /// are created with the same base types, they will have the same classification name.
        /// </para>
        /// </remarks>
        IClassificationType CreateTransientClassificationType(IEnumerable<IClassificationType> baseTypes);

        /// <summary>
        /// Creates an <see cref="IClassificationType"/> that persists only for the duration of
        /// this session. This <see cref="IClassificationType"/> must inherit from at least one
        /// <see cref="IClassificationType"/>.
        /// </summary>
        /// <param name="baseTypes">
        /// The base types for this <see cref="IClassificationType"/>.
        /// </param>
        /// <returns>
        /// A new <see cref="IClassificationType"/> which inherits from all <paramref name="baseTypes"/>.
        /// </returns>
        /// <exception cref="ArgumentNullException"><paramref name="baseTypes"/> is null.</exception>
        /// <exception cref="InvalidOperationException"><paramref name="baseTypes"/> has zero items.</exception>
        /// <remarks>
        /// <para>
        /// This function is intended primarily to aid in the runtime display of overlapping classifications.
        /// </para>
        /// 
        /// <para>
        /// The classification names generated by this function are determined at run time and are subject to
        /// change in future revisions. The only guarantee made is that if two transient <see cref="IClassificationType"/> objects
        /// are created with the same base types, they will have the same classification name.
        /// </para>
        /// </remarks>
        IClassificationType CreateTransientClassificationType(params IClassificationType[] baseTypes);

        /// <summary>
        /// Gets the <see cref="IClassificationType"></see> object identified by the specified <paramref name="type"/>.
        /// </summary>
        /// <param name="layer">
        /// Specifies the layer to which this classification belongs. Layers are specializations
        /// of <see cref="IClassificationType"/>s that can be used to make all classifications from
        /// one source supersede another.
        /// </param>
        /// <param name="type">
        /// The name of the classification type.
        /// </param>
        /// <returns>
        /// The classification type, <c>null</c> if there is no classification type of that name.
        /// </returns>
        ILayeredClassificationType GetClassificationType(ClassificationLayer layer, string type);

        /// <summary>
        /// Initializes a new instance of a <see cref="IClassificationType"/> and adds it to the registry.
        /// </summary>
        /// <param name="layer">
        /// Specifies the layer to which this classification belongs. Layers are specializations
        /// of <see cref="IClassificationType"/>s that can be used to make all classifications from
        /// one source supersede another.
        /// </param>
        /// <param name="type">The name of the classification type to create.</param>
        /// <param name="baseTypes">The base types of the classification.</param>
        /// <returns>A new <see cref="IClassificationType"/>.</returns>
        /// <exception cref="InvalidOperationException"><paramref name="type"/> is already in the registry.</exception>
        ILayeredClassificationType CreateClassificationType(ClassificationLayer layer, string type, IEnumerable<IClassificationType> baseTypes);
    }
}