Atom10ItemFormatter<TSyndicationItem> Constructors
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee maakt u een nieuw exemplaar van de Atom10ItemFormatter<TSyndicationItem> klasse.
Overloads
| Name | Description |
|---|---|
| Atom10ItemFormatter<TSyndicationItem>() |
Hiermee maakt u een nieuw exemplaar van de Atom10ItemFormatter<TSyndicationItem> klasse. |
| Atom10ItemFormatter<TSyndicationItem>(TSyndicationItem) |
Hiermee maakt u een nieuw exemplaar van de Atom10ItemFormatter<TSyndicationItem> klasse met het opgegeven SyndicationItem-afgeleide exemplaar. |
Atom10ItemFormatter<TSyndicationItem>()
Hiermee maakt u een nieuw exemplaar van de Atom10ItemFormatter<TSyndicationItem> klasse.
public:
Atom10ItemFormatter();
public Atom10ItemFormatter();
Public Sub New ()
Van toepassing op
Atom10ItemFormatter<TSyndicationItem>(TSyndicationItem)
Hiermee maakt u een nieuw exemplaar van de Atom10ItemFormatter<TSyndicationItem> klasse met het opgegeven SyndicationItem-afgeleide exemplaar.
public:
Atom10ItemFormatter(TSyndicationItem itemToWrite);
public Atom10ItemFormatter(TSyndicationItem itemToWrite);
new System.ServiceModel.Syndication.Atom10ItemFormatter<'SyndicationItem (requires 'SyndicationItem :> System.ServiceModel.Syndication.SyndicationItem and 'SyndicationItem : (new : unit -> 'SyndicationItem))> : 'SyndicationItem -> System.ServiceModel.Syndication.Atom10ItemFormatter<'SyndicationItem (requires 'SyndicationItem :> System.ServiceModel.Syndication.SyndicationItem and 'SyndicationItem : (new : unit -> 'SyndicationItem))>
Public Sub New (itemToWrite As TSyndicationItem)
Parameters
- itemToWrite
- TSyndicationItem
De SyndicationItem te serialiseren.
Voorbeelden
In het volgende voorbeeld ziet u hoe u deze constructor aanroept.
MySyndicationItem item = new MySyndicationItem("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<MySyndicationItem> formatter = new Atom10ItemFormatter<MySyndicationItem>(item);
Dim item As MySyndicationItem = New MySyndicationItem("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(Of MySyndicationItem) = New Atom10ItemFormatter(Of MySyndicationItem)(item)