SpreadsheetGear 2023
WithLock(Action) Method


SpreadsheetGear.Windows.Controls Namespace > WorkbookView Class > WithLock Method : WithLock(Action) Method
Specifies the method to call after acquiring the lock.
Acquires a lock with GetLock, calls the specified delegate and then calls ReleaseLock.
Syntax
'Declaration
 
Public Overloads Sub WithLock( _
   ByVal action As System.Action _
) 
'Usage
 
Dim instance As WorkbookView
Dim action As System.Action
 
instance.WithLock(action)
public void WithLock( 
   System.Action action
)

Parameters

action
Specifies the method to call after acquiring the lock.
Remarks

This method is equivalent to: // Acquire a workbook set lock. workbookView.GetLock(); try { // Call the specified action. action(); } finally { // Release the workbook set lock. workbookView.ReleaseLock(); }

See RewindLock for more information.

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

Reference

WorkbookView Class
WorkbookView Members
Overload List
WithLock<TResult>(Func<TResult>) Method
GetLock Method
ReleaseLock Method