Elmah.RssXml.Item C# (CSharp) Méthode

Item() public static méthode

public static Item ( string title, string description, System.DateTime pubDate ) : System.Xml.Linq.XElement
title string
description string
pubDate System.DateTime
Résultat System.Xml.Linq.XElement
        public static XElement Item(string title, string description, DateTime pubDate)
        {
            return Item(title, description, pubDate, null);
        }

Same methods

RssXml::Item ( string title, string description, System.DateTime pubDate, string link ) : System.Xml.Linq.XElement

Usage Example

Exemple #1
0
        public static void ProcessRequest(HttpContextBase context)
        {
            const int pageSize = 15;
            var       entries  = new List <ErrorLogEntry>(pageSize);
            var       log      = ErrorLog.GetDefault(context);

            log.GetErrors(0, pageSize, entries);

            var response = context.Response;

            response.ContentType = "application/xml";

            var title = string.Format(@"Error log of {0} on {1}",
                                      log.ApplicationName, Environment.MachineName);

            var link    = ErrorLogPageFactory.GetRequestUrl(context).GetLeftPart(UriPartial.Authority) + context.Request.ServerVariables["URL"];
            var baseUrl = new Uri(link.TrimEnd('/') + "/");

            var items =
                from entry in entries
                let error = entry.Error
                            select RssXml.Item(
                    error.Message,
                    "An error of type " + error.Type + " occurred. " + error.Message,
                    error.Time,
                    baseUrl + "detail?id=" + Uri.EscapeDataString(entry.Id));

            var rss = RssXml.Rss(title, link, "Log of recent errors", items);

            response.Write(XmlText.StripIllegalXmlCharacters(rss.ToString()));
        }
All Usage Examples Of Elmah.RssXml::Item