Click or drag to resize

PartitionableListTTemporaryDisabler Class

Helper class to temporarily disable something, e.g. some events. By calling Disable one gets a disposable token, that, when disposed, enables again, which fires then the action that is given as parameter to the constructor. It is possible to make nested calls to Disable. In this case all tokens must be disposed before the IsEnabled is again true and the re-enabling action is fired.
Inheritance Hierarchy
SystemObject
  Altaxo.CollectionsPartitionableListTTemporaryDisabler

Namespace: Altaxo.Collections
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
protected class TemporaryDisabler

The PartitionableListTTemporaryDisabler type exposes the following members.

Constructors
 NameDescription
Public methodPartitionableListTTemporaryDisabler Constructor. You have to provide a callback function, that is been called when the event handling resumes.
Top
Properties
 NameDescription
Public propertyIsDisabled Returns true when the disabling level is greater than zero (after calling the Disable function). Returns false if the disabling level is zero.
Public propertyIsEnabled Returns true when the disabling level is equal to zero (initial state). Otherwise false.
Top
Methods
 NameDescription
Public methodDisable Increase the SuspendLevel.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Protected methodOnResume Is called when the suppress level falls down from 1 to zero and the event count is != 0. Per default, the resume event handler is called that you provided in the constructor.
Protected methodOnResumeSilently Is called when the suppress level falls down from 1 to zero and the event count is != 0. Per default, the resume event handler is called that you provided in the constructor.
Public methodReenableShortly Just fires the reenabling action that was given in the constructor, without changing the disabling level.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
See Also