_XDocument2.IsDirty property

Gets a value that indicates whether the data in a form has been modified since it was last saved.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
ReadOnly Property IsDirty As Boolean
    Get
'Usage
Dim instance As _XDocument2
Dim value As Boolean

value = instance.IsDirty
bool IsDirty { get; }

Property value

Type: System.Boolean

Implements

_XDocument.IsDirty

Remarks

If the IsDirty property is true, data in the form's underlying XML document has been changed since it was last saved. If false, no changes have occurred.

Note

Changes that occur during an OnLoad event will not result in the IsDirty property being set to true.

Important

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Examples

In the following example, the IsDirty property of the XDocument object is used to determine whether data in the form has been changed:

if (thisXDocument.IsDirty)
{
 thisXDocument.UI.Alert("Data has been changed.");
}
else
{
 thisXDocument.UI.Alert("Data has not been changed.");
}

See also

Reference

_XDocument2 interface

_XDocument2 members

IsDirty overload

Microsoft.Office.Interop.InfoPath.SemiTrust namespace