Table of Contents

Enum AssignmentOperator

Namespace
Cuemon
Assembly
Cuemon.Core.dll

Defines the most common assignment operators for numeric operands.

public enum AssignmentOperator

Fields

Addition = 1

An addition compound assignment operation, such as (x += y).

And = 6

A bitwise or logical AND compound assignment operation, such as (x &= y).

Assign = 0

An assignment operation, such as (x = y).

Division = 4

An division compound assignment operation, such as (x /= y).

ExclusiveOr = 8

A bitwise or logical XOR compound assignment operation, such as (x ^= y).

LeftShift = 9

A bitwise left-shift compound assignment, such as (x <<= y).

Multiplication = 3

A multiplication compound assignment operation, such as (x *= y).

Or = 7

A bitwise or logical OR compound assignment, such as (x |= y).

Remainder = 5

An arithmetic remainder compound assignment operation, such as (x %= y).

RightShift = 10

A bitwise left-shift compound assignment, such as (x >>= y).

Subtraction = 2

A 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.