Switch Methods |
The Switch type exposes the following members.
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IfOff |
Executes the provided action and returns if the action was executed or not, if the switch is IMMEDIATELY off (i.e. no lock involved)
| |
IfOn |
Executes the provided action and returns if the action was executed or not, if the switch is IMMEDIATELY on (i.e. no lock involved)
| |
Locked |
TBD
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
SwitchOff |
Switches the switch off (if on). Uses locking.
| |
SwitchOff(Action) |
Executes the provided action if the lock is on. This is done under a lock so be _very_ careful with longrunning/blocking operations in it.
Only executes the action if the switch is on, and switches it off immediately after obtaining the lock.
Will switch it back on if the provided action throws an exception.
| |
SwitchOn |
Switches the switch on (if off). Uses locking.
| |
SwitchOn(Action) |
Executes the provided action if the lock is off. This is done under a lock so be _very_ careful with longrunning/blocking operations in it.
Only executes the action if the switch is off, and switches it on immediately after obtaining the lock.
Will switch it back off if the provided action throws an exception.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TranscendFrom |
TBD
| |
WhileOff |
Executes the provided action and returns if the action was executed or not, if the switch is off, waiting for any pending changes to happen before (locking)
Be careful of longrunning or blocking within the provided action as it can lead to deadlocks or bad performance
| |
WhileOn |
Executes the provided action and returns if the action was executed or not, if the switch is on, waiting for any pending changes to happen before (locking)
Be careful of longrunning or blocking within the provided action as it can lead to deadlocks or bad performance
|
Name | Description | |
---|---|---|
AsInstanceOfT |
TBD
(Defined by Extensions.) | |
Match | Overloaded.
Matches the specified target.
(Defined by PatternMatch.) | |
MatchT | Overloaded.
Matches the specified target and return a result of target processing.
(Defined by PatternMatch.) |