public virtual void ProcessRequest(HttpContext context) { AtomFeed feed = this.Create(); UriBuilder ub = new UriBuilder(context.Request.Url); ub.Port = -1; AtomLink self = new AtomLink(ub.Uri, "self"); feed.AddLink(self); // Obsolated, only for compatibility AtomLink link = GetFeedLink(); if (link != null) { if (feed.Links != null) { feed.Links.Clear(); } feed.AddLink(link); } context.Response.ContentType = "application/atom+xml;type=feed"; context.Response.ContentEncoding = new UTF8Encoding(); using (TextWriter output = context.Response.Output) { using (XmlWriter writer = XmlWriter.Create(output)) { feed.WriteDocument(writer); } } }
public void AddLink(AtomLink link) { Helper.AddItem<AtomLink>(ref _links, link); }