How do I properly use SyndicationFeed<TSyndicationFeed>.Load()?

66 Views Asked by At

Let's say I want to inherit from 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 offers a method that I can't quite wrap my head around: Load<TSyndicationFeed>(xmlReader).

Clearly, this method outputs my derived type. But it is unclear if that type can have any additional properties set beyond the base class SyndicationFeed. I would think that I should be able to override some method so that I can plug-in to the system, read RSS extension elements and set the appropriate properties. But I don't see where I would go about doing this.

I see other ways of accomplishing this without Load, but the fact that there is a generic there tells me that there has to be something I'm missing.

Maybe I could have:

public static PodcastSyndicationFeed Load<TSyndicationFeed>(XmlReader reader)
{
  base.Load(reader);
  // Do other stuff, like read through ElementExtensions
}

But I just feel like I'm missing something here. Is this the right track? If not, how do I properly use this method with my derived class?

0

There are 0 best solutions below