Beispiel #1
0
 private void TrustedCertificatesChanged(TrustedCertificatesEventArgs obj)
 {
     if (_userId != UserId.Empty)
     {
         using (var client = ClientModel.Get())
         {
             var user = client.Chat.GetUser(_userId);
             if (user.Certificate.Equals(obj.Certificate))
             {
                 CheckStatus = GetCheckStatus(client);
             }
         }
     }
 }
Beispiel #2
0
        public UserViewModel(string nickLKey, UserId userId, RoomViewModel parentViewModel)
            : base(parentViewModel, true)
        {
            _userId = userId;
            _parent = parentViewModel;

            using (var client = ClientModel.Get())
            {
                _checkStatus = GetCheckStatus(client);
                _isClient    = GetClientStatus(client);
                _nickColor   = GetColor(client);
            }

            UserClickCommand         = new Command(UserClick);
            SetRoomAdminCommand      = new Command(SetRoomAdmin, _ => ClientModel.Api != null);
            OpenCertificateCommand   = new Command(OpenCertificate, _ => ClientModel.Api != null);
            SaveCertificateCommand   = new Command(SaveCertificate, _ => ClientModel.Api != null);
            RemoveCertificateCommand = new Command(RemoveCertificate, _ => ClientModel.Api != null);

            Events.TrustedCertificatesChanged += CreateSubscriber <TrustedCertificatesEventArgs>(TrustedCertificatesChanged);

            Localizer.Instance.LocaleChanged += RefreshNick;
        }