Class Type<T>.Operator
Represents unary operator applicable to type T.
Inherited Members
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public static class Operator
Methods
| Improve this Doc View SourceGet(UnaryOperator, OperatorLookup)
Gets unary operator of the same result type as its operand.
Declaration
public static UnaryOperator<T, T> Get(UnaryOperator op, OperatorLookup lookup = OperatorLookup.Any)
Parameters
| Type | Name | Description |
|---|---|---|
| UnaryOperator | op | Unary operator type. |
| OperatorLookup | lookup | Operator resolution strategy. |
Returns
| Type | Description |
|---|---|
| UnaryOperator<T, T> | Unary operator; or null, if it doesn't exist. |
Get<TResult>(UnaryOperator, OperatorLookup)
Gets unary operator.
Declaration
public static UnaryOperator<T, TResult> Get<TResult>(UnaryOperator op, OperatorLookup lookup = OperatorLookup.Any)
Parameters
| Type | Name | Description |
|---|---|---|
| UnaryOperator | op | Unary operator type. |
| OperatorLookup | lookup | Operator resolution strategy. |
Returns
| Type | Description |
|---|---|
| UnaryOperator<T, TResult> | Unary operator; or null, if it doesn't exist. |
Type Parameters
| Name | Description |
|---|---|
| TResult | Result of unary operator. |
Require(UnaryOperator, OperatorLookup)
Gets unary operator of the same result type as its operand.
Declaration
public static UnaryOperator<T, T> Require(UnaryOperator op, OperatorLookup lookup = OperatorLookup.Any)
Parameters
| Type | Name | Description |
|---|---|---|
| UnaryOperator | op | Unary operator type. |
| OperatorLookup | lookup | Operator resolution strategy. |
Returns
| Type | Description |
|---|---|
| UnaryOperator<T, T> | Unary operator. |
Exceptions
| Type | Condition |
|---|---|
| MissingOperatorException | Operator doesn't exist. |
Require<TResult>(UnaryOperator, OperatorLookup)
Gets unary operator.
Declaration
public static UnaryOperator<T, TResult> Require<TResult>(UnaryOperator op, OperatorLookup lookup = OperatorLookup.Any)
Parameters
| Type | Name | Description |
|---|---|---|
| UnaryOperator | op | Unary operator type. |
| OperatorLookup | lookup | Operator resolution strategy. |
Returns
| Type | Description |
|---|---|
| UnaryOperator<T, TResult> | Unary operator. |
Type Parameters
| Name | Description |
|---|---|
| TResult | Result of unary operator. |
Exceptions
| Type | Condition |
|---|---|
| MissingOperatorException | Operator doesn't exist. |