// When the user finishes the quiz, an automated message is generated detailing their efforts.
        private async void FinishQuiz()
        {
            DecideExclamation();

            Message message = new Message()
            {
                ObjType      = "Msg",
                SenderName   = "AnnouncerBot",
                SenderAvatar = new Uri("http://icons.iconarchive.com/icons/danleech/simple/1024/android-icon.png"),
                Text         = MainPageViewModel.CurrentGoogleUsername
                               + " just got " + _correctSubmissions + " out of " + Length
                               + " flashcards right playing " + Creator + "'s " + QuizName
                               + " deck! " + _exclamation,
                Category  = "Announcement",
                Timestamp = DateTime.Now.Ticks.ToString()
            };

            await ChatDBService.UploadMessage(message);

            await _navigationService.GoBackAsync();
        }
Пример #2
0
        public async void ComposeMessage()
        {
            // Disallows the user from publishing empty strings.
            if (Input == null)
            {
                return;
            }

            Message message = new Message()
            {
                ObjType      = "Msg",
                SenderAvatar = MainPageViewModel.CurrentGoogleAvatar,
                SenderName   = MainPageViewModel.CurrentGoogleUsername,
                Text         = Input,
                Category     = PickerCategory,
                Timestamp    = DateTime.Now.Ticks.ToString()
            };

            Input = "";
            await ChatDBService.UploadMessage(message);
        }