Exemple #1
0
        void ChangeStatus(RpcClientStatus newStatus)
        {
            if (Status == newStatus)
            {
                return;
            }
            logger.Debug($"Changed status from {Status} to {newStatus}");
            RpcClientStatusChangedEventArgs args = new RpcClientStatusChangedEventArgs(this, Status, newStatus);

            Status = newStatus;

            try
            {
                OnStatusChanged(args);
            }
            catch (Exception e)
            {
                logger.Error($"Unhandled exception on {this.GetType().Name}.{nameof(OnStatusChanged)}: {e}");
            }

            try
            {
                OnStatusChangedEvent?.Invoke(args);
            }
            catch (Exception e)
            {
                logger.Error($"Unhandled exception on {this.GetType().Name}.{nameof(OnStatusChangedEvent)}: {e}");
            }
        }
Exemple #2
0
 protected virtual void OnStatusChanged(RpcClientStatusChangedEventArgs args)
 {
 }