TriState

Field: static readonly TriState NotDefined

The null value of type TriState.


Field: static readonly TriState False

The false value of type TriState.


Field: static readonly TriState True

The true value of type TriState.


Method: static List<TriState> GetAllStates()

Returns a list of all cases (null, true, false) of type List<TriState>.


Method: static TriState Parse(String)

Creates a TriState object with state information of the string type.

The triStateString value is case-insensitive .

    TriState.Parse("NotDefined")); //TriState.NotDefined
    TriState.Parse("false")); //TriState.False
    TriState.Parse("True")); //TriState.True
Parameter Name Description
triStateString Status information in string type. ("NotDefined", "True", "False")

Error Type: ArgumentNullException (This error is thrown if the value set null.)

Error Type: FormatException (This error is thrown if the value of triStateString is different from NotDefined, True, False.)


Constructor(Boolean})

Creates a TriState object with the given state information.

    new TriState(null); //TriState.NotDefined
    new TriState(false); //TriState.False
    new TriState(true); //TriState.True
Parameter Name Description
state Status information in bool type

Property: bool? Value

Returns the state of the data. (null, true, false)


Method: string ToString()

Returns the status value in string type.

    TriState.NotDefined.ToString(); //"NotDefined"
    TriState.False.ToString(); //"False"
    TriState.True.ToString(); //"True"

Method: bool IsNotDefined()

Returns true if the data is NotDefined, false otherwise.


Method: bool IsTrue()

Returns true if the data is true, false otherwise.


Method: bool IsFalse()

Returns true if the data is false, false otherwise.


Method: bool Equals(Object)

Returns true if the given object has the same value as the TriState object and the data, false otherwise.

Parameter Name Description
obj Object to be compared

Method: bool Equals(TriState)

Returns true if the given TriState object has the same value as the data, false otherwise.

Parameter Name Description
other The object of type TriState to be compared