Exemplo n.º 1
0
 private void RaiseCommandExecutes()
 {
     StopPriceSourceCommand.RaiseCanExecuteChanged();
     StartPriceSourceCommand.RaiseCanExecuteChanged();
     SubscribeCommand.RaiseCanExecuteChanged();
     UnsubscribeCommand.RaiseCanExecuteChanged();
     SubscribeAllCommand.RaiseCanExecuteChanged();
     UnsubscribeAllCommand.RaiseCanExecuteChanged();
 }
Exemplo n.º 2
0
        private async void OnUnsubscribeCommand()
        {
            canSubscribe = true;
            SubscribeCommand.RaiseCanExecuteChanged();
            canUnsubscribe = false;
            UnsubscribeCommand.RaiseCanExecuteChanged();

            await hub.Invoke <int>("Unsubscribe", new object[] { ClientId });

            if (connection.State == ConnectionState.Connected)
            {
                connection.Stop();
            }
        }
Exemplo n.º 3
0
        private async void OnSubscribeCommand()
        {
            canSubscribe = false;
            SubscribeCommand.RaiseCanExecuteChanged();
            canUnsubscribe = true;
            UnsubscribeCommand.RaiseCanExecuteChanged();

            if (connection.State != ConnectionState.Connected)
            {
                await connection.Start();
            }

            try
            {
                await hub.Invoke <int>("Subscribe", new object[] { ClientId });
            }
            catch (Exception ex)
            {
                Message = ex.Message;
            }
        }