mirror of
https://github.com/chylex/.NET-Community-Toolkit.git
synced 2025-08-16 05:31:46 +02:00
.github
CommunityToolkit.Common
CommunityToolkit.Diagnostics
CommunityToolkit.HighPerformance
CommunityToolkit.Mvvm
CommunityToolkit.Mvvm.SourceGenerators
Attributes
NotNullWhenAttribute.cs
NullabilityAttributesGenerator.cs
ComponentModel
Diagnostics
EmbeddedResources
Extensions
Helpers
Input
Messaging
Models
System.Runtime.CompilerServices
AnalyzerReleases.Shipped.md
AnalyzerReleases.Unshipped.md
CommunityToolkit.Mvvm.SourceGenerators.csproj
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
25 lines
1.1 KiB
C#
25 lines
1.1 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.
|
|
|
|
namespace System.Diagnostics.CodeAnalysis;
|
|
|
|
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter will not be null even if the corresponding type allows it.</summary>
|
|
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
|
|
internal sealed class NotNullWhenAttribute : Attribute
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="NotNullWhenAttribute"/> class.
|
|
/// </summary>
|
|
/// <param name="returnValue">The return value condition. If the method returns this value, the associated parameter will not be null.</param>
|
|
public NotNullWhenAttribute(bool returnValue)
|
|
{
|
|
ReturnValue = returnValue;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets a value indicating whether the annotated parameter will be null depending on the return value.
|
|
/// </summary>
|
|
public bool ReturnValue { get; }
|
|
}
|