stringFormat

指定 IPropertyDescription::FormatForDisplay 应如何将属性的值格式化为字符串。 仅当 <displayInfo displayType=“String”>时,这才适用。 每个 displayInfo 元素应只有一个 stringFormat 元素。

如果有多个元素,则使用最后一个元素。 如果未提供 stringFormat 元素,则默认属性设置将应用于属性说明。

语法

<!-- stringFormat -->
<xs:element name="stringFormat"  minOccurs="0" maxOccurs="1">
    <xs:complexType>
        <xs:attribute name="formatAs">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="General"/>
                    <xs:enumeration value="FileName"/>
                    <xs:enumeration value="FilePath"/>
                    <xs:enumeration value="Hyperlink"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
    </xs:complexType>
</xs:element>

元素信息

Parent 元素 子元素
displayInfo 没有

 

属性

属性 描述
formatAs 公共。 自选。 默认值为“常规”。 以下是有效值。
价值 意义
常规 违约。 以无格式字符串形式返回值。
文件名 将值的格式设置为文件名。 根据用户设置隐藏扩展。 需要属性类型为 String。
FilePath 将值格式化为文件路径。 根据用户设置隐藏扩展。 需要属性类型为 String。
超链接 将值的格式设置为超链接。