Share via


SyndicationPerson.AttributeExtensions 屬性

定義

取得 SyndicationPerson 的屬性延伸。

public:
 property System::Collections::Generic::Dictionary<System::Xml::XmlQualifiedName ^, System::String ^> ^ AttributeExtensions { System::Collections::Generic::Dictionary<System::Xml::XmlQualifiedName ^, System::String ^> ^ get(); };
public System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName,string> AttributeExtensions { get; }
member this.AttributeExtensions : System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, string>
Public ReadOnly Property AttributeExtensions As Dictionary(Of XmlQualifiedName, String)

屬性值

字典,其中包含屬性延伸的集合。

範例

下列程式碼示範如何將屬性延伸加入至 SyndicationPerson 執行個體。

SyndicationPerson sp = new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://Jesper/Aaberg");
sp.AttributeExtensions.Add(new XmlQualifiedName("myAttribute", ""), "someValue");
Dim sp As New SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://Jesper/Aaberg")
sp.AttributeExtensions.Add(New XmlQualifiedName("myAttribute", ""), "someValue")

下列 XML 會說明 AttributeExtensions 集合如何序列化為 Atom 1.0。

<author customAttribute="value">
  <name>Syed Abas</name>
  <uri>http://Syed/Abas</uri>
  <email>Syed.Abas@contoso.com</email>
</author>

下列 XML 會說明 AttributeExtensions 集合如何序列化為 RSS 2.0。

<a10:author customAttribute="value">
  <a10:name>Syed Abas</a10:name>
  <a10:uri>http://Syed/Abas</a10:uri>
  <a10:email>Syed.Abas@contoso.com</a10:email>
</a10:author>

備註

新聞訂閱物件模型允許您新增自訂屬性至 SyndicationPerson 執行個體。 您可以新增任何有效的 XML 屬性/值。

序列化為 Atom 1.0 時,會將任何自訂屬性/值做為屬性寫入 <author><contributor> 項目中。 序列化為 RSS 2.0 時,會將任何自訂屬性/值做為屬性寫入 <managingEditor><a10:contributor><a10:author> 項目中。

適用於