コード例 #1
0
 public ConfigEditorVM(IHubClientSettings hubClientSettings,
                       IHubSessionsClient hubSessionsClient)
 {
     _hub             = hubSessionsClient;
     _key             = hubClientSettings.SharedKey;
     EncryptCmd       = R2Command.Relay(EncryptUnsaved, _ => !IsEncrypted, "Encrypt");
     DecryptCmd       = R2Command.Relay(DecryptUnsaved, _ => IsEncrypted, "Decrypt");
     PrettifyCmd      = R2Command.Relay(PrettifyUnsaved, _ => !IsEncrypted, "Prettify");
     SaveCmd          = R2Command.Async(SaveUnsaved, CanSave, "Save");
     PropertyChanged += ConfigEditorVM_PropertyChanged;
 }
コード例 #2
0
        public CurrentClienteleVM(IHubSessionsClient clientStatusHubProxy1)
        {
            _hub = clientStatusHubProxy1;
            _hub.ClientConnected    += (s, e) => RefreshWhenNotBusy();
            _hub.ClientInteracted   += (s, e) => RefreshWhenNotBusy();
            _hub.ClientDisconnected += (s, e) => RefreshWhenNotBusy();

            GetCurrentListCmd = R2Command.Async(_ => RefreshList(),
                                                _ => !IsBusy, "Refresh List");
            RequestStatesCmd = R2Command.Async(RequestStates, _ => !IsBusy, "Request States");
        }
コード例 #3
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         if (disposing)
         {
             _hub?.Dispose();
             _hub = null;
         }
         disposedValue = true;
     }
 }