/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Dependencies/Contracts/InterpolatedStringHandlerArgumentAttribute.cs
39 строк
2 KB
Tomáš Matoušek
Source package fixes (#78534)
09 май 2025, 23:25
Не верифицирован
09 май 2025, 23:25
0899e12
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable enable #if NET6_0_OR_GREATER using System.Runtime.CompilerServices; #pragma warning disable RS0016 // Add public types and members to the declared API (this is a supporting forwarder for an internal polyfill API) [assembly: TypeForwardedTo(typeof(InterpolatedStringHandlerArgumentAttribute))] #pragma warning restore RS0016 // Add public types and members to the declared API #else #pragma warning disable CA1019 // Add a public read-only property accessor for positional argument argument of Attribute namespace System.Runtime.CompilerServices { /// <summary>Indicates which arguments to a method involving an interpolated string handler should be passed to that handler.</summary> [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] internal sealed class InterpolatedStringHandlerArgumentAttribute : Attribute { /// <summary>Initializes a new instance of the <see cref="InterpolatedStringHandlerArgumentAttribute"/> class.</summary> /// <param name="argument">The name of the argument that should be passed to the handler.</param> /// <remarks><see langword="null"/> may be used as the name of the receiver in an instance method.</remarks> public InterpolatedStringHandlerArgumentAttribute(string argument) => Arguments = new string[] { argument }; /// <summary>Initializes a new instance of the <see cref="InterpolatedStringHandlerArgumentAttribute"/> class.</summary> /// <param name="arguments">The names of the arguments that should be passed to the handler.</param> /// <remarks><see langword="null"/> may be used as the name of the receiver in an instance method.</remarks> public InterpolatedStringHandlerArgumentAttribute(params string[] arguments) => Arguments = arguments; /// <summary>Gets the names of the arguments that should be passed to the handler.</summary> /// <remarks><see langword="null"/> may be used as the name of the receiver in an instance method.</remarks> public string[] Arguments { get; } } } #endif