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

ImageElement.cs « ViewElementFactories « ToolTipService « Adornments « TextUI « Def « Text « src - github.com/microsoft/vs-editor-api.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 079449ac94e129c3a6f53222f2558664b94dc202 (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
namespace Microsoft.VisualStudio.Text.Adornments
{
    using System;
    using Microsoft.VisualStudio.Core.Imaging;

    /// <summary>
    /// Represents cross platform compatible image.
    /// </summary>
    ///
    /// <remarks>
    /// <see cref="ImageElement"/>s should be constructed with <see cref="Microsoft.VisualStudio.Core.Imaging.ImageId"/>s
    /// that correspond to an image on that platform.
    /// </remarks>
    public class ImageElement
    {
        /// <summary>
        /// Creates a new instance of an image element.
        /// </summary>
        /// <param name="imageId"> A unique identifier for an image</param>
        public ImageElement(ImageId imageId)
        {
            this.ImageId = imageId;
        }

        /// <summary>
        /// Creates a new instance of an image element.
        /// </summary>
        /// <param name="imageId"> A unique identifier for an image</param>
        /// <param name="automationName"> Localized description of the image</param>
        public ImageElement(ImageId imageId, string automationName)
            : this(imageId)
        {
            // Let's allow empty strings, as long as they are not null references
            this.AutomationName = automationName ?? throw new ArgumentNullException(nameof(automationName));
        }

        /// <summary>
        /// A unique identifier for an image.
        /// </summary>
        public ImageId ImageId { get; }

        /// <summary>
        /// Localized description of the image
        /// </summary>
        public string AutomationName { get; }
    }
}