C # in a Nutshell, Second Edition

STAThreadAttribute

System (mscorlib.dll) sealed class

This attribute can be used only on the Main method of an application. It sets the default threading model to STA (single-threaded apartment). Alternatively, you can use the MTAThreadAttribute attribute to use a multithreaded apartment model. See Chapter 17.

Like its counterpart , MTAThreadAttribute , this attribute has no meaning outside of COM interoperability.

public sealed class STAThreadAttribute : Attribute { // Public Constructors public STAThreadAttribute ( ); }

Hierarchy

Object Attribute STAThreadAttribute

Valid On

Method

Категории