Skip to content

M_CodeJam_Code_DisposedIfNull__2_2

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

Code.DisposedIfNull(TResource, TDisposable) Method (TResource, TDisposable, String, Object[])

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 messageFormat,
	params Object[] args
)
where TResource : class
where TDisposable : IDisposable

VB

Public Shared Sub DisposedIfNull(Of TResource As Class, TDisposable As IDisposable) ( 
	resource As TResource,
	thisReference As TDisposable,
	messageFormat As String,
	ParamArray args As Object()
)

F#

static member DisposedIfNull : 
        resource : 'TResource * 
        thisReference : 'TDisposable * 
        messageFormat : string * 
        args : Object[] -> 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.
messageFormat
Type: System.String
The message format.
args
Type: System.Object[]
The arguments.

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