Exemple #1
0
        private async void PreviewButton_Click(object sender, RoutedEventArgs e)
        {
            PostPreviewRaw.Visibility = Visibility.Collapsed;

            _forumReply.MapMessage(ReplyText.Text);
            var replyManager = new ReplyManager();
            string result = await replyManager.CreatePreviewPost(_forumReply);
            if (!string.IsNullOrEmpty(result))
            {
                PostPreviewRaw.NavigateToString(result);
                PostPreviewRaw.Visibility = Visibility.Visible;
                PreviewPostGrid.Visibility = Visibility.Visible;
            }
            else
            {
                loadingProgressBar.Visibility = Visibility.Collapsed;
                PreviewPostGrid.Visibility = Visibility.Collapsed;
                string messageText =
                    string.Format(
                        "No text?! What good is showing you a preview then! Type something in and try again!{0}{1}",
                        Environment.NewLine, Constants.ASCII_2);
                var msgDlg = new MessageDialog(messageText);
                await msgDlg.ShowAsync();
            }
        }
Exemple #2
0
 public async Task<bool> GetPreviewPost(string replyText)
 {
     Html = string.Empty;
     IsLoading = true;
     ForumReplyEntity.MapMessage(replyText);
     var replyManager = new ReplyManager();
     Html = await replyManager.CreatePreviewPost(ForumReplyEntity);
     IsLoading = false;
     return !string.IsNullOrEmpty(Html);
 }
Exemple #3
0
 public async Task<bool> GetPreviewPost(string replyText)
 {
     Html = string.Empty;
     IsLoading = true;
     ForumReplyEntity.MapMessage(replyText);
     var replyManager = new ReplyManager();
     try
     {
         Html = await replyManager.CreatePreviewPost(ForumReplyEntity);
     }
     catch (Exception ex)
     {
          AwfulDebugger.SendMessageDialogAsync("Could not create preview HTML", ex);
     }
     IsLoading = false;
     return !string.IsNullOrEmpty(Html);
 }