/// <summary>
        /// Converts the object to a string
        /// </summary>
        /// <returns>The object as a string</returns>
        public override string ToString()
        {
            StringBuilder Builder = new StringBuilder();

            Builder.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>")
            .AppendFormat("<blog root-url=\"{0}\" date-created=\"{1}\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://www.blogml.com/2006/09/BlogML\">\n", RootURL, DateCreated.ToString("yyyy-MM-ddThh:mm:ss"))
            .AppendFormat("<title type=\"text\"><![CDATA[{0}]]></title>\n", Title)
            .AppendFormat("<sub-title type=\"text\"><![CDATA[{0}]]></sub-title>\n", SubTitle)
            .Append(Authors.ToString())
            .Append(Categories.ToString())
            .Append(Posts.ToString())
            .AppendLine("</blog>");
            return(Builder.ToString());
        }
示例#2
0
        /// <summary>
        /// Converts the object to a string
        /// </summary>
        /// <returns>The object as a string</returns>
        public override string ToString()
        {
            StringBuilder Builder = new StringBuilder();

            Builder.AppendFormat("<post id=\"{0}\" date-created=\"{1}\" date-modified=\"{2}\" approved=\"true\" post-url=\"{3}\" type=\"normal\" hasexcerpt=\"true\" views=\"0\" is-published=\"True\">\n", ID, DateCreated.ToString("yyyy-MM-ddThh:mm:ss"), DateModified.ToString("yyyy-MM-ddThh:mm:ss"), PostURL);
            Builder.AppendFormat("<title type=\"text\"><![CDATA[{0}]]></title>\n", Title);
            Builder.AppendFormat("<content type=\"text\"><![CDATA[{0}]]></content>\n", Content);
            Builder.AppendFormat("<post-name type=\"text\"><![CDATA[{0}]]></post-name>\n", PostName);
            Builder.AppendFormat("<excerpt type=\"text\"><![CDATA[{0}]]></excerpt>\n", Excerpt);
            Builder.AppendLine(Authors.ToString());
            Builder.AppendLine(Categories.ToString());
            Builder.AppendLine(Tags.ToString());
            Builder.AppendLine(Comments.ToString());
            Builder.AppendLine("<trackbacks />");
            Builder.AppendLine("</post>");
            return(Builder.ToString());
        }