Sdílet prostřednictvím


Atom10ItemFormatter Konstruktory

Definice

Vytvoří novou instanci třídy Atom10ItemFormatter.

Přetížení

Atom10ItemFormatter()

Vytvoří novou instanci třídy Atom10ItemFormatter.

Atom10ItemFormatter(SyndicationItem)

Vytvoří novou instanci Atom10ItemFormatter třídy se zadaným SyndicationItemobjektem .

Atom10ItemFormatter(Type)

Inicializuje novou instanci Atom10ItemFormatter třídy.

Atom10ItemFormatter()

Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs

Vytvoří novou instanci třídy Atom10ItemFormatter.

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

Platí pro

Atom10ItemFormatter(SyndicationItem)

Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs

Vytvoří novou instanci Atom10ItemFormatter třídy se zadaným SyndicationItemobjektem .

public:
 Atom10ItemFormatter(System::ServiceModel::Syndication::SyndicationItem ^ itemToWrite);
public Atom10ItemFormatter (System.ServiceModel.Syndication.SyndicationItem itemToWrite);
new System.ServiceModel.Syndication.Atom10ItemFormatter : System.ServiceModel.Syndication.SyndicationItem -> System.ServiceModel.Syndication.Atom10ItemFormatter
Public Sub New (itemToWrite As SyndicationItem)

Parametry

itemToWrite
SyndicationItem

Serializovat SyndicationItem .

Příklady

Následující příklad ukazuje, jak volat tento konstruktor.

SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://localhost/ItemOne"), "TestItemID", DateTime.Now);

item.Links.Add(new SyndicationLink(new Uri("http://someuri"), "alternate", "MyItemLink", "text/html", 100));
item.PublishDate = new DateTime(1968, 2, 23);
item.LastUpdatedTime = DateTime.Today;
item.SourceFeed = new SyndicationFeed();
item.Summary = new TextSyndicationContent("This the item summary");

XmlWriter atomWriter = XmlWriter.Create("AtomItem.xml");
Atom10ItemFormatter formatter = new Atom10ItemFormatter(item);
Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http:'localhost/ItemOne"), "TestItemID", DateTime.Now)

item.Links.Add(New SyndicationLink(New Uri("http:'someuri"), "alternate", "MyItemLink", "text/html", 100))
item.PublishDate = New DateTime(1968, 2, 23)
item.LastUpdatedTime = DateTime.Today
item.SourceFeed = New SyndicationFeed()
item.Summary = New TextSyndicationContent("This the item summary")

Dim atomWriter As XmlWriter = XmlWriter.Create("AtomItem.xml")
Dim formatter As Atom10ItemFormatter = New Atom10ItemFormatter(item)

Platí pro

Atom10ItemFormatter(Type)

Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs
Zdroj:
Atom10ItemFormatter.cs

Inicializuje novou instanci Atom10ItemFormatter třídy.

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

Parametry

itemTypeToCreate
Type

Odvozená SyndicationItem instance, která se má přidružit k objektu Rss20ItemFormatter.

Příklady

Následující kód ukazuje, jak tento konstruktor použít.

Atom10ItemFormatter myItemAtomFormatter = new Atom10ItemFormatter(typeof(MySyndicationItem));
XmlReader atomReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Items");
myItemAtomFormatter.ReadFrom(atomReader);
atomReader.Close();
Dim myItemAtomFormatter As New Atom10ItemFormatter(GetType(MySyndicationItem))
Dim atomReader As XmlReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Items")
myItemAtomFormatter.ReadFrom(atomReader)
atomReader.Close()

Poznámky

Pomocí tohoto konstruktoru můžete určit třídu odvozenou od SyndicationItem k vytvoření instance při čtení položky syndikace.

Platí pro