Skip to content

M_CodeJam_Code_DisposedIfNull__2_1

Andrew Koryavchenko edited this page Jun 17, 2018 · 7 revisions

Code.DisposedIfNull(TResource, TDisposable) Method (TResource, TDisposable, String)

Assertion for object disposal

Namespace: CodeJam
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

public static void DisposedIfNull<TResource, TDisposable>(
	TResource resource,
	TDisposable thisReference,
	string message
)
where TResource : class
where TDisposable : IDisposable

VB

Public Shared Sub DisposedIfNull(Of TResource As Class, TDisposable As IDisposable) ( 
	resource As TResource,
	thisReference As TDisposable,
	message As String
)

F#

static member DisposedIfNull : 
        resource : 'TResource * 
        thisReference : 'TDisposable * 
        message : string -> unit  when 'TResource : not struct when 'TDisposable : IDisposable

Parameters

 

resource
Type: TResource
The resource. Should be not null if the object is not disposed.
thisReference
Type: TDisposable
The this reference.
message
Type: System.String
The message.

Type Parameters

 

TResource
The type of the resource.
TDisposable
The type of the disposable.

See Also

Reference

Code Class
DisposedIfNull Overload
CodeJam Namespace

Clone this wiki locally