Beispiel #1
0
        /// <summary>
        /// Decrypt a message using the user private key if it was intented to them
        /// </summary>
        /// <param name="identity"></param>
        /// <param name="message"></param>
        public async void DecryptMessage(string identity, string message)
        {
            if (identity == myIdentity)
            {
                string result = await bfService.DecipherText(message, key);

                Message = result;
            }
            else
            {
                Message = AppResources.DecryptMessageMessageError;
            }
            Recipient       = identity;
            PanelVisibility = System.Windows.Visibility.Visible;
            dispatcherService.CallDispatcher(() => {
                IsBusy          = false;
                ProgressMessage = String.Empty;
            });
        }
Beispiel #2
0
        private async void EncryptSecureNoteExecute()
        {
            IsBusy                  = true;
            ProgressMessage         = AppResources.EncryptingMessage;
            secureNoteEncryptedText = await bfService.CipherText(SecureNoteText, myIdentity, myKey);

            string url = String.Format("ibcs:decrypt?message={0}&id={1}", secureNoteEncryptedText, myIdentity);

            if (shortenSecureNote)
            {
                shortenedNote = await apiService.ShortenUrl(url);
            }
            else
            {
                shortenedNote = url;
            }
            dispatcherService.CallDispatcher(() => {
                IsBusy          = false;
                ProgressMessage = String.Empty;
            });
            SecureNoteEncrypted = true;
        }
Beispiel #3
0
        private async void ResetGameExecute()
        {
            LogMessage("Resetting game");
            dispatcherService.CallDispatcher(() => ResetBoard());
            dataWriter.WriteString("R");
            dataWriter.WriteInt16(Convert.ToInt16(0));
            await dataWriter.StoreAsync();

            GameStarted = false;
            isInitiator = false;
            MyTurn      = false;
            HandShake();
        }
Beispiel #4
0
 private void apiService_CreateAccountCompleted()
 {
     dispatcherService.CallDispatcher(() => IsBusy = false);
     navService.NavigateToLoginPage("created=true");
 }