1 <?xml version="1.0" encoding="utf-8"?>
2 <Type Name="ApplicationContext" FullName="System.Windows.Forms.ApplicationContext">
3 <TypeSignature Language="C#" Value="public class ApplicationContext : IDisposable" />
5 <AssemblyName>System.Windows.Forms</AssemblyName>
6 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
7 <AssemblyVersion>2.0.0.0</AssemblyVersion>
10 <BaseTypeName>System.Object</BaseTypeName>
14 <InterfaceName>System.IDisposable</InterfaceName>
19 <attribution license="cc4" from="Microsoft" modified="false" />
20 <para>You can use the <see cref="T:System.Windows.Forms.ApplicationContext" /> class to redefine the circumstances that cause a message loop to exit. By default, the <see cref="T:System.Windows.Forms.ApplicationContext" /> listens to the <see cref="E:System.Windows.Forms.Form.Closed" /> event on the application's main <see cref="T:System.Windows.Forms.Form" />, then exits the thread's message loop.</para>
23 <attribution license="cc4" from="Microsoft" modified="false" />
24 <para>Specifies the contextual information about an application thread.</para>
28 <Member MemberName=".ctor">
29 <MemberSignature Language="C#" Value="public ApplicationContext ();" />
30 <MemberType>Constructor</MemberType>
33 <remarks>To be added.</remarks>
35 <attribution license="cc4" from="Microsoft" modified="false" />
36 <para>Initializes a new instance of the <see cref="T:System.Windows.Forms.ApplicationContext" /> class with no context.</para>
40 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
41 <AssemblyVersion>2.0.0.0</AssemblyVersion>
44 <Member MemberName=".ctor">
45 <MemberSignature Language="C#" Value="public ApplicationContext (System.Windows.Forms.Form mainForm);" />
46 <MemberType>Constructor</MemberType>
48 <Parameter Name="mainForm" Type="System.Windows.Forms.Form" />
52 <attribution license="cc4" from="Microsoft" modified="false" />
53 <para>If <see cref="M:System.Windows.Forms.ApplicationContext.OnMainFormClosed(System.Object,System.EventArgs)" /> is not overridden, the message loop of the thread terminates when <see cref="P:System.Windows.Forms.ApplicationContext.MainForm" /> is closed.</para>
56 <attribution license="cc4" from="Microsoft" modified="false" />
57 <para>Initializes a new instance of the <see cref="T:System.Windows.Forms.ApplicationContext" /> class with the specified <see cref="T:System.Windows.Forms.Form" />.</para>
59 <param name="mainForm">
60 <attribution license="cc4" from="Microsoft" modified="false" />The main <see cref="T:System.Windows.Forms.Form" /> of the application to use for context. </param>
63 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
64 <AssemblyVersion>2.0.0.0</AssemblyVersion>
67 <Member MemberName="Dispose">
68 <MemberSignature Language="C#" Value="public void Dispose ();" />
69 <MemberType>Method</MemberType>
71 <ReturnType>System.Void</ReturnType>
76 <attribution license="cc4" from="Microsoft" modified="false" />
77 <para>Call <see cref="M:System.Windows.Forms.ApplicationContext.Dispose" /> when you are finished using the <see cref="T:System.Windows.Forms.ApplicationContext" />. The <see cref="M:System.Windows.Forms.ApplicationContext.Dispose" /> method leaves the <see cref="T:System.Windows.Forms.ApplicationContext" /> in an unusable state. After calling <see cref="M:System.Windows.Forms.ApplicationContext.Dispose" />, you must release all references to the <see cref="T:System.Windows.Forms.ApplicationContext" /> so the garbage collector can reclaim the memory that the <see cref="T:System.Windows.Forms.ApplicationContext" /> was occupying. For more information, see <format type="text/html"><a href="a17b0066-71c2-4ba4-9822-8e19332fc213">Cleaning Up Unmanaged Resources</a></format> and <format type="text/html"><a href="eb4e1af0-3b48-4fbc-ad4e-fc2f64138bf9">Implementing a Dispose Method</a></format>. </para>
78 <block subset="none" type="note">
79 <para>Always call <see cref="M:System.Windows.Forms.ApplicationContext.Dispose" /> before you release your last reference to the <see cref="T:System.Windows.Forms.ApplicationContext" />. Otherwise, the resources it is using will not be freed until the garbage collector calls the <see cref="T:System.Windows.Forms.ApplicationContext" /> object's Finalize method.</para>
83 <attribution license="cc4" from="Microsoft" modified="false" />
84 <para>Releases all resources used by the <see cref="T:System.Windows.Forms.ApplicationContext" />.</para>
88 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
89 <AssemblyVersion>2.0.0.0</AssemblyVersion>
92 <Member MemberName="Dispose">
93 <MemberSignature Language="C#" Value="protected virtual void Dispose (bool disposing);" />
94 <MemberType>Method</MemberType>
96 <ReturnType>System.Void</ReturnType>
99 <Parameter Name="disposing" Type="System.Boolean" />
103 <attribution license="cc4" from="Microsoft" modified="false" />
104 <para>This method is called by the public Dispose() method and the <see cref="M:System.Object.Finalize" /> method. Dispose() invokes the protected <see cref="M:System.Windows.Forms.ApplicationContext.Dispose(System.Boolean)" /> method with the <paramref name="disposing" /> parameter set to true. <see cref="M:System.Object.Finalize" /> invokes Dispose with <paramref name="disposing" /> set to false.</para>
105 <para>When the <paramref name="disposing" /> parameter is true, this method releases all resources held by any managed objects that this <see cref="T:System.Windows.Forms.ApplicationContext" /> references. This method invokes the Dispose() method of each referenced object.</para>
108 <attribution license="cc4" from="Microsoft" modified="false" />
109 <para>Releases the unmanaged resources used by the <see cref="T:System.Windows.Forms.ApplicationContext" /> and optionally releases the managed resources.</para>
111 <param name="disposing">
112 <attribution license="cc4" from="Microsoft" modified="false" />true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
115 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
116 <AssemblyVersion>2.0.0.0</AssemblyVersion>
119 <Member MemberName="ExitThread">
120 <MemberSignature Language="C#" Value="public void ExitThread ();" />
121 <MemberType>Method</MemberType>
123 <ReturnType>System.Void</ReturnType>
128 <attribution license="cc4" from="Microsoft" modified="false" />
129 <para>This method calls <see cref="M:System.Windows.Forms.ApplicationContext.ExitThreadCore" />.</para>
130 <block subset="none" type="note">
132 <see cref="M:System.Windows.Forms.ApplicationContext.ExitThread" /> and <see cref="M:System.Windows.Forms.ApplicationContext.ExitThreadCore" /> do not actually cause the thread to terminate. These methods raise the <see cref="E:System.Windows.Forms.Application.ThreadExit" /> event to which the <see cref="T:System.Windows.Forms.Application" /> object listens. The <see cref="T:System.Windows.Forms.Application" /> object then terminates the thread.</para>
136 <attribution license="cc4" from="Microsoft" modified="false" />
137 <para>Terminates the message loop of the thread.</para>
141 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
142 <AssemblyVersion>2.0.0.0</AssemblyVersion>
145 <Member MemberName="ExitThreadCore">
146 <MemberSignature Language="C#" Value="protected virtual void ExitThreadCore ();" />
147 <MemberType>Method</MemberType>
149 <ReturnType>System.Void</ReturnType>
154 <attribution license="cc4" from="Microsoft" modified="false" />
155 <para>This method is called from <see cref="M:System.Windows.Forms.ApplicationContext.ExitThread" />.</para>
156 <block subset="none" type="note">
158 <see cref="M:System.Windows.Forms.ApplicationContext.ExitThread" /> and <see cref="M:System.Windows.Forms.ApplicationContext.ExitThreadCore" /> do not actually cause the thread to terminate. These methods raise the <see cref="E:System.Windows.Forms.Application.ThreadExit" /> event to which the <see cref="T:System.Windows.Forms.Application" /> object listens. The <see cref="T:System.Windows.Forms.Application" /> object then terminates the thread.</para>
162 <attribution license="cc4" from="Microsoft" modified="false" />
163 <para>Terminates the message loop of the thread.</para>
167 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
168 <AssemblyVersion>2.0.0.0</AssemblyVersion>
171 <Member MemberName="Finalize">
172 <MemberSignature Language="C#" Value="~ApplicationContext ();" />
173 <MemberType>Method</MemberType>
175 <ReturnType>System.Void</ReturnType>
180 <attribution license="cc4" from="Microsoft" modified="false" />
181 <para>This method overrides <see cref="M:System.Object.Finalize" /> and cleans up resources by calling Dispose(false). Override Dispose(Boolean) to customize the cleanup.</para>
182 <para>Application code should not call this method; an object's Finalize method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the <see cref="M:System.GC.SuppressFinalize(System.Object)" /> method.</para>
183 <para>For more information, see <format type="text/html"><a href="FD376774-1643-499B-869E-9546A3AEEA70">[<topic://cpconFinalizeMethodscDestructors>]</a></format>, <format type="text/html"><a href="A17B0066-71C2-4BA4-9822-8E19332FC213">[<topic://cpconCleaningUpUnmanagedResources>]</a></format>, and <format type="text/html"><a href="8026CB68-FE93-43FC-96C1-C09AD7D64CD3">[<topic://cpconOverridingFinalizeMethod>]</a></format>.</para>
186 <attribution license="cc4" from="Microsoft" modified="false" />
187 <para>Attempts to free resources and perform other cleanup operations before the application context is reclaimed by garbage collection.</para>
191 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
192 <AssemblyVersion>2.0.0.0</AssemblyVersion>
195 <Member MemberName="MainForm">
196 <MemberSignature Language="C#" Value="public System.Windows.Forms.Form MainForm { set; get; }" />
197 <MemberType>Property</MemberType>
199 <ReturnType>System.Windows.Forms.Form</ReturnType>
202 <value>To be added.</value>
204 <attribution license="cc4" from="Microsoft" modified="false" />
205 <para>This property determines the main <see cref="T:System.Windows.Forms.Form" /> for this context. This property can change at any time. If <see cref="M:System.Windows.Forms.ApplicationContext.OnMainFormClosed(System.Object,System.EventArgs)" /> is not overridden, the message loop of the thread terminates when the <paramref name="mainForm" /> parameter closes.</para>
208 <attribution license="cc4" from="Microsoft" modified="false" />
209 <para>Gets or sets the <see cref="T:System.Windows.Forms.Form" /> to use as context.</para>
213 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
214 <AssemblyVersion>2.0.0.0</AssemblyVersion>
217 <Member MemberName="OnMainFormClosed">
218 <MemberSignature Language="C#" Value="protected virtual void OnMainFormClosed (object sender, EventArgs e);" />
219 <MemberType>Method</MemberType>
221 <ReturnType>System.Void</ReturnType>
224 <Parameter Name="sender" Type="System.Object" />
225 <Parameter Name="e" Type="System.EventArgs" />
229 <attribution license="cc4" from="Microsoft" modified="false" />
230 <para>The default implementation of this method calls <see cref="M:System.Windows.Forms.ApplicationContext.ExitThreadCore" />.</para>
233 <attribution license="cc4" from="Microsoft" modified="false" />
234 <para>Calls <see cref="M:System.Windows.Forms.ApplicationContext.ExitThreadCore" />, which raises the <see cref="E:System.Windows.Forms.ApplicationContext.ThreadExit" /> event.</para>
236 <param name="sender">
237 <attribution license="cc4" from="Microsoft" modified="false" />The object that raised the event. </param>
239 <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.EventArgs" /> that contains the event data. </param>
242 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
243 <AssemblyVersion>2.0.0.0</AssemblyVersion>
246 <Member MemberName="Tag">
247 <MemberSignature Language="C#" Value="public object Tag { set; get; }" />
248 <MemberType>Property</MemberType>
250 <AssemblyVersion>2.0.0.0</AssemblyVersion>
254 <AttributeName>System.ComponentModel.TypeConverter(typeof(System.ComponentModel.StringConverter))</AttributeName>
257 <AttributeName>System.ComponentModel.Localizable(false)</AttributeName>
260 <AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
263 <AttributeName>System.ComponentModel.Bindable(true)</AttributeName>
267 <ReturnType>System.Object</ReturnType>
270 <value>To be added.</value>
272 <attribution license="cc4" from="Microsoft" modified="false" />
273 <para>Any type derived from the <see cref="T:System.Object" /> class can be assigned to this property. If the <see cref="P:System.Windows.Forms.ApplicationContext.Tag" /> property is set through the Windows Forms designer, only text can be assigned.</para>
274 <para>A common use for the <see cref="P:System.Windows.Forms.ApplicationContext.Tag" /> property is to store data that is closely associated with the control. For example, if you have a control that displays information about a customer, you might store a <see cref="T:System.Data.DataSet" /> that contains the customer's order history in that control's <see cref="P:System.Windows.Forms.ApplicationContext.Tag" /> property so the data can be accessed quickly.</para>
277 <attribution license="cc4" from="Microsoft" modified="false" />
278 <para>Gets or sets an object that contains data about the control.</para>
282 <Member MemberName="ThreadExit">
283 <MemberSignature Language="C#" Value="public event EventHandler ThreadExit;" />
284 <MemberType>Event</MemberType>
286 <ReturnType>System.EventHandler</ReturnType>
289 <remarks>To be added.</remarks>
291 <attribution license="cc4" from="Microsoft" modified="false" />
292 <para>Occurs when the message loop of the thread should be terminated, by calling <see cref="M:System.Windows.Forms.ApplicationContext.ExitThread" />.</para>
296 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
297 <AssemblyVersion>2.0.0.0</AssemblyVersion>