Exemplo n.º 1
0
 public void Close()
 {
     if (Interlocked.CompareExchange(ref _closedMarker, 1, 0) == 0)
     {
         _connectionProvider.Close();
     }
 }
Exemplo n.º 2
0
        private IObservable <RedisConnectionInfo> Close()
        {
            return(_dialogManager.Open(new ConfirmDialogModel
            {
                TitleText = "Delete connection?",
                MessageText = "Do you want to delete selected connection?",
                ConfirmText = "Delete",
                CancelText = "Cancel"
            })
                   .SelectMany(confirmed =>
            {
                if (!confirmed)
                {
                    return Observable.Return <RedisConnectionInfo>(null);
                }

                return _connectionProvider.Close(_model.ConnectionInfo);
            }));
        }