Share via


Atom10ItemFormatter 생성자

정의

Atom10ItemFormatter 클래스의 새 인스턴스를 만듭니다.

오버로드

Atom10ItemFormatter()

Atom10ItemFormatter 클래스의 새 인스턴스를 만듭니다.

Atom10ItemFormatter(SyndicationItem)

지정된 Atom10ItemFormatter를 사용하여 SyndicationItem 클래스의 새 인스턴스를 만듭니다.

Atom10ItemFormatter(Type)

Atom10ItemFormatter 클래스의 새 인스턴스를 초기화합니다.

Atom10ItemFormatter()

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

Atom10ItemFormatter 클래스의 새 인스턴스를 만듭니다.

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

적용 대상

Atom10ItemFormatter(SyndicationItem)

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

지정된 Atom10ItemFormatter를 사용하여 SyndicationItem 클래스의 새 인스턴스를 만듭니다.

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)

매개 변수

itemToWrite
SyndicationItem

serialize할 SyndicationItem입니다.

예제

다음 예제에서는 이 생성자를 호출하는 방법을 보여 줍니다.

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)

적용 대상

Atom10ItemFormatter(Type)

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

Atom10ItemFormatter 클래스의 새 인스턴스를 초기화합니다.

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

매개 변수

itemTypeToCreate
Type

SyndicationItemRss20ItemFormatter연결할 파생 instance.

예제

다음 코드에서는 이 생성자를 사용하는 방법을 보여 줍니다.

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()

설명

배포 항목을 읽을 때 인스턴스화할 에서 SyndicationItem 파생된 클래스를 지정하려면 이 생성자를 사용합니다.

적용 대상