Show / Hide Table of Contents

Class DiscriminatedUnion<TA, TB>

A data type that can store one of two possible strongly typed options.

Inheritance
System.Object
DiscriminatedUnion<TA, TB>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: NModbus.Utility
Assembly: NModbus.dll
Syntax
public class DiscriminatedUnion<TA, TB>
Type Parameters
Name Description
TA

The type of option A.

TB

The type of option B.

Properties

| Improve this Doc View Source

A

Gets the value of option A.

Declaration
public TA A { get; }
Property Value
Type Description
TA
| Improve this Doc View Source

B

Gets the value of option B.

Declaration
public TB B { get; }
Property Value
Type Description
TB
| Improve this Doc View Source

Option

Gets the discriminated value option set for this instance.

Declaration
public DiscriminatedUnionOption Option { get; }
Property Value
Type Description
DiscriminatedUnionOption

Methods

| Improve this Doc View Source

CreateA(TA)

Factory method for creating DiscriminatedUnion with option A set.

Declaration
public static DiscriminatedUnion<TA, TB> CreateA(TA a)
Parameters
Type Name Description
TA a
Returns
Type Description
DiscriminatedUnion<TA, TB>
| Improve this Doc View Source

CreateB(TB)

Factory method for creating DiscriminatedUnion with option B set.

Declaration
public static DiscriminatedUnion<TA, TB> CreateB(TB b)
Parameters
Type Name Description
TB b
Returns
Type Description
DiscriminatedUnion<TA, TB>
| Improve this Doc View Source

ToString()

Returns a System.String that represents the current System.Object.

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents the current System.Object.

Overrides
System.Object.ToString()
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX