Class ComplexDecomposer
Decomposes System.Numerics.Complex numbers into tuples (arrays of 2).
Inheritance
Implements
Namespace: DisCatSharp.Common.Serialization
Assembly: DisCatSharp.Common.dll
Syntax
public sealed class ComplexDecomposer : IDecomposer
Methods
| Improve this Doc View SourceCanDecompose(Type)
Checks whether the decomposer can decompose a specific type.
Declaration
public bool CanDecompose(Type t)
Parameters
Type | Name | Description |
---|---|---|
System.Type | t | Type to check. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the decomposer can decompose a given type. |
CanRecompose(Type)
Checks whether the decomposer can recompose a specific decomposed type.
Note that while a type might be considered recomposable, other factors might prevent recomposing operation from being successful.
Declaration
public bool CanRecompose(Type t)
Parameters
Type | Name | Description |
---|---|---|
System.Type | t | Decomposed type to check. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the decomposer can decompose a given type. |
TryDecompose(Object, Type, out Object, out Type)
Attempts to decompose a given object of specified source type. The operation produces the decomposed object and the type it got decomposed into.
Declaration
public bool TryDecompose(object obj, Type tobj, out object decomposed, out Type tdecomposed)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object to decompose. |
System.Type | tobj | Type to decompose. |
System.Object | decomposed | Decomposition result. |
System.Type | tdecomposed | Type of the result. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the operation was successful. |
TryRecompose(Object, Type, Type, out Object)
Attempts to recompose given object of specified source type, into specified target type. The operation produces the recomposed object.
Declaration
public bool TryRecompose(object obj, Type tobj, Type trecomposed, out object recomposed)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object to recompose from. |
System.Type | tobj | Type of data to recompose. |
System.Type | trecomposed | Type to recompose into. |
System.Object | recomposed | Recomposition result. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the operation was successful. |