icationElementExtension给一个Syndic

icationElementExtension给一个Syndic

本文介绍了如何添加SyndicationElementExtension给一个SyndicationItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用.NET System.ServiceModel.Syndication类...

我想一个新的SyndicationElementExtension添加到SyndicationItem,将导出以下XML:

 <媒体:缩略图的URL =htt​​p://www.foo.com/keyframe.jpgWIDTH =75高度=50时间=12:05 :01.123/>
 

线沿线的东西:

  syndicationItem.ElementExtensions.Add(新SyndicationElementExtension(缩略图,http://video.search.yahoo.com/mrss?
 

你怎么有几个属性创建一个简单的SyndicationElementExtension?

解决方案

在这里找到了答案:http://msdn.microsoft.com/en-us/library/bb943475.aspx

  feed.ElementExtensions.Add(新的XElement(xElementExtension
        新的XElement(钥匙,新XAttribute(attR1位,someValue中),Z),
        新的XElement(价值,新XAttribute(attR1位,someValue中),
        15))CreateReader())。
 

Using the .NET System.ServiceModel.Syndication classes...

I would like to add a new SyndicationElementExtension to a SyndicationItem that will export the following XML:

<media:thumbnail url="http://www.foo.com/keyframe.jpg" width="75" height="50" time="12:05:01.123" />

Something along the lines of:

syndicationItem.ElementExtensions.Add(new SyndicationElementExtension("thumbnail", "http://video.search.yahoo.com/mrss", ?

How do you create a simple SyndicationElementExtension with a few attributes?

解决方案

Found the answer here: http://msdn.microsoft.com/en-us/library/bb943475.aspx

feed.ElementExtensions.Add(new XElement("xElementExtension",
        new XElement("Key", new XAttribute("attr1", "someValue"), "Z"),
        new XElement("Value", new XAttribute("attr1", "someValue"),
        "15")).CreateReader());

这篇关于如何添加SyndicationElementExtension给一个SyndicationItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 12:41