public void LoadTest() { XHTMLText target = new XHTMLText(); string folder = PathHelper.CombineUrl(Environment.CurrentDirectory, PathHelper.CombineUrl("Data", "Xhtml")); string xhtml = PathHelper.CombineUrl(folder, "sop-1.1.001-management-meetings-v1.1.html"); target.Load(xhtml); xhtml = "<p>The purpose of this Procedure is to specify requirements for scheduling and performing Internal Quality " + "and OH&S Audits of the Sigma Bravo Business Management System (BMS) to verify its maintenance, effectiveness and continual improvement.</p>"; target.Load(xhtml); xhtml = " <h1>Internal & Audits</h1>"; target.Load(xhtml); xhtml = "<p>Doc & Data Develop & Control</p>"; target.Load(xhtml); xhtml = "<p>&</p>"; target.Load(xhtml); xhtml = target.Xhtml; target.Load(xhtml); // This one fails. //xhtml = "<p><h1>&<h1></p>"; //xhtml = HttpUtility.HtmlDecode(xhtml); //target.Load(xhtml); xhtml = PathHelper.CombineUrl(folder, "sop-1.1.002-internal-audits.html"); target.Load(xhtml); xhtml = PathHelper.CombineUrl(folder, "sop-1.1.003-problems-and-enhancements-v1.1.html"); target.Load(xhtml); }
/// <summary> /// Send a notification to the user of the parent message /// </summary> /// <param name="parent"></param> /// <param name="message">Answer</param> private void NotifyUserReply(Message parent, Message message) { if (NotificationProvider == null) { return; } if (parent.Owner == null) { return; } XHTMLText xhtml = new XHTMLText(); xhtml.Load(message.Body); //Create the parameters list Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("?title?", message.Title); parameters.Add("?bodyhtml?", message.Body); parameters.Add("?bodytext?", xhtml.GetShortText()); parameters.Add("?user?", message.Owner); parameters.Add("?idmessage?", message.Id); parameters.Add("?idforum?", parent.Topic.Category.Id); parameters.Add("?idtopic?", parent.Topic.Id); parameters.Add("?forum?", parent.Topic.Category.Name); parameters.Add("?forumDisplayName?", parent.Topic.Category.DisplayName); if (parent.Owner != null && parent.Owner.Length > 0) { System.Web.Security.MembershipUser destinationUser = System.Web.Security.Membership.GetUser(parent.Owner); if (destinationUser != null && NotificationProvider.UserCanReceiveNotification(destinationUser)) { NotificationProvider.NotifyUser(destinationUser, parameters); } } }
/// <summary> /// Send a notification to the user of the parent message /// </summary> /// <param name="parent"></param> /// <param name="message">Answer</param> private void NotifyUserReply(Message parent, Message message) { if (NotificationProvider == null) return; if (parent.Owner == null) return; XHTMLText xhtml = new XHTMLText(); xhtml.Load(message.Body); //Create the parameters list Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("?title?", message.Title); parameters.Add("?bodyhtml?", message.Body); parameters.Add("?bodytext?", xhtml.GetShortText()); parameters.Add("?user?", message.Owner); parameters.Add("?idmessage?", message.Id); parameters.Add("?idforum?", parent.Topic.Category.Id); parameters.Add("?idtopic?", parent.Topic.Id); parameters.Add("?forum?", parent.Topic.Category.Name); parameters.Add("?forumDisplayName?", parent.Topic.Category.DisplayName); if (parent.Owner != null && parent.Owner.Length > 0) { System.Web.Security.MembershipUser destinationUser = System.Web.Security.Membership.GetUser(parent.Owner); if (destinationUser != null && UserCanReceiveNotification(destinationUser)) //NotificationProvider.UserCanReceiveNotification(destinationUser { NotificationProvider.NotifyUser(destinationUser, parameters); } } }