Aracılığıyla paylaş


Atom10ItemFormatter Oluşturucular

Tanım

Atom10ItemFormatter sınıfının yeni bir örneğini oluşturur.

Aşırı Yüklemeler

Atom10ItemFormatter()

Atom10ItemFormatter sınıfının yeni bir örneğini oluşturur.

Atom10ItemFormatter(SyndicationItem)

belirtilen SyndicationItemile sınıfının yeni bir örneğini Atom10ItemFormatter oluşturur.

Atom10ItemFormatter(Type)

Atom10ItemFormatter sınıfının yeni bir örneğini başlatır.

Atom10ItemFormatter()

Kaynak:
Atom10ItemFormatter.cs
Kaynak:
Atom10ItemFormatter.cs
Kaynak:
Atom10ItemFormatter.cs
Kaynak:
Atom10ItemFormatter.cs

Atom10ItemFormatter sınıfının yeni bir örneğini oluşturur.

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

Şunlara uygulanır

Atom10ItemFormatter(SyndicationItem)

Kaynak:
Atom10ItemFormatter.cs
Kaynak:
Atom10ItemFormatter.cs
Kaynak:
Atom10ItemFormatter.cs
Kaynak:
Atom10ItemFormatter.cs

belirtilen SyndicationItemile sınıfının yeni bir örneğini Atom10ItemFormatter oluşturur.

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)

Parametreler

itemToWrite
SyndicationItem

seri SyndicationItem hale getirmek için.

Örnekler

Aşağıdaki örnekte bu oluşturucunun nasıl çağrılacakları gösterilmektedir.

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)

Şunlara uygulanır

Atom10ItemFormatter(Type)

Kaynak:
Atom10ItemFormatter.cs
Kaynak:
Atom10ItemFormatter.cs
Kaynak:
Atom10ItemFormatter.cs
Kaynak:
Atom10ItemFormatter.cs

Atom10ItemFormatter sınıfının yeni bir örneğini başlatır.

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

Parametreler

itemTypeToCreate
Type

SyndicationItem ile Rss20ItemFormatterilişkilendirilecek türetilmiş örnek.

Örnekler

Aşağıdaki kodda bu oluşturucunun nasıl kullanılacağı gösterilmektedir.

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

Açıklamalar

Bir dağıtım öğesi okunduğunda örneği oluşturmak için öğesinden SyndicationItem türetilen bir sınıf belirtmek için bu oluşturucuyu kullanın.

Şunlara uygulanır