Exemple #1
0
        /// <summary>
        /// get the string for the opml-export
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public string GetOPMLString(int level)
        {
            //used for tabs
            string prefix = "";

            if (level > 0)
            {
                for (int i = 0; i < level; i++)
                {
                    prefix += "\t";
                }
            }

            StringBuilder BodyString = new StringBuilder();

            BodyString.Append(prefix + "<body>" + Environment.NewLine);
            foreach (Outline Outline in Outlines)
            {
                BodyString.Append(Outline.GetOPMLString(level + 1));
            }
            BodyString.Append(prefix + "</body>");

            return(BodyString.ToString());
        }
Exemple #2
0
        /// <summary>
        /// get the string for the opml-export
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public string GetOPMLString(int level)
        {
            //used for tabs
            string prefix = "";

            if (level > 0)
            {
                for (int i = 0; i < level; i++)
                {
                    prefix += "\t";
                }
            }

            StringBuilder OutlineString = new StringBuilder();

            OutlineString.Append(prefix + "<outline text=\"" + Text + "\"");

            if (!string.IsNullOrEmpty(XMLUrl))
            {
                OutlineString.Append(" xmlUrl=\"" + XMLUrl + "\"");
            }

            if (!string.IsNullOrEmpty(Version))
            {
                OutlineString.Append(" version=\"" + Version + "\"");
            }

            if (!string.IsNullOrEmpty(Title))
            {
                OutlineString.Append(" title=\"" + Title + "\"");
            }

            if (!string.IsNullOrEmpty(Language))
            {
                OutlineString.Append(" language=\"" + Language + "\"");
            }

            if (!string.IsNullOrEmpty(Type))
            {
                OutlineString.Append(" type=\"" + Type + "\"");
            }

            if (!string.IsNullOrEmpty(HTMLUrl))
            {
                OutlineString.Append(" htmlUrl=\"" + HTMLUrl + "\"");
            }

            if (!string.IsNullOrEmpty(Description))
            {
                OutlineString.Append(" description=\"" + Description + "\"");
            }

            if (Outlines != null)
            {
                if (Outlines.Count > 0)
                {
                    OutlineString.Append(">\r");
                    foreach (Outline Outline in Outlines)
                    {
                        OutlineString.Append(Outline.GetOPMLString(level + 1));// + Environment.NewLine);
                    }
                    OutlineString.Append(prefix + "</outline>" + Environment.NewLine);
                }
                else
                {
                    OutlineString.Append("></outline>" + Environment.NewLine);
                }
            }
            else
            {
                OutlineString.Append("></outline>" + Environment.NewLine);
            }


            return(OutlineString.ToString());
        }