Method FromDelegate
| Edit this page View SourceFromDelegate(TDelegate?)
Creates a TSelf from a delegate of type TDelegate.
Declaration
public static abstract TSelf FromDelegate(TDelegate? @delegate)
Parameters
| Type | Name | Description |
|---|---|---|
| TDelegate | delegate | The delegate to create the function pointer from. |
Returns
| Type | Description |
|---|---|
| TSelf | A |
Remarks
If TSelf represents a non-nullable function pointer type, then the delegate must not be null. If it is, an ArgumentNullException will be thrown.
Otherwise, if TSelf represents a nullable function pointer type, then the delegate pointer may be null. If it is, then the resulting TSelf will represent a null pointer.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|