forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplicationBase.xml
387 lines (315 loc) · 21.4 KB
/
ApplicationBase.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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
<Type Name="ApplicationBase" FullName="Microsoft.VisualBasic.ApplicationServices.ApplicationBase">
<TypeSignature Language="C#" Value="public class ApplicationBase" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi ApplicationBase extends System.Object" />
<TypeSignature Language="DocId" Value="T:Microsoft.VisualBasic.ApplicationServices.ApplicationBase" />
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides properties, methods, and events related to the current application.</summary>
<remarks>
<format type="text/markdown"><]
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ApplicationBase ();" />
<MemberSignature Language="ILAsm" Value=".method public specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.ApplicationServices.ApplicationBase.#ctor" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:Microsoft.VisualBasic.ApplicationServices.ApplicationBase" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ChangeCulture">
<MemberSignature Language="C#" Value="public void ChangeCulture (string cultureName);" />
<MemberSignature Language="ILAsm" Value=".method public instance void ChangeCulture(string cultureName) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.ApplicationServices.ApplicationBase.ChangeCulture(System.String)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cultureName" Type="System.String" />
</Parameters>
<Docs>
<param name="cultureName">
<see langword="String" />. Name of the culture as a string. For a list of possible names, see <see cref="T:System.Globalization.CultureInfo" />.</param>
<summary>Changes the culture used by the current thread for string manipulation and for string formatting.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `My.Application.ChangeCulture` method changes the current thread's <xref:System.Threading.Thread.CurrentCulture%2A> property. <xref:System.Threading.Thread.CurrentCulture%2A> determines the default formats for dates, times, currency, numbers, sorting order of text, string comparisons, and casing for all computations on that thread.
To retrieve the current culture, you can use the <xref:Microsoft.VisualBasic.ApplicationServices.ApplicationBase.Culture%2A> property or the <xref:System.Threading.Thread.CurrentCulture%2A> property.
The <xref:System.Threading.Thread.CurrentCulture%2A> setting is different from a language setting. It contains only data related to the standard settings for a geographical region. Therefore, the <xref:System.Threading.Thread.CurrentCulture%2A> property can only be set to a specific culture or to the <xref:System.Globalization.CultureInfo.InvariantCulture%2A>.
Use the `My.Application.ChangeUICulture` method to change the culture that the current thread uses for retrieving culture-specific resources.
> [!IMPORTANT]
> The `My.Application.ChangeCulture` method requires a <xref:System.Security.Permissions.SecurityPermission> with the <xref:System.Security.Permissions.SecurityPermissionFlag.ControlThread> set. Manipulating threads is dangerous because of the security state associated with threads. Therefore, this permission should be given only as necessary to trustworthy code. You cannot change a thread's culture in semi-trusted code.
## Availability by Project Type
|Project type|Available|
|-|-|
|Windows Forms Application|**Yes**|
|Class Library|**Yes**|
|Console Application|**Yes**|
|Windows Forms Control Library|**Yes**|
|Web Control Library|No|
|Windows Service|**Yes**|
|Web Site|No|
## Examples
This example demonstrates how changing the culture changes the string representation of dates.
[!code-vb[VbVbalrMyApplication#1](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyApplication/VB/Form1.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="cultureName" /> is <see langword="Nothing" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="cultureName" /> is not a valid culture name.</exception>
</Docs>
</Member>
<Member MemberName="ChangeUICulture">
<MemberSignature Language="C#" Value="public void ChangeUICulture (string cultureName);" />
<MemberSignature Language="ILAsm" Value=".method public instance void ChangeUICulture(string cultureName) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.ApplicationServices.ApplicationBase.ChangeUICulture(System.String)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cultureName" Type="System.String" />
</Parameters>
<Docs>
<param name="cultureName">
<see langword="String" />. Name of the culture as a string. For a list of possible names, see <see cref="T:System.Globalization.CultureInfo" />.</param>
<summary>Changes the culture that the current thread uses for retrieving culture-specific resources.</summary>
<remarks>
<format type="text/markdown"><]
For this example to work, your application must have a string named `Message` in the application's resource file, and the application should have the French-culture version of that resource file, `Resources.fr-FR.resx`. For more information, see [How to: Add or Remove Resources](http://msdn.microsoft.com/en-us/7b77bc06-3952-4799-b029-def3f8f7f88d).
If the application does not have the French-culture version of that resource file, the `My.Resources` object retrieves the resource from the default-culture resource file.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="cultureName" /> is <see langword="Nothing" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="cultureName" /> is not a valid culture name.</exception>
</Docs>
</Member>
<Member MemberName="Culture">
<MemberSignature Language="C#" Value="public System.Globalization.CultureInfo Culture { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Globalization.CultureInfo Culture" />
<MemberSignature Language="DocId" Value="P:Microsoft.VisualBasic.ApplicationServices.ApplicationBase.Culture" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Globalization.CultureInfo</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the culture that the current thread uses for string manipulation and string formatting.</summary>
<value>A <see cref="T:System.Globalization.CultureInfo" /> object that represents the culture the current thread uses for string manipulation and string formatting.</value>
<remarks>
<format type="text/markdown"><]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetEnvironmentVariable">
<MemberSignature Language="C#" Value="public string GetEnvironmentVariable (string name);" />
<MemberSignature Language="ILAsm" Value=".method public instance string GetEnvironmentVariable(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.ApplicationServices.ApplicationBase.GetEnvironmentVariable(System.String)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="name">A <see langword="String" /> containing the name of the environment variable.</param>
<summary>Returns the value of the specified environment variable.</summary>
<returns>A <see langword="String" /> containing the value of the environment variable with the name <paramref name="name" />.</returns>
<remarks>
<format type="text/markdown"><]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="name" /> is <see langword="Nothing" />.</exception>
<exception cref="T:System.ArgumentException">The environment variable specified by <paramref name="name" /> does not exist.</exception>
<exception cref="T:System.Security.SecurityException">The calling code does not have <see cref="T:System.Security.Permissions.EnvironmentPermission" /> with <see langword="Read" /> access.</exception>
</Docs>
</Member>
<Member MemberName="Info">
<MemberSignature Language="C#" Value="public Microsoft.VisualBasic.ApplicationServices.AssemblyInfo Info { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Microsoft.VisualBasic.ApplicationServices.AssemblyInfo Info" />
<MemberSignature Language="DocId" Value="P:Microsoft.VisualBasic.ApplicationServices.ApplicationBase.Info" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.VisualBasic.ApplicationServices.AssemblyInfo</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets an object that provides properties for getting information about the application's assembly, such as the version number, description, and so on.</summary>
<value>The <see cref="T:Microsoft.VisualBasic.ApplicationServices.AssemblyInfo" /> object for the current application.</value>
<remarks>
<format type="text/markdown"><]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Log">
<MemberSignature Language="C#" Value="public Microsoft.VisualBasic.Logging.Log Log { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Microsoft.VisualBasic.Logging.Log Log" />
<MemberSignature Language="DocId" Value="P:Microsoft.VisualBasic.ApplicationServices.ApplicationBase.Log" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.VisualBasic.Logging.Log</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets an object that provides properties and methods for writing event and exception information to the application's log listeners.</summary>
<value>The <see cref="T:Microsoft.VisualBasic.Logging.Log" /> object for the current application.</value>
<remarks>
<format type="text/markdown"><.
[!code-vb[VbVbalrMyApplicationLog#11](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyApplicationLog/VB/Form1.vb#11)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="UICulture">
<MemberSignature Language="C#" Value="public System.Globalization.CultureInfo UICulture { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Globalization.CultureInfo UICulture" />
<MemberSignature Language="DocId" Value="P:Microsoft.VisualBasic.ApplicationServices.ApplicationBase.UICulture" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Globalization.CultureInfo</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the culture that the current thread uses for retrieving culture-specific resources.</summary>
<value>A <see cref="T:System.Globalization.CultureInfo" /> object that represents the culture that the current thread uses for retrieving culture-specific resources.</value>
<remarks>
<format type="text/markdown"><]
For this example to work, your application must have a string named `Message` in the application's resource file, and the application should have the French-culture version of that resource file, `Resources.fr-FR.resx`. For more information, see [How to: Add or Remove Resources](http://msdn.microsoft.com/en-us/7b77bc06-3952-4799-b029-def3f8f7f88d).
If the application does not have the French-culture version of that resource file, the `My.Resources` object retrieves the resource from the default-culture resource file.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>