In This Article

DefaultableInt32 Struct

Provides a representation for an Int32 that can be defaulted.

public struct DefaultableInt32

Constructors

DefaultableInt32(Int32)

Initializes a new instance of the DefaultableInt32 structure.

public DefaultableInt32(int value)
Parameter Type Description
value Int32

The integer value of the structure.

Properties

Default

Gets the DefaultableInt32 that represents a default value.

public static DefaultableInt32 Default { get; }

Property Value

DefaultableInt32:

The DefaultableInt32 that represents a default value.

IsDefault

Gets whether the value of the structure is flagged as a default.

public bool IsDefault { get; }

Property Value

Boolean:

true if the value of the structure is flagged as a default; otherwise, false.

Value

Gets the value of the structure.

public int Value { get; }

Property Value

Int32:

The value of the structure.

Methods

Equals(Object)

Determines whether the specified Object is equal to the current Object.

public override bool Equals(object obj)
Parameter Type Description
obj Object

The Object to compare to the current Object.

Returns

Boolean:

true if the specified Object is equal to the current Object; otherwise, false.

GetHashCode()

Returns a hash code for this object.

public override int GetHashCode()

Returns

Int32:

An integer value that specifies a hash value for this object.

Operators

Equality(DefaultableInt32, DefaultableInt32)

Compares two objects for equality.

public static bool operator ==(DefaultableInt32 left, DefaultableInt32 right)
Parameter Type Description
left DefaultableInt32

A DefaultableInt32 to compare.

right DefaultableInt32

A DefaultableInt32 to compare.

Returns

Boolean:

true if the values of left and right are equal; otherwise, false.

Explicit(DefaultableInt32 to Int32)

Explicitly converts a DefaultableInt32 to an Int32.

public static explicit operator int (DefaultableInt32 value)
Parameter Type Description
value DefaultableInt32

The DefaultableInt32 to convert.

Returns

Int32:

The Int32 that was created.

Implicit(Int32 to DefaultableInt32)

Implicitly converts an Int32 to a DefaultableInt32.

public static implicit operator DefaultableInt32(int value)
Parameter Type Description
value Int32

The Int32 to convert.

Returns

DefaultableInt32:

The DefaultableInt32 that was created.

Inequality(DefaultableInt32, DefaultableInt32)

Compares two objects for inequality.

public static bool operator !=(DefaultableInt32 left, DefaultableInt32 right)
Parameter Type Description
left DefaultableInt32

A DefaultableInt32 to compare.

right DefaultableInt32

A DefaultableInt32 to compare.

Returns

Boolean:

true if the values of left and right are unequal; otherwise, false.

Inherited Members