-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathThreadExceptionEventArgs.xml
202 lines (184 loc) · 12.4 KB
/
ThreadExceptionEventArgs.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<Type Name="ThreadExceptionEventArgs" FullName="System.Threading.ThreadExceptionEventArgs">
<TypeSignature Language="C#" Value="public class ThreadExceptionEventArgs : EventArgs" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ThreadExceptionEventArgs extends System.EventArgs" />
<TypeSignature Language="DocId" Value="T:System.Threading.ThreadExceptionEventArgs" />
<TypeSignature Language="VB.NET" Value="Public Class ThreadExceptionEventArgs
Inherits EventArgs" />
<TypeSignature Language="F#" Value="type ThreadExceptionEventArgs = class
 inherit EventArgs" />
<TypeSignature Language="C++ CLI" Value="public ref class ThreadExceptionEventArgs : EventArgs" />
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Threading.Thread</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Threading.Thread" ToVersion="10.0.0.0" FrameworkAlternate="net-10.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Threading.Thread" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Threading.Thread" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Threading.Thread" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Threading.Thread" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Threading.Thread" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.EventArgs</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides data for the <see cref="E:System.Windows.Forms.Application.ThreadException" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A <xref:System.Threading.ThreadExceptionEventArgs> is created by a thread when an unhandled exception occurs. <xref:System.Threading.ThreadExceptionEventArgs> contains the <xref:System.Exception> that occurred.
## Examples
The following example allows you to raise a <xref:System.Windows.Forms.Application.ThreadException> event by clicking `button1` on a form. The example creates two classes. The `ErrorHandler` class creates the form and the button that raises the event. The `CustomExceptionHandler` class provides the methods to handle the exception.
In `Main` in the `ErrorHandler` class, the code creates a new instance of the exception handling class, that is, an instance of the `CustomExceptionHandler`. Then the instance is added to the event, and the application is run.
In the `OnThreadException` method in the `CustomExceptionHandler` class, the example uses a `try...catch...finally` statement to process the exception. The `ShowThreadExceptionDialog` method creates the message to display, and displays it in a message box.
:::code language="csharp" source="~/snippets/csharp/System.Threading/ThreadExceptionEventArgs/Overview/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic ThreadExceptionEventArgs Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Threading.Thread" />
<altmember cref="T:System.Threading.ThreadStart" />
<altmember cref="T:System.Threading.ThreadExceptionEventHandler" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ThreadExceptionEventArgs (Exception t);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Exception t) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.ThreadExceptionEventArgs.#ctor(System.Exception)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (t As Exception)" />
<MemberSignature Language="F#" Value="new System.Threading.ThreadExceptionEventArgs : Exception -> System.Threading.ThreadExceptionEventArgs" Usage="new System.Threading.ThreadExceptionEventArgs t" />
<MemberSignature Language="C++ CLI" Value="public:
 ThreadExceptionEventArgs(Exception ^ t);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Threading.Thread</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="t" Type="System.Exception" />
</Parameters>
<Docs>
<param name="t">The <see cref="T:System.Exception" /> that occurred.</param>
<summary>Initializes a new instance of the <see cref="T:System.Threading.ThreadExceptionEventArgs" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example allows you to raise a <xref:System.Windows.Forms.Application.ThreadException> event by clicking `button1` on a form. The example creates two classes. The `ErrorHandler` class creates the form and the button that raises the event. The `CustomExceptionHandler` class provides the methods to handle the exception.
In `Main` in the `ErrorHandler` class, the code creates a new instance of the exception handling class, that is, an instance of the `CustomExceptionHandler`. Then the instance is added to the event, and the application is run.
In the `OnThreadException` method in the `CustomExceptionHandler` class, the example uses a `try...catch...finally` statement to process the exception. The `ShowThreadExceptionDialog` method creates the message to display, and displays it in a message box.
:::code language="csharp" source="~/snippets/csharp/System.Threading/ThreadExceptionEventArgs/Overview/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic ThreadExceptionEventArgs Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Threading.Thread" />
<altmember cref="T:System.Threading.ThreadStart" />
</Docs>
</Member>
<Member MemberName="Exception">
<MemberSignature Language="C#" Value="public Exception Exception { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Exception Exception" />
<MemberSignature Language="DocId" Value="P:System.Threading.ThreadExceptionEventArgs.Exception" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Exception As Exception" />
<MemberSignature Language="F#" Value="member this.Exception : Exception" Usage="System.Threading.ThreadExceptionEventArgs.Exception" />
<MemberSignature Language="C++ CLI" Value="public:
 property Exception ^ Exception { Exception ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Threading.Thread</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Exception</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the <see cref="T:System.Exception" /> that occurred.</summary>
<value>The <see cref="T:System.Exception" /> that occurred.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example allows you to raise a <xref:System.Windows.Forms.Application.ThreadException> event by clicking `button1` on a form. The example creates two classes. The `ErrorHandler` class creates the form and the button that raises the event. The `CustomExceptionHandler` class provides the methods to handle the exception.
In `Main` in the `ErrorHandler` class, the code creates a new instance of the exception handling class, that is, an instance of the `CustomExceptionHandler`. Then the instance is added to the event, and the application is run.
In the `OnThreadException` method in the `CustomExceptionHandler` class, the example uses a `try...catch...finally` statement to process the exception. The `ShowThreadExceptionDialog` method creates the message to display, and displays it in a message box.
:::code language="csharp" source="~/snippets/csharp/System.Threading/ThreadExceptionEventArgs/Overview/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic ThreadExceptionEventArgs Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>