mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
(SharpTreeView) add LockUpdates method to SharpTreeView
This commit is contained in:
@@ -122,6 +122,27 @@ namespace ICSharpCode.TreeView
|
||||
TreeFlattener flattener;
|
||||
bool updatesLocked;
|
||||
|
||||
public IDisposable LockUpdates()
|
||||
{
|
||||
return new UpdateLock(this);
|
||||
}
|
||||
|
||||
class UpdateLock : IDisposable
|
||||
{
|
||||
SharpTreeView instance;
|
||||
|
||||
public UpdateLock(SharpTreeView instance)
|
||||
{
|
||||
this.instance = instance;
|
||||
this.instance.updatesLocked = true;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
this.instance.updatesLocked = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Reload()
|
||||
{
|
||||
if (flattener != null) {
|
||||
|
||||
Reference in New Issue
Block a user