C# 如何正确使用SyndicationFeed<;TSyndicationFeed>;。加载()?
假设我想从C# 如何正确使用SyndicationFeed<;TSyndicationFeed>;。加载()?,c#,.net,rss,syndication-feed,syndicationfeed,C#,.net,Rss,Syndication Feed,Syndicationfeed,假设我想从SyndicationFeed继承: public class PodcastSyndicationFeed : SyndicationFeed { private string subtitle; // Gets or sets the subtitle. Used with the iTunes RSS extensions public string Subtitle { get { return subtitle; } set { subtit
SyndicationFeed
继承:
public class PodcastSyndicationFeed : SyndicationFeed
{
private string subtitle;
// Gets or sets the subtitle. Used with the iTunes RSS extensions
public string Subtitle
{
get { return subtitle; }
set { subtitle = value; }
}
}
SyndicationFeed
提供了一种我无法完全理解的方法:
显然,这个方法输出我的派生类型。但不清楚该类型是否可以在基类SyndicationFeed
之外设置任何其他属性。我认为我应该能够重写一些方法,这样我就可以插入系统,读取RSS扩展元素并设置适当的属性。但我不知道该怎么做
我看到了其他不用加载的方法,但事实上,这里有一个泛型,这告诉我,一定有我遗漏的东西
也许我可以:
public static PodcastSyndicationFeed Load<TSyndicationFeed>(XmlReader reader)
{
base.Load(reader);
// Do other stuff, like read through ElementExtensions
}
公共静态PodcastSyndicationFeed加载(XmlReader)
{
基本负载(读卡器);
//做其他事情,比如通读ElementExtensions
}
但我只是觉得我错过了一些东西。这是正确的轨道吗?如果不是,我如何在派生类中正确使用此方法