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

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

namespace Microsoft.VisualStudio.Text.Editor
{
    /// <summary>
    /// Specifies the type of margin container.
    /// </summary>
    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Field, AllowMultiple = false)]
    public sealed class MarginContainerAttribute : SingletonBaseMetadataAttribute
    {
        private readonly string marginContainer;

        /// <summary>
        /// Instantiates a new instance of a <see cref="MarginContainerAttribute"/>.
        /// </summary>
        /// <param name="marginContainer">The name of the container for this margin.</param>
        /// <exception cref="ArgumentNullException"><paramref name="marginContainer"/> is null.</exception>
        /// <exception cref="ArgumentException"><paramref name="marginContainer"/> is an empty string.</exception>
        public MarginContainerAttribute(string marginContainer)
        {
            if (marginContainer == null)
                throw new ArgumentNullException("marginContainer");
            if (marginContainer.Length == 0)
                throw new ArgumentException("marginContainer is an empty string.");

            this.marginContainer = marginContainer;
        }

        /// <summary>
        /// The name of the margin container.
        /// </summary>
        public string MarginContainer
        {
            get 
            { 
                return this.marginContainer; 
            }
        }
    }
}