System.Threading.Thread.GetApartmentState Method

Returns an System.Threading.ApartmentState value indicating the apartment state.

Syntax

public ApartmentState GetApartmentState ()

Returns

One of the System.Threading.ApartmentState values indicating the apartment state of the managed thread. The default is ApartmentState.Unknown.

Remarks

This method, along with the Thread.SetApartmentState(ApartmentState) method and the Thread.TrySetApartmentState(ApartmentState) method, replaces the Thread.ApartmentState property.

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0