SumType<T1,T2> Yapı

Tanım

Veya içeren bir struct T1 T2 .

generic <typename T1, typename T2>
public value class SumType : IEquatable<Microsoft::VisualStudio::LanguageServer::Protocol::SumType<T1, T2>>, Microsoft::VisualStudio::LanguageServer::Protocol::ISumType
[Newtonsoft.Json.JsonConverter(typeof(Microsoft.VisualStudio.LanguageServer.Protocol.SumConverter))]
public struct SumType<T1,T2> : IEquatable<Microsoft.VisualStudio.LanguageServer.Protocol.SumType<T1,T2>>, Microsoft.VisualStudio.LanguageServer.Protocol.ISumType
[<Newtonsoft.Json.JsonConverter(typeof(Microsoft.VisualStudio.LanguageServer.Protocol.SumConverter))>]
type SumType<'T1, 'T2> = struct
    interface ISumType
Public Structure SumType(Of T1, T2)
Implements IEquatable(Of SumType(Of T1, T2)), ISumType

Tür Parametreleri

T1

Bu yapının içermesi için tasarlanan ilk tür.

T2

Bu yapının içermesi için tasarlanan ikinci tür.

Devralma
SumType<T1,T2>
Öznitelikler
Newtonsoft.Json.JsonConverterAttribute
Uygulamalar

Oluşturucular

SumType<T1,T2>(T1)

İçeren yapının yeni bir örneğini başlatır SumType<T1,T2> T1 .

SumType<T1,T2>(T2)

İçeren yapının yeni bir örneğini başlatır SumType<T1,T2> T2 .

Özellikler

Value

SumType içinde depolanan değeri alır. Bu, "SIS" işleci kullanılarak eşleştirilebilir.

Yöntemler

Equals(Object)

Indicates whether this instance and a specified object are equal.

Equals(SumType<T1,T2>)

Indicates whether the current object is equal to another object of the same type.

GetHashCode()

Returns the hash code for this instance.

Match<TResult>(Func<T1,TResult>, Func<T2,TResult>, Func<TResult>)

Bu örnekte yer alan türe karşılık gelen bir temsilci çalıştırır.

İşleçler

Equality(SumType<T1,T2>, SumType<T1,T2>)
Explicit(SumType<T1,T2> to T1)

Bir örneğini örneğine dönüştürmeye çalışır SumType<T1,T2> T1 .

Explicit(SumType<T1,T2> to T2)

Bir örneğini örneğine dönüştürmeye çalışır SumType<T1,T2> T2 .

Implicit(T1 to SumType<T1,T2>)
Implicit(T2 to SumType<T1,T2>)
Inequality(SumType<T1,T2>, SumType<T1,T2>)

Şunlara uygulanır