Enum AssignmentOperator
- Namespace
- Cuemon
- Assembly
- Cuemon.Core.dll
Defines the most common assignment operators for numeric operands.
public enum AssignmentOperator
Fields
Addition = 1An addition compound assignment operation, such as (x += y).
And = 6A bitwise or logical AND compound assignment operation, such as (x &= y).
Assign = 0An assignment operation, such as (x = y).
Division = 4An division compound assignment operation, such as (x /= y).
ExclusiveOr = 8A bitwise or logical XOR compound assignment operation, such as (x ^= y).
LeftShift = 9A bitwise left-shift compound assignment, such as (x <<= y).
Multiplication = 3A multiplication compound assignment operation, such as (x *= y).
Or = 7A bitwise or logical OR compound assignment, such as (x |= y).
Remainder = 5An arithmetic remainder compound assignment operation, such as (x %= y).
RightShift = 10A bitwise left-shift compound assignment, such as (x >>= y).
Subtraction = 2A subtraction compound assignment operation, such as (x -= y).
Examples
The following example demonstrates how to use the enum to specify arithmetic or bitwise compound assignment operations.
using System;
using Cuemon;
namespace Contoso.Billing;
public sealed class AssignmentOperatorExample
{
public static void Run()
{
int total = Calculator.Calculate(5, AssignmentOperator.Addition, 3);
int shifted = Calculator.Calculate(5, AssignmentOperator.LeftShift, 2);
Console.WriteLine($"Total: {total}");
Console.WriteLine($"Shifted: {shifted}");
}
}
Remarks
For more information please refer to this Wikibooks article: http://en.wikibooks.org/wiki/C_Sharp_Programming/Operators.