BlockLiteral Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| BlockLiteral(Void*, Object, MethodInfo) |
Creates a block literal. |
| BlockLiteral(Void*, Object, String) |
Creates a block literal. |
| BlockLiteral(Void*, Object, Type, String) |
Creates a block literal. |
BlockLiteral(Void*, Object, MethodInfo)
Creates a block literal.
public BlockLiteral(void* trampoline, object context, System.Reflection.MethodInfo trampolineMethod);
new ObjCRuntime.BlockLiteral : nativeptr<unit> * obj * System.Reflection.MethodInfo -> ObjCRuntime.BlockLiteral
Parameters
- trampoline
- Void*
A function pointer that will be called when the block is called. This function must have an [UnmanagedCallersOnly] attribute.
- context
- Object
A context object that can be retrieved from the trampoline. This is typically a delegate to the managed function to call.
- trampolineMethod
- MethodInfo
The MethodInfo instance corresponding with the trampoline method.
Applies to
BlockLiteral(Void*, Object, String)
Creates a block literal.
public BlockLiteral(void* trampoline, object context, string trampolineSignature);
new ObjCRuntime.BlockLiteral : nativeptr<unit> * obj * string -> ObjCRuntime.BlockLiteral
Parameters
- trampoline
- Void*
A function pointer that will be called when the block is called. This function must have an [UnmanagedCallersOnly] attribute.
- context
- Object
A context object that can be retrieved from the trampoline. This is typically a delegate to the managed function to call.
- trampolineSignature
- String
The Objective-C signature of the trampoline method.
Applies to
BlockLiteral(Void*, Object, Type, String)
Creates a block literal.
public BlockLiteral(void* trampoline, object context, Type trampolineType, string trampolineMethod);
new ObjCRuntime.BlockLiteral : nativeptr<unit> * obj * Type * string -> ObjCRuntime.BlockLiteral
Parameters
- trampoline
- Void*
A function pointer that will be called when the block is called. This function must have an [UnmanagedCallersOnly] attribute.
- context
- Object
A context object that can be retrieved from the trampoline. This is typically a delegate to the managed function to call.
- trampolineType
- Type
The type where the trampoline is located.
- trampolineMethod
- String
The name of the trampoline method.
Remarks
The 'trampolineType' and 'trampolineMethod' must uniquely define the trampoline method (it will be looked up using reflection). If there are multiple methods with the same name, use the overload that takes a MethodInfo instead.