Commits changes as a single "undo" unit.
Syntax
| Visual Basic (Declaration) | |
|---|
Sub Commit() |
Exceptions
| Exception | Description |
| System.ObjectDisposedException | The method is called after Commit, Reject or
System.IDisposable.Dispose. |
Remarks
Example
The following code demonstrates the conditional commit of changes that have been made.
| C# | Copy Code |
|---|
bool commit = true; // will commit by default
using (ILayoutActions la = pivotView.BeginLayoutUpdate("Initialization"))
{
// make changes
// possible set commit to False
// ...
if (commit)
{
// commit changes
la.Commit();
}
else
{
// reject changes
la.Reject(); // NOTE: this call is optional and can be omitted
}
}// NOTE: la.Dispose() must reject our changes if la.Commit() or la.Reject() isn't called yet. |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also