Example #1
0
        public async Task ConnectAsync()
        {
            hubConnection = new HubConnection(url);
            hubProxy      = hubConnection.CreateHubProxy("pollHub");

            //client event handlers
            hubProxy.On <ReportExecutionResultSet>("RequestUpdating", (resultSet) =>
                                                   RequestUpdated?.Invoke(resultSet));
            hubProxy.On <ReportExecutionResultSet>("requestCancelling", (resultSet) => RequestCancelled?.Invoke(resultSet));
            hubProxy.On("requestCancelled", () => AllRequestsCancelled?.Invoke());

            hubConnection.Reconnecting += Reconnecting;
            hubConnection.Reconnected  += Reconnected;
            hubConnection.Closed       += ConnectionClosed;
            await hubConnection.Start();
        }
Example #2
0
 internal void Cancel()
 {
     RequestCancelled?.Invoke(this, new EventArgs());
 }
Example #3
0
 public virtual void OnRequestCancelled(WebEventArgs e)
 {
     RequestCancelled?.Invoke(this, e);
 }