private async void SaveHeaderAsync() { EditorBox.IsReadOnly = true; using (MemoryStream ms = new MemoryStream()) { EditorBox.Save(ms, FormatType.Html); ms.Flush(); ms.Position = 0; StreamReader reader = new StreamReader(ms); String content = reader.ReadToEnd(); CommentSettings.CurrentHeaderParagraph.SetHtml(content); } HttpWebResponse response = await CurrentSection.SaveCommentHeaderAsync(CommentSettings.CurrentHeaderParagraph.HtmlContent); String message = ""; switch (response.StatusCode) { case HttpStatusCode.OK: message = "Successfully Saved to Webhost."; break; default: message = String.Format("Something went wrong...{0}{1}", Environment.NewLine, response.StatusDescription); break; } EditorBox.IsReadOnly = false; }
private async void SaveStudentCommentAsync() { EditorBox.IsReadOnly = true; using (MemoryStream ms = new MemoryStream()) { EditorBox.Save(ms, FormatType.Html); ms.Flush(); ms.Position = 0; StreamReader reader = new StreamReader(ms); String content = reader.ReadToEnd(); CommentSettings.CurrentStudentComment.HtmlContent = content; } HttpWebResponse response = await CurrentStudent.SaveCommentAsync(CommentSettings.CurrentStudentComment.HtmlContent); }