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

ContentTypeAttribute.cs « ContentType « Def « Core « src - github.com/microsoft/vs-editor-api.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e5939a1420f5e3639f9884d397928abedfbcd69c (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
//
//  Copyright (c) Microsoft Corporation. All rights reserved.
//  Licensed under the MIT License. See License.txt in the project root for license information.
//
using System;

namespace Microsoft.VisualStudio.Utilities
{
    /// <summary>
    /// Declares an association between an extension part and a particular content type.
    /// </summary>
    /// <seealso cref="IContentType"></seealso>
    /// <seealso cref="IContentTypeRegistryService"></seealso>
    /// <seealso cref="ContentTypeDefinition"></seealso>
    public sealed class ContentTypeAttribute : MultipleBaseMetadataAttribute
    {
        private string contentTypes;

        /// <summary>
        /// Initializes a new instance of <see cref="ContentTypeAttribute"/>.
        /// </summary>
        /// <param name="name">The content type name. 
        /// Content type names are case-insensitive.</param>
        /// <exception cref="ArgumentNullException"><paramref name="name"/>is null or an empty string.</exception>
        public ContentTypeAttribute(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }
            contentTypes = name;
        }

        /// <summary>
        /// The content type name.
        /// </summary>
        public string ContentTypes
        {
            get
            {
                return contentTypes;
            }
        }
    }
}