Class TypeSwitch
Allows to make a switch statement on the Type of the object, and executes a different Action depending on its outcome.
Inheritance
System.Object
TypeSwitch
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: RuriLib
Assembly: RuriLib.dll
Syntax
public class TypeSwitch
Methods
| Improve this Doc View SourceCase<T>(Action<T>)
Adds a case to the TypeSwitch.
Declaration
public TypeSwitch Case<T>(Action<T> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | action | The action to perform |
Returns
Type | Description |
---|---|
TypeSwitch | The TypeSwitch itself |
Type Parameters
Name | Description |
---|---|
T | The type |
Switch(Object)
Runs the switch statement on an object and executes the corresponding Action.
Declaration
public void Switch(object x)
Parameters
Type | Name | Description |
---|---|---|
System.Object | x | The object on which you want to execute the switch statement |