信息
您所需的主题如下所示。但此主题未包含在此库中。

DataPackagePropertySet Class

定义要用于 DataPackage 对象的一组属性。

语法


var dataPackagePropertySet = dataPackage.properties;

特性

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Version(0x06020000)]

成员

DataPackagePropertySet类 具有这些类型的成员:

方法

The DataPackagePropertySet 类 具有这些方法。 对于 C#、Visual Basic 和 C++,它还继承方法于Object 类.

方法说明
Add(KeyValuePair) [C#, VB]Adds a new key-value pair to the DataPackagePropertySet.
Add(String) [C#, VB]Adds an item to the DataPackagePropertySet.
Clear Removes all items from the property set.
Contains [C#, VB]Returns a value that indicates whether a specified key-value pair exists in the DataPackagePropertySet.
ContainsKey [C#, VB]Returns a value that indicates whether a specified key exists in the DataPackagePropertySet.
CopyTo [C#, VB]Copies the elements of the collection to an array, starting at a particular array index.
First [C++, JavaScript]Returns an iterator to enumerate the items in the property set.
GetView [C++, JavaScript]Gets an immutable view of the property set.
HasKey [C++, JavaScript]Indicates whether the DataPackagePropertySet object contains a specific property.
Insert [C++, JavaScript]Adds a property to the DataPackagePropertySet object.
Lookup [C++, JavaScript]Retrieves the value of a specific property.
Remove [C++, JavaScript]Removes an item from the property set.
Remove(KeyValuePair) [C#, VB]Removes a specific key-value pair from the DataPackagePropertySet.
Remove(String) [C#, VB]Removes a specific item from the DataPackagePropertySet.
TryGetValue [C#, VB]Returns a value that indicates whether a specified key exists in the DataPackagePropertySet. If an item with that key exists, the item is retrieved as an out parameter.

 

属性

DataPackagePropertySet类 具有这些属性。

属性访问类型说明

ApplicationListingUri

读/写Gets or sets the Uniform Resource Identifier (URI) of the app's location in the Windows Store.

ApplicationName

读/写Gets or sets the name of the app that created the DataPackage object.

ContentSourceApplicationLink

读/写Gets or sets the application link to the content from the source app.

ContentSourceWebLink

读/写Provides a web link to shared content that's currently displayed in the app.

Count [C#, VB]

只读Gets the number of elements contained in the collection.

Description

读/写Gets or sets text that describes the contents of the DataPackage.

FileTypes

只读Specifies a vector object that contains the types of files stored in the DataPackage object.

IsReadOnly [C#, VB]

只读Gets a value indicating whether the dictionary is read-only.

Item [C#, VB]

读/写Gets or sets the element value at the specified key index.

Keys [C#, VB]

只读Gets an ICollection object containing the keys of the DataPackagePropertySet.

LogoBackgroundColor

读/写Gets or sets a background color for the sharing app's Square30x30Logo.

PackageFamilyName

读/写Gets or sets the package family name of the source app.

Size [C++, JavaScript]

只读Gets the number of items that are contained in the property set.

Square30x30Logo

读/写Gets or sets the source app's logo.

Thumbnail

读/写Gets or sets a thumbnail image for the DataPackage.

Title

读/写Gets or sets the text that displays as a title for the contents of the DataPackage object.

Values [C#, VB]

只读Gets an ICollection object containing the values of the DataPackagePropertySet .

 

备注

除了共享内容以外,DataPackage 对象的每个实例都支持一组属性。目标应用程序可以使用这些属性来了解 DataPackage 的内容的更多信息。

此类直接支持若干默认属性,如 thumbnailtitledescription。使用 Insert 方法或某个 Add 方法,您还可以创建自己的自定义特性。目标应用程序通过 LookupTryGetValue 方法可以访问特定的属性。

集合成员列表

对于 JavaScript,DataPackagePropertySet 支持使用索引访问项目。

要求

最低支持客户端

Windows 8 [Windows 应用商店应用程序, 桌面应用程序]

最低支持服务器

Windows Server 2012 [Windows 应用商店应用程序, 桌面应用程序]

最低支持电话

Windows Phone 8

命名空间

Windows.ApplicationModel.DataTransfer
Windows::ApplicationModel::DataTransfer [C++]

元数据

Windows.winmd

 

 

显示: