Atom10ItemFormatter Constructors

Definition

Creates a new instance of the Atom10ItemFormatter class.

Overloads

Atom10ItemFormatter()

Creates a new instance of the Atom10ItemFormatter class.

Atom10ItemFormatter(SyndicationItem)

Creates a new instance of the Atom10ItemFormatter class with the specified SyndicationItem.

Atom10ItemFormatter(Type)

Initializes a new instance of the Atom10ItemFormatter class.

Atom10ItemFormatter()

Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs

Creates a new instance of the Atom10ItemFormatter class.

C#
public Atom10ItemFormatter();

Applies to

.NET 10 (package-provided) i druge verzije
Proizvod Verzije
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

Atom10ItemFormatter(SyndicationItem)

Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs

Creates a new instance of the Atom10ItemFormatter class with the specified SyndicationItem.

C#
public Atom10ItemFormatter(System.ServiceModel.Syndication.SyndicationItem itemToWrite);

Parameters

itemToWrite
SyndicationItem

The SyndicationItem to serialize.

Examples

The following example shows how to call this constructor.

C#
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);

Applies to

.NET 10 (package-provided) i druge verzije
Proizvod Verzije
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

Atom10ItemFormatter(Type)

Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs
Source:
Atom10ItemFormatter.cs

Initializes a new instance of the Atom10ItemFormatter class.

C#
public Atom10ItemFormatter(Type itemTypeToCreate);

Parameters

itemTypeToCreate
Type

The SyndicationItem derived instance to associate with the Rss20ItemFormatter.

Examples

The following code shows how to use this constructor.

C#
Atom10ItemFormatter myItemAtomFormatter = new Atom10ItemFormatter(typeof(MySyndicationItem));
XmlReader atomReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Items");
myItemAtomFormatter.ReadFrom(atomReader);
atomReader.Close();

Remarks

Use this constructor to specify a class derived from SyndicationItem to instantiate when a syndication item is read in.

Applies to

.NET 10 (package-provided) i druge verzije
Proizvod Verzije
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)