Atom10FeedFormatter Constructeurs
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Crée une instance de la Atom10FeedFormatter classe.
Surcharges
| Nom | Description |
|---|---|
| Atom10FeedFormatter() |
Crée une instance de la Atom10FeedFormatter classe. |
| Atom10FeedFormatter(SyndicationFeed) |
Crée une instance de la Atom10FeedFormatter classe avec l’instance spécifiée SyndicationFeed . |
| Atom10FeedFormatter(Type) |
Crée une instance de la Atom10FeedFormatter classe. |
Atom10FeedFormatter()
- Source:
- Atom10FeedFormatter.cs
- Source:
- Atom10FeedFormatter.cs
- Source:
- Atom10FeedFormatter.cs
- Source:
- Atom10FeedFormatter.cs
Crée une instance de la Atom10FeedFormatter classe.
public:
Atom10FeedFormatter();
public Atom10FeedFormatter();
Public Sub New ()
Exemples
Le code suivant montre comment créer un Atom10FeedFormatter flux de syndication et le lire.
XmlReader atomReader = XmlReader.Create("AtomFeed.xml");
Atom10FeedFormatter atomFormatter = new Atom10FeedFormatter();
atomFormatter.ReadFrom(atomReader);
atomReader.Close();
Dim atomReader As XmlReader = XmlReader.Create("AtomFeed.xml")
Dim atomFormatter As Atom10FeedFormatter = New Atom10FeedFormatter()
atomFormatter.ReadFrom(atomReader)
atomReader.Close()
S’applique à
Atom10FeedFormatter(SyndicationFeed)
- Source:
- Atom10FeedFormatter.cs
- Source:
- Atom10FeedFormatter.cs
- Source:
- Atom10FeedFormatter.cs
- Source:
- Atom10FeedFormatter.cs
Crée une instance de la Atom10FeedFormatter classe avec l’instance spécifiée SyndicationFeed .
public:
Atom10FeedFormatter(System::ServiceModel::Syndication::SyndicationFeed ^ feedToWrite);
public Atom10FeedFormatter(System.ServiceModel.Syndication.SyndicationFeed feedToWrite);
new System.ServiceModel.Syndication.Atom10FeedFormatter : System.ServiceModel.Syndication.SyndicationFeed -> System.ServiceModel.Syndication.Atom10FeedFormatter
Public Sub New (feedToWrite As SyndicationFeed)
Paramètres
- feedToWrite
- SyndicationFeed
À SyndicationFeed sérialiser.
Exemples
Le code suivant montre comment créer et sérialiser un SyndicationFeed fichier sur Atom 1.0.
SyndicationFeed feed = new SyndicationFeed("Test Feed", "This is a test feed", new Uri("http://Contoso/testfeed"), "TestFeedID", DateTime.Now);
SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://localhost/ItemOne"), "TestItemID", DateTime.Now);
List<SyndicationItem> items = new List<SyndicationItem>();
items.Add(item);
feed.Items = items;
XmlWriter atomWriter = XmlWriter.Create("Atom.xml");
Atom10FeedFormatter atomFormatter = new Atom10FeedFormatter(feed);
atomFormatter.WriteTo(atomWriter);
atomWriter.Close();
Dim feed As SyndicationFeed = New SyndicationFeed("Test Feed", "This is a test feed", New Uri("http:'Contoso/testfeed"), "TestFeedID", DateTime.Now)
Dim item As SyndicationItem = New SyndicationItem("Test Item", "This is the content for Test Item", New Uri("http:'localhost/ItemOne"), "TestItemID", DateTime.Now)
Dim items As List(Of SyndicationItem) = New List(Of SyndicationItem)
items.Add(item)
feed.Items = items
Dim atomWriter As XmlWriter = XmlWriter.Create("Atom.xml")
Dim atomFormatter As Atom10FeedFormatter = New Atom10FeedFormatter(feed)
atomFormatter.WriteTo(atomWriter)
atomWriter.Close()
S’applique à
Atom10FeedFormatter(Type)
- Source:
- Atom10FeedFormatter.cs
- Source:
- Atom10FeedFormatter.cs
- Source:
- Atom10FeedFormatter.cs
- Source:
- Atom10FeedFormatter.cs
Crée une instance de la Atom10FeedFormatter classe.
public:
Atom10FeedFormatter(Type ^ feedTypeToCreate);
public Atom10FeedFormatter(Type feedTypeToCreate);
new System.ServiceModel.Syndication.Atom10FeedFormatter : Type -> System.ServiceModel.Syndication.Atom10FeedFormatter
Public Sub New (feedTypeToCreate As Type)
Paramètres
- feedTypeToCreate
- Type
Instance SyndicationFeed dérivée à sérialiser.
Exemples
Le code suivant montre comment utiliser ce constructeur.
Atom10FeedFormatter myFeedAtomFormatter = new Atom10FeedFormatter(typeof(MySyndicationFeed));
XmlReader atomReader = XmlReader.Create("http://Contoso/Feeds/MyFeed");
myFeedAtomFormatter.ReadFrom(atomReader);
atomReader.Close();
Dim myFeedAtomFormatter As New Atom10FeedFormatter(GetType(MySyndicationFeed))
Dim atomReader As XmlReader = XmlReader.Create("http://Contoso/Feeds/MyFeed")
myFeedAtomFormatter.ReadFrom(atomReader)
atomReader.Close()
Remarques
Utilisez ce constructeur pour spécifier une classe dérivée de SyndicationFeed l’instanciation lorsqu’un flux de syndication est lu.