SpreadsheetGear 2017
WithLock(Action) Method






SpreadsheetGear.Windows.Forms 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 WorkbookView.ReleaseLock.
Syntax
'Declaration
 
Public Overloads Sub WithLock( _
   ByVal action As Action _
) 
'Usage
 
Dim instance As WorkbookView
Dim action As Action
 
instance.WithLock(action)
public void WithLock( 
   Action action
)
public procedure WithLock( 
    action: Action
); 
public function WithLock( 
   action : Action
);
public: void WithLock( 
   Action* action
) 
public:
void WithLock( 
   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