Ejemplo n.º 1
0
        //Body of text to insert into a post with Trackback
        public static string TrackBackTag(Entry entry, Blog blog, UrlHelper urlHelper)
        {
            if(entry == null)
            {
                throw new ArgumentNullException("entry");
            }

            Uri entryUrl = urlHelper.EntryUrl(entry).ToFullyQualifiedUrl(blog);
            return String.Format(CultureInfo.InvariantCulture, Resources.TrackbackTag, entryUrl, entryUrl, entry.Title,
                                 urlHelper.BlogUrl(), entry.Id.ToString(CultureInfo.InvariantCulture));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Writes the RSD for the specified blog into the XmlWriter.
        /// </summary>
        public void WriteRsd(XmlWriter writer, Blog blog, UrlHelper urlHelper)
        {
            writer.WriteStartDocument();
            writer.WriteStartElement("rsd", "http://archipelago.phrasewise.com/rsd");
            writer.WriteAttributeString("version", "1.0");
            writer.WriteStartElement("service");
            writer.WriteElementString("engineName", "Subtext");
            writer.WriteElementString("engineLink", "http://subtextproject.com/");
            writer.WriteElementString("homePageLink", urlHelper.BlogUrl().ToFullyQualifiedUrl(blog).ToString());

            writer.WriteStartElement("apis");

            //When we have more than one API, we'll list them here.
            writer.WriteStartElement("api");
            writer.WriteAttributeString("name", "MetaWeblog");
            writer.WriteAttributeString("preferred", "true");
            writer.WriteAttributeString("apiLink", urlHelper.MetaWeblogApiUrl(blog).ToString());
            writer.WriteAttributeString("blogID", blog.Id.ToString(CultureInfo.InvariantCulture));
            writer.WriteEndElement(); // </api>

            writer.WriteEndElement(); // </apis>

            writer.WriteEndElement(); // </service>
            writer.WriteEndElement(); // </rsd>
            writer.WriteEndDocument();
            writer.Flush();
        }
Ejemplo n.º 3
0
 //Text to insert into a file with pinkback service location
 public static string GetPingPackTag(UrlHelper urlHelper)
 {
     return string.Format(CultureInfo.InvariantCulture,
                          "<link rel=\"pingback\" href=\"{0}Services/Pingback.aspx\"></link>",
                          urlHelper.BlogUrl());
 }