Поделиться через


Locked Class

Style Cannot Be Applied.When the object is serialized out as xml, its qualified name is w:locked.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.OnOffOnlyType
        DocumentFormat.OpenXml.Wordprocessing.Locked

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
Public Class Locked _
    Inherits OnOffOnlyType
'Usage
Dim instance As Locked
public class Locked : OnOffOnlyType

Remarks

[ISO/IEC 29500-1 1st Edition]

17.7.2.7 locked (Style Cannot Be Applied)

This element specifies whether an application shall prevent the use of this style when this document is loaded and/or modified. If this element is set, then this style can be used to format existing content (i.e. any content which references this style shall have its properties as normal), but new instances of the style shall be prevented from being applied via all mechanisms associated with that application.

If this element is omitted, then the use of the style shall not be prevented by an application processing this document.

[Example: Consider a style with a primary name of Test Style which should be locked, and prevented from being added to any content in a given document. This requirement would be specified using the following WordprocessingML:

<w:style … w:styleId="TestStyle">
<w:name w:val="Test Style"/>
<w:locked/>
…
</w:style>

The presence of the locked element specifies that new instances of the style must be prevented from being applied via all mechanisms associated with that application. end example]

Parent Elements

style (§17.7.4.17)

This element’s content model is defined by the common boolean property definition in §17.17.4.

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Locked Members

DocumentFormat.OpenXml.Wordprocessing Namespace