You are here: Start » AVL.NET » SafeNullableRef<T> Class

SafeNullableRef<T> Class


Extension of the NullableRef<T> class, that takes responsibility for disposing object in the Value property.


SafeNullableRef<T>(T)Creates a new non-empty SafeNullableRef<T> object that holds the reference to the passed obj and takes responsibility for disposing it. If obj is null this constructor is equivalent to the parameterless one.
SafeNullableRef<T>()Creates a new empty SafeNullableRef<T> object, for which HasValue property is false.


HasValueSystem.BooleanGets a value indicating whether the current NullableRef<T> object has a valid value of its underlying type.

Inherited from AvlNet.NullableRef<T>
IsDisposedSystem.BooleanGets if the SafeNullableRef<T> object has been disposed.
ValueTGets the value of the current NullableRef<T> object if the HasValue property is true. An exception is thrown if the HasValue property is false.

Inherited from AvlNet.NullableRef<T>


Dispose()Disposes underlying unmanaged resources. See MSDN documentation for IDisposable interface for more info.
Equals(object)Inherited from System.Object
GetHashCode()Inherited from System.Object
GetType()Inherited from System.Object
Release()Detaches value of the current NullableRef<T> object if HasValue property is true and sets this object as an empty. An exception is thrown if HasValue property is false.
Reset()Resets the current NullableRef<T> object to an empty value (HasValue is equal to false)

Inherited from NullableRef<T>
Reset(T)Resets the current NullableRef<T> object to a new, non-null value (HasValue is equal to true)

Inherited from NullableRef<T>
ToString()Inherited from System.Object


See also