Beispiel #1
0
        //
        // NOTE: For sake of brevity, the following WriteRss* methods do not
        // write out all the members of the RichSiteSummary and related types.
        //

        private static void WriteRssToJson(RichSiteSummary rss, JsonWriter writer)
        {
            writer.WriteStartObject();
            writer.WriteMember("version");
            writer.WriteString(rss.version);
            writer.WriteMember("channel");
            WriteRssToJson(rss.channel, writer);
            writer.WriteEndObject();
        }
Beispiel #2
0
        private static RichSiteSummary GetNews()
        {
            if (news == null)
            {
                XmlSerializer serializer = new XmlSerializer(typeof(RichSiteSummary));

                using (XmlReader reader = XmlReader.Create(newsSourceUrl))
                    news = (RichSiteSummary) serializer.Deserialize(reader);
            }

            return news;
        }
Beispiel #3
0
        private static RichSiteSummary GetNews()
        {
            if (news == null)
            {
                XmlSerializer serializer = new XmlSerializer(typeof(RichSiteSummary));

                using (XmlReader reader = XmlReader.Create(newsSourceUrl))
                    news = (RichSiteSummary)serializer.Deserialize(reader);
            }

            return(news);
        }
Beispiel #4
0
 //
 // NOTE: For sake of brevity, the following WriteRss* methods do not
 // write out all the members of the RichSiteSummary and related types.
 //
 private static void WriteRssToJson(RichSiteSummary rss, JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WriteMember("version");
     writer.WriteString(rss.version);
     writer.WriteMember("channel");
     WriteRssToJson(rss.channel, writer);
     writer.WriteEndObject();
 }