Method ToDelegate
| Edit this page View SourceToDelegate()
Converts the current function pointer to a delegate of type TDelegate.
Declaration
TDelegate? ToDelegate()
Returns
| Type | Description |
|---|---|
| TDelegate | A delegate of type |
Remarks
If the current function pointer type represents a non-nullable function pointer type, then the current instance must not be a null pointer. If it is, an InvalidOperationException will be thrown.
Otherwise, if the current function pointer type represents a nullable function pointer type, then the current instance may be a null pointer. If it is, then the resulting delegate will be null.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The current function pointer is a null pointer and the current function pointer type represents a non- |