我正在使用SSLWare的EZShellExtensions.Net v2011,它们支持属性处理程序,但代码不能像我希望的那样工作。
我想为 docx xlsx 文件扩展名的属性处理程序添加几个新属性,但我的代码会删除所有默认属性。
有没有办法用EZShellExtensions添加其他属性?或者我必须使用C ++?
示例代码:
[TargetExtension(".docx", true)]
[TargetExtension(".xlsx", true)]
[TargetExtension(".xlsm", true)]
public class PropertyHandler4 : PropertyHandler
{
public PropertyHandler4()
{
}
protected override Property[] GetProperties()
{
// TODO : Write your code here.
// Defines two properties for a file
UserDefinedProperty prop = new UserDefinedProperty("MyProperty1");
prop.Description = "My Property1";
prop.LabelText = "My Property1";
UserDefinedProperty prop1 = new UserDefinedProperty("MyProperty2");
prop1.Description = "My Property2";
prop1.LabelText = "My Property2";
return new Property[] { prop, prop1 };
}
// Override this method to retrieve the value of the specified property.
protected override object GetPropertyValue(Property property)
{
return "WUZZAP!";
}