C# Класс Monobjc.Block

Managed implementation of the blocks as defined in the Language Specification for Blocks[1]. Even if the implementation strictly follows the Block Implementation Specification[2], it is restricted to global block for the moment.

The block bridging allow a delegate function or action to be marshalled as a native block. Its implementation points to a proxy invoker that will forward the native block invocation to the delegate function or action.

Currently, any delegate can be passed to create a block. For example:

Delegate Equivalent block signature Action void (^)() Action{T1,T2,T3} void (^)(T1, T2, T3) Func{TResult} TResult (^)() Func{T1,T2,TResult} TResult (^)(T1, T2)

[1] Language Specification for Blocks (http://clang.llvm.org/docs/BlockLanguageSpec.html)

[2] Block Implementation Specification (http://clang.llvm.org/docs/Block-ABI-Apple.html)

Наследование: IDisposable
Показать файл Открыть проект

Открытые методы

Метод Описание
Create ( Delegate @delegate ) : Block

Create a block around the specified delegate.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ToString ( ) : string

Returns a String that represents this instance.

Защищенные методы

Метод Описание
Block ( Delegate invoker ) : System

Initializes a new instance of the Block class.

Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

Приватные методы

Метод Описание
CreateBlock ( Object thunk, Object invoker, IntPtr function ) : IntPtr
DestroyBlock ( IntPtr layout ) : void

Описание методов

Block() защищенный Метод

Initializes a new instance of the Block class.
protected Block ( Delegate invoker ) : System
invoker System.Delegate The invoker.
Результат System

Create() публичный статический Метод

Create a block around the specified delegate.
public static Create ( Delegate @delegate ) : Block
@delegate System.Delegate
Результат Block

Dispose() публичный Метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Releases unmanaged and - optionally - managed resources
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
Результат void

ToString() публичный Метод

Returns a String that represents this instance.
public ToString ( ) : string
Результат string