StorageItemContentProperties.SavePropertiesAsync 方法

定义

重载

SavePropertiesAsync()

保存与项关联的所有属性。

SavePropertiesAsync(IIterable<KeyValuePair<String,Object>>)

保存与项关联的指定属性和值。

SavePropertiesAsync()

保存与项关联的所有属性。

public:
 virtual IAsyncAction ^ SavePropertiesAsync() = SavePropertiesAsync;
/// [Windows.Foundation.Metadata.Overload("SavePropertiesAsyncOverloadDefault")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction SavePropertiesAsync();
[Windows.Foundation.Metadata.Overload("SavePropertiesAsyncOverloadDefault")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction SavePropertiesAsync();
function savePropertiesAsync()
Public Function SavePropertiesAsync () As IAsyncAction

返回

此方法完成后,不会返回任何对象或值。

实现

属性

注解

如果任一属性值无效,则不会保存任何值。

另请参阅

适用于

SavePropertiesAsync(IIterable<KeyValuePair<String,Object>>)

保存与项关联的指定属性和值。

public:
 virtual IAsyncAction ^ SavePropertiesAsync(IIterable<IKeyValuePair<Platform::String ^, Platform::Object ^> ^> ^ propertiesToSave) = SavePropertiesAsync;
/// [Windows.Foundation.Metadata.Overload("SavePropertiesAsync")]
IAsyncAction SavePropertiesAsync(IIterable<IKeyValuePair<winrt::hstring, IInspectable const&>> const& propertiesToSave);
[Windows.Foundation.Metadata.Overload("SavePropertiesAsync")]
public IAsyncAction SavePropertiesAsync(IEnumerable<KeyValuePair<string,object>> propertiesToSave);
function savePropertiesAsync(propertiesToSave)
Public Function SavePropertiesAsync (propertiesToSave As IEnumerable(Of KeyValuePair(Of String, Object))) As IAsyncAction

参数

propertiesToSave

IIterable<IKeyValuePair<String,Object>>

IEnumerable<KeyValuePair<String,Object>>

IIterable<IKeyValuePair<Platform::String,Platform::Object>>

IIterable<IKeyValuePair<winrt::hstring,IInspectable>>

一个集合,其中包含要保存为键值对的属性的名称和值 (类型 IKeyValuePair) 。

返回

此方法完成后,不会返回任何对象或值。

实现

M:Windows.Storage.FileProperties.IStorageItemExtraProperties.SavePropertiesAsync(System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.String,System.Object}}) M:Windows.Storage.FileProperties.IStorageItemExtraProperties.SavePropertiesAsync(System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{Platform::String,Platform::Object}}) M:Windows.Storage.FileProperties.IStorageItemExtraProperties.SavePropertiesAsync(System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{winrt::hstring,IInspectable}})
属性

注解

System.ExpandoProperties

Expando 属性是一组与内存中的存储文件实例关联的命名值。 它们不会永久保存在文件系统中,但在将文件保存在访问缓存中时会保留。

它们可由任何应用写入和读取,因此提供了一种将信息与存储文件相关联的方法。 在存储文件从一个应用传递到另一个应用以传达有关该文件的额外信息的情况下,这非常有用。

使用 Windows 运行时 存储 API 访问 Expando 属性。 它们使用具有“System.ExpandoProperties”属性名称的 RetrievePropertiesAsync 作为值进行检索。 expando 属性是使用 SavePropertiesAsync 编写的。 该值是属性集本身,因此可以使用 PropertySet 编程模型访问其中的值。

用于标识 System.ExpandoProperties 集中的值的名称不需要符合系统的属性命名方案, (将属性名称作为“System”) 前缀。 它们可以是任何字符串值。

系统定义一些应使用的名称。 例如,“OriginURL”用于传达本地存储文件的来源(如果它是从远程源下载的)。 (请参阅 自定义下载体验。)

应用可以定义和记录它们使用的属性,以便其他应用程序可以与之互操作。 例如,System.ExpandoProperties 可用于允许提供商应用将许可证信息传递给通用 Office 应用,以指示文件可以是个人文件还是企业文件。

另请参阅

适用于