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

github.com/microsoft/vs-editor-api.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Editor/Core/Def/ContentType/FileExtensionAttribute.cs')
-rw-r--r--src/Editor/Core/Def/ContentType/FileExtensionAttribute.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Editor/Core/Def/ContentType/FileExtensionAttribute.cs b/src/Editor/Core/Def/ContentType/FileExtensionAttribute.cs
new file mode 100644
index 0000000..6df6ad3
--- /dev/null
+++ b/src/Editor/Core/Def/ContentType/FileExtensionAttribute.cs
@@ -0,0 +1,34 @@
+//
+// 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>
+ /// Identifies a file extension.
+ /// </summary>
+ public sealed class FileExtensionAttribute : SingletonBaseMetadataAttribute
+ {
+
+ /// <summary>
+ /// Constructs a new instance of the attribute.
+ /// </summary>
+ /// <param fileExtension="fileExtension">The file extension.</param>
+ /// <exception cref="ArgumentNullException"><paramref name="fileExtension"/> is null or empty.</exception>
+ public FileExtensionAttribute(string fileExtension)
+ {
+ if (string.IsNullOrWhiteSpace(fileExtension))
+ {
+ throw new ArgumentNullException(nameof(fileExtension));
+ }
+ this.FileExtension = fileExtension;
+ }
+
+ /// <summary>
+ /// Gets the file extension.
+ /// </summary>
+ public string FileExtension { get; }
+ }
+}