HubConnection.On Metodo

Definizione

Overload

On(String, Type[], Func<Object[],Object,Task>, Object)

Registra un gestore che verrà richiamato quando viene richiamato il metodo hub con il nome del metodo specificato.

On(String, Type[], Func<Object[],Object,Task<Object>>, Object)

Registra un gestore che verrà richiamato quando viene richiamato il metodo hub con il nome del metodo specificato. Restituisce il valore restituito dal gestore al server se il server richiede un risultato.

On(String, Type[], Func<Object[],Object,Task>, Object)

Origine:
HubConnection.cs
Origine:
HubConnection.cs
Origine:
HubConnection.cs
Origine:
HubConnection.cs
Origine:
HubConnection.cs
Origine:
HubConnection.cs
Origine:
HubConnection.cs
Origine:
HubConnection.cs

Registra un gestore che verrà richiamato quando viene richiamato il metodo hub con il nome del metodo specificato.

public:
 IDisposable ^ On(System::String ^ methodName, cli::array <Type ^> ^ parameterTypes, Func<cli::array <System::Object ^> ^, System::Object ^, System::Threading::Tasks::Task ^> ^ handler, System::Object ^ state);
public IDisposable On (string methodName, Type[] parameterTypes, Func<object[],object,System.Threading.Tasks.Task> handler, object state);
public virtual IDisposable On (string methodName, Type[] parameterTypes, Func<object?[],object,System.Threading.Tasks.Task> handler, object state);
member this.On : string * Type[] * Func<obj[], obj, System.Threading.Tasks.Task> * obj -> IDisposable
abstract member On : string * Type[] * Func<obj[], obj, System.Threading.Tasks.Task> * obj -> IDisposable
override this.On : string * Type[] * Func<obj[], obj, System.Threading.Tasks.Task> * obj -> IDisposable
Public Function On (methodName As String, parameterTypes As Type(), handler As Func(Of Object(), Object, Task), state As Object) As IDisposable
Public Overridable Function On (methodName As String, parameterTypes As Type(), handler As Func(Of Object(), Object, Task), state As Object) As IDisposable

Parametri

methodName
String

Nome del metodo hub da definire.

parameterTypes
Type[]

I parametri previsti dal metodo hub.

handler
Func<Object[],Object,Task>

Gestore che verrà generato quando viene richiamato il metodo hub.

state
Object

Oggetto state che verrà passato al gestore.

Restituisce

Sottoscrizione che può essere eliminata per annullare la sottoscrizione dal metodo hub.

Commenti

Si tratta di un metodo di basso livello per la registrazione di un gestore. È consigliabile usare un HubConnectionExtensionsOn metodo di estensione.

Si applica a

On(String, Type[], Func<Object[],Object,Task<Object>>, Object)

Origine:
HubConnection.cs
Origine:
HubConnection.cs

Registra un gestore che verrà richiamato quando viene richiamato il metodo hub con il nome del metodo specificato. Restituisce il valore restituito dal gestore al server se il server richiede un risultato.

public virtual IDisposable On (string methodName, Type[] parameterTypes, Func<object?[],object,System.Threading.Tasks.Task<object?>> handler, object state);
abstract member On : string * Type[] * Func<obj[], obj, System.Threading.Tasks.Task<obj>> * obj -> IDisposable
override this.On : string * Type[] * Func<obj[], obj, System.Threading.Tasks.Task<obj>> * obj -> IDisposable
Public Overridable Function On (methodName As String, parameterTypes As Type(), handler As Func(Of Object(), Object, Task(Of Object)), state As Object) As IDisposable

Parametri

methodName
String

Nome del metodo hub da definire.

parameterTypes
Type[]

I parametri previsti dal metodo hub.

handler
Func<Object[],Object,Task<Object>>

Gestore che verrà generato quando viene richiamato il metodo hub.

state
Object

Oggetto state che verrà passato al gestore.

Restituisce

Sottoscrizione che può essere eliminata per annullare la sottoscrizione dal metodo hub.

Commenti

Si tratta di un metodo di basso livello per la registrazione di un gestore. È consigliabile usare un HubConnectionExtensionsOn metodo di estensione.

Si applica a