Język

Atom10FeedFormatter Konstruktory

Definicja

Tworzy nowe wystąpienie Atom10FeedFormatter klasy.

Przeciążenia

Nazwa Opis
Atom10FeedFormatter()

Tworzy nowe wystąpienie Atom10FeedFormatter klasy.

Atom10FeedFormatter(SyndicationFeed)

Tworzy nowe wystąpienie Atom10FeedFormatter klasy z określonym SyndicationFeed wystąpieniem.

Atom10FeedFormatter(Type)

Tworzy nowe wystąpienie Atom10FeedFormatter klasy.

Atom10FeedFormatter()

Źródło:
Atom10FeedFormatter.cs
Źródło:
Atom10FeedFormatter.cs
Źródło:
Atom10FeedFormatter.cs
Źródło:
Atom10FeedFormatter.cs

Tworzy nowe wystąpienie Atom10FeedFormatter klasy.

public:
 Atom10FeedFormatter();
public Atom10FeedFormatter();
Public Sub New ()

Przykłady

Poniższy kod pokazuje, jak utworzyć element Atom10FeedFormatter i odczytać w kanale informacyjnym syndykacji.

XmlReader atomReader = XmlReader.Create("AtomFeed.xml");
Atom10FeedFormatter atomFormatter = new Atom10FeedFormatter();
atomFormatter.ReadFrom(atomReader);
atomReader.Close();
Dim atomReader As XmlReader = XmlReader.Create("AtomFeed.xml")
Dim atomFormatter As Atom10FeedFormatter = New Atom10FeedFormatter()
atomFormatter.ReadFrom(atomReader)
atomReader.Close()

Dotyczy

Atom10FeedFormatter(SyndicationFeed)

Źródło:
Atom10FeedFormatter.cs
Źródło:
Atom10FeedFormatter.cs
Źródło:
Atom10FeedFormatter.cs
Źródło:
Atom10FeedFormatter.cs

Tworzy nowe wystąpienie Atom10FeedFormatter klasy z określonym SyndicationFeed wystąpieniem.

public:
 Atom10FeedFormatter(System::ServiceModel::Syndication::SyndicationFeed ^ feedToWrite);
public Atom10FeedFormatter(System.ServiceModel.Syndication.SyndicationFeed feedToWrite);
new System.ServiceModel.Syndication.Atom10FeedFormatter : System.ServiceModel.Syndication.SyndicationFeed -> System.ServiceModel.Syndication.Atom10FeedFormatter
Public Sub New (feedToWrite As SyndicationFeed)

Parametry

feedToWrite
SyndicationFeed

Element SyndicationFeed do serializacji.

Przykłady

Poniższy kod pokazuje, jak utworzyć element SyndicationFeed i serializować go do atomu 1.0.

SyndicationFeed feed = new SyndicationFeed("Test Feed", "This is a test feed", new Uri("http://Contoso/testfeed"), "TestFeedID", DateTime.Now);
SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://localhost/ItemOne"), "TestItemID", DateTime.Now);

List<SyndicationItem> items = new List<SyndicationItem>();
items.Add(item);
feed.Items = items;

XmlWriter atomWriter = XmlWriter.Create("Atom.xml");
Atom10FeedFormatter atomFormatter = new Atom10FeedFormatter(feed);
atomFormatter.WriteTo(atomWriter);
atomWriter.Close();
Dim feed As SyndicationFeed = New SyndicationFeed("Test Feed", "This is a test feed", New Uri("http:'Contoso/testfeed"), "TestFeedID", DateTime.Now)
Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http:'localhost/ItemOne"), "TestItemID", DateTime.Now)

Dim items As List(Of SyndicationItem) = New List(Of SyndicationItem)
items.Add(item)
feed.Items = items

Dim atomWriter As XmlWriter = XmlWriter.Create("Atom.xml")
Dim atomFormatter As Atom10FeedFormatter = New Atom10FeedFormatter(feed)
atomFormatter.WriteTo(atomWriter)
atomWriter.Close()

Dotyczy

Atom10FeedFormatter(Type)

Źródło:
Atom10FeedFormatter.cs
Źródło:
Atom10FeedFormatter.cs
Źródło:
Atom10FeedFormatter.cs
Źródło:
Atom10FeedFormatter.cs

Tworzy nowe wystąpienie Atom10FeedFormatter klasy.

public:
 Atom10FeedFormatter(Type ^ feedTypeToCreate);
public Atom10FeedFormatter(Type feedTypeToCreate);
new System.ServiceModel.Syndication.Atom10FeedFormatter : Type -> System.ServiceModel.Syndication.Atom10FeedFormatter
Public Sub New (feedTypeToCreate As Type)

Parametry

feedTypeToCreate
Type

Wystąpienie SyndicationFeed pochodne do serializacji.

Przykłady

Poniższy kod pokazuje, jak używać tego konstruktora.

Atom10FeedFormatter myFeedAtomFormatter = new Atom10FeedFormatter(typeof(MySyndicationFeed));
XmlReader atomReader = XmlReader.Create("http://Contoso/Feeds/MyFeed");
myFeedAtomFormatter.ReadFrom(atomReader);
atomReader.Close();
Dim myFeedAtomFormatter As New Atom10FeedFormatter(GetType(MySyndicationFeed))
Dim atomReader As XmlReader = XmlReader.Create("http://Contoso/Feeds/MyFeed")
myFeedAtomFormatter.ReadFrom(atomReader)
atomReader.Close()

Uwagi

Użyj tego konstruktora, aby określić klasę pochodzącą z SyndicationFeed , aby utworzyć wystąpienie, gdy źródło danych syndykacji jest odczytywane.

Dotyczy