mirror of
https://github.com/chylex/.NET-Community-Toolkit.git
synced 2025-08-16 05:31:46 +02:00
.github
CommunityToolkit.Common
CommunityToolkit.Diagnostics
Attributes
CallerArgumentExpressionAttribute.cs
DoesNotReturnAttribute.cs
DoesNotReturnIfAttribute.cs
NotNullAttribute.cs
SkipLocalsInitAttribute.cs
StackTraceHiddenAttribute.cs
Extensions
Generated
Internals
Properties
CommunityToolkit.Diagnostics.csproj
Guard.Boolean.cs
Guard.Comparable.Generic.cs
Guard.Comparable.Numeric.cs
Guard.IO.cs
Guard.String.cs
Guard.Tasks.cs
Guard.cs
ThrowHelper.Generic.cs
ThrowHelper.cs
CommunityToolkit.HighPerformance
CommunityToolkit.Mvvm
CommunityToolkit.Mvvm.SourceGenerators
build
tests
.editorconfig
.git-blame-ignore-revs
.gitattributes
.gitignore
.runsettings
CODE_OF_CONDUCT.md
Contributing.md
Directory.Build.props
Directory.Build.targets
License.md
README.md
ThirdPartyNotices.txt
azure-pipelines.yml
dotnet Community Toolkit.sln
toolkit.snk
version.json
35 lines
1.2 KiB
C#
35 lines
1.2 KiB
C#
// 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.
|
|
|
|
#if !NETSTANDARD2_1_OR_GREATER
|
|
|
|
namespace System.Diagnostics.CodeAnalysis;
|
|
|
|
/// <summary>
|
|
/// Specifies that a given <see cref="ParameterValue"/> also indicates
|
|
/// whether the method will not return (eg. throw an exception).
|
|
/// </summary>
|
|
/// <remarks>Internal copy from the BCL attribute.</remarks>
|
|
[AttributeUsage(AttributeTargets.Parameter)]
|
|
internal sealed class DoesNotReturnIfAttribute : Attribute
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="DoesNotReturnIfAttribute"/> class.
|
|
/// </summary>
|
|
/// <param name="parameterValue">
|
|
/// The condition parameter value. Code after the method will be considered unreachable
|
|
/// by diagnostics if the argument to the associated parameter matches this value.
|
|
/// </param>
|
|
public DoesNotReturnIfAttribute(bool parameterValue)
|
|
{
|
|
ParameterValue = parameterValue;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets a value indicating whether the parameter value should be <see langword="true"/>.
|
|
/// </summary>
|
|
public bool ParameterValue { get; }
|
|
}
|
|
|
|
#endif |