From 8b9aa24a8a6f34b29757bee1faa42979f9ce8c63 Mon Sep 17 00:00:00 2001
From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com>
Date: Fri, 19 Nov 2021 07:41:37 -0800
Subject: [PATCH 1/8] Update package index with latest published versions
(#27162)
---
docs/azure/includes/dotnet-all.md | 4 ++--
docs/azure/includes/dotnet-new.md | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md
index 002dd3a23ba28..bcdf64c5e6cc4 100644
--- a/docs/azure/includes/dotnet-all.md
+++ b/docs/azure/includes/dotnet-all.md
@@ -16,7 +16,7 @@
| Communication Chat | NuGet [1.1.0](https://www.nuget.org/packages/Azure.Communication.Chat/1.1.0) | [docs](/dotnet/api/overview/azure/Communication.Chat-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Chat_1.1.0/sdk/communication/Azure.Communication.Chat/) |
| Communication Common | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.Common/1.0.1) | [docs](/dotnet/api/overview/azure/Communication.Common-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Common_1.0.1/sdk/communication/Azure.Communication.Common/) |
| Communication Identity | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.Identity/1.0.1)
NuGet [1.1.0-beta.1](https://www.nuget.org/packages/Azure.Communication.Identity/1.1.0-beta.1) | [docs](/dotnet/api/overview/azure/Communication.Identity-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Identity_1.0.1/sdk/communication/Azure.Communication.Identity/)
GitHub [1.1.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Identity_1.1.0-beta.1/sdk/communication/Azure.Communication.Identity/) |
-| Communication Network Traversal | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Communication.NetworkTraversal/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Communication.NetworkTraversal-readme-pre) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.NetworkTraversal_1.0.0-beta.2/sdk/communication/Azure.Communication.NetworkTraversal/) |
+| Communication Network Traversal | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Communication.NetworkTraversal/1.0.0-beta.3) | [docs](/dotnet/api/overview/azure/Communication.NetworkTraversal-readme-pre) | GitHub [1.0.0-beta.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.NetworkTraversal_1.0.0-beta.3/sdk/communication/Azure.Communication.NetworkTraversal/) |
| Communication Phone Numbers | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.PhoneNumbers/1.0.1) | [docs](/dotnet/api/overview/azure/Communication.PhoneNumbers-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.PhoneNumbers_1.0.1/sdk/communication/Azure.Communication.PhoneNumbers/) |
| Communication SMS | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.Sms/1.0.1) | [docs](/dotnet/api/overview/azure/Communication.Sms-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Sms_1.0.1/sdk/communication/Azure.Communication.Sms/) |
| ConfidentialLedger | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Security.ConfidentialLedger/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Security.ConfidentialLedger-readme-pre) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Security.ConfidentialLedger_1.0.0-beta.2/sdk/confidentialledger/Azure.Security.ConfidentialLedger/) |
@@ -204,7 +204,7 @@
| Communication Chat | NuGet [1.1.0](https://www.nuget.org/packages/Azure.Communication.Chat/1.1.0) | [docs](/dotnet/api/overview/azure/Communication.Chat-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Chat_1.1.0/sdk/communication/Azure.Communication.Chat/) |
| Communication Common | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.Common/1.0.1) | [docs](/dotnet/api/overview/azure/Communication.Common-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Common_1.0.1/sdk/communication/Azure.Communication.Common/) |
| Communication Identity | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.Identity/1.0.1)
NuGet [1.1.0-beta.1](https://www.nuget.org/packages/Azure.Communication.Identity/1.1.0-beta.1) | [docs](/dotnet/api/overview/azure/Communication.Identity-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Identity_1.0.1/sdk/communication/Azure.Communication.Identity/)
GitHub [1.1.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Identity_1.1.0-beta.1/sdk/communication/Azure.Communication.Identity/) |
-| Communication Network Traversal | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Communication.NetworkTraversal/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Communication.NetworkTraversal-readme-pre) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.NetworkTraversal_1.0.0-beta.2/sdk/communication/Azure.Communication.NetworkTraversal/) |
+| Communication Network Traversal | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Communication.NetworkTraversal/1.0.0-beta.3) | [docs](/dotnet/api/overview/azure/Communication.NetworkTraversal-readme-pre) | GitHub [1.0.0-beta.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.NetworkTraversal_1.0.0-beta.3/sdk/communication/Azure.Communication.NetworkTraversal/) |
| Communication Phone Numbers | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.PhoneNumbers/1.0.1) | [docs](/dotnet/api/overview/azure/Communication.PhoneNumbers-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.PhoneNumbers_1.0.1/sdk/communication/Azure.Communication.PhoneNumbers/) |
| Communication SMS | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.Sms/1.0.1) | [docs](/dotnet/api/overview/azure/Communication.Sms-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Sms_1.0.1/sdk/communication/Azure.Communication.Sms/) |
| Computer Vision | NuGet [7.0.1](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ComputerVision/7.0.1) | | GitHub [7.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.CognitiveServices.Vision.ComputerVision_6.0.0-preview.1/sdk/cognitiveservices/Vision.ComputerVision) |
diff --git a/docs/azure/includes/dotnet-new.md b/docs/azure/includes/dotnet-new.md
index b6ae9d96dc114..02998076eb393 100644
--- a/docs/azure/includes/dotnet-new.md
+++ b/docs/azure/includes/dotnet-new.md
@@ -16,7 +16,7 @@
| Communication Chat | NuGet [1.1.0](https://www.nuget.org/packages/Azure.Communication.Chat/1.1.0) | [docs](/dotnet/api/overview/azure/Communication.Chat-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Chat_1.1.0/sdk/communication/Azure.Communication.Chat/) |
| Communication Common | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.Common/1.0.1) | [docs](/dotnet/api/overview/azure/Communication.Common-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Common_1.0.1/sdk/communication/Azure.Communication.Common/) |
| Communication Identity | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.Identity/1.0.1)
NuGet [1.1.0-beta.1](https://www.nuget.org/packages/Azure.Communication.Identity/1.1.0-beta.1) | [docs](/dotnet/api/overview/azure/Communication.Identity-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Identity_1.0.1/sdk/communication/Azure.Communication.Identity/)
GitHub [1.1.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Identity_1.1.0-beta.1/sdk/communication/Azure.Communication.Identity/) |
-| Communication Network Traversal | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Communication.NetworkTraversal/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Communication.NetworkTraversal-readme-pre) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.NetworkTraversal_1.0.0-beta.2/sdk/communication/Azure.Communication.NetworkTraversal/) |
+| Communication Network Traversal | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Communication.NetworkTraversal/1.0.0-beta.3) | [docs](/dotnet/api/overview/azure/Communication.NetworkTraversal-readme-pre) | GitHub [1.0.0-beta.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.NetworkTraversal_1.0.0-beta.3/sdk/communication/Azure.Communication.NetworkTraversal/) |
| Communication Phone Numbers | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.PhoneNumbers/1.0.1) | [docs](/dotnet/api/overview/azure/Communication.PhoneNumbers-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.PhoneNumbers_1.0.1/sdk/communication/Azure.Communication.PhoneNumbers/) |
| Communication SMS | NuGet [1.0.1](https://www.nuget.org/packages/Azure.Communication.Sms/1.0.1) | [docs](/dotnet/api/overview/azure/Communication.Sms-readme) | GitHub [1.0.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Communication.Sms_1.0.1/sdk/communication/Azure.Communication.Sms/) |
| ConfidentialLedger | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Security.ConfidentialLedger/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Security.ConfidentialLedger-readme-pre) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Security.ConfidentialLedger_1.0.0-beta.2/sdk/confidentialledger/Azure.Security.ConfidentialLedger/) |
From 1912c5cd4fec8fe99b988507e60795be8571dda0 Mon Sep 17 00:00:00 2001
From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com>
Date: Fri, 19 Nov 2021 08:17:45 -0800
Subject: [PATCH 2/8] Update package index with latest published versions
(#27180)
---
docs/azure/includes/dotnet-all.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/azure/includes/dotnet-all.md b/docs/azure/includes/dotnet-all.md
index bcdf64c5e6cc4..72fc110aadd5d 100644
--- a/docs/azure/includes/dotnet-all.md
+++ b/docs/azure/includes/dotnet-all.md
@@ -502,7 +502,7 @@
| Management - Data Box | NuGet [1.3.1](https://www.nuget.org/packages/Microsoft.Azure.Management.DataBox/1.3.1) | | GitHub [1.3.1](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Management.DataBox_1.3.1/sdk/databox/Microsoft.Azure.Management.DataBox/) |
| Management - Data Box Edge | NuGet [1.1.0](https://www.nuget.org/packages/Microsoft.Azure.Management.DataBoxEdge/1.1.0) | | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Management.DataBoxEdge_1.1.0/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/) |
| Management - Data Factories | NuGet [4.13.3](https://www.nuget.org/packages/Microsoft.Azure.Management.DataFactories/4.13.3) | [docs](/dotnet/api/overview/azure/data-factory) | |
-| Management - Data Factory | NuGet [4.27.0](https://www.nuget.org/packages/Microsoft.Azure.Management.DataFactory/4.27.0) | [docs](/dotnet/api/overview/azure/data-factory) | GitHub [4.27.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Management.DataFactory_4.27.0/sdk/datafactory/Microsoft.Azure.Management.DataFactory/) |
+| Management - Data Factory | NuGet [4.28.0](https://www.nuget.org/packages/Microsoft.Azure.Management.DataFactory/4.28.0) | [docs](/dotnet/api/overview/azure/data-factory) | GitHub [4.28.0](https://github.com/Azure/azure-sdk-for-net/tree/Microsoft.Azure.Management.DataFactory_4.28.0/sdk/datafactory/Microsoft.Azure.Management.DataFactory/) |
| Management - Data Lake Analytics | NuGet [3.5.3-preview](https://www.nuget.org/packages/Microsoft.Azure.Management.DataLake.Analytics/3.5.3-preview) | [docs](/dotnet/api/overview/azure/data-lake-analytics) | GitHub [3.5.3-preview](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics) |
| Management - Data Lake Storage | NuGet [2.4.2-preview](https://www.nuget.org/packages/Microsoft.Azure.Management.DataLake.Store/2.4.2-preview) | [docs](/dotnet/api/overview/azure/data-lake-store) | GitHub [2.4.2-preview](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/datalake-store/Microsoft.Azure.Management.DataLake.Store) |
| Management - Data Lake Storage Uploader | NuGet [1.0.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Management.DataLake.StoreUploader/1.0.1-preview) | | |
From b911118a793bd265e6cd13a8d202acf87a5ae94a Mon Sep 17 00:00:00 2001
From: Bill Wagner
Date: Fri, 19 Nov 2021 12:09:42 -0500
Subject: [PATCH 3/8] Remove stray closing parenthesis (#27085)
* Remove stray closing parenthesis
Fixes #27075
* Update docs/csharp/whats-new/csharp-10.md
Co-authored-by: Youssef Victor
Co-authored-by: Youssef Victor
---
docs/csharp/whats-new/csharp-10.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/csharp/whats-new/csharp-10.md b/docs/csharp/whats-new/csharp-10.md
index d27f18784c3ea..ddffee0c6e20c 100644
--- a/docs/csharp/whats-new/csharp-10.md
+++ b/docs/csharp/whats-new/csharp-10.md
@@ -120,7 +120,7 @@ Prior to C# 10, there were many scenarios where definite assignment and null-sta
```csharp
string representation = "N/A";
-if ((c != null) && c.GetDependentValue(out object obj)) == true)
+if ((c != null && c.GetDependentValue(out object obj)) == true)
{
representation = obj.ToString(); // undesired error
}
From 321c7550b6a263f9c03a4fd2bade862bf1f59bdc Mon Sep 17 00:00:00 2001
From: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Date: Fri, 19 Nov 2021 10:06:17 -0800
Subject: [PATCH 4/8] Remove daisy chains in redirection file (#27161)
---
.openpublishing.redirection.json | 80 ++++++++++++++++----------------
1 file changed, 39 insertions(+), 41 deletions(-)
diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json
index 93a3d31968a1f..059ce656d5a8c 100644
--- a/.openpublishing.redirection.json
+++ b/.openpublishing.redirection.json
@@ -127,7 +127,7 @@
},
{
"source_path": "docs/azure/dotnet-sdk-azure-authenticate.md",
- "redirect_url": "/dotnet/azure/authentication"
+ "redirect_url": "/dotnet/azure/sdk/authentication"
},
{
"source_path": "docs/azure/dotnet-sdk-azure-concepts.md",
@@ -143,11 +143,11 @@
},
{
"source_path": "docs/azure/dotnet-sdk-vs2015-install.md",
- "redirect_url": "/dotnet/azure/vs2015-install"
+ "redirect_url": "/dotnet/azure/dotnet-dev-env-checklist"
},
{
"source_path": "docs/azure/dotnet-tools.md",
- "redirect_url": "/dotnet/azure/tools"
+ "redirect_url": "/dotnet/azure/dotnet-dev-env-checklist"
},
{
"source_path": "docs/azure/dotnet-tutorials.md",
@@ -175,15 +175,15 @@
},
{
"source_path": "docs/azure/sdk/tools.md",
- "redirect_url": "/dotnet/azure/tools"
+ "redirect_url": "/dotnet/azure/dotnet-dev-env-checklist"
},
{
"source_path": "docs/azure/sdk/vs2015-install.md",
- "redirect_url": "/dotnet/azure/vs2015-install"
+ "redirect_url": "/dotnet/azure/dotnet-dev-env-checklist"
},
{
"source_path": "docs/azure/vs2015-install.md",
- "redirect_url": "/dotnet/azure/tools"
+ "redirect_url": "/dotnet/azure/dotnet-dev-env-checklist"
},
{
"source_path": "docs/cli-preview3/tools/dotnet-nuget-delete.md",
@@ -493,7 +493,7 @@
},
{
"source_path": "docs/core/compatibility/wpf.md",
- "redirect_url": "/dotnet/core/compatibility/windows-forms/5.0/automatically-infer-winexe-output-type"
+ "redirect_url": "/dotnet/core/compatibility/sdk/5.0/automatically-infer-winexe-output-type"
},
{
"source_path": "docs/core/deploying/applications.md",
@@ -699,7 +699,7 @@
},
{
"source_path": "docs/core/preview3/tools/csproj.md",
- "redirect_url": "/dotnet/core/tools/csproj",
+ "redirect_url": "/dotnet/core/project-sdk/msbuild-props",
"redirect_document_id": true
},
{
@@ -985,7 +985,7 @@
},
{
"source_path": "docs/csharp/classes.md",
- "redirect_url": "/dotnet/csharp/programming-guide/classes-and-structs/classes"
+ "redirect_url": "/dotnet/csharp/fundamentals/types/classes"
},
{
"source_path": "docs/csharp/csharp-6.md",
@@ -1021,7 +1021,7 @@
},
{
"source_path": "docs/csharp/generics.md",
- "redirect_url": "/dotnet/csharp/programming-guide/generics/index"
+ "redirect_url": "/dotnet/csharp/fundamentals/types/generics"
},
{
"source_path": "docs/csharp/getting-started/additional-resources.md",
@@ -1121,7 +1121,7 @@
},
{
"source_path": "docs/csharp/interfaces.md",
- "redirect_url": "/dotnet/csharp/programming-guide/interfaces/index"
+ "redirect_url": "/dotnet/csharp/fundamentals/types/interfaces"
},
{
"source_path": "docs/csharp/interop.md",
@@ -1926,7 +1926,7 @@
},
{
"source_path": "docs/csharp/namespaces-and-assemblies.md",
- "redirect_url": "/dotnet/csharp/programming-guide/namespaces/index"
+ "redirect_url": "/dotnet/csharp/fundamentals/types/namespaces"
},
{
"source_path": "docs/csharp/nullable-attributes.md",
@@ -1962,7 +1962,7 @@
},
{
"source_path": "docs/csharp/programming-guide/classes-and-structs/how-to-access-a-collection-class-with-foreach.md",
- "redirect_url": "/dotnet/csharp/language-reference/keywords/foreach-in"
+ "redirect_url": "/dotnet/csharp/language-reference/statements/iteration-statements"
},
{
"source_path": "docs/csharp/programming-guide/classes-and-structs/index.md",
@@ -2912,7 +2912,7 @@
},
{
"source_path": "docs/csharp/programming-guide/concepts/object-oriented-programming.md",
- "redirect_url": "/dotnet/csharp/tutorials/intro-to-csharp/object-oriented-programming",
+ "redirect_url": "/dotnet/csharp/fundamentals/tutorials/oop",
"redirect_document_id": true
},
{
@@ -2990,7 +2990,7 @@
},
{
"source_path": "docs/csharp/programming-guide/exceptions/exceptions-and-exception-handling.md",
- "redirect_url": "/dotnet/csharp/programming-guide/exceptions/index"
+ "redirect_url": "/dotnet/csharp/fundamentals/exceptions"
},
{
"source_path": "docs/csharp/programming-guide/exceptions/using-exceptions.md",
@@ -3135,7 +3135,7 @@
},
{
"source_path": "docs/csharp/programming-guide/main-and-command-args/main-and-command-line-arguments.md",
- "redirect_url": "/dotnet/csharp/programming-guide/main-and-command-args/index"
+ "redirect_url": "/dotnet/csharp/fundamentals/program-structure/main-command-line"
},
{
"source_path": "docs/csharp/programming-guide/main-and-command-args/main-return-values.md",
@@ -3267,7 +3267,7 @@
},
{
"source_path": "docs/csharp/programming-guide/types/how-to-safely-cast-using-as-and-is-operators.md",
- "redirect_url": "/dotnet/csharp/how-to/safely-cast-using-pattern-matching-is-and-as-operators"
+ "redirect_url": "/dotnet/csharp/fundamentals/tutorials/safely-cast-using-pattern-matching-is-and-as-operators"
},
{
"source_path": "docs/csharp/programming-guide/interfaces/index.md",
@@ -3363,7 +3363,7 @@
},
{
"source_path": "docs/csharp/programming-guide/xmldoc/how-to-use-the-xml-documentation-features.md",
- "redirect_url": "/dotnet/csharp/programming-guide/xmldoc/index"
+ "redirect_url": "/dotnet/csharp/language-reference/xmldoc"
},
{
"source_path": "docs/csharp/programming-guide/xmldoc/include.md",
@@ -3447,12 +3447,12 @@
},
{
"source_path": "docs/csharp/quick-starts/arrays-and-collections.md",
- "redirect_url": "/dotnet/csharp/tutorials/intro-to-csharp/arrays-and-collections",
+ "redirect_url": "/dotnet/csharp/tour-of-csharp/tutorials/arrays-and-collections",
"redirect_document_id": true
},
{
"source_path": "docs/csharp/quick-starts/branches-and-loops-local.md",
- "redirect_url": "/dotnet/csharp/tutorials/intro-to-csharp/branches-and-loops-local",
+ "redirect_url": "/dotnet/csharp/tour-of-csharp/tutorials/branches-and-loops-local",
"redirect_document_id": true
},
{
@@ -3479,7 +3479,7 @@
},
{
"source_path": "docs/csharp/quick-starts/introduction-to-classes.md",
- "redirect_url": "/dotnet/csharp/tutorials/intro-to-csharp/introduction-to-classes",
+ "redirect_url": "/dotnet/csharp/fundamentals/tutorials/classes",
"redirect_document_id": true
},
{
@@ -3488,12 +3488,12 @@
},
{
"source_path": "docs/csharp/quick-starts/local-environment.md",
- "redirect_url": "/dotnet/csharp/tutorials/intro-to-csharp/local-environment",
+ "redirect_url": "/dotnet/csharp/tour-of-csharp/tutorials/local-environment",
"redirect_document_id": true
},
{
"source_path": "docs/csharp/quick-starts/numbers-in-csharp-local.md",
- "redirect_url": "/dotnet/csharp/tutorials/intro-to-csharp/numbers-in-csharp-local",
+ "redirect_url": "/dotnet/csharp/tour-of-csharp/tutorials/numbers-in-csharp-local",
"redirect_document_id": true
},
{
@@ -3582,11 +3582,11 @@
},
{
"source_path": "docs/csharp/tutorials/upgrade-to-nullable-references.md",
- "redirect_url": "/dotnet/csharp/whats-new/tutorials/upgrade-to-nullable-references"
+ "redirect_url": "/dotnet/csharp/nullable-migration-strategies"
},
{
"source_path": "docs/csharp/tutorials/exploration/csharp-6.yml",
- "redirect_url": "/dotnet/csharp/whats-new/csharp-7"
+ "redirect_url": "/dotnet/csharp/whats-new/csharp-version-history#c-version-70"
},
{
"source_path": "docs/csharp/tutorials/exploration/csharp-7.yml",
@@ -3674,7 +3674,7 @@
},
{
"source_path": "docs/csharp/type-system.md",
- "redirect_url": "/dotnet/csharp/programming-guide/types/index"
+ "redirect_url": "/dotnet/csharp/fundamentals/types"
},
{
"source_path": "docs/csharp/walkthroughs.md",
@@ -4940,7 +4940,7 @@
},
{
"source_path": "docs/framework/deployment/windows/7.md",
- "redirect_url": "/dotnet/framework/install/on-windows-7"
+ "redirect_url": "/previous-versions/dotnet/framework/install/on-windows-7"
},
{
"source_path": "docs/framework/deployment/windows/8.md",
@@ -4960,11 +4960,11 @@
},
{
"source_path": "docs/framework/deployment/windows/vista.md",
- "redirect_url": "/dotnet/framework/install/on-windows-vista"
+ "redirect_url": "/previous-versions/dotnet/framework/install/on-windows-vista"
},
{
"source_path": "docs/framework/deployment/windows/xp.md",
- "redirect_url": "/dotnet/framework/install/on-windows-xp"
+ "redirect_url": "/previous-versions/dotnet/framework/install/on-windows-xp"
},
{
"source_path": "docs/framework/docker/aspnetmvc.md",
@@ -13000,7 +13000,7 @@
},
{
"source_path": "docs/fsharp/async.md",
- "redirect_url": "/dotnet/fsharp/tutorials/asynchronous-and-concurrent-programming/async"
+ "redirect_url": "/dotnet/fsharp/tutorials/async"
},
{
"source_path": "docs/fsharp/language-reference/asynchronous-workflows.md",
@@ -13509,27 +13509,27 @@
},
{
"source_path": "docs/standard/cross-platform/app-resources-for-libraries-that-target-multiple-platforms.md",
- "redirect_url": "/dotnet/framework/cross-platform/app-resources-for-libraries-that-target-multiple-platforms"
+ "redirect_url": "/previous-versions/dotnet/framework/cross-platform/app-resources-for-libraries-that-target-multiple-platforms"
},
{
"source_path": "docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md",
- "redirect_url": "/dotnet/framework/cross-platform/portable-class-library"
+ "redirect_url": "/previous-versions/dotnet/framework/cross-platform/portable-class-library"
},
{
"source_path": "docs/standard/cross-platform/index.md",
- "redirect_url": "/dotnet/framework/cross-platform/index"
+ "redirect_url": "/previous-versions/dotnet/framework/cross-platform/index"
},
{
"source_path": "docs/standard/cross-platform/passing-a-uri-to-the-windows-runtime.md",
- "redirect_url": "/dotnet/framework/cross-platform/passing-a-uri-to-the-windows-runtime"
+ "redirect_url": "/previous-versions/dotnet/framework/cross-platform/passing-a-uri-to-the-windows-runtime"
},
{
"source_path": "docs/standard/cross-platform/support-for-windows-store-apps-and-windows-runtime.md",
- "redirect_url": "/dotnet/framework/cross-platform/support-for-windows-store-apps-and-windows-runtime"
+ "redirect_url": "/previous-versions/dotnet/framework/cross-platform/support-for-windows-store-apps-and-windows-runtime"
},
{
"source_path": "docs/standard/cross-platform/using-portable-class-library-with-model-view-view-model.md",
- "redirect_url": "/dotnet/framework/cross-platform/using-portable-class-library-with-model-view-view-model"
+ "redirect_url": "/previous-versions/dotnet/framework/cross-platform/using-portable-class-library-with-model-view-view-model"
},
{
"source_path": "docs/standard/cross-platform/windowsruntimestreamextensions-asrandomaccessstream-method.md",
@@ -15192,7 +15192,7 @@
},
{
"source_path": "docs/standard/globalization-localization/culture-insensitive-string-operations.md",
- "redirect_url": "/dotnet/core/extensions/culture-insensitive-string-operations",
+ "redirect_url": "/dotnet/core/extensions/performing-culture-insensitive-string-operations",
"redirect_document_id": true
},
{
@@ -15217,8 +15217,7 @@
},
{
"source_path": "docs/standard/globalization-localization/performing-culture-insensitive-case-changes.md",
- "redirect_url": "/dotnet/core/extensions/performing-culture-insensitive-case-changes",
- "redirect_document_id": true
+ "redirect_url": "/dotnet/core/extensions/performing-culture-insensitive-case-changes"
},
{
"source_path": "docs/standard/globalization-localization/performing-culture-insensitive-string-comparisons.md",
@@ -15237,8 +15236,7 @@
},
{
"source_path": "docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md",
- "redirect_url": "/dotnet/core/extensions/performing-culture-insensitive-string-operations",
- "redirect_document_id": true
+ "redirect_url": "/dotnet/core/extensions/performing-culture-insensitive-string-operations"
},
{
"source_path": "docs/standard/globalization-localization/localization.md",
From e09248c647c30a6316880ce02be2713a1508df9a Mon Sep 17 00:00:00 2001
From: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Date: Fri, 19 Nov 2021 10:06:48 -0800
Subject: [PATCH 5/8] update view= links from version 5 to 6 (#27159)
---
.../more-migration-scenarios.md | 2 +-
.../globalization/6.0/culture-creation-invariant-mode.md | 4 ++--
docs/core/compatibility/winforms.md | 2 +-
docs/core/porting/index.md | 8 ++++----
docs/core/porting/upgrade-assistant-aspnetmvc.md | 4 ++--
docs/core/porting/windows-compat-pack.md | 4 ++--
docs/core/whats-new/dotnet-core-3-0.md | 2 +-
docs/fundamentals/toc.yml | 4 ++--
.../serialization/system-text-json-configure-options.md | 2 +-
9 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/docs/architecture/porting-existing-aspnet-apps/more-migration-scenarios.md b/docs/architecture/porting-existing-aspnet-apps/more-migration-scenarios.md
index d4d433eb3c522..13e421576aaf1 100644
--- a/docs/architecture/porting-existing-aspnet-apps/more-migration-scenarios.md
+++ b/docs/architecture/porting-existing-aspnet-apps/more-migration-scenarios.md
@@ -375,7 +375,7 @@ In ASP.NET Core, there are three built-in ways to enable CORS:
- [Configured via policy](/aspnet/core/security/cors?#cors-with-named-policy-and-middleware) in `ConfigureServices`
- Enabled with [endpoint routing](/aspnet/core/security/cors?#enable-cors-with-endpoint-routing)
-- Enabled with the [`EnableCors` attribute](/aspnet/core/security/cors?view=aspnetcore-5.0#enable-cors-with-attributes&preserve-view=false)
+- Enabled with the [`EnableCors` attribute](/aspnet/core/security/cors#enable-cors-with-attributes)
Each of these approaches is covered in detail in the docs, which are linked from the above options. Which one you choose will largely depend on how your existing app supports CORS. If the app uses attributes, you can probably migrate to use the `EnableCors` attribute most easily. If your app uses filters, you could continue using that approach (though it's not the typical approach used in ASP.NET Core), or migrate to use attributes or policies. Endpoint routing is a relatively new feature introduced with ASP.NET Core 3 and as such it doesn't have a close analog in ASP.NET MVC 5 or ASP.NET Web API 2 apps.
diff --git a/docs/core/compatibility/globalization/6.0/culture-creation-invariant-mode.md b/docs/core/compatibility/globalization/6.0/culture-creation-invariant-mode.md
index b9c5419d43ff2..066756f89f70b 100644
--- a/docs/core/compatibility/globalization/6.0/culture-creation-invariant-mode.md
+++ b/docs/core/compatibility/globalization/6.0/culture-creation-invariant-mode.md
@@ -7,7 +7,7 @@ ms.date: 07/23/2021
This breaking change affects *globalization-invariant mode* in two ways:
-- Previously, .NET allowed any culture to be created in globalization-invariant mode, as long as the culture name conformed to [BCP-47](https://tools.ietf.org/rfc/bcp/bcp47.txt). However, [the invariant culture](/dotnet/api/system.globalization.cultureinfo?view=net-5.0#invariant-neutral-and-specific-cultures&preserve-view=false) data was used instead of the real culture data. Starting in .NET 6, an exception is thrown if you create any culture other than the invariant culture in globalization-invariant mode.
+- Previously, .NET allowed any culture to be created in globalization-invariant mode, as long as the culture name conformed to [BCP-47](https://tools.ietf.org/rfc/bcp/bcp47.txt). However, [the invariant culture](/dotnet/api/system.globalization.cultureinfo#invariant-neutral-and-specific-cultures) data was used instead of the real culture data. Starting in .NET 6, an exception is thrown if you create any culture other than the invariant culture in globalization-invariant mode.
- Previously, globalization-invariant mode only supported case mapping for ASCII characters. Starting in .NET 6, globalization-invariant mode provides full case-mapping support for all Unicode-defined characters. Case mapping is used in operations such as string comparisons, string searches, and upper or lower casing strings.
[Globalization-invariant mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md) is used for apps that don't required any globalization support. That is, the app runs without access to culture-specific data and behavior. Globalization-invariant mode is enabled by default on some Docker containers, for example, Alpine containers.
@@ -59,4 +59,4 @@ In most cases, no action is needed. However, if you desire the previous culture-
## See also
- [.NET globalization invariant mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md)
-- [Invariant, neutral, and specific cultures](/dotnet/api/system.globalization.cultureinfo?view=net-5.0#invariant-neutral-and-specific-cultures&preserve-view=false)
+- [Invariant, neutral, and specific cultures](/dotnet/api/system.globalization.cultureinfo#invariant-neutral-and-specific-cultures)
diff --git a/docs/core/compatibility/winforms.md b/docs/core/compatibility/winforms.md
index fba4717edf82b..24d8699d88c8e 100644
--- a/docs/core/compatibility/winforms.md
+++ b/docs/core/compatibility/winforms.md
@@ -88,4 +88,4 @@ The following breaking changes are documented on this page:
## See also
-- [Port a Windows Forms app to .NET Core](/dotnet/desktop/winforms/migration/?view=netdesktop-5.0&preserve-view=true)
+- [Port a Windows Forms app to .NET Core](/dotnet/desktop/winforms/migration/?view=netdesktop-6.0&preserve-view=true)
diff --git a/docs/core/porting/index.md b/docs/core/porting/index.md
index fabe39b34e0cd..093b1d0df231b 100644
--- a/docs/core/porting/index.md
+++ b/docs/core/porting/index.md
@@ -56,8 +56,8 @@ Consider the following dependencies before you migrate a Windows Forms or WPF ap
For tutorials on migrating your desktop application to .NET 5, see one of the following articles:
-- [Migrate .NET Framework WPF apps to .NET](/dotnet/desktop/wpf/migration/convert-project-from-net-framework?view=netdesktop-5.0&preserve-view=true)
-- [Migrate .NET Framework Windows Forms apps to .NET](/dotnet/desktop/winforms/migration/?view=netdesktop-5.0&preserve-view=true)
+- [Migrate .NET Framework WPF apps to .NET](/dotnet/desktop/wpf/migration/convert-project-from-net-framework?view=netdesktop-6.0&preserve-view=true)
+- [Migrate .NET Framework Windows Forms apps to .NET](/dotnet/desktop/winforms/migration/?view=netdesktop-6.0&preserve-view=true)
## Windows-specific APIs
@@ -156,6 +156,6 @@ When porting your application to .NET, consider the following suggestions in ord
- [Overview of the .NET Upgrade Assistant](upgrade-assistant-overview.md)
- [ASP.NET to ASP.NET Core migration](/aspnet/core/migration/proper-to-2x)
-- [Migrate .NET Framework WPF apps to .NET](/dotnet/desktop/wpf/migration/convert-project-from-net-framework?view=netdesktop-5.0&preserve-view=true)
-- [Migrate .NET Framework Windows Forms apps to .NET](/dotnet/desktop/winforms/migration/?view=netdesktop-5.0&preserve-view=true)
+- [Migrate .NET Framework WPF apps to .NET](/dotnet/desktop/wpf/migration/convert-project-from-net-framework?view=netdesktop-6.0&preserve-view=true)
+- [Migrate .NET Framework Windows Forms apps to .NET](/dotnet/desktop/winforms/migration/?view=netdesktop-6.0&preserve-view=true)
- [.NET 5 vs. .NET Framework for server apps](../../standard/choosing-core-framework-server.md)
diff --git a/docs/core/porting/upgrade-assistant-aspnetmvc.md b/docs/core/porting/upgrade-assistant-aspnetmvc.md
index efe31a89f4200..841ea3f44abd9 100644
--- a/docs/core/porting/upgrade-assistant-aspnetmvc.md
+++ b/docs/core/porting/upgrade-assistant-aspnetmvc.md
@@ -107,7 +107,7 @@ Once this process has completed, open the project file and review it. Look for s
```
-Static files that should be served by the web server should be moved to an appropriate folder within a root level folder named `wwwroot`. See [Static files in ASP.NET Core](/aspnet/core/fundamentals/static-files?view=aspnetcore-5.0&preserve-view=true) for details. Once the files have been moved, the `` elements in the project file corresponding to these files can be deleted. In fact, all `` elements and their containing groups can be removed. Also, any `` to a client-side library like `bootstrap` or `jQuery` should be removed.
+Static files that should be served by the web server should be moved to an appropriate folder within a root level folder named `wwwroot`. See [Static files in ASP.NET Core](/aspnet/core/fundamentals/static-files) for details. Once the files have been moved, the `` elements in the project file corresponding to these files can be deleted. In fact, all `` elements and their containing groups can be removed. Also, any `` to a client-side library like `bootstrap` or `jQuery` should be removed.
By default, the project will be converted as a class library. Change the first line's `Sdk` attribute to `Microsoft.NET.Sdk.Web` and set the `` to `net5.0`. Compile the project. At this point, the number of errors should be fairly small. When porting a new ASP.NET 4.6.1 MVC project, the remaining errors refer to files in the `App_Start` folder:
@@ -117,7 +117,7 @@ By default, the project will be converted as a class library. Change the first l
These files, and the entire `App_Start` folder, can be deleted. Likewise, the `Global.asax` and `Global.asax.cs` files can be removed.
-At this point the only errors that remain are related to bundling. There are [several ways to configure bundling and minification in ASP.NET Core](/aspnet/core/migration/mvc?view=aspnetcore-5.0&preserve-view=true#configure-bundling-and-minification). Choose whatever makes the most sense for your project.
+At this point the only errors that remain are related to bundling. There are [several ways to configure bundling and minification in ASP.NET Core](/aspnet/core/migration/mvc#configure-bundling-and-minification). Choose whatever makes the most sense for your project.
## Troubleshooting tips
diff --git a/docs/core/porting/windows-compat-pack.md b/docs/core/porting/windows-compat-pack.md
index fae46772561a5..f14d43f260737 100644
--- a/docs/core/porting/windows-compat-pack.md
+++ b/docs/core/porting/windows-compat-pack.md
@@ -74,5 +74,5 @@ For a demo, check out the [Channel 9 video of the Windows Compatibility Pack](ht
- [Overview of porting from .NET Framework to .NET](index.md)
- [ASP.NET to ASP.NET Core migration](/aspnet/core/migration/proper-to-2x)
-- [Migrate .NET Framework WPF apps to .NET](/dotnet/desktop/wpf/migration/convert-project-from-net-framework?view=netdesktop-5.0&preserve-view=true)
-- [Migrate .NET Framework Windows Forms apps to .NET](/dotnet/desktop/winforms/migration/?view=netdesktop-5.0&preserve-view=true)
+- [Migrate .NET Framework WPF apps to .NET](/dotnet/desktop/wpf/migration/convert-project-from-net-framework?view=netdesktop-6.0&preserve-view=true)
+- [Migrate .NET Framework Windows Forms apps to .NET](/dotnet/desktop/winforms/migration/?view=netdesktop-6.0&preserve-view=true)
diff --git a/docs/core/whats-new/dotnet-core-3-0.md b/docs/core/whats-new/dotnet-core-3-0.md
index f1025d7d70d51..42831c81a9f6e 100644
--- a/docs/core/whats-new/dotnet-core-3-0.md
+++ b/docs/core/whats-new/dotnet-core-3-0.md
@@ -302,7 +302,7 @@ dotnet new winforms
Visual Studio 2019 adds **New Project** templates for .NET Core 3.0 Windows Forms and WPF.
-For more information about how to port an existing .NET Framework application, see [Port WPF projects](/dotnet/desktop/wpf/migration/convert-project-from-net-framework) and [Port Windows Forms projects](/dotnet/desktop/winforms/migration/?view=netdesktop-5.0&preserve-view=true).
+For more information about how to port an existing .NET Framework application, see [Port WPF projects](/dotnet/desktop/wpf/migration/convert-project-from-net-framework) and [Port Windows Forms projects](/dotnet/desktop/winforms/migration/?view=netdesktop-6.0&preserve-view=true).
#### WinForms high DPI
diff --git a/docs/fundamentals/toc.yml b/docs/fundamentals/toc.yml
index 7348cd7757183..6c0e01b725323 100644
--- a/docs/fundamentals/toc.yml
+++ b/docs/fundamentals/toc.yml
@@ -2821,8 +2821,8 @@ items:
- name: Application Porting Guides
items:
- name: Windows Forms
- href: /dotnet/desktop/winforms/migration/?view=netdesktop-5.0
+ href: /dotnet/desktop/winforms/migration/?view=netdesktop-6.0
- name: Windows Presentation Foundation
- href: /dotnet/desktop/wpf/migration/convert-project-from-net-framework?view=netdesktop-5.0
+ href: /dotnet/desktop/wpf/migration/convert-project-from-net-framework?view=netdesktop-6.0
- name: Port C++/CLI projects
href: ../core/porting/cpp-cli.md
diff --git a/docs/standard/serialization/system-text-json-configure-options.md b/docs/standard/serialization/system-text-json-configure-options.md
index cc350c58d6251..a7049863e97ac 100644
--- a/docs/standard/serialization/system-text-json-configure-options.md
+++ b/docs/standard/serialization/system-text-json-configure-options.md
@@ -55,7 +55,7 @@ Here are the options that have different defaults for web apps:
* =
* =
-There's a [JsonSerializerOptions constructor](xref:System.Text.Json.JsonSerializerOptions.%23ctor(System.Text.Json.JsonSerializerDefaults)?view=net-5.0&preserve-view=true) that lets you create a new instance with the default options that ASP.NET Core uses for web apps, as shown in the following example:
+There's a [JsonSerializerOptions constructor](xref:System.Text.Json.JsonSerializerOptions.%23ctor(System.Text.Json.JsonSerializerDefaults)) that lets you create a new instance with the default options that ASP.NET Core uses for web apps, as shown in the following example:
:::code language="csharp" source="snippets/system-text-json-how-to-5-0/csharp/OptionsDefaults.cs" highlight="24":::
:::code language="vb" source="snippets/system-text-json-how-to-5-0/vb/OptionsDefaults.vb" :::
From 12712b4a6cc29d54cc302aaa06162acff1efcf43 Mon Sep 17 00:00:00 2001
From: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Date: Fri, 19 Nov 2021 10:07:13 -0800
Subject: [PATCH 6/8] Remove unneeded lines from docfx (#27160)
---
docfx.json | 6 ------
1 file changed, 6 deletions(-)
diff --git a/docfx.json b/docfx.json
index f7958c8d77adf..03e08aa75ee16 100644
--- a/docfx.json
+++ b/docfx.json
@@ -81,12 +81,6 @@
"LICENSE.md",
"**/includes/**"
]
- },
- {
- "files": [
- "core/**/*.md",
- "core/**/*.yml"
- ]
}
],
"resource": [
From 78355deefd88e3a6b20ece4189763da34989fbf5 Mon Sep 17 00:00:00 2001
From: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Date: Fri, 19 Nov 2021 10:07:39 -0800
Subject: [PATCH 7/8] Current thread culture -> current culture (#27165)
---
docs/core/extensions/retrieve-resources.md | 2 +-
docs/framework/whats-new/index.md | 4 +-
.../base-types/best-practices-display-data.md | 8 +-
.../base-types/composite-formatting.md | 4 +-
.../custom-date-and-time-format-strings.md | 4 +-
.../custom-numeric-format-strings.md | 2 +-
docs/standard/base-types/formatting-types.md | 4 +-
docs/standard/base-types/parsing-datetime.md | 2 +-
docs/standard/base-types/parsing-numeric.md | 6 +-
.../standard-date-and-time-format-strings.md | 4 +-
.../standard-numeric-format-strings.md | 4 +-
.../cs/Formatting-Overview.csproj | 11 ++
.../cs/Program.cs | 2 +
.../cs/appstandard1.cs | 2 +-
.../cs/composite1.cs | 2 +-
.../cs/composite2.cs | 2 +-
.../cs/culturespecific1.cs | 11 +-
.../cs/culturespecific2.cs | 7 +-
.../cs/culturespecific3.cs | 11 +-
.../cs/culturespecific4.cs | 22 +--
.../cs/custom1.cs | 2 +-
.../cs/default1.cs | 2 +-
.../cs/icustomformatter1.cs | 2 +-
.../cs/iformatprovider1.cs | 2 +-
.../cs/iformattable.cs | 146 ++++++++-------
.../cs/overrides1.cs | 50 ++---
.../cs/precisionspecifier1.cs | 2 +-
.../cs/singlecustom1.cs | 2 +-
.../cs/specifier1.cs | 2 +-
.../cs/standard1.cs | 2 +-
.../cs/telnumber1.cs | 2 +-
.../conceptual.globalization/cs/codepages1.cs | 53 +++---
.../conceptual.globalization/cs/currency1.cs | 4 +-
.../conceptual.globalization/cs/currency2.cs | 8 +-
.../conceptual.globalization/cs/dates1.cs | 4 +-
.../conceptual.globalization/cs/dates2.cs | 4 +-
.../conceptual.globalization/cs/dates3.cs | 4 +-
.../conceptual.globalization/cs/dates4.cs | 4 +-
.../conceptual.globalization/cs/dates5.cs | 4 +-
.../conceptual.globalization/cs/dates6.cs | 4 +-
.../conceptual.globalization/cs/dates8.cs | 4 +-
.../conceptual.globalization/cs/equals1.cs | 4 +-
.../conceptual.globalization/cs/equals2.cs | 4 +-
.../cs/globalization.csproj | 9 +
.../conceptual.globalization/cs/monthname1.cs | 4 +-
.../conceptual.globalization/cs/monthname2.cs | 8 +-
.../conceptual.globalization/cs/numbers1.cs | 4 +-
.../conceptual.globalization/cs/numbers2.cs | 4 +-
.../conceptual.globalization/cs/numbers3.cs | 6 +-
.../conceptual.globalization/cs/search1.cs | 4 +-
.../conceptual.globalization/cs/sort1.cs | 4 +-
.../conceptual.globalization/cs/sortkey1.cs | 4 +-
.../vb/Formatting-Overview.vbproj | 9 +
.../vb/Program.vb | 7 +
.../vb/alias1.vb | 4 +-
.../vb/appstandard1.vb | 177 +++++++++---------
.../vb/composite1.vb | 8 +-
.../vb/composite2.vb | 4 +-
.../vb/culturespecific1.vb | 11 +-
.../vb/culturespecific2.vb | 6 +-
.../vb/culturespecific3.vb | 15 +-
.../vb/culturespecific4.vb | 4 +-
.../vb/custom1.vb | 4 +-
.../vb/default1.vb | 4 +-
.../vb/icustomformatter1.vb | 4 +-
.../vb/iformatprovider1.vb | 6 +-
.../vb/iformattable.vb | 136 +++++++-------
.../vb/overrides1.vb | 6 +-
.../vb/precisionspecifier1.vb | 4 +-
.../vb/singlecustom1.vb | 4 +-
.../vb/specifier1.vb | 4 +-
.../vb/standard1.vb | 4 +-
.../vb/telnumber1.vb | 4 +-
.../conceptual.globalization/vb/currency1.vb | 12 +-
.../conceptual.globalization/vb/currency2.vb | 13 +-
.../conceptual.globalization/vb/dates1.vb | 6 +-
.../conceptual.globalization/vb/dates2.vb | 6 +-
.../conceptual.globalization/vb/dates3.vb | 6 +-
.../conceptual.globalization/vb/dates4.vb | 6 +-
.../conceptual.globalization/vb/dates5.vb | 4 +-
.../conceptual.globalization/vb/dates6.vb | 6 +-
.../conceptual.globalization/vb/dates8.vb | 10 +-
.../conceptual.globalization/vb/equals1.vb | 4 +-
.../conceptual.globalization/vb/equals2.vb | 4 +-
.../vb/globalization.vbproj | 9 +
.../conceptual.globalization/vb/monthname1.vb | 4 +-
.../conceptual.globalization/vb/monthname2.vb | 8 +-
.../conceptual.globalization/vb/numbers1.vb | 8 +-
.../conceptual.globalization/vb/numbers2.vb | 6 +-
.../conceptual.globalization/vb/numbers3.vb | 6 +-
.../conceptual.globalization/vb/search1.vb | 10 +-
.../conceptual.globalization/vb/sort1.vb | 6 +-
.../conceptual.globalization/vb/sortkey1.vb | 6 +-
93 files changed, 544 insertions(+), 497 deletions(-)
create mode 100644 samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/Formatting-Overview.csproj
create mode 100644 samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/Program.cs
create mode 100644 samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/globalization.csproj
create mode 100644 samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/Formatting-Overview.vbproj
create mode 100644 samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/Program.vb
create mode 100644 samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/globalization.vbproj
diff --git a/docs/core/extensions/retrieve-resources.md b/docs/core/extensions/retrieve-resources.md
index b9a025a9316e8..cf4a85fb5e078 100644
--- a/docs/core/extensions/retrieve-resources.md
+++ b/docs/core/extensions/retrieve-resources.md
@@ -31,7 +31,7 @@ When you work with localized resources in .NET apps, you should ideally package
The class provides access to resources at run time. You use the method to retrieve string resources and the or method to retrieve non-string resources. Each method has two overloads:
-- An overload whose single parameter is a string that contains the name of the resource. The method attempts to retrieve that resource for the current thread culture. For more information, see the , , and methods.
+- An overload whose single parameter is a string that contains the name of the resource. The method attempts to retrieve that resource for the current culture. For more information, see the , , and methods.
- An overload that has two parameters: a string containing the name of the resource, and a object that represents the culture whose resource is to be retrieved. If a resource set for that culture cannot be found, the resource manager uses fallback rules to retrieve an appropriate resource. For more information, see the , , and methods.
diff --git a/docs/framework/whats-new/index.md b/docs/framework/whats-new/index.md
index 7f419477077e5..dbe0fc83b3947 100644
--- a/docs/framework/whats-new/index.md
+++ b/docs/framework/whats-new/index.md
@@ -1314,13 +1314,13 @@ The delay in firing touch events has been fixed in .NET Framework 4.6.1. In addi
The spell checker in WPF has been updated on Windows 8.1 and later versions to leverage operating system support for spell-checking additional languages. There is no change in functionality on Windows versions prior to Windows 8.1.
-As in previous versions of .NET Framework, the language for a control ora block is detected by looking for information in the following order:
+As in previous versions of .NET Framework, the language for a control or a block is detected by looking for information in the following order:
- `xml:lang`, if it is present.
- Current input language.
-- Current thread culture.
+- Current culture.
For more information on language support in WPF, see the [WPF blog post on .NET Framework 4.6.1 features](https://devblogs.microsoft.com/wpf/wpf-in-net-4-6-1/).
diff --git a/docs/standard/base-types/best-practices-display-data.md b/docs/standard/base-types/best-practices-display-data.md
index 64fb68bc2c0b7..02c8c54d4d194 100644
--- a/docs/standard/base-types/best-practices-display-data.md
+++ b/docs/standard/base-types/best-practices-display-data.md
@@ -13,9 +13,9 @@ This article examines how formatted data, such as numeric data and date-and-time
When you develop with .NET, use culture-sensitive formatting to display non-string data, such as numbers and dates, in a user interface. Use formatting with the [invariant culture](xref:System.Globalization.CultureInfo.InvariantCulture) to persist non-string data in string form. Do not use culture-sensitive formatting to persist numeric or date-and-time data in string form.
-## Displaying formatted data
+## Display formatted data
-When you display non-string data such as numbers and dates and times to users, format them by using the user's cultural settings. By default, the following all use the current thread culture in formatting operations:
+When you display non-string data such as numbers and dates and times to users, format them by using the user's cultural settings. By default, the following all use the current culture in formatting operations:
- Interpolated strings supported by the [C#](../../csharp/language-reference/tokens/interpolated.md) and [Visual Basic](../../visual-basic/programming-guide/language-features/strings/interpolated-strings.md) compilers.
- String concatenation operations that use the [C#](../../csharp/language-reference/operators/addition-operator.md#string-concatenation) or [Visual Basic](../../visual-basic/programming-guide/language-features/operators-and-expressions/concatenation-operators.md) concatenation operators or that call the method directly.
@@ -41,7 +41,7 @@ To explicitly specify that a string should be formatted by using the conventions
[!code-csharp[String interpolation](./snippets/best-practices-strings/csharp/formattable/Program.cs)]
[!code-vb[String interpolation](./snippets/best-practices-strings/vb/formattable/Program.vb)]
-## Persisting formatted data
+## Persist formatted data
You can persist non-string data either as binary data or as formatted data. If you choose to save it as formatted data, you should call a formatting method overload that includes a `provider` parameter and pass it the property. The invariant culture provides a consistent format for formatted data that is independent of culture and machine. In contrast, persisting data that is formatted by using cultures other than the invariant culture has a number of limitations:
@@ -49,7 +49,7 @@ You can persist non-string data either as binary data or as formatted data. If y
- The properties of a culture on a specific computer can differ from standard values. At any time, a user can customize culture-sensitive display settings. Because of this, formatted data that is saved on a system may not be readable after the user customizes cultural settings. The portability of formatted data across computers is likely to be even more limited.
- International, regional, or national standards that govern the formatting of numbers or dates and times change over time, and these changes are incorporated into Windows operating system updates. When formatting conventions change, data that was formatted by using the previous conventions may become unreadable.
-The following example illustrates the limited portability that results from using culture-sensitive formatting to persist data. The example saves an array of date and time values to a file. These are formatted by using the conventions of the English (United States) culture. After the application changes the current thread culture to French (Switzerland), it tries to read the saved values by using the formatting conventions of the current culture. The attempt to read two of the data items throws a exception, and the array of dates now contains two incorrect elements that are equal to .
+The following example illustrates the limited portability that results from using culture-sensitive formatting to persist data. The example saves an array of date and time values to a file. These are formatted by using the conventions of the English (United States) culture. After the application changes the current culture to French (Switzerland), it tries to read the saved values by using the formatting conventions of the current culture. The attempt to read two of the data items throws a exception, and the array of dates now contains two incorrect elements that are equal to .
[!code-csharp[Conceptual.Strings.BestPractices#21](~/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.bestpractices/cs/persistence.cs#21)]
[!code-vb[Conceptual.Strings.BestPractices#21](~/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.strings.bestpractices/vb/persistence.vb#21)]
diff --git a/docs/standard/base-types/composite-formatting.md b/docs/standard/base-types/composite-formatting.md
index 75db24998acc9..82a48568cb5c1 100644
--- a/docs/standard/base-types/composite-formatting.md
+++ b/docs/standard/base-types/composite-formatting.md
@@ -126,9 +126,9 @@ The composite formatting feature is supported by methods such as the following:
3. If the value implements the interface, the interface's method is called. The method is passed the *formatString* value, if one is present in the format item, or `null` if it's not. The argument is determined as follows:
- - For a numeric value, if a composite formatting method with a non-null argument is called, the runtime requests a object from its method. If it's unable to supply one, if the value of the argument is `null`, or if the composite formatting method doesn't have an parameter, the object for the current thread culture is used.
+ - For a numeric value, if a composite formatting method with a non-null argument is called, the runtime requests a object from its method. If it's unable to supply one, if the value of the argument is `null`, or if the composite formatting method doesn't have an parameter, the object for the current culture is used.
- - For a date and time value, if a composite formatting method with a non-null argument is called, the runtime requests a object from its method. If it's unable to supply one, if the value of the argument is `null`, or if the composite formatting method doesn't have an parameter, the object for the current thread culture is used.
+ - For a date and time value, if a composite formatting method with a non-null argument is called, the runtime requests a object from its method. If it's unable to supply one, if the value of the argument is `null`, or if the composite formatting method doesn't have an parameter, the object for the current culture is used.
- For objects of other types, if a composite formatting method is called with an argument, its value is passed directly to the implementation. Otherwise, `null` is passed to the implementation.
diff --git a/docs/standard/base-types/custom-date-and-time-format-strings.md b/docs/standard/base-types/custom-date-and-time-format-strings.md
index 9e8ec0272b619..3dd4221ac4872 100644
--- a/docs/standard/base-types/custom-date-and-time-format-strings.md
+++ b/docs/standard/base-types/custom-date-and-time-format-strings.md
@@ -720,13 +720,13 @@ The following example uses the escape character to prevent the formatting operat
### Control Panel settings
-The **Regional and Language Options** settings in Control Panel influence the result string produced by a formatting operation that includes many of the custom date and time format specifiers. These settings are used to initialize the object associated with the current thread culture, which provides values used to govern formatting. Computers that use different settings generate different result strings.
+The **Regional and Language Options** settings in Control Panel influence the result string produced by a formatting operation that includes many of the custom date and time format specifiers. These settings are used to initialize the object associated with the current culture, which provides values used to govern formatting. Computers that use different settings generate different result strings.
In addition, if you use the constructor to instantiate a new object that represents the same culture as the current system culture, any customizations established by the **Regional and Language Options** item in Control Panel will be applied to the new object. You can use the constructor to create a object that doesn't reflect a system's customizations.
### DateTimeFormatInfo properties
-Formatting is influenced by properties of the current object, which is provided implicitly by the current thread culture or explicitly by the parameter of the method that invokes formatting. For the parameter, you should specify a object, which represents a culture, or a object.
+Formatting is influenced by properties of the current object, which is provided implicitly by the current culture or explicitly by the parameter of the method that invokes formatting. For the parameter, you should specify a object, which represents a culture, or a object.
The result string produced by many of the custom date and time format specifiers also depends on properties of the current object. Your application can change the result produced by some custom date and time format specifiers by changing the corresponding property. For example, the "ddd" format specifier adds an abbreviated weekday name found in the string array to the result string. Similarly, the "MMMM" format specifier adds a full month name found in the string array to the result string.
diff --git a/docs/standard/base-types/custom-numeric-format-strings.md b/docs/standard/base-types/custom-numeric-format-strings.md
index 013ef77d4700c..64eeecd67d04d 100644
--- a/docs/standard/base-types/custom-numeric-format-strings.md
+++ b/docs/standard/base-types/custom-numeric-format-strings.md
@@ -258,7 +258,7 @@ Regardless of the format string, if the value of a , object associated with the current thread culture, and the current thread culture provides values used to govern formatting. Computers that use different settings generate different result strings.
+The settings in the **Regional and Language Options** item in Control Panel influence the result string produced by a formatting operation. Those settings are used to initialize the object associated with the current culture, and the current culture provides values used to govern formatting. Computers that use different settings generate different result strings.
In addition, if you use the constructor to instantiate a new object that represents the same culture as the current system culture, any customizations established by the **Regional and Language Options** item in Control Panel will be applied to the new object. You can use the constructor to create a object that does not reflect a system's customizations.
diff --git a/docs/standard/base-types/formatting-types.md b/docs/standard/base-types/formatting-types.md
index 9e056f825e167..94be3cab32c42 100644
--- a/docs/standard/base-types/formatting-types.md
+++ b/docs/standard/base-types/formatting-types.md
@@ -251,7 +251,7 @@ You can also implement your own format provider to replace any one of these clas
### Culture-sensitive formatting of numeric values
-By default, the formatting of numeric values is culture-sensitive. If you do not specify a culture when you call a formatting method, the formatting conventions of the current thread culture are used. This is illustrated in the following example, which changes the current thread culture four times and then calls the method. In each case, the result string reflects the formatting conventions of the current culture. This is because the `ToString` and `ToString(String)` methods wrap calls to each numeric type's `ToString(String, IFormatProvider)` method.
+By default, the formatting of numeric values is culture-sensitive. If you do not specify a culture when you call a formatting method, the formatting conventions of the current culture are used. This is illustrated in the following example, which changes the current culture four times and then calls the method. In each case, the result string reflects the formatting conventions of the current culture. This is because the `ToString` and `ToString(String)` methods wrap calls to each numeric type's `ToString(String, IFormatProvider)` method.
[!code-csharp[Conceptual.Formatting.Overview#19](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific3.cs#19)]
[!code-vb[Conceptual.Formatting.Overview#19](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific3.vb#19)]
@@ -269,7 +269,7 @@ The following example uses objects
### Culture-sensitive formatting of date and time values
-By default, the formatting of date and time values is culture-sensitive. If you do not specify a culture when you call a formatting method, the formatting conventions of the current thread culture are used. This is illustrated in the following example, which changes the current thread culture four times and then calls the method. In each case, the result string reflects the formatting conventions of the current culture. This is because the , , , and methods wrap calls to the and methods.
+By default, the formatting of date and time values is culture-sensitive. If you do not specify a culture when you call a formatting method, the formatting conventions of the current culture are used. This is illustrated in the following example, which changes the current culture four times and then calls the method. In each case, the result string reflects the formatting conventions of the current culture. This is because the , , , and methods wrap calls to the and methods.
[!code-csharp[Conceptual.Formatting.Overview#17](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific1.cs#17)]
[!code-vb[Conceptual.Formatting.Overview#17](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific1.vb#17)]
diff --git a/docs/standard/base-types/parsing-datetime.md b/docs/standard/base-types/parsing-datetime.md
index 1f9cf6ba7e362..8d1738cf912af 100644
--- a/docs/standard/base-types/parsing-datetime.md
+++ b/docs/standard/base-types/parsing-datetime.md
@@ -24,7 +24,7 @@ Parsing strings to convert them to objects requires you t
The and methods convert many common representations of a date and time. The and methods convert a string representation that conforms to the pattern specified by a date and time format string. (See the articles on [standard date and time format strings](standard-date-and-time-format-strings.md) and [custom date and time format strings](custom-date-and-time-format-strings.md) for details.)
-The current object provides more control over how text should be interpreted as a date and time. Properties of a describe the date and time separators, and the names of months, days, and eras, and the format for the "AM" and "PM" designations. The current thread culture provides a that represents the current culture. If you want a specific culture or custom settings, you specify the parameter of a parsing method. For the parameter, specify a object, which represents a culture, or a object.
+The current object provides more control over how text should be interpreted as a date and time. Properties of a describe the date and time separators, the names of months, days, and eras, and the format for the "AM" and "PM" designations. The returned by has a property that represents the current culture. If you want a specific culture or custom settings, you specify the parameter of a parsing method. For the parameter, specify a object, which represents a culture, or a object.
The text representing a date or time may be missing some information. For example, most people would assume the date "March 12" represents the current year. Similarly, "March 2018" represents the month of March in the year 2018. Text representing time often does only includes hours, minutes, and an AM/PM designation. Parsing methods handle this missing information by using reasonable defaults:
diff --git a/docs/standard/base-types/parsing-numeric.md b/docs/standard/base-types/parsing-numeric.md
index 514ce8dddc9b8..1d89a3a81220d 100644
--- a/docs/standard/base-types/parsing-numeric.md
+++ b/docs/standard/base-types/parsing-numeric.md
@@ -12,13 +12,13 @@ helpviewer_keywords:
- "base types, parsing strings"
ms.assetid: e39324ee-72e5-42d4-a80d-bf3ee7fc6c59
---
-# Parsing Numeric Strings in NET
+# Parsing numeric strings in .NET
All numeric types have two static parsing methods, `Parse` and `TryParse`, that you can use to convert the string representation of a number into a numeric type. These methods enable you to parse strings that were produced by using the format strings documented in [Standard Numeric Format Strings](standard-numeric-format-strings.md) and [Custom Numeric Format Strings](custom-numeric-format-strings.md). By default, the `Parse` and `TryParse` methods can successfully convert strings that contain integral decimal digits only to integer values. They can successfully convert strings that contain integral and fractional decimal digits, group separators, and a decimal separator to floating-point values. The `Parse` method throws an exception if the operation fails, whereas the `TryParse` method returns `false`.
-## Parsing and Format Providers
+## Parsing and format providers
- Typically, the string representations of numeric values differ by culture. Elements of numeric strings such as currency symbols, group (or thousands) separators, and decimal separators all vary by culture. Parsing methods either implicitly or explicitly use a format provider that recognizes these culture-specific variations. If no format provider is specified in a call to the `Parse` or `TryParse` method, the format provider associated with the current thread culture (the object returned by the property) is used.
+ Typically, the string representations of numeric values differ by culture. Elements of numeric strings, such as currency symbols, group (or thousands) separators, and decimal separators, all vary by culture. Parsing methods either implicitly or explicitly use a format provider that recognizes these culture-specific variations. If no format provider is specified in a call to the `Parse` or `TryParse` method, the format provider associated with the current culture (the object returned by the property) is used.
A format provider is represented by an implementation. This interface has a single member, the method, whose single parameter is a object that represents the type to be formatted. This method returns the object that provides formatting information. .NET supports the following two implementations for parsing numeric strings:
diff --git a/docs/standard/base-types/standard-date-and-time-format-strings.md b/docs/standard/base-types/standard-date-and-time-format-strings.md
index e43933d12f0dc..095af3a67e512 100644
--- a/docs/standard/base-types/standard-date-and-time-format-strings.md
+++ b/docs/standard/base-types/standard-date-and-time-format-strings.md
@@ -466,13 +466,13 @@ The following example uses the "y" format specifier to display a date and time v
## Control Panel settings
-In Windows, the settings in the **Regional and Language Options** item in Control Panel influence the result string produced by a formatting operation. These settings are used to initialize the object associated with the current thread culture, which provides values used to govern formatting. Computers that use different settings generate different result strings.
+In Windows, the settings in the **Regional and Language Options** item in Control Panel influence the result string produced by a formatting operation. These settings are used to initialize the object associated with the current culture, which provides values used to govern formatting. Computers that use different settings generate different result strings.
In addition, if you use the constructor to instantiate a new object that represents the same culture as the current system culture, any customizations established by the **Regional and Language Options** item in Control Panel will be applied to the new object. You can use the constructor to create a object that does not reflect a system's customizations.
## DateTimeFormatInfo properties
-Formatting is influenced by properties of the current object, which is provided implicitly by the current thread culture or explicitly by the parameter of the method that invokes formatting. For the parameter, your application should specify a object, which represents a culture, or a object, which represents a particular culture's date and time formatting conventions. Many of the standard date and time format specifiers are aliases for formatting patterns defined by properties of the current object. Your application can change the result produced by some standard date and time format specifiers by changing the corresponding date and time format patterns of the corresponding property.
+Formatting is influenced by properties of the current object, which is provided implicitly by the current culture or explicitly by the parameter of the method that invokes formatting. For the parameter, your application should specify a object, which represents a culture, or a object, which represents a particular culture's date and time formatting conventions. Many of the standard date and time format specifiers are aliases for formatting patterns defined by properties of the current object. Your application can change the result produced by some standard date and time format specifiers by changing the corresponding date and time format patterns of the corresponding property.
## See also
diff --git a/docs/standard/base-types/standard-numeric-format-strings.md b/docs/standard/base-types/standard-numeric-format-strings.md
index d2b1e12b25b40..0c68e57fcb32c 100644
--- a/docs/standard/base-types/standard-numeric-format-strings.md
+++ b/docs/standard/base-types/standard-numeric-format-strings.md
@@ -332,13 +332,13 @@ This section contains additional information about using standard numeric format
### Control Panel settings
-The settings in the **Regional and Language Options** item in Control Panel influence the result string produced by a formatting operation. Those settings are used to initialize the object associated with the current thread culture, which provides values used to govern formatting. Computers that use different settings generate different result strings.
+The settings in the **Regional and Language Options** item in Control Panel influence the result string produced by a formatting operation. Those settings are used to initialize the object associated with the current culture, which provides values used to govern formatting. Computers that use different settings generate different result strings.
In addition, if the constructor is used to instantiate a new object that represents the same culture as the current system culture, any customizations established by the **Regional and Language Options** item in Control Panel will be applied to the new object. You can use the constructor to create a object that does not reflect a system's customizations.
### NumberFormatInfo properties
-Formatting is influenced by the properties of the current object, which is provided implicitly by the current thread culture or explicitly by the parameter of the method that invokes formatting. Specify a or object for that parameter.
+Formatting is influenced by the properties of the current object, which is provided implicitly by the current culture or explicitly by the parameter of the method that invokes formatting. Specify a or object for that parameter.
> [!NOTE]
> For information about customizing the patterns or strings used in formatting numeric values, see the class topic.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/Formatting-Overview.csproj b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/Formatting-Overview.csproj
new file mode 100644
index 0000000000000..9df5e4bd9c172
--- /dev/null
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/Formatting-Overview.csproj
@@ -0,0 +1,11 @@
+
+
+
+ Exe
+ net6.0
+ Formatting_Overview
+ enable
+ enable
+
+
+
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/Program.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/Program.cs
new file mode 100644
index 0000000000000..44e0ae4273883
--- /dev/null
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/Program.cs
@@ -0,0 +1,2 @@
+//HotAndCold2.Example12.Main();
+Example7.Main();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/appstandard1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/appstandard1.cs
index d9c5250ffe2bb..f842297dc08c2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/appstandard1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/appstandard1.cs
@@ -56,7 +56,7 @@ public string ToString(string format)
}
}
-public class Example
+public class Example1
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/composite1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/composite1.cs
index c6fce4240e07b..2e4b2481248ce 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/composite1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/composite1.cs
@@ -39,7 +39,7 @@ public override string ToString()
}
}
-public class Example
+public class Example2
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/composite2.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/composite2.cs
index 1ab168d72a995..b3a28790a7ba8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/composite2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/composite2.cs
@@ -1,6 +1,6 @@
using System;
-public class Example
+public class Example3
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific1.cs
index 2c2b1f5d5d811..a0823b26cd698 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific1.cs
@@ -1,9 +1,7 @@
//
-using System;
using System.Globalization;
-using System.Threading;
-public class Example
+public class Example4
{
public static void Main()
{
@@ -11,10 +9,9 @@ public static void Main()
DateTime dateToFormat = new DateTime(2012, 5, 28, 11, 30, 0);
foreach (var cultureName in cultureNames) {
- // Change the current thread culture.
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(cultureName);
- Console.WriteLine("The current culture is {0}",
- Thread.CurrentThread.CurrentCulture.Name);
+ // Change the current culture.
+ CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture(cultureName);
+ Console.WriteLine($"The current culture is {CultureInfo.CurrentCulture.Name}");
Console.WriteLine(dateToFormat.ToString("F"));
Console.WriteLine();
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific2.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific2.cs
index be6343dffbf03..e8571f4f8247d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific2.cs
@@ -1,17 +1,16 @@
//
-using System;
using System.Globalization;
-public class Example
+public class Example5
{
public static void Main()
{
- DateTime dat1 = new DateTime(2012, 5, 28, 11, 30, 0);
+ DateTime dat1 = new(2012, 5, 28, 11, 30, 0);
string[] cultureNames = { "en-US", "en-GB", "ru", "fr" };
foreach (var name in cultureNames) {
DateTimeFormatInfo dtfi = CultureInfo.CreateSpecificCulture(name).DateTimeFormat;
- Console.WriteLine("{0}: {1}", name, dat1.ToString(dtfi));
+ Console.WriteLine($"{name}: {dat1.ToString(dtfi)}");
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific3.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific3.cs
index f75186b3dcdaf..76a2c9756cef5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific3.cs
@@ -1,9 +1,7 @@
//
-using System;
using System.Globalization;
-using System.Threading;
-public class Example
+public class Example6
{
public static void Main()
{
@@ -11,10 +9,9 @@ public static void Main()
Decimal value = 1043.17m;
foreach (var cultureName in cultureNames) {
- // Change the current thread culture.
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(cultureName);
- Console.WriteLine("The current culture is {0}",
- Thread.CurrentThread.CurrentCulture.Name);
+ // Change the current culture.
+ CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture(cultureName);
+ Console.WriteLine($"The current culture is {CultureInfo.CurrentCulture.Name}");
Console.WriteLine(value.ToString("C2"));
Console.WriteLine();
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific4.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific4.cs
index 1c1c37c5b6101..68c8fef626e2a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/culturespecific4.cs
@@ -1,19 +1,19 @@
//
-using System;
using System.Globalization;
-public class Example
+public class Example7
{
- public static void Main()
- {
- Double value = 1043.62957;
- string[] cultureNames = { "en-US", "en-GB", "ru", "fr" };
+ public static void Main()
+ {
+ double value = 1043.62957;
+ string[] cultureNames = { "en-US", "en-GB", "ru", "fr" };
- foreach (var name in cultureNames) {
- NumberFormatInfo nfi = CultureInfo.CreateSpecificCulture(name).NumberFormat;
- Console.WriteLine("{0,-6} {1}", name + ":", value.ToString("N3", nfi));
- }
- }
+ foreach (string? name in cultureNames)
+ {
+ NumberFormatInfo nfi = CultureInfo.CreateSpecificCulture(name).NumberFormat;
+ Console.WriteLine("{0,-6} {1}", name + ":", value.ToString("N3", nfi));
+ }
+ }
}
// The example displays the following output:
// en-US: 1,043.630
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/custom1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/custom1.cs
index cd7c1cb456d23..311bac776085b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/custom1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/custom1.cs
@@ -1,6 +1,6 @@
using System;
-public class Example
+public class Example8
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/default1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/default1.cs
index 174959ea5ea34..4c8864feae164 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/default1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/default1.cs
@@ -6,7 +6,7 @@ public class Automobile
// No implementation. All members are inherited from Object.
}
-public class Example
+public class Example9
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/icustomformatter1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/icustomformatter1.cs
index 6e7acc241d6de..6637ff5cb65eb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/icustomformatter1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/icustomformatter1.cs
@@ -51,7 +51,7 @@ public string Format(string format, object arg,
//
//
-public class Example
+public class Example10
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/iformatprovider1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/iformatprovider1.cs
index e12e1919c7af4..bfe5fceaf08a3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/iformatprovider1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/iformatprovider1.cs
@@ -2,7 +2,7 @@
using System;
using System.Globalization;
-public class Example
+public class Example18
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/iformattable.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/iformattable.cs
index c3bb65f0b611b..b35828b0ecb40 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/iformattable.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/iformattable.cs
@@ -2,86 +2,90 @@
using System;
using System.Globalization;
-public class Temperature : IFormattable
+namespace HotAndCold
{
- private decimal m_Temp;
- public Temperature(decimal temperature)
- {
- this.m_Temp = temperature;
- }
+ public class Temperature : IFormattable
+ {
+ private decimal m_Temp;
- public decimal Celsius
- {
- get { return this.m_Temp; }
- }
+ public Temperature(decimal temperature)
+ {
+ this.m_Temp = temperature;
+ }
- public decimal Kelvin
- {
- get { return this.m_Temp + 273.15m; }
- }
+ public decimal Celsius
+ {
+ get { return this.m_Temp; }
+ }
- public decimal Fahrenheit
- {
- get { return Math.Round((decimal) this.m_Temp * 9 / 5 + 32, 2); }
- }
+ public decimal Kelvin
+ {
+ get { return this.m_Temp + 273.15m; }
+ }
- public override string ToString()
- {
- return this.ToString("G", null);
- }
+ public decimal Fahrenheit
+ {
+ get { return Math.Round((decimal)this.m_Temp * 9 / 5 + 32, 2); }
+ }
- public string ToString(string format)
- {
- return this.ToString(format, null);
- }
+ public override string ToString()
+ {
+ return this.ToString("G", null);
+ }
- public string ToString(string format, IFormatProvider provider)
- {
- // Handle null or empty arguments.
- if (String.IsNullOrEmpty(format))
- format = "G";
- // Remove any white space and covert to uppercase.
- format = format.Trim().ToUpperInvariant();
+ public string ToString(string format)
+ {
+ return this.ToString(format, null);
+ }
- if (provider == null)
- provider = NumberFormatInfo.CurrentInfo;
+ public string ToString(string format, IFormatProvider provider)
+ {
+ // Handle null or empty arguments.
+ if (String.IsNullOrEmpty(format))
+ format = "G";
+ // Remove any white space and covert to uppercase.
+ format = format.Trim().ToUpperInvariant();
- switch (format)
- {
- // Convert temperature to Fahrenheit and return string.
- case "F":
- return this.Fahrenheit.ToString("N2", provider) + "°F";
- // Convert temperature to Kelvin and return string.
- case "K":
- return this.Kelvin.ToString("N2", provider) + "K";
- // Return temperature in Celsius.
- case "C":
- case "G":
- return this.Celsius.ToString("N2", provider) + "°C";
- default:
- throw new FormatException(String.Format("The '{0}' format string is not supported.", format));
- }
- }
-}
-//
+ if (provider == null)
+ provider = NumberFormatInfo.CurrentInfo;
-//
-public class Example
-{
- public static void Main()
- {
- CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
- Temperature temp = new Temperature(22m);
- Console.WriteLine(Convert.ToString(temp, new CultureInfo("ja-JP")));
- Console.WriteLine("Temperature: {0:K}", temp);
- Console.WriteLine("Temperature: {0:F}", temp);
- Console.WriteLine(String.Format(new CultureInfo("fr-FR"), "Temperature: {0:F}", temp));
- }
+ switch (format)
+ {
+ // Convert temperature to Fahrenheit and return string.
+ case "F":
+ return this.Fahrenheit.ToString("N2", provider) + "°F";
+ // Convert temperature to Kelvin and return string.
+ case "K":
+ return this.Kelvin.ToString("N2", provider) + "K";
+ // Return temperature in Celsius.
+ case "C":
+ case "G":
+ return this.Celsius.ToString("N2", provider) + "°C";
+ default:
+ throw new FormatException(String.Format("The '{0}' format string is not supported.", format));
+ }
+ }
+ }
+ //
+
+ //
+ public class Example11
+ {
+ public static void Main()
+ {
+ CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
+ Temperature temp = new Temperature(22m);
+ Console.WriteLine(Convert.ToString(temp, new CultureInfo("ja-JP")));
+ Console.WriteLine("Temperature: {0:K}", temp);
+ Console.WriteLine("Temperature: {0:F}", temp);
+ Console.WriteLine(String.Format(new CultureInfo("fr-FR"), "Temperature: {0:F}", temp));
+ }
+ }
+ // The example displays the following output:
+ // 22.00°C
+ // Temperature: 295.15K
+ // Temperature: 71.60°F
+ // Temperature: 71,60°F
+ //
}
-// The example displays the following output:
-// 22.00°C
-// Temperature: 295.15K
-// Temperature: 71.60°F
-// Temperature: 71,60°F
-//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/overrides1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/overrides1.cs
index 0e51e38472417..27d550b48be04 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/overrides1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/overrides1.cs
@@ -1,30 +1,30 @@
-//
-using System;
-
-public class Temperature
+namespace HotAndCold2
{
- private decimal temp;
+ //
+ public class Temperature
+ {
+ private decimal temp;
- public Temperature(decimal temperature)
- {
- this.temp = temperature;
- }
+ public Temperature(decimal temperature)
+ {
+ this.temp = temperature;
+ }
- public override string ToString()
- {
- return this.temp.ToString("N1") + "°C";
- }
-}
+ public override string ToString()
+ {
+ return this.temp.ToString("N1") + "°C";
+ }
+ }
-public class Example
-{
- public static void Main()
- {
- Temperature currentTemperature = new Temperature(23.6m);
- Console.WriteLine("The current temperature is " +
- currentTemperature.ToString());
- }
+ public class Example12
+ {
+ public static void Main()
+ {
+ Temperature currentTemperature = new Temperature(23.6m);
+ Console.WriteLine($"The current temperature is {currentTemperature}");
+ }
+ }
+ // The example displays the following output:
+ // The current temperature is 23.6°C.
+ //
}
-// The example displays the following output:
-// The current temperature is 23.6°C.
-//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/precisionspecifier1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/precisionspecifier1.cs
index 5bfe494738a09..f78d77e28efd7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/precisionspecifier1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/precisionspecifier1.cs
@@ -1,6 +1,6 @@
using System;
-public class Example
+public class Example13
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/singlecustom1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/singlecustom1.cs
index 92b00488a0cec..60cfe932e5f95 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/singlecustom1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/singlecustom1.cs
@@ -1,6 +1,6 @@
using System;
-public class Example
+public class Example14
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/specifier1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/specifier1.cs
index 1155638f53ed5..6d0abff660ee2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/specifier1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/specifier1.cs
@@ -1,6 +1,6 @@
using System;
-public class Example
+public class Example15
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/standard1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/standard1.cs
index cf3d10f87cee0..cc332b30ada9e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/standard1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/standard1.cs
@@ -1,6 +1,6 @@
using System;
-public class Example
+public class Example16
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/telnumber1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/telnumber1.cs
index 04cb1214a4105..c7291ae30bc8c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/telnumber1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/telnumber1.cs
@@ -1,7 +1,7 @@
//
using System;
-public class Example
+public class Example17
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/codepages1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/codepages1.cs
index f26f54a9ea632..826802efe0ce6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/codepages1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/codepages1.cs
@@ -5,40 +5,41 @@
public class Example
{
- public static void Main()
- {
- // Represent Greek uppercase characters in code page 737.
- char[] greekChars = { 'Α', 'Β', 'Γ', 'Δ', 'Ε', 'Ζ', 'Η', 'Θ',
+ public static void Main()
+ {
+ // Represent Greek uppercase characters in code page 737.
+ char[] greekChars = { 'Α', 'Β', 'Γ', 'Δ', 'Ε', 'Ζ', 'Η', 'Θ',
'Ι', 'Κ', 'Λ', 'Μ', 'Ν', 'Ξ', 'Ο', 'Π',
'Ρ', 'Σ', 'Τ', 'Υ', 'Φ', 'Χ', 'Ψ', 'Ω' };
- Encoding cp737 = Encoding.GetEncoding(737);
- int nBytes = cp737.GetByteCount(greekChars);
- byte[] bytes737 = new byte[nBytes];
- bytes737 = cp737.GetBytes(greekChars);
- // Write the bytes to a file.
- FileStream fs = new FileStream(@".\\CodePageBytes.dat", FileMode.Create);
- fs.Write(bytes737, 0, bytes737.Length);
- fs.Close();
+ Encoding cp737 = Encoding.GetEncoding(737);
+ int nBytes = cp737.GetByteCount(greekChars);
+ byte[] bytes737 = new byte[nBytes];
+ bytes737 = cp737.GetBytes(greekChars);
+ // Write the bytes to a file.
+ FileStream fs = new FileStream(@".\\CodePageBytes.dat", FileMode.Create);
+ fs.Write(bytes737, 0, bytes737.Length);
+ fs.Close();
- // Retrieve the byte data from the file.
- fs = new FileStream(@".\\CodePageBytes.dat", FileMode.Open);
- byte[] bytes1 = new byte[fs.Length];
- fs.Read(bytes1, 0, (int)fs.Length);
- fs.Close();
+ // Retrieve the byte data from the file.
+ fs = new FileStream(@".\\CodePageBytes.dat", FileMode.Open);
+ byte[] bytes1 = new byte[fs.Length];
+ fs.Read(bytes1, 0, (int)fs.Length);
+ fs.Close();
- // Restore the data on a system whose code page is 737.
- string data = cp737.GetString(bytes1);
- Console.WriteLine(data);
- Console.WriteLine();
+ // Restore the data on a system whose code page is 737.
+ string data = cp737.GetString(bytes1);
+ Console.WriteLine(data);
+ Console.WriteLine();
- // Restore the data on a system whose code page is 1252.
- Encoding cp1252 = Encoding.GetEncoding(1252);
- data = cp1252.GetString(bytes1);
- Console.WriteLine(data);
- }
+ // Restore the data on a system whose code page is 1252.
+ Encoding cp1252 = Encoding.GetEncoding(1252);
+ data = cp1252.GetString(bytes1);
+ Console.WriteLine(data);
+ }
}
// The example displays the following output:
// ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ
// €‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’""•–—
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/currency1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/currency1.cs
index ccb12f9f5b8ee..bf73a95cab9d6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/currency1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/currency1.cs
@@ -4,9 +4,9 @@
using System.IO;
using System.Threading;
-public class Example
+public class Example1
{
- public static void Main()
+ public static void Main1()
{
// Display the currency value.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/currency2.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/currency2.cs
index 1817d555033f2..551d028df9faf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/currency2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/currency2.cs
@@ -5,9 +5,9 @@
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
-public class Example
+public class Example2
{
- public static void Main()
+ public static void Main2()
{
// Display the currency value.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
@@ -23,8 +23,8 @@ public static void Main()
fw.Close();
Console.WriteLine();
- // Change the current thread culture.
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB");
+ // Change the current culture.
+ CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB");
Console.WriteLine("Current Culture: {0}", CultureInfo.CurrentCulture.DisplayName);
// Deserialize the data.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates1.cs
index 0777681ccd47a..d7b0d7e702498 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates1.cs
@@ -3,12 +3,12 @@
using System.Globalization;
using System.Threading;
-public class Example
+public class Example3
{
static DateTime[] dates = { new DateTime(2012, 10, 11, 7, 06, 0),
new DateTime(2012, 10, 11, 18, 19, 0) };
- public static void Main()
+ public static void Main3()
{
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("hr-HR");
ShowDayInfo();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates2.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates2.cs
index 4ac2fb7c07b0e..5e2902c85f1c2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates2.cs
@@ -4,9 +4,9 @@
using System.Globalization;
using System.Threading;
-public class Example
+public class Example4
{
- public static void Main()
+ public static void Main4()
{
// Persist two dates as strings.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates3.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates3.cs
index 26f3aa36dff93..34f620bb7f1d6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates3.cs
@@ -4,9 +4,9 @@
using System.Globalization;
using System.Threading;
-public class Example
+public class Example5
{
- public static void Main()
+ public static void Main5()
{
// Persist two dates as strings.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates4.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates4.cs
index 743bddb9a0a79..7e9017173768d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates4.cs
@@ -3,9 +3,9 @@
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
-public class Example
+public class Example6
{
- public static void Main()
+ public static void Main6()
{
BinaryFormatter formatter = new BinaryFormatter();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates5.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates5.cs
index 8d6b77e81353f..22fa3dfe5d828 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates5.cs
@@ -1,9 +1,9 @@
//
using System;
-public class Example
+public class Example7
{
- public static void Main()
+ public static void Main7()
{
DateTime date1 = DateTime.SpecifyKind(new DateTime(2013, 3, 9, 10, 30, 0),
DateTimeKind.Local);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates6.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates6.cs
index 952e11bc13851..a2cc5c396d43c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates6.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates6.cs
@@ -1,9 +1,9 @@
//
using System;
-public class Example
+public class Example8
{
- public static void Main()
+ public static void Main8()
{
TimeZoneInfo pst = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
DateTime date1 = DateTime.SpecifyKind(new DateTime(2013, 3, 9, 10, 30, 0),
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates8.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates8.cs
index 4304eaec62029..fdbb79b769a00 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates8.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/dates8.cs
@@ -3,9 +3,9 @@
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
-public class Example
+public class Example9
{
- public static void Main()
+ public static void Main9()
{
BinaryFormatter formatter = new BinaryFormatter();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/equals1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/equals1.cs
index e760aa2a42013..68764d747a49a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/equals1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/equals1.cs
@@ -3,9 +3,9 @@
using System.Globalization;
using System.Threading;
-public class Example
+public class Example10
{
- public static void Main()
+ public static void Main10()
{
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("tr-TR");
string uri = @"file:\\c:\users\username\Documents\bio.txt";
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/equals2.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/equals2.cs
index d60982684d31b..aab0dd481417e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/equals2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/equals2.cs
@@ -3,9 +3,9 @@
using System.Globalization;
using System.Threading;
-public class Example
+public class Example11
{
- public static void Main()
+ public static void Main11()
{
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("tr-TR");
string uri = @"file:\\c:\users\username\Documents\bio.txt";
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/globalization.csproj b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/globalization.csproj
new file mode 100644
index 0000000000000..6d847ae5ed328
--- /dev/null
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/globalization.csproj
@@ -0,0 +1,9 @@
+
+
+
+ Exe
+ net6.0
+ Globalization
+
+
+
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/monthname1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/monthname1.cs
index a455d4dbee625..7920f719ab4fb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/monthname1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/monthname1.cs
@@ -1,9 +1,9 @@
//
using System;
-public class Example
+public class Example12
{
- public static void Main()
+ public static void Main12()
{
DateTime midYear = new DateTime(2013, 7, 1);
Console.WriteLine("{0:d} is a {1}.", midYear, GetDayName(midYear));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/monthname2.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/monthname2.cs
index 38f64ae379cb1..f5d441a8120bd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/monthname2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/monthname2.cs
@@ -3,12 +3,12 @@
using System.Globalization;
using System.Threading;
-public class Example
+public class Example13
{
- public static void Main()
+ public static void Main13()
{
- // Set the current thread culture to French (France).
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR");
+ // Set the current culture to French (France).
+ CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR");
DateTime midYear = new DateTime(2013, 7, 1);
Console.WriteLine("{0:d} is a {1}.", midYear, DateUtilities.GetDayName(midYear));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers1.cs
index c62bb28ea2c09..c70d054a951f6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers1.cs
@@ -3,9 +3,9 @@
using System.Globalization;
using System.Threading;
-public class Example
+public class Example14
{
- public static void Main()
+ public static void Main14()
{
DateTime dateForMonth = new DateTime(2013, 1, 1);
double[] temperatures = { 3.4, 3.5, 7.6, 10.4, 14.5, 17.2,
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers2.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers2.cs
index deef7f6fef5cf..45ba5f3650be1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers2.cs
@@ -4,9 +4,9 @@
using System.IO;
using System.Threading;
-public class Example
+public class Example15
{
- public static void Main()
+ public static void Main15()
{
// Create ten random doubles.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers3.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers3.cs
index 9103d9c1aa101..59730f80c9d24 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/numbers3.cs
@@ -5,9 +5,9 @@
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
-public class Example
+public class Example16
{
- public static void Main()
+ public static void Main16()
{
// Create ten random doubles.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
@@ -88,4 +88,4 @@ private static void DisplayRandomNumbers(double[] numbers)
// 83,79498919648816
// 957,31006048494487
// 996,54487892824454
-//
\ No newline at end of file
+//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/search1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/search1.cs
index e31fe7f7158e1..b3da4e6c5809f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/search1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/search1.cs
@@ -3,9 +3,9 @@
using System.Globalization;
using System.Threading;
-public class Example
+public class Example17
{
- public static void Main()
+ public static void Main17()
{
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("pl-PL");
string composite = "\u0041\u0300";
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/sort1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/sort1.cs
index 1e47d3239c562..40d62f77f25ab 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/sort1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/sort1.cs
@@ -3,9 +3,9 @@
using System.Globalization;
using System.Threading;
-public class Example
+public class Example18
{
- public static void Main()
+ public static void Main18()
{
string[] values = { "able", "ångström", "apple", "Æble",
"Windows", "Visual Studio" };
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/sortkey1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/sortkey1.cs
index 6ed75d05cd106..a400ba5aca03f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/sortkey1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.globalization/cs/sortkey1.cs
@@ -15,9 +15,9 @@ public int Compare(string str1, string str2)
}
}
-public class Example
+public class Example19
{
- public static void Main()
+ public static void Main19()
{
string[] values = { "able", "ångström", "apple", "Æble",
"Windows", "Visual Studio" };
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/Formatting-Overview.vbproj b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/Formatting-Overview.vbproj
new file mode 100644
index 0000000000000..028553694a8cd
--- /dev/null
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/Formatting-Overview.vbproj
@@ -0,0 +1,9 @@
+
+
+
+ Exe
+ Formatting_Overview
+ net6.0
+
+
+
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/Program.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/Program.vb
new file mode 100644
index 0000000000000..46283ca23175e
--- /dev/null
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/Program.vb
@@ -0,0 +1,7 @@
+Imports System
+
+Module Program
+ Sub Main(args As String())
+ Console.WriteLine("Hello World!")
+ End Sub
+End Module
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/alias1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/alias1.vb
index d226f8109ba73..5a031db4d903a 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/alias1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/alias1.vb
@@ -5,11 +5,11 @@ Option Strict On
Imports System.Globalization
Module Example
- Public Sub Main()
+ Public Sub Main0()
Dim date1 As Date = #6/30/2009#
Console.WriteLine("D Format Specifier: {0:D}", date1)
Dim longPattern As String = CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern
- Console.WriteLine("'{0}' custom format string: {1}", _
+ Console.WriteLine("'{0}' custom format string: {1}",
longPattern, date1.ToString(longPattern))
End Sub
End Module
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/appstandard1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/appstandard1.vb
index 29c2bdaa603d2..d988ac938aa64 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/appstandard1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/appstandard1.vb
@@ -1,99 +1,102 @@
-' Visual Basic .NET Document
-Option Strict On
+Option Strict On
-'
-Public Class Temperature
- Private m_Temp As Decimal
+Namespace HotAndCold
- Public Sub New(temperature As Decimal)
- Me.m_Temp = temperature
- End Sub
+ '
+ Public Class Temperature
+ Private m_Temp As Decimal
- Public ReadOnly Property Celsius() As Decimal
- Get
- Return Me.m_Temp
- End Get
- End Property
+ Public Sub New(temperature As Decimal)
+ Me.m_Temp = temperature
+ End Sub
- Public ReadOnly Property Kelvin() As Decimal
- Get
- Return Me.m_Temp + 273.15d
- End Get
- End Property
+ Public ReadOnly Property Celsius() As Decimal
+ Get
+ Return Me.m_Temp
+ End Get
+ End Property
- Public ReadOnly Property Fahrenheit() As Decimal
- Get
- Return Math.Round(CDec(Me.m_Temp * 9 / 5 + 32), 2)
- End Get
- End Property
+ Public ReadOnly Property Kelvin() As Decimal
+ Get
+ Return Me.m_Temp + 273.15D
+ End Get
+ End Property
- Public Overrides Function ToString() As String
- Return Me.ToString("C")
- End Function
+ Public ReadOnly Property Fahrenheit() As Decimal
+ Get
+ Return Math.Round(CDec(Me.m_Temp * 9 / 5 + 32), 2)
+ End Get
+ End Property
- Public Overloads Function ToString(format As String) As String
- ' Handle null or empty string.
- If String.IsNullOrEmpty(format) Then format = "C"
- ' Remove spaces and convert to uppercase.
- format = format.Trim().ToUpperInvariant()
+ Public Overrides Function ToString() As String
+ Return Me.ToString("C")
+ End Function
- Select Case format
- Case "F"
- ' Convert temperature to Fahrenheit and return string.
- Return Me.Fahrenheit.ToString("N2") & " °F"
- Case "K"
- ' Convert temperature to Kelvin and return string.
- Return Me.Kelvin.ToString("N2") & " K"
- Case "C", "G"
- ' Return temperature in Celsius.
- Return Me.Celsius.ToString("N2") & " °C"
- Case Else
- Throw New FormatException(String.Format("The '{0}' format string is not supported.", format))
- End Select
- End Function
-End Class
+ Public Overloads Function ToString(format As String) As String
+ ' Handle null or empty string.
+ If String.IsNullOrEmpty(format) Then format = "C"
+ ' Remove spaces and convert to uppercase.
+ format = format.Trim().ToUpperInvariant()
-Public Module Example
- Public Sub Main()
- Dim temp1 As New Temperature(0d)
- Console.WriteLine(temp1.ToString())
- Console.WriteLine(temp1.ToString("G"))
- Console.WriteLine(temp1.ToString("C"))
- Console.WriteLine(temp1.ToString("F"))
- Console.WriteLine(temp1.ToString("K"))
+ Select Case format
+ Case "F"
+ ' Convert temperature to Fahrenheit and return string.
+ Return Me.Fahrenheit.ToString("N2") & " °F"
+ Case "K"
+ ' Convert temperature to Kelvin and return string.
+ Return Me.Kelvin.ToString("N2") & " K"
+ Case "C", "G"
+ ' Return temperature in Celsius.
+ Return Me.Celsius.ToString("N2") & " °C"
+ Case Else
+ Throw New FormatException(String.Format("The '{0}' format string is not supported.", format))
+ End Select
+ End Function
+ End Class
- Dim temp2 As New Temperature(-40d)
- Console.WriteLine(temp2.ToString())
- Console.WriteLine(temp2.ToString("G"))
- Console.WriteLine(temp2.ToString("C"))
- Console.WriteLine(temp2.ToString("F"))
- Console.WriteLine(temp2.ToString("K"))
+ Public Module Example1
+ Public Sub Main1()
+ Dim temp1 As New Temperature(0D)
+ Console.WriteLine(temp1.ToString())
+ Console.WriteLine(temp1.ToString("G"))
+ Console.WriteLine(temp1.ToString("C"))
+ Console.WriteLine(temp1.ToString("F"))
+ Console.WriteLine(temp1.ToString("K"))
- Dim temp3 As New Temperature(16d)
- Console.WriteLine(temp3.ToString())
- Console.WriteLine(temp3.ToString("G"))
- Console.WriteLine(temp3.ToString("C"))
- Console.WriteLine(temp3.ToString("F"))
- Console.WriteLine(temp3.ToString("K"))
+ Dim temp2 As New Temperature(-40D)
+ Console.WriteLine(temp2.ToString())
+ Console.WriteLine(temp2.ToString("G"))
+ Console.WriteLine(temp2.ToString("C"))
+ Console.WriteLine(temp2.ToString("F"))
+ Console.WriteLine(temp2.ToString("K"))
- Console.WriteLine(String.Format("The temperature is now {0:F}.", temp3))
- End Sub
-End Module
-' The example displays the following output:
-' 0.00 °C
-' 0.00 °C
-' 0.00 °C
-' 32.00 °F
-' 273.15 K
-' -40.00 °C
-' -40.00 °C
-' -40.00 °C
-' -40.00 °F
-' 233.15 K
-' 16.00 °C
-' 16.00 °C
-' 16.00 °C
-' 60.80 °F
-' 289.15 K
-' The temperature is now 16.00 °C.
-'
+ Dim temp3 As New Temperature(16D)
+ Console.WriteLine(temp3.ToString())
+ Console.WriteLine(temp3.ToString("G"))
+ Console.WriteLine(temp3.ToString("C"))
+ Console.WriteLine(temp3.ToString("F"))
+ Console.WriteLine(temp3.ToString("K"))
+
+ Console.WriteLine(String.Format("The temperature is now {0:F}.", temp3))
+ End Sub
+ End Module
+ ' The example displays the following output:
+ ' 0.00 °C
+ ' 0.00 °C
+ ' 0.00 °C
+ ' 32.00 °F
+ ' 273.15 K
+ ' -40.00 °C
+ ' -40.00 °C
+ ' -40.00 °C
+ ' -40.00 °F
+ ' 233.15 K
+ ' 16.00 °C
+ ' 16.00 °C
+ ' 16.00 °C
+ ' 60.80 °F
+ ' 289.15 K
+ ' The temperature is now 16.00 °C.
+ '
+
+End Namespace
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/composite1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/composite1.vb
index 5b9bcfebeb42d..6f8091fb1262e 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/composite1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/composite1.vb
@@ -45,15 +45,15 @@ Public Class Product
End Function
End Class
-Module Example
- Public Sub Main()
+Module Example2
+ Public Sub Main2()
Dim item1 As New Product("WidgetA")
item1.Quantity = 17
- item1.Price = 6.32d
+ item1.Price = 6.32D
Dim thatDate As DateTime = #5/1/2009#
Dim result As String
'
- result = String.Format("On {0:d}, the inventory of {1} was worth {2:C2}.", _
+ result = String.Format("On {0:d}, the inventory of {1} was worth {2:C2}.",
thatDate, item1, item1.Value)
Console.WriteLine(result)
' The example displays output like the following if run on a system
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/composite2.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/composite2.vb
index 27c3c1758105a..32e362fa6da56 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/composite2.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/composite2.vb
@@ -1,6 +1,6 @@
-Public Module Example
- Public Sub Main()
+Public Module Example3
+ Public Sub Main3()
'
Dim startDate As New Date(2015, 8, 28, 6, 0, 0)
Dim temps() As Decimal = {73.452, 68.98, 72.6, 69.24563,
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific1.vb
index 582e631ec0e1e..7a1cd18419312 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific1.vb
@@ -5,16 +5,15 @@ Option Strict On
Imports System.Globalization
Imports System.Threading
-Module Example
- Public Sub Main()
+Module Example4
+ Public Sub Main4()
Dim cultureNames() As String = {"en-US", "fr-FR", "es-MX", "de-DE"}
Dim dateToFormat As Date = #5/28/2012 11:30AM#
For Each cultureName In cultureNames
- ' Change the current thread culture.
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(cultureName)
- Console.WriteLine("The current culture is {0}",
- Thread.CurrentThread.CurrentCulture.Name)
+ ' Change the current culture.
+ CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture(cultureName)
+ Console.WriteLine($"The current culture is {CultureInfo.CurrentCulture.Name}")
Console.WriteLine(dateToFormat.ToString("F"))
Console.WriteLine()
Next
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific2.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific2.vb
index ed103e4f6257a..d44ebd7eb7c2c 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific2.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific2.vb
@@ -4,14 +4,14 @@ Option Strict On
'
Imports System.Globalization
-Module Example
- Public Sub Main()
+Module Example5
+ Public Sub Main5()
Dim dat1 As Date = #5/28/2012 11:30AM#
Dim cultureNames() As String = {"en-US", "en-GB", "ru", "fr"}
For Each name In cultureNames
Dim dtfi As DateTimeFormatInfo = CultureInfo.CreateSpecificCulture(name).DateTimeFormat
- Console.WriteLine("{0}: {1}", name, dat1.ToString(dtfi))
+ Console.WriteLine($"{name}: {dat1.ToString(dtfi)}")
Next
End Sub
End Module
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific3.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific3.vb
index d2df3383687f8..efc8cea9ae112 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific3.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific3.vb
@@ -3,18 +3,16 @@ Option Strict On
'
Imports System.Globalization
-Imports System.Threading
-Module Example
- Public Sub Main()
+Module Example6
+ Public Sub Main6()
Dim cultureNames() As String = {"en-US", "fr-FR", "es-MX", "de-DE"}
- Dim value As Decimal = 1043.17d
+ Dim value As Decimal = 1043.17D
For Each cultureName In cultureNames
- ' Change the current thread culture.
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(cultureName)
- Console.WriteLine("The current culture is {0}",
- Thread.CurrentThread.CurrentCulture.Name)
+ ' Change the current culture.
+ CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture(cultureName)
+ Console.WriteLine($"The current culture is {CultureInfo.CurrentCulture.Name}")
Console.WriteLine(value.ToString("C2"))
Console.WriteLine()
Next
@@ -33,4 +31,3 @@ End Module
' The current culture is de-DE
' 1.043,17 €
'
-
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific4.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific4.vb
index ef17cd8ca8322..f8bf74d57e6ed 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific4.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/culturespecific4.vb
@@ -4,8 +4,8 @@ Option Strict On
'
Imports System.Globalization
-Module Example
- Public Sub Main()
+Module Example7
+ Public Sub Main7()
Dim value As Double = 1043.62957
Dim cultureNames() As String = {"en-US", "en-GB", "ru", "fr"}
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/custom1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/custom1.vb
index 7bb4af77e4921..03bb450da4daf 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/custom1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/custom1.vb
@@ -1,8 +1,8 @@
' Visual Basic .NET Document
Option Strict On
-Module Example
- Public Sub Main()
+Module Example8
+ Public Sub Main8()
'
Dim customFormat As String = "MMMM dd, yyyy (dddd)"
Dim date1 As Date = #8/28/2009#
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/default1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/default1.vb
index 6703e70fac776..01e0315910773 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/default1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/default1.vb
@@ -6,8 +6,8 @@ Public Class Automobile
' No implementation. All members are inherited from Object.
End Class
-Module Example
- Public Sub Main()
+Module Example9
+ Public Sub Main9()
Dim firstAuto As New Automobile()
Console.WriteLine(firstAuto)
End Sub
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/icustomformatter1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/icustomformatter1.vb
index f2a9a40888255..a32139ae59a4f 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/icustomformatter1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/icustomformatter1.vb
@@ -44,8 +44,8 @@ End Class
'
'
-Public Module Example
- Public Sub Main()
+Public Module Example10
+ Public Sub Main10()
Dim value As Long = 3210662321
Dim value1 As Byte = 214
Dim value2 As Byte = 19
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/iformatprovider1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/iformatprovider1.vb
index 045c35a5255ee..4ee6c1afffaf8 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/iformatprovider1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/iformatprovider1.vb
@@ -3,9 +3,9 @@
'
Imports System.Globalization
-Public Module Example
- Public Sub Main()
- Dim value As Decimal = 1603.42d
+Public Module Example11
+ Public Sub Main11()
+ Dim value As Decimal = 1603.42D
Console.WriteLine(value.ToString("C3", New CultureInfo("en-US")))
Console.WriteLine(value.ToString("C3", New CultureInfo("fr-FR")))
Console.WriteLine(value.ToString("C3", New CultureInfo("de-DE")))
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/iformattable.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/iformattable.vb
index 85eea3547d8bb..1b0aec637c67d 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/iformattable.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/iformattable.vb
@@ -1,83 +1,85 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
+Option Strict On
Imports System.Globalization
-Public Class Temperature : Implements IFormattable
- Private m_Temp As Decimal
+Namespace HotAndCold2
+
+ '
+ Public Class Temperature : Implements IFormattable
+ Private m_Temp As Decimal
- Public Sub New(temperature As Decimal)
- Me.m_Temp = temperature
- End Sub
+ Public Sub New(temperature As Decimal)
+ Me.m_Temp = temperature
+ End Sub
- Public ReadOnly Property Celsius() As Decimal
- Get
- Return Me.m_Temp
- End Get
- End Property
+ Public ReadOnly Property Celsius() As Decimal
+ Get
+ Return Me.m_Temp
+ End Get
+ End Property
- Public ReadOnly Property Kelvin() As Decimal
- Get
- Return Me.m_Temp + 273.15d
- End Get
- End Property
+ Public ReadOnly Property Kelvin() As Decimal
+ Get
+ Return Me.m_Temp + 273.15D
+ End Get
+ End Property
- Public ReadOnly Property Fahrenheit() As Decimal
- Get
- Return Math.Round(CDec(Me.m_Temp * 9 / 5 + 32), 2)
- End Get
- End Property
+ Public ReadOnly Property Fahrenheit() As Decimal
+ Get
+ Return Math.Round(CDec(Me.m_Temp * 9 / 5 + 32), 2)
+ End Get
+ End Property
- Public Overrides Function ToString() As String
- Return Me.ToString("G", Nothing)
- End Function
+ Public Overrides Function ToString() As String
+ Return Me.ToString("G", Nothing)
+ End Function
- Public Overloads Function ToString(format As String) As String
- Return Me.ToString(format, Nothing)
- End Function
+ Public Overloads Function ToString(format As String) As String
+ Return Me.ToString(format, Nothing)
+ End Function
- Public Overloads Function ToString(format As String, provider As IFormatProvider) As String _
- Implements IFormattable.ToString
+ Public Overloads Function ToString(format As String, provider As IFormatProvider) As String _
+ Implements IFormattable.ToString
- ' Handle null or empty arguments.
- If String.IsNullOrEmpty(format) Then format = "G"
- ' Remove any white space and convert to uppercase.
- format = format.Trim().ToUpperInvariant()
+ ' Handle null or empty arguments.
+ If String.IsNullOrEmpty(format) Then format = "G"
+ ' Remove any white space and convert to uppercase.
+ format = format.Trim().ToUpperInvariant()
- If provider Is Nothing Then provider = NumberFormatInfo.CurrentInfo
+ If provider Is Nothing Then provider = NumberFormatInfo.CurrentInfo
- Select Case format
+ Select Case format
' Convert temperature to Fahrenheit and return string.
- Case "F"
- Return Me.Fahrenheit.ToString("N2", provider) & "°F"
+ Case "F"
+ Return Me.Fahrenheit.ToString("N2", provider) & "°F"
' Convert temperature to Kelvin and return string.
- Case "K"
- Return Me.Kelvin.ToString("N2", provider) & "K"
+ Case "K"
+ Return Me.Kelvin.ToString("N2", provider) & "K"
' Return temperature in Celsius.
- Case "C", "G"
- Return Me.Celsius.ToString("N2", provider) & "°C"
- Case Else
- Throw New FormatException(String.Format("The '{0}' format string is not supported.", format))
- End Select
- End Function
-End Class
-'
+ Case "C", "G"
+ Return Me.Celsius.ToString("N2", provider) & "°C"
+ Case Else
+ Throw New FormatException(String.Format($"The '{format}' format string is not supported."))
+ End Select
+ End Function
+ End Class
+ '
+
+ '
+ Public Module Example12
+ Public Sub Main12()
+ Dim temp As New Temperature(22D)
+ CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en-US")
+ Console.WriteLine(Convert.ToString(temp, New CultureInfo("ja-JP")))
+ Console.WriteLine($"Temperature: {temp:K}")
+ Console.WriteLine($"Temperature: {temp:F}")
+ Console.WriteLine(String.Format(New CultureInfo("fr-FR"), $"Temperature: {temp:F}"))
+ End Sub
+ End Module
+ ' The example displays the following output:
+ ' 22.00°C
+ ' Temperature: 295.15K
+ ' Temperature: 71.60°F
+ ' Temperature: 71,60°F
+ '
-'
-Public Module Example
- Public Sub Main()
- Dim temp As New Temperature(22d)
- CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en-US")
- Console.WriteLine(Convert.ToString(temp1, New CultureInfo("ja-JP")))
- Console.WriteLine("Temperature: {0:K}", temp)
- Console.WriteLine("Temperature: {0:F}", temp)
- Console.WriteLine(String.Format(New CultureInfo("fr-FR"), "Temperature: {0:F}", temp))
- End Sub
-End Module
-' The example displays the following output:
-' 22.00°C
-' Temperature: 295.15K
-' Temperature: 71.60°F
-' Temperature: 71,60°F
-'
+End Namespace
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/overrides1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/overrides1.vb
index 577997ec8f438..fa7d21b5c6075 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/overrides1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/overrides1.vb
@@ -14,9 +14,9 @@ Public Class Temperature
End Function
End Class
-Module Example
- Public Sub Main()
- Dim currentTemperature As New Temperature(23.6d)
+Module Example13
+ Public Sub Main13()
+ Dim currentTemperature As New Temperature(23.6D)
Console.WriteLine("The current temperature is " +
currentTemperature.ToString())
End Sub
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/precisionspecifier1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/precisionspecifier1.vb
index 0f57966f6b10a..604211ebf35d6 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/precisionspecifier1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/precisionspecifier1.vb
@@ -1,8 +1,8 @@
' Visual Basic .NET Document
Option Strict On
-Module Example
- Public Sub Main()
+Module Example14
+ Public Sub Main14()
'
Dim byteValues() As Byte = {12, 163, 255}
For Each byteValue As Byte In byteValues
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/singlecustom1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/singlecustom1.vb
index abcd176cd6eca..75b02ff14c0e4 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/singlecustom1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/singlecustom1.vb
@@ -1,8 +1,8 @@
' Visual Basic .NET Document
Option Strict On
-Module Example
- Public Sub Main()
+Module Example15
+ Public Sub Main15()
'
Dim date1 As Date = #09/08/2009#
Console.WriteLine(date1.ToString("%M")) ' Displays 9
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/specifier1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/specifier1.vb
index 5033b6f441485..3fdd56a790cda 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/specifier1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/specifier1.vb
@@ -1,8 +1,8 @@
' Visual Basic .NET Document
Option Strict On
-Module Example
- Public Sub Main()
+Module Example16
+ Public Sub Main16()
'
Dim integerValue As Integer = 60312
Console.WriteLine(integerValue.ToString("X")) ' Displays EB98.
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/standard1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/standard1.vb
index dd579ad7fd50b..402514fc0b83d 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/standard1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/standard1.vb
@@ -1,8 +1,8 @@
' Visual Basic .NET Document
Option Strict On
-Module Example
- Public Sub Main()
+Module Example17
+ Public Sub Main17()
'
Dim thisDay As DayOfWeek = DayOfWeek.Monday
Dim formatStrings() As String = {"G", "F", "D", "X"}
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/telnumber1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/telnumber1.vb
index 0499e030fa244..6313a349b91f4 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/telnumber1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/telnumber1.vb
@@ -2,8 +2,8 @@
Option Strict On
'
-Module Example
- Public Sub Main()
+Module Example18
+ Public Sub Main18()
Dim number As Long = 8009999999
Dim fmt As String = "000-000-0000"
Console.WriteLine(number.ToString(fmt))
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/currency1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/currency1.vb
index b06d6907cd0d0..70cd5ef904e66 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/currency1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/currency1.vb
@@ -6,11 +6,11 @@ Imports System.Globalization
Imports System.IO
Imports System.Threading
-Module Example
- Public Sub Main()
+Module Example1
+ Public Sub Main1()
' Display the currency value.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US")
- Dim value As Decimal = 16039.47d
+ Dim value As Decimal = 16039.47D
Console.WriteLine("Current Culture: {0}", CultureInfo.CurrentCulture.DisplayName)
Console.WriteLine("Currency Value: {0:C2}", value)
@@ -20,14 +20,14 @@ Module Example
sw.Close()
' Read the persisted data using the current culture.
- Dim sr AS New StreamReader("currency.dat")
+ Dim sr As New StreamReader("currency.dat")
Dim currencyData As String = sr.ReadToEnd()
sr.Close()
' Restore and display the data using the conventions of the current culture.
Dim restoredValue As Decimal
If Decimal.TryParse(currencyData, restoredValue) Then
- Console.WriteLine(restoredvalue.ToString("C2"))
+ Console.WriteLine(restoredValue.ToString("C2"))
Else
Console.WriteLine("ERROR: Unable to parse '{0}'", currencyData)
End If
@@ -38,7 +38,7 @@ Module Example
Console.WriteLine("Current Culture: {0}",
Thread.CurrentThread.CurrentCulture.DisplayName)
If Decimal.TryParse(currencyData, NumberStyles.Currency, Nothing, restoredValue) Then
- Console.WriteLine(restoredvalue.ToString("C2"))
+ Console.WriteLine(restoredValue.ToString("C2"))
Else
Console.WriteLine("ERROR: Unable to parse '{0}'", currencyData)
End If
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/currency2.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/currency2.vb
index 9055e168f47b3..0b0615d4433a3 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/currency2.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/currency2.vb
@@ -17,11 +17,11 @@ Imports System.Threading
Public CultureName As String
End Structure
-Module Example
- Public Sub Main()
+Module Example2
+ Public Sub Main2()
' Display the currency value.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US")
- Dim value As Decimal = 16039.47d
+ Dim value As Decimal = 16039.47D
Console.WriteLine("Current Culture: {0}", CultureInfo.CurrentCulture.DisplayName)
Console.WriteLine("Currency Value: {0:C2}", value)
@@ -33,12 +33,12 @@ Module Example
fw.Close()
Console.WriteLine()
- ' Change the current thread culture.
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB")
+ ' Change the current culture.
+ CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB")
Console.WriteLine("Current Culture: {0}", CultureInfo.CurrentCulture.DisplayName)
' Deserialize the data.
- Dim fr AS New FileStream("currency.dat", FileMode.Open)
+ Dim fr As New FileStream("currency.dat", FileMode.Open)
Dim restoredData As CurrencyValue = CType(bf.Deserialize(fr), CurrencyValue)
fr.Close()
@@ -47,6 +47,7 @@ Module Example
Console.WriteLine("Currency Value: {0}", restoredData.Amount.ToString("C2", culture))
End Sub
End Module
+
' The example displays the following output:
' Current Culture: English (United States)
' Currency Value: $16,039.47
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates1.vb
index 1e44513da3117..93029b3f0bec1 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates1.vb
@@ -5,11 +5,11 @@ Option Strict On
Imports System.Globalization
Imports System.Threading
-Module Example
- Dim dates() As Date = {New Date(2012, 10, 11, 7, 06, 0),
+Module Example3
+ Dim dates() As Date = {New Date(2012, 10, 11, 7, 6, 0),
New Date(2012, 10, 11, 18, 19, 0)}
- Public Sub Main()
+ Public Sub Main3()
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("hr-HR")
ShowDayInfo()
Console.WriteLine()
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates2.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates2.vb
index 9689d16cac026..8e509eb0f67d3 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates2.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates2.vb
@@ -7,8 +7,8 @@ Imports System.Globalization
Imports System.IO
Imports System.Threading
-Module Example
- Public Sub Main()
+Module Example4
+ Public Sub Main4()
' Persist two dates as strings.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US")
Dim dates() As DateTime = {New DateTime(2013, 1, 9),
@@ -18,7 +18,7 @@ Module Example
sw.Close()
' Read the persisted data.
- Dim sr AS New StreamReader("dateData.dat")
+ Dim sr As New StreamReader("dateData.dat")
Dim dateData As String = sr.ReadToEnd()
sr.Close()
Dim dateStrings() As String = dateData.Split("|"c)
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates3.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates3.vb
index f77f94128a048..a3b9623d572e1 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates3.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates3.vb
@@ -7,8 +7,8 @@ Imports System.Globalization
Imports System.IO
Imports System.Threading
-Module Example
- Public Sub Main()
+Module Example5
+ Public Sub Main5()
' Persist two dates as strings.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US")
Dim dates() As DateTime = {New DateTime(2013, 1, 9),
@@ -19,7 +19,7 @@ Module Example
sw.Close()
' Read the persisted data.
- Dim sr AS New StreamReader("dateData.dat")
+ Dim sr As New StreamReader("dateData.dat")
Dim dateData As String = sr.ReadToEnd()
sr.Close()
Dim dateStrings() As String = dateData.Split("|"c)
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates4.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates4.vb
index d8645d767cc84..b6674ba32837d 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates4.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates4.vb
@@ -5,8 +5,8 @@ Option Strict On
Imports System.IO
Imports System.Runtime.Serialization.Formatters.Binary
-Module Example
- Public Sub Main()
+Module Example6
+ Public Sub Main6()
Dim formatter As New BinaryFormatter()
' Serialize a date.
@@ -34,7 +34,7 @@ Module Example
Dim dateStrings() As String = datesToSplit.Split("|"c)
For Each dateStr In dateStrings
Dim newDate As DateTime = DateTime.Parse(dateStr)
- Console.WriteLine("'{0}' --> {1} {2}", _
+ Console.WriteLine("'{0}' --> {1} {2}",
dateStr, newDate, newDate.Kind)
Next
Console.WriteLine()
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates5.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates5.vb
index b5d24e15c9388..1f296783b5331 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates5.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates5.vb
@@ -2,8 +2,8 @@
Option Strict On
'
-Module Example
- Public Sub Main()
+Module Example7
+ Public Sub Main7()
Dim date1 As Date = DateTime.SpecifyKind(#3/9/2013 10:30AM#,
DateTimeKind.Local)
Dim interval As New TimeSpan(48, 0, 0)
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates6.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates6.vb
index 8913ddd193ee6..c67b5f89d5155 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates6.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates6.vb
@@ -2,9 +2,9 @@
Option Strict On
'
-Module Example
- Public Sub Main()
- Dim pst As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneByID("Pacific Standard Time")
+Module Example8
+ Public Sub Main8()
+ Dim pst As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time")
Dim date1 As Date = DateTime.SpecifyKind(#3/9/2013 10:30AM#,
DateTimeKind.Local)
Dim utc1 As Date = date1.ToUniversalTime()
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates8.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates8.vb
index 4bc5454ce7ed3..ce254611cbf58 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates8.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/dates8.vb
@@ -5,8 +5,8 @@ Option Strict On
Imports System.IO
Imports System.Runtime.Serialization.Formatters.Binary
-Module Example
- Public Sub Main()
+Module Example9
+ Public Sub Main9()
Dim formatter As New BinaryFormatter()
' Serialize a date.
@@ -16,7 +16,7 @@ Module Example
' Serialize the date in string form.
If Not File.Exists("DateInfo2.dat") Then
Dim sw As New StreamWriter("DateInfo2.dat")
- sw.Write("{0:o}|{1:r}|{1:u}", dateOriginal, _
+ sw.Write("{0:o}|{1:r}|{1:u}", dateOriginal,
dateOriginal.ToUniversalTime())
sw.Close()
Console.WriteLine("Serialized dates to DateInfo.dat")
@@ -37,11 +37,11 @@ Module Example
For ctr As Integer = 0 To dateStrings.Length - 1
Dim newDate As DateTime = DateTime.Parse(dateStrings(ctr))
If ctr = 1 Then
- Console.WriteLine("'{0}' --> {1} {2}", _
+ Console.WriteLine("'{0}' --> {1} {2}",
dateStrings(ctr), newDate, newDate.Kind)
Else
Dim newLocalDate As DateTime = newDate.ToLocalTime()
- Console.WriteLine("'{0}' --> {1} {2}", _
+ Console.WriteLine("'{0}' --> {1} {2}",
dateStrings(ctr), newLocalDate, newLocalDate.Kind)
End If
Next
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/equals1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/equals1.vb
index 005b6ce8f11ce..5edecaeec3ba9 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/equals1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/equals1.vb
@@ -5,8 +5,8 @@ Option Strict On
Imports System.Globalization
Imports System.Threading
-Module Example
- Public Sub Main()
+Module Example10
+ Public Sub Main10()
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("tr-TR")
Dim uri As String = "file:\\c:\users\username\Documents\bio.txt"
If Not AccessesFileSystem(uri) Then
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/equals2.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/equals2.vb
index 90f78d62793e2..16470e9c3ee41 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/equals2.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/equals2.vb
@@ -5,8 +5,8 @@ Option Strict On
Imports System.Globalization
Imports System.Threading
-Module Example
- Public Sub Main()
+Module Example11
+ Public Sub Main11()
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("tr-TR")
Dim uri As String = "file:\\c:\users\username\Documents\bio.txt"
If Not AccessesFileSystem(uri) Then
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/globalization.vbproj b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/globalization.vbproj
new file mode 100644
index 0000000000000..e4d31a3c24eff
--- /dev/null
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/globalization.vbproj
@@ -0,0 +1,9 @@
+
+
+
+ Exe
+ Globalization
+ net6.0
+
+
+
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/monthname1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/monthname1.vb
index b5b86f2e86540..5d015e486f0ef 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/monthname1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/monthname1.vb
@@ -2,8 +2,8 @@
Option Strict On
'
-Module Example
- Public Sub Main()
+Module Example12
+ Public Sub Main12()
Dim midYear As Date = #07/01/2013#
Console.WriteLine("{0:d} is a {1}.", midYear, GetDayName(midYear))
End Sub
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/monthname2.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/monthname2.vb
index f265353aec389..028c3bb141120 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/monthname2.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/monthname2.vb
@@ -5,10 +5,10 @@ Option Strict On
Imports System.Globalization
Imports System.Threading
-Module Example
- Public Sub Main()
- ' Set the current thread culture to French (France).
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR")
+Module Example13
+ Public Sub Main13()
+ ' Set the current culture to French (France).
+ CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR")
Dim midYear As Date = #07/01/2013#
Console.WriteLine("{0:d} is a {1}.", midYear, DateUtilities.GetDayName(midYear))
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers1.vb
index 8985799f7ef06..fe5c2d4ddba9e 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers1.vb
@@ -5,8 +5,8 @@ Option Strict On
Imports System.Globalization
Imports System.Threading
-Module Example
- Public Sub Main()
+Module Example14
+ Public Sub Main14()
Dim dateForMonth As Date = #1/1/2013#
Dim temperatures() As Double = {3.4, 3.5, 7.6, 10.4, 14.5, 17.2,
19.9, 18.2, 15.9, 11.3, 6.9, 5.3}
@@ -15,7 +15,7 @@ Module Example
Console.WriteLine("Current Culture: {0}", CultureInfo.CurrentCulture.DisplayName)
Dim fmtString As String = "{0,-" + GetLongestMonthNameLength().ToString() + ":MMMM} {1,4}"
For ctr = 0 To temperatures.Length - 1
- Console.WriteLine(fmtstring,
+ Console.WriteLine(fmtString,
dateForMonth.AddMonths(ctr),
temperatures(ctr))
Next
@@ -26,7 +26,7 @@ Module Example
' Build the format string dynamically so we allocate enough space for the month name.
fmtString = "{0,-" + GetLongestMonthNameLength().ToString() + ":MMMM} {1,4}"
For ctr = 0 To temperatures.Length - 1
- Console.WriteLine(fmtstring,
+ Console.WriteLine(fmtString,
dateForMonth.AddMonths(ctr),
temperatures(ctr))
Next
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers2.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers2.vb
index 8e0402e00ccbb..e55efb5bc893c 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers2.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers2.vb
@@ -6,8 +6,8 @@ Imports System.Globalization
Imports System.IO
Imports System.Threading
-Module Example
- Public Sub Main()
+Module Example15
+ Public Sub Main15()
' Create ten random doubles.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US")
Dim numbers() As Double = GetRandomNumbers(10)
@@ -21,7 +21,7 @@ Module Example
sw.Close()
' Read the persisted data.
- Dim sr AS New StreamReader("randoms.dat")
+ Dim sr As New StreamReader("randoms.dat")
Dim numericData As String = sr.ReadToEnd()
sr.Close()
Dim numberStrings() As String = numericData.Split("|"c)
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers3.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers3.vb
index 713e1733e4515..49767865a3e48 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers3.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/numbers3.vb
@@ -7,8 +7,8 @@ Imports System.IO
Imports System.Runtime.Serialization.Formatters.Binary
Imports System.Threading
-Module Example
- Public Sub Main()
+Module Example16
+ Public Sub Main16()
' Create ten random doubles.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US")
Dim numbers() As Double = GetRandomNumbers(10)
@@ -21,7 +21,7 @@ Module Example
fsIn.Close()
' Read the persisted data.
- Dim fsOut AS New FileStream("randoms.dat", FileMode.Open)
+ Dim fsOut As New FileStream("randoms.dat", FileMode.Open)
Dim numbers1() As Double = DirectCast(formatter.Deserialize(fsOut), Double())
fsOut.Close()
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/search1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/search1.vb
index c65e5ae333db0..e6007aff318eb 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/search1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/search1.vb
@@ -5,12 +5,12 @@ Option Strict On
Imports System.Globalization
Imports System.Threading
-Module Example
- Public Sub Main()
+Module Example17
+ Public Sub Main17()
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("pl-PL")
- Dim composite As String = ChrW(&h0041) + ChrW(&H0300)
- Console.WriteLine("Comparing using Char: {0}", composite.IndexOf(ChrW(&h00C0)))
- Console.WriteLine("Comparing using String: {0}", composite.IndexOf(ChrW(&h00C0).ToString()))
+ Dim composite As String = ChrW(&H41) + ChrW(&H300)
+ Console.WriteLine("Comparing using Char: {0}", composite.IndexOf(ChrW(&HC0)))
+ Console.WriteLine("Comparing using String: {0}", composite.IndexOf(ChrW(&HC0).ToString()))
End Sub
End Module
' The example displays the following output:
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/sort1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/sort1.vb
index 4c0460ba71215..12ff3df2c38e3 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/sort1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/sort1.vb
@@ -5,9 +5,9 @@ Option Strict On
Imports System.Globalization
Imports System.Threading
-Module Example
- Public Sub Main()
- Dim values() As String = {"able", "ångström", "apple", _
+Module Example18
+ Public Sub Main18()
+ Dim values() As String = {"able", "ångström", "apple",
"Æble", "Windows", "Visual Studio"}
' Change thread to en-US.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US")
diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/sortkey1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/sortkey1.vb
index 56298871d85d3..864030752fd98 100644
--- a/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/sortkey1.vb
+++ b/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.globalization/vb/sortkey1.vb
@@ -16,9 +16,9 @@ Public Class SortKeyComparer : Implements IComparer(Of String)
End Function
End Class
-Module Example
- Public Sub Main()
- Dim values() As String = {"able", "ångström", "apple", _
+Module Example19
+ Public Sub Main19()
+ Dim values() As String = {"able", "ångström", "apple",
"Æble", "Windows", "Visual Studio"}
Dim comparer As New SortKeyComparer()
From 2ac9f55152887fa05667f8fdece014cc0968d5b9 Mon Sep 17 00:00:00 2001
From: katiesavage
Date: Fri, 19 Nov 2021 11:24:17 -0800
Subject: [PATCH 8/8] Update index.yml (#27183)
Changes forms to forums (line 37)
---
docs/csharp/index.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/csharp/index.yml b/docs/csharp/index.yml
index 22fea2d7513c7..b9204166fcdf9 100644
--- a/docs/csharp/index.yml
+++ b/docs/csharp/index.yml
@@ -34,7 +34,7 @@ landingContent:
links:
- text: "C# on Q&A"
url: /answers/topics/dotnet-csharp.html
- - text: "Languages on .NET tech community forms"
+ - text: "Languages on .NET tech community forums"
url: https://techcommunity.microsoft.com/t5/languages/bd-p/languages
- text: "C# on Stack Overflow"
url: https://stackoverflow.com/questions/tagged/c%23