Miner.Desktop.DesignerExpress Assembly > Miner.Desktop.DesignerExpress.Annotations Namespace : CanBeNullAttribute Class |
null
sometimes, so the check for null
is necessary before its usage'Declaration <AttributeUsageAttribute(ValidOn=AttributeTargets.Method Or _ AttributeTargets.Property Or _ AttributeTargets.Field Or _ AttributeTargets.Parameter Or _ AttributeTargets.Delegate, AllowMultiple=False, Inherited=True)> Public NotInheritable Class CanBeNullAttribute Inherits System.Attribute
'Usage Dim instance As CanBeNullAttribute
[AttributeUsage(ValidOn=AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Delegate, AllowMultiple=false, Inherited=true)] public sealed class CanBeNullAttribute : System.Attribute
[CanBeNull] public object Test() { return null; } public void UseTest() { var p = Test(); var s = p.ToString(); // Warning: Possible 'System.NullReferenceException' }
System.Object
System.Attribute
Miner.Desktop.DesignerExpress.Annotations.CanBeNullAttribute
Target Platforms: Windows XP SP3 (32-bit and 64-bit), Windows 7 (32-bit and 64-bit)
Not all Operating Systems are supported on all products. Visit the ArcFM Solution Supported Versions page for full details.