Edit

Share via


_XDocument4.IsDOMReadOnly Property

Definition

Gets a value that indicates whether the data in the underlying XML document of a Microsoft InfoPath form has been placed in a read-only state.

public:
 property bool IsDOMReadOnly { bool get(); };
public bool IsDOMReadOnly { get; }
member this.IsDOMReadOnly : bool
Public ReadOnly Property IsDOMReadOnly As Boolean

Property Value

Returns Boolean.

Implements

Examples

In the following example, the IsDOMReadOnly property of the XDocument object is used to determine whether data in the form's underlying XML document has been placed in a read-only state. If it has, a return statement is used to exit the event handler.

[InfoPathEventHandler(MatchPath="/my:myFields/my:field1", EventType=InfoPathEventType.OnAfterChange)]
public void field1_OnAfterChange(DataDOMEvent e)
{
 // Determine whether the XML DOM is read-only.
 if (thisXDocument.<span class="label">IsDOMReadOnly</span>)
  return;

 // Continue normal processing...
}

In the following example, the IsDOMReadOnly property of the XDocument object is used to determine whether data in the form's underlying XML document has been placed in a read-only state. If it has, a return statement is used to exit the event handler.

[InfoPathEventHandler(MatchPath="/my:myFields/my:field1", EventType=InfoPathEventType.OnAfterChange)]
public void field1_OnAfterChange(DataDOMEvent e)
{
 // Determine whether the XML DOM is read-only.
 if (thisXDocument.<span class="label">IsDOMReadOnly</span>)
  return;

 // Continue normal processing...
}

Remarks

If the IsDOMReadOnly property is true, data in the form's underlying XML document is in a read-only state and cannot be changed. If false, the data in the form's underlying XML document can be changed.

To determine whether the form has been placed in a read-only state, use the IsReadOnly property

The data in a form's XML document will be placed in a read-only state in the following scenarios:

  • The form is digitally signed
  • The form is in Reduced Functionality Mode (RFM) mode
  • During an OnBeforeChange event
  • During an OnValidate event
  • During an undo or redo operation

Applies to