You are here: Start » AVL.NET » SafeNullableRef<T> Class
SafeNullableRef<T> Class
Namespace: | AvlNet |
---|---|
Assembly: | AVL.NET.TS.dll |
Extension of the NullableRef<T> class, that takes responsibility for disposing object in the Value property.
Constructors
Constructor | Description | |
---|---|---|
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. |
Properties
Name | Type | Description | |
---|---|---|---|
HasValue | System.Boolean | Gets a value indicating whether the current NullableRef<T> object has a valid value of its underlying type. Inherited from AvlNet.NullableRef<T> | |
IsDisposed | System.Boolean | Gets if the SafeNullableRef<T> object has been disposed. | |
Value | T | Gets 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> |
Methods
Name | Description | |
---|---|---|
Dispose() | Disposes underlying unmanaged resources. See MSDN documentation for IDisposable interface for more info. | |
Equals(NullableRef<T>) | ||
Equals(object) | Inherited from System.Object | |
Equals(SafeNullableRef<T>) | ||
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 |