RingSoft.DataEntryControls.Engine.Annotations Namespace
RingSoft.DataEntryControls.WPF Namespace

CanBeNullAttribute Class

Indicates that the value of the marked element could be null sometimes, so checking for null is required before its usage.

Namespace:  RingSoft.DataEntryControls.WPF
Assembly:  RingSoft.DataEntryControls.WPF (in RingSoft.DataEntryControls.WPF.dll)

Syntax


[AttributeUsageAttribute]
public sealed class CanBeNullAttribute : Attribute
<AttributeUsageAttribute> _
Public NotInheritable Class CanBeNullAttribute _
	Inherits Attribute
[AttributeUsageAttribute]
public ref class CanBeNullAttribute sealed : public Attribute

Examples


C#
[CanBeNull] object Test() => null;
void UseTest() {
var p = Test();
var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
}

Inheritance Hierarchy


Object
  Attribute
    RingSoft.DataEntryControls.WPF..::..CanBeNullAttribute