简体   繁体   English

我们可以将 Cloud Storage API 用于类型化的自定义属性吗?

[英]Can we use the Cloud Storage API for typed custom properties?

Using the Cloud Files API environment , is it possible to define typed custom properties?使用Cloud Files API 环境,是否可以定义类型化的自定义属性? The only method I can find is Windows.Storage.Provider.StorageProviderItemProperties.SetAsync() .我能找到的唯一方法是Windows.Storage.Provider.StorageProviderItemProperties.SetAsync() This takes a list of StorageProviderItemProperty whose Value is string .这需要一个StorageProviderItemProperty列表,其Value string

However, custom properties defined with the Property Description Schema can have types and offer a lot more control.但是,使用属性描述架构定义的自定义属性可以具有类型并提供更多控制。

For instance, "file size" and "dates" get special treatment in the column headers.例如,“文件大小”和“日期”在列标题中得到特殊处理。

日期的列标题弹出窗口 文件大小的列标题弹出窗口

One can define custom Windows Properties and register them using the PSRegisterPropertySchema function .可以定义自定义 Windows 属性并使用PSRegisterPropertySchema 函数注册它们。 Note registration and unregistration needs admin right so is usually done at install/uninstall time.注意注册和注销需要管理员权限,因此通常在安装/卸载时完成。

The "special treatment" you see is defined in the schema.您看到的“特殊待遇”是在架构中定义的。

Now, adding these properties in aa Shell View is only possible per file type as stated here: Initializing Property Handlers / Before you begin现在,只能按照此处所述的文件类型在 Shell 视图中添加这些属性: 初始化属性处理程序/开始之前

Property handlers are always associated with specific file types;属性处理程序总是与特定的文件类型相关联; thus, if your file format contains properties that require a custom property handler, you should always register a unique file name extension for each file format.因此,如果您的文件格式包含需要自定义属性处理程序的属性,您应该始终为每种文件格式注册一个唯一的文件扩展名。

For cloud based placeholder files, you can register a custom property handler with the package itself using the desktop3:ExtendedPropertyHandler Xml element in the manifest.对于基于云的占位符文件,您可以使用清单中的desktop3:ExtendedPropertyHandler Xml 元素向包本身注册自定义属性处理程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM