diff --git a/.openpublishing.redirection.ai.json b/.openpublishing.redirection.ai.json
index 0d717d29c46bb..47c7bcdc01924 100644
--- a/.openpublishing.redirection.ai.json
+++ b/.openpublishing.redirection.ai.json
@@ -95,6 +95,10 @@
"redirect_url": "/dotnet/ai/quickstarts/prompt-model",
"redirect_document_id": true
},
+ {
+ "source_path_from_root": "/docs/ai/resources/get-started.md",
+ "redirect_url": "/dotnet/ai/overview"
+ },
{
"source_path_from_root": "/docs/ai/semantic-kernel-dotnet-overview.md",
"redirect_url": "/semantic-kernel/overview"
diff --git a/.openpublishing.redirection.fundamentals.json b/.openpublishing.redirection.fundamentals.json
index a8f85bfb5e996..53e11f7e38ff3 100644
--- a/.openpublishing.redirection.fundamentals.json
+++ b/.openpublishing.redirection.fundamentals.json
@@ -24,10 +24,6 @@
"source_path_from_root": "/docs/fundamentals/code-analysis/quality-rules/ca1867.md",
"redirect_url": "/dotnet/fundamentals/code-analysis/quality-rules/ca1865-ca1867"
},
- {
- "source_path_from_root": "/docs/fundamentals/code-analysis/quality-rules/singlefile-warnings.md",
- "redirect_url": "/dotnet/core/deploying/single-file/warnings/overview"
- },
{
"source_path_from_root": "/docs/fundamentals/code-analysis/quality-rules/il3000.md",
"redirect_url": "/dotnet/core/deploying/single-file/warnings/il3000"
@@ -48,6 +44,10 @@
"source_path_from_root": "/docs/fundamentals/code-analysis/quality-rules/publish-warnings.md",
"redirect_url": "/dotnet/core/deploying/single-file/warnings/overview"
},
+ {
+ "source_path_from_root": "/docs/fundamentals/code-analysis/quality-rules/singlefile-warnings.md",
+ "redirect_url": "/dotnet/core/deploying/single-file/warnings/overview"
+ },
{
"source_path_from_root": "/docs/fundamentals/code-analysis/style-rules/code-block-preferences.md",
"redirect_url": "/dotnet/fundamentals/code-analysis/style-rules/language-rules"
@@ -165,40 +165,20 @@
"redirect_url": "/dotnet/fundamentals/code-analysis/style-rules/language-rules"
},
{
- "source_path_from_root": "/docs/fundamentals/networking/httpclient.md",
- "redirect_url": "/dotnet/fundamentals/networking/http/httpclient"
- },
- {
- "source_path_from_root": "/docs/standard/commandline/customize-help.md",
- "redirect_url": "/dotnet/standard/commandline/how-to-customize-help"
- },
- {
- "source_path_from_root": "/docs/standard/commandline/define-commands.md",
- "redirect_url": "/dotnet/standard/commandline/syntax#commands"
- },
- {
- "source_path_from_root": "/docs/standard/commandline/dependency-injection.md",
- "redirect_url": "/dotnet/standard/commandline/migration-guide-2.0.0-beta5#invocation"
- },
- {
- "source_path_from_root": "/docs/standard/commandline/handle-termination.md",
- "redirect_url": "/dotnet/standard/commandline/how-to-parse-and-invoke#process-termination-timeout"
- },
- {
- "source_path_from_root": "/docs/standard/commandline/model-binding.md",
- "redirect_url": "/dotnet/standard/commandline/how-to-parse-and-invoke"
+ "source_path_from_root": "/docs/fundamentals/networking/http/http-autoclient.md",
+ "redirect_url": "/dotnet/fundamentals/networking/http/http-overview"
},
{
- "source_path_from_root": "/docs/standard/commandline/use-middleware.md",
- "redirect_url": "/dotnet/standard/commandline/migration-guide-2.0.0-beta5#configuration"
+ "source_path_from_root": "/docs/fundamentals/networking/httpclient-guidelines.md",
+ "redirect_url": "/dotnet/fundamentals/networking/http/httpclient-guidelines"
},
{
- "source_path_from_root": "/docs/standard/commandline/tab-completion.md",
- "redirect_url": "/dotnet/standard/commandline/how-to-enable-tab-completion"
+ "source_path_from_root": "/docs/fundamentals/networking/httpclient.md",
+ "redirect_url": "/dotnet/fundamentals/networking/http/httpclient"
},
{
- "source_path_from_root": "/docs/fundamentals/networking/httpclient-guidelines.md",
- "redirect_url": "/dotnet/fundamentals/networking/http/httpclient-guidelines"
+ "source_path_from_root": "/docs/fundamentals/networking/networking-telemetry.md",
+ "redirect_url": "/dotnet/fundamentals/networking/telemetry/overview"
},
{
"source_path_from_root": "/docs/fundamentals/package-validation/baseline-version-validator.md",
@@ -225,10 +205,6 @@
"redirect_url": "/dotnet/fundamentals/apicompat/package-validation/overview",
"redirect_document_id": true
},
- {
- "source_path_from_root": "/docs/fundamentals/networking/networking-telemetry.md",
- "redirect_url": "/dotnet/fundamentals/networking/telemetry/overview"
- },
{
"source_path_from_root": "/docs/fundamentals/productivity/code-analysis.md",
"redirect_url": "/dotnet/fundamentals/code-analysis/overview"
@@ -241,6 +217,74 @@
"source_path_from_root": "/docs/fundamentals/reflection/reflection.md",
"redirect_url": "/dotnet/fundamentals/reflection/overview"
},
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/microsoft-win32-registry.md",
+ "redirect_url": "/dotnet/api/microsoft.win32.registry"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-accessviolationexception.md",
+ "redirect_url": "/dotnet/api/system.accessviolationexception"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-appcontext.md",
+ "redirect_url": "/dotnet/api/system.appcontext"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-appdomain-unhandledexception.md",
+ "redirect_url": "/dotnet/api/system.appdomain.unhandledexception"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-boolean.md",
+ "redirect_url": "/dotnet/api/system.boolean"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-byte.md",
+ "redirect_url": "/dotnet/api/system.byte"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-char.md",
+ "redirect_url": "/dotnet/api/system.char"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-collections-generic-hashset{t}.md",
+ "redirect_url": "/dotnet/api/system.collections.generic.hashset-1"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-collections-generic-list{t}.md",
+ "redirect_url": "/dotnet/api/system.collections.generic.list-1"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-collections-objectmodel-keyedcollection{tkey,titem}-changeitemkey.md",
+ "redirect_url": "/dotnet/api/system.collections.objectmodel.keyedcollection-2.changeitemkey"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-collections-objectmodel-observablecollection{t}.md",
+ "redirect_url": "/dotnet/api/system.collections.objectmodel.observablecollection-1"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-console.md",
+ "redirect_url": "/dotnet/api/system.console"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-convert.md",
+ "redirect_url": "/dotnet/api/system.convert"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-data-commandbehavior.md",
+ "redirect_url": "/dotnet/api/system.data.commandbehavior"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-data-datacolumn-expression.md",
+ "redirect_url": "/dotnet/api/system.data.datacolumn.expression"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-data-dataset.md",
+ "redirect_url": "/dotnet/api/system.data.dataset"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-data-datatable.md",
+ "redirect_url": "/dotnet/api/system.data.datatable"
+ },
{
"source_path_from_root": "/docs/fundamentals/runtime-libraries/system-data-linq-dataloadoptions.md",
"redirect_url": "/dotnet/framework/data/adonet/sql/linq/"
@@ -249,6 +293,618 @@
"source_path_from_root": "/docs/fundamentals/runtime-libraries/system-data-linq-mapping-tableattribute.md",
"redirect_url": "/dotnet/framework/data/adonet/sql/linq/"
},
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-datetime-tobinary.md",
+ "redirect_url": "/dotnet/api/system.datetime.tobinary"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-datetime-tryparse.md",
+ "redirect_url": "/dotnet/api/system.datetime.tryparse"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-datetime.md",
+ "redirect_url": "/dotnet/api/system.datetime"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-decimal.md",
+ "redirect_url": "/dotnet/api/system.decimal"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-delegate-createdelegate.md",
+ "redirect_url": "/dotnet/api/system.delegate.createdelegate"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-diagnostics-performancecountertype.md",
+ "redirect_url": "/dotnet/api/system.diagnostics.performancecountertype"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-diagnostics-processstartinfo-useshellexecute.md",
+ "redirect_url": "/dotnet/api/system.diagnostics.processstartinfo.useshellexecute"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-diagnostics-tracing-eventsource.md",
+ "redirect_url": "/dotnet/api/system.diagnostics.tracing.eventsource"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-diagnostics-tracing-eventwritteneventargs.md",
+ "redirect_url": "/dotnet/api/system.diagnostics.tracing.eventwritteneventargs"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-double-compareto.md",
+ "redirect_url": "/dotnet/api/system.double.compareto"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-double-epsilon.md",
+ "redirect_url": "/dotnet/api/system.double.epsilon"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-double-equals.md",
+ "redirect_url": "/dotnet/api/system.double.equals"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-double.md",
+ "redirect_url": "/dotnet/api/system.double"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-drawing-drawing2d-matrix.md",
+ "redirect_url": "/dotnet/api/system.drawing.drawing2d.matrix"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-dynamic-expandoobject.md",
+ "redirect_url": "/dotnet/api/system.dynamic.expandoobject"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-enum.md",
+ "redirect_url": "/dotnet/api/system.enum"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-environment-getenvironmentvariable.md",
+ "redirect_url": "/dotnet/api/system.environment.getenvironmentvariable"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-exception-data.md",
+ "redirect_url": "/dotnet/api/system.exception.data"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-exception-message.md",
+ "redirect_url": "/dotnet/api/system.exception.message"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-exception.md",
+ "redirect_url": "/dotnet/api/system.exception"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-flagsattribute.md",
+ "redirect_url": "/dotnet/api/system.flagsattribute"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-gc.md",
+ "redirect_url": "/dotnet/api/system.gc"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-compareinfo.md",
+ "redirect_url": "/dotnet/api/system.globalization.compareinfo"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-compareoptions.md",
+ "redirect_url": "/dotnet/api/system.globalization.compareoptions"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-cultureandregioninfobuilder-ctor.md",
+ "redirect_url": "/dotnet/api/system.globalization.cultureandregioninfobuilder.ctor"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-cultureandregioninfobuilder.md",
+ "redirect_url": "/dotnet/api/system.globalization.cultureandregioninfobuilder"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-cultureinfo-currentculture.md",
+ "redirect_url": "/dotnet/api/system.globalization.cultureinfo.currentculture"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-cultureinfo-currentuiculture.md",
+ "redirect_url": "/dotnet/api/system.globalization.cultureinfo.currentuiculture"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-cultureinfo-invariantculture.md",
+ "redirect_url": "/dotnet/api/system.globalization.cultureinfo.invariantculture"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-cultureinfo.md",
+ "redirect_url": "/dotnet/api/system.globalization.cultureinfo"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-datetimeformatinfo.md",
+ "redirect_url": "/dotnet/api/system.globalization.datetimeformatinfo"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-numberformatinfo.md",
+ "redirect_url": "/dotnet/api/system.globalization.numberformatinfo"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-persiancalendar.md",
+ "redirect_url": "/dotnet/api/system.globalization.persiancalendar"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-regioninfo.md",
+ "redirect_url": "/dotnet/api/system.globalization.regioninfo"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-sortkey.md",
+ "redirect_url": "/dotnet/api/system.globalization.sortkey"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-globalization-sortversion.md",
+ "redirect_url": "/dotnet/api/system.globalization.sortversion"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-iasyncdisposable.md",
+ "redirect_url": "/dotnet/api/system.iasyncdisposable"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-idisposable.md",
+ "redirect_url": "/dotnet/api/system.idisposable"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-int32.md",
+ "redirect_url": "/dotnet/api/system.int32"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-int64.md",
+ "redirect_url": "/dotnet/api/system.int64"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-invalidcastexception.md",
+ "redirect_url": "/dotnet/api/system.invalidcastexception"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-invalidoperationexception.md",
+ "redirect_url": "/dotnet/api/system.invalidoperationexception"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-io-filestream.md",
+ "redirect_url": "/dotnet/api/system.io.filestream"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-io-filesystemwatcher.md",
+ "redirect_url": "/dotnet/api/system.io.filesystemwatcher"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-linq-expressions-binaryexpression.md",
+ "redirect_url": "/dotnet/api/system.linq.expressions.binaryexpression"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-linq-expressions-expression-add.md",
+ "redirect_url": "/dotnet/api/system.linq.expressions.expression.add"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-midpointrounding.md",
+ "redirect_url": "/dotnet/api/system.midpointrounding"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-net-ftpwebrequest-proxy.md",
+ "redirect_url": "/dotnet/api/system.net.ftpwebrequest.proxy"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-net-http-httpclient.md",
+ "redirect_url": "/dotnet/api/system.net.http.httpclient"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-net-http-httpclienthandler.md",
+ "redirect_url": "/dotnet/api/system.net.http.httpclienthandler"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-net-httplistener.md",
+ "redirect_url": "/dotnet/api/system.net.httplistener"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-net-sockets-socket.md",
+ "redirect_url": "/dotnet/api/system.net.sockets.socket"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-notimplementedexception.md",
+ "redirect_url": "/dotnet/api/system.notimplementedexception"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-notsupportedexception.md",
+ "redirect_url": "/dotnet/api/system.notsupportedexception"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-nullable.md",
+ "redirect_url": "/dotnet/api/system.nullable"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-nullable{t}.md",
+ "redirect_url": "/dotnet/api/system.nullable-1"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-numerics-biginteger.md",
+ "redirect_url": "/dotnet/api/system.numerics.biginteger"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-numerics-complex.md",
+ "redirect_url": "/dotnet/api/system.numerics.complex"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-object-equals.md",
+ "redirect_url": "/dotnet/api/system.object.equals"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-object-finalize.md",
+ "redirect_url": "/dotnet/api/system.object.finalize"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-object-gethashcode.md",
+ "redirect_url": "/dotnet/api/system.object.gethashcode"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-object-tostring.md",
+ "redirect_url": "/dotnet/api/system.object.tostring"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-object.md",
+ "redirect_url": "/dotnet/api/system.object"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-random.md",
+ "redirect_url": "/dotnet/api/system.random"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-context-customreflectioncontext.md",
+ "redirect_url": "/dotnet/api/system.reflection.context.customreflectioncontext"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-emit-assemblybuilder.md",
+ "redirect_url": "/dotnet/api/system.reflection.emit.assemblybuilder"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicilinfo.md",
+ "redirect_url": "/dotnet/api/system.reflection.emit.dynamicilinfo"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicmethod-createdelegate.md",
+ "redirect_url": "/dotnet/api/system.reflection.emit.dynamicmethod.createdelegate"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicmethod-ctor.md",
+ "redirect_url": "/dotnet/api/system.reflection.emit.dynamicmethod.ctor"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicmethod-getilgenerator.md",
+ "redirect_url": "/dotnet/api/system.reflection.emit.dynamicmethod.getilgenerator"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicmethod-invoke.md",
+ "redirect_url": "/dotnet/api/system.reflection.emit.dynamicmethod.invoke"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicmethod-issecuritycritical.md",
+ "redirect_url": "/dotnet/api/system.reflection.emit.dynamicmethod.issecuritycritical"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicmethod.md",
+ "redirect_url": "/dotnet/api/system.reflection.emit.dynamicmethod"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-emit-methodbuilder.md",
+ "redirect_url": "/dotnet/api/system.reflection.emit.methodbuilder"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-emit-persistedassemblybuilder.md",
+ "redirect_url": "/dotnet/api/system.reflection.emit.persistedassemblybuilder"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-emit-typebuilder.md",
+ "redirect_url": "/dotnet/api/system.reflection.emit.typebuilder"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-reflection-portableexecutable-debugdirectoryentrytype.md",
+ "redirect_url": "/dotnet/api/system.reflection.portableexecutable.debugdirectoryentrytype"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-resources-missingmanifestresourceexception.md",
+ "redirect_url": "/dotnet/api/system.resources.missingmanifestresourceexception"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-resources-neutralresourceslanguageattribute.md",
+ "redirect_url": "/dotnet/api/system.resources.neutralresourceslanguageattribute"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-resources-resourcemanager-ctor.md",
+ "redirect_url": "/dotnet/api/system.resources.resourcemanager.ctor"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-resources-resourcemanager-getobject.md",
+ "redirect_url": "/dotnet/api/system.resources.resourcemanager.getobject"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-resources-resourcemanager-getstring.md",
+ "redirect_url": "/dotnet/api/system.resources.resourcemanager.getstring"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-resources-resourcemanager.md",
+ "redirect_url": "/dotnet/api/system.resources.resourcemanager"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-resources-resourcereader.md",
+ "redirect_url": "/dotnet/api/system.resources.resourcereader"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-resources-satellitecontractversionattribute.md",
+ "redirect_url": "/dotnet/api/system.resources.satellitecontractversionattribute"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-compilerservices-internalsvisibletoattribute.md",
+ "redirect_url": "/dotnet/api/system.runtime.compilerservices.internalsvisibletoattribute"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-compilerservices-runtimehelpers-gethashcode.md",
+ "redirect_url": "/dotnet/api/system.runtime.compilerservices.runtimehelpers.gethashcode"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-interopservices-comexception.md",
+ "redirect_url": "/dotnet/api/system.runtime.interopservices.comexception"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-interopservices-comwrappers.md",
+ "redirect_url": "/dotnet/api/system.runtime.interopservices.comwrappers"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-interopservices-icustommarshaler.md",
+ "redirect_url": "/dotnet/api/system.runtime.interopservices.icustommarshaler"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-interopservices-marshal-getactiveobject.md",
+ "redirect_url": "/dotnet/api/system.runtime.interopservices.marshal.getactiveobject"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-interopservices-safehandle.md",
+ "redirect_url": "/dotnet/api/system.runtime.interopservices.safehandle"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-loader-assemblyloadcontext.md",
+ "redirect_url": "/dotnet/api/system.runtime.loader.assemblyloadcontext"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-serialization-datacontractattribute.md",
+ "redirect_url": "/dotnet/api/system.runtime.serialization.datacontractattribute"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-serialization-datacontractserializer.md",
+ "redirect_url": "/dotnet/api/system.runtime.serialization.datacontractserializer"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-serialization-iextensibledataobject.md",
+ "redirect_url": "/dotnet/api/system.runtime.serialization.iextensibledataobject"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-serialization-xsddatacontractexporter.md",
+ "redirect_url": "/dotnet/api/system.runtime.serialization.xsddatacontractexporter"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-runtime-versioning-componentguaranteesattribute.md",
+ "redirect_url": "/dotnet/api/system.runtime.versioning.componentguaranteesattribute"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-security-cryptography-rsacryptoserviceprovider.md",
+ "redirect_url": "/dotnet/api/system.security.cryptography.rsacryptoserviceprovider"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-security-cryptography-rsaparameters.md",
+ "redirect_url": "/dotnet/api/system.security.cryptography.rsaparameters"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-security-cryptography-xml-signedxml.md",
+ "redirect_url": "/dotnet/api/system.security.cryptography.xml.signedxml"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-security-securestring.md",
+ "redirect_url": "/dotnet/api/system.security.securestring"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-single-compareto.md",
+ "redirect_url": "/dotnet/api/system.single.compareto"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-single-epsilon.md",
+ "redirect_url": "/dotnet/api/system.single.epsilon"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-single-equals.md",
+ "redirect_url": "/dotnet/api/system.single.equals"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-single.md",
+ "redirect_url": "/dotnet/api/system.single"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-span{t}.md",
+ "redirect_url": "/dotnet/api/system.span-1"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-string-ctor.md",
+ "redirect_url": "/dotnet/api/system.string.ctor"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-string-format.md",
+ "redirect_url": "/dotnet/api/system.string.format"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-string-intern.md",
+ "redirect_url": "/dotnet/api/system.string.intern"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-string-isnullorempty.md",
+ "redirect_url": "/dotnet/api/system.string.isnullorempty"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-string.md",
+ "redirect_url": "/dotnet/api/system.string"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-stringcomparer.md",
+ "redirect_url": "/dotnet/api/system.stringcomparer"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-text-encoding-default.md",
+ "redirect_url": "/dotnet/api/system.text.encoding.default"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-text-encoding.md",
+ "redirect_url": "/dotnet/api/system.text.encoding"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-text-regularexpressions-regex-match.md",
+ "redirect_url": "/dotnet/api/system.text.regularexpressions.regex.match"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-text-regularexpressions-regex.md",
+ "redirect_url": "/dotnet/api/system.text.regularexpressions.regex"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-text-rune.md",
+ "redirect_url": "/dotnet/api/system.text.rune"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-text-stringbuilder.md",
+ "redirect_url": "/dotnet/api/system.text.stringbuilder"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-threading-monitor-wait.md",
+ "redirect_url": "/dotnet/api/system.threading.monitor.wait"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-threading-monitor.md",
+ "redirect_url": "/dotnet/api/system.threading.monitor"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-threading-readerwriterlockslim.md",
+ "redirect_url": "/dotnet/api/system.threading.readerwriterlockslim"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-threading-tasks-task.md",
+ "redirect_url": "/dotnet/api/system.threading.tasks.task"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-threading-tasks-taskscheduler.md",
+ "redirect_url": "/dotnet/api/system.threading.tasks.taskscheduler"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-threading-thread.md",
+ "redirect_url": "/dotnet/api/system.threading.thread"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-timespan-parse.md",
+ "redirect_url": "/dotnet/api/system.timespan.parse"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-timespan-tryparse.md",
+ "redirect_url": "/dotnet/api/system.timespan.tryparse"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-timespan.md",
+ "redirect_url": "/dotnet/api/system.timespan"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-type-getproperty.md",
+ "redirect_url": "/dotnet/api/system.type.getproperty"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-type-gettype.md",
+ "redirect_url": "/dotnet/api/system.type.gettype"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-type-makegenerictype.md",
+ "redirect_url": "/dotnet/api/system.type.makegenerictype"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-type.md",
+ "redirect_url": "/dotnet/api/system.type"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-typeinitializationexception.md",
+ "redirect_url": "/dotnet/api/system.typeinitializationexception"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-uri.md",
+ "redirect_url": "/dotnet/api/system.uri"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-version.md",
+ "redirect_url": "/dotnet/api/system.version"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-linq-xname.md",
+ "redirect_url": "/dotnet/api/system.xml.linq.xname"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-linq-xnamespace.md",
+ "redirect_url": "/dotnet/api/system.xml.linq.xnamespace"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-schema-xmlschemaset.md",
+ "redirect_url": "/dotnet/api/system.xml.schema.xmlschemaset"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-serialization-codegenerationoptions.md",
+ "redirect_url": "/dotnet/api/system.xml.serialization.codegenerationoptions"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-serialization-xmlserializer.md",
+ "redirect_url": "/dotnet/api/system.xml.serialization.xmlserializer"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmlconvert.md",
+ "redirect_url": "/dotnet/api/system.xml.xmlconvert"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmldocument.md",
+ "redirect_url": "/dotnet/api/system.xml.xmldocument"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmlreader-create.md",
+ "redirect_url": "/dotnet/api/system.xml.xmlreader.create"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmlreader.md",
+ "redirect_url": "/dotnet/api/system.xml.xmlreader"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmlreadersettings-dtdprocessing.md",
+ "redirect_url": "/dotnet/api/system.xml.xmlreadersettings.dtdprocessing"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmlreadersettings-schemas.md",
+ "redirect_url": "/dotnet/api/system.xml.xmlreadersettings.schemas"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmlreadersettings.md",
+ "redirect_url": "/dotnet/api/system.xml.xmlreadersettings"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmlresolver.md",
+ "redirect_url": "/dotnet/api/system.xml.xmlresolver"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmlsecureresolver.md",
+ "redirect_url": "/dotnet/api/system.xml.xmlsecureresolver"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmltextreader.md",
+ "redirect_url": "/dotnet/api/system.xml.xmltextreader"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmltextwriter.md",
+ "redirect_url": "/dotnet/api/system.xml.xmltextwriter"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xmlwriter.md",
+ "redirect_url": "/dotnet/api/system.xml.xmlwriter"
+ },
+ {
+ "source_path_from_root": "/docs/fundamentals/runtime-libraries/system-xml-xsl-xslcompiledtransform.md",
+ "redirect_url": "/dotnet/api/system.xml.xsl.xslcompiledtransform"
+ },
{
"source_path_from_root": "/docs/fundamentals/syslib-diagnostics/syslib1004.md",
"redirect_url": "/dotnet/fundamentals/syslib-diagnostics/source-generator-overview"
@@ -594,8 +1250,32 @@
"redirect_url": "/dotnet/toc/tools-diagnostics/index"
},
{
- "source_path_from_root": "/docs/fundamentals/networking/http/http-autoclient.md",
- "redirect_url": "/dotnet/fundamentals/networking/http/http-overview"
+ "source_path_from_root": "/docs/standard/commandline/customize-help.md",
+ "redirect_url": "/dotnet/standard/commandline/how-to-customize-help"
+ },
+ {
+ "source_path_from_root": "/docs/standard/commandline/define-commands.md",
+ "redirect_url": "/dotnet/standard/commandline/syntax#commands"
+ },
+ {
+ "source_path_from_root": "/docs/standard/commandline/dependency-injection.md",
+ "redirect_url": "/dotnet/standard/commandline/migration-guide-2.0.0-beta5#invocation"
+ },
+ {
+ "source_path_from_root": "/docs/standard/commandline/handle-termination.md",
+ "redirect_url": "/dotnet/standard/commandline/how-to-parse-and-invoke#process-termination-timeout"
+ },
+ {
+ "source_path_from_root": "/docs/standard/commandline/model-binding.md",
+ "redirect_url": "/dotnet/standard/commandline/how-to-parse-and-invoke"
+ },
+ {
+ "source_path_from_root": "/docs/standard/commandline/tab-completion.md",
+ "redirect_url": "/dotnet/standard/commandline/how-to-enable-tab-completion"
+ },
+ {
+ "source_path_from_root": "/docs/standard/commandline/use-middleware.md",
+ "redirect_url": "/dotnet/standard/commandline/migration-guide-2.0.0-beta5#configuration"
}
]
}
diff --git a/docs/ai/evaluation/libraries.md b/docs/ai/evaluation/libraries.md
index d7f717ef7524b..f98166c11c926 100644
--- a/docs/ai/evaluation/libraries.md
+++ b/docs/ai/evaluation/libraries.md
@@ -93,11 +93,14 @@ The `dotnet aieval` tool, which ships as part of the `Microsoft.Extensions.AI.Ev
The libraries are flexible and you can pick the components you need. For example, disable response caching or tailor reporting to work best in your environment. You can also customize and configure your evaluations, for example, by adding customized metrics and reporting options.
-## Samples
+## Usage examples
-For a more comprehensive tour of the functionality and APIs in the Microsoft.Extensions.AI.Evaluation libraries, see the [API usage examples (dotnet/ai-samples repo)](https://github.com/dotnet/ai-samples/blob/main/src/microsoft-extensions-ai-evaluation/api/). These examples are a collection of unit tests. Each unit test showcases a specific concept or API and builds on the concepts and APIs showcased in previous unit tests.
+For usage examples, see the following tutorials:
+
+- [Quickstart: Evaluate response quality](evaluate-ai-response.md)
+- [Tutorial: Evaluate response quality with caching and reporting](evaluate-with-reporting.md)
+- [Tutorial: Evaluate response safety with caching and reporting](evaluate-safety.md)
## See also
-- [Quickstart: Evaluate response quality](evaluate-ai-response.md)
- [Evaluation of generative AI apps (Foundry)](/azure/ai-studio/concepts/evaluation-approach-gen-ai)
diff --git a/docs/ai/index.yml b/docs/ai/index.yml
index 393f59396a2fd..4670e2c37b67e 100644
--- a/docs/ai/index.yml
+++ b/docs/ai/index.yml
@@ -101,8 +101,6 @@ landingContent:
linkLists:
- linkListType: sample
links:
- - text: Get started resources
- url: resources/get-started.md
- text: Azure AI resources
url: resources/azure-ai.md
- text: MCP server resources
diff --git a/docs/ai/microsoft-extensions-ai.md b/docs/ai/microsoft-extensions-ai.md
index 59a8c8e5ddc32..9481fd69e52d8 100644
--- a/docs/ai/microsoft-extensions-ai.md
+++ b/docs/ai/microsoft-extensions-ai.md
@@ -57,7 +57,7 @@ You can start building with `Microsoft.Extensions.AI` in the following ways:
- **Application developers**: Use the abstractions to simplify integration into your apps. This enables portability across models and services, facilitates testing and mocking, leverages middleware provided by the ecosystem, and maintains a consistent API throughout your app, even if you use different services in different parts of your application.
- **Ecosystem contributors**: If you're interested in contributing to the ecosystem, consider writing custom middleware components.
-For more samples, see the [dotnet/ai-samples](https://aka.ms/meai-samples) GitHub repository. For an end-to-end sample, see [eShopSupport](https://github.com/dotnet/eShopSupport).
+For an end-to-end sample, see [eShopSupport](https://github.com/dotnet/eShopSupport).
## See also
diff --git a/docs/ai/quickstarts/snippets/structured-output/SOChat.csproj b/docs/ai/quickstarts/snippets/structured-output/SOChat.csproj
index 37371e88a2d64..bf7e49bcfaa08 100644
--- a/docs/ai/quickstarts/snippets/structured-output/SOChat.csproj
+++ b/docs/ai/quickstarts/snippets/structured-output/SOChat.csproj
@@ -11,10 +11,10 @@
-
-
-
-
+
+
+
+
diff --git a/docs/ai/resources/get-started.md b/docs/ai/resources/get-started.md
deleted file mode 100644
index 5355431a089c4..0000000000000
--- a/docs/ai/resources/get-started.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: Learning resources to get started with AI in .NET
-description: This article provides a list of resources for .NET developers who are starting to build AI apps with .NET.
-ms.date: 09/04/2025
-ms.topic: reference
----
-
-# Learning resources to get started with AI in .NET
-
-This article contains an organized list of the best learning resources for .NET developers who are starting to build AI apps with .NET. Resources include samples, documentation, videos, and workshops.
-
-## Tutorials
-
-- [Generative AI for beginners](https://github.com/microsoft/Generative-AI-for-beginners-dotnet)
-
-## Workshops
-
-- [AI workshop](https://github.com/dotnet-presentations/ai-workshop)
-- [Steve Sanderson's AI workshop](https://github.com/SteveSandersonMS/dotnet-ai-workshop)
-
-## Sample apps
-
-- [AI samples for .NET](https://github.com/dotnet/ai-samples)
diff --git a/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CacheResponses/ConsoleAI.CacheResponses.csproj b/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CacheResponses/ConsoleAI.CacheResponses.csproj
index d637b65e72464..5165dab9eecf2 100644
--- a/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CacheResponses/ConsoleAI.CacheResponses.csproj
+++ b/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CacheResponses/ConsoleAI.CacheResponses.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CustomClientMiddle/ConsoleAI.CustomClientMiddle.csproj b/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CustomClientMiddle/ConsoleAI.CustomClientMiddle.csproj
index 9d51b11548098..96527fac2b0f6 100644
--- a/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CustomClientMiddle/ConsoleAI.CustomClientMiddle.csproj
+++ b/docs/ai/snippets/microsoft-extensions-ai/ConsoleAI.CustomClientMiddle/ConsoleAI.CustomClientMiddle.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/docs/ai/toc.yml b/docs/ai/toc.yml
index 2a79d60b16b14..553909c99e1b6 100644
--- a/docs/ai/toc.yml
+++ b/docs/ai/toc.yml
@@ -151,8 +151,6 @@ items:
href: evaluation/evaluate-safety.md
- name: Resources
items:
- - name: Get started resources
- href: resources/get-started.md
- name: Azure AI resources
href: resources/azure-ai.md
- name: MCP server resources
diff --git a/docs/ai/vector-stores/snippets/chat-with-data/openai/VectorDataAI.csproj b/docs/ai/vector-stores/snippets/chat-with-data/openai/VectorDataAI.csproj
index 72410ef49212c..9d1ab9069f6c2 100644
--- a/docs/ai/vector-stores/snippets/chat-with-data/openai/VectorDataAI.csproj
+++ b/docs/ai/vector-stores/snippets/chat-with-data/openai/VectorDataAI.csproj
@@ -9,9 +9,9 @@
-
-
-
+
+
+
diff --git a/docs/ai/vector-stores/snippets/conceptual/VectorStoreSnippets.csproj b/docs/ai/vector-stores/snippets/conceptual/VectorStoreSnippets.csproj
index 86bf9f6a9531f..fcb52214d0132 100644
--- a/docs/ai/vector-stores/snippets/conceptual/VectorStoreSnippets.csproj
+++ b/docs/ai/vector-stores/snippets/conceptual/VectorStoreSnippets.csproj
@@ -9,8 +9,8 @@
-
-
+
+
diff --git a/docs/core/compatibility/11.md b/docs/core/compatibility/11.md
index 4dcf57ec139db..7d83696490c96 100644
--- a/docs/core/compatibility/11.md
+++ b/docs/core/compatibility/11.md
@@ -22,6 +22,7 @@ See [Breaking changes in ASP.NET Core 11](/aspnet/core/breaking-changes/11/overv
| Title | Type of change |
|-------------------------------------------------------------------|-------------------|
+| [CborReader and CborWriter enforce a default maximum nesting depth](core-libraries/11/cbor-max-depth.md) | Behavioral change |
| [CRC32 validation added when reading ZIP archive entries](core-libraries/11/ziparchive-entry-crc32-validation.md) | Behavioral change |
| [DateOnly and TimeOnly TryParse methods throw for invalid input](core-libraries/11/dateonly-timeonly-tryparse-argumentexception.md) | Behavioral change |
| [DeflateStream and GZipStream write headers and footers for empty payload](core-libraries/11/deflatestream-gzipstream-empty-payload.md) | Behavioral change |
diff --git a/docs/core/compatibility/core-libraries/11/cbor-max-depth.md b/docs/core/compatibility/core-libraries/11/cbor-max-depth.md
new file mode 100644
index 0000000000000..d9465cb1d01cd
--- /dev/null
+++ b/docs/core/compatibility/core-libraries/11/cbor-max-depth.md
@@ -0,0 +1,101 @@
+---
+title: "Breaking change: CborReader and CborWriter enforce a default maximum nesting depth"
+description: "Learn about the breaking change in .NET 11 where CborReader and CborWriter enforce a maximum nesting depth by default, throwing exceptions when the limit is exceeded."
+ms.date: 06/12/2026
+ai-usage: ai-assisted
+---
+
+# CborReader and CborWriter enforce a default maximum nesting depth
+
+Starting in .NET 11, and enforce a maximum nesting depth by default. Reading or writing CBOR data that exceeds the configured maximum depth throws an exception.
+
+## Version introduced
+
+.NET 11 Preview 5
+
+## Previous behavior
+
+Previously, `CborReader` and `CborWriter` had no maximum nesting depth limit. Reading or writing arbitrarily nested CBOR data structures succeeded without restriction.
+
+```csharp
+// Deeply nested CBOR data (100 levels of nested arrays)
+var reader = new CborReader(deeplyNestedBuffer);
+
+for (int i = 0; i < 100; i++)
+{
+ reader.ReadStartArray(); // Succeeded at any depth
+}
+```
+
+```csharp
+var writer = new CborWriter();
+
+for (int i = 0; i < 2000; i++)
+{
+ writer.WriteStartArray(1); // Succeeded at any depth
+}
+```
+
+## New behavior
+
+Starting in .NET 11, `CborReader` throws when reading a container (array, map, or indefinite-length string) that would exceed the maximum allowed depth (default: 64). `CborWriter` throws when writing a container that would exceed the maximum allowed depth (default: 1000).
+
+```csharp
+// Throws CborContentException when nesting depth exceeds 64
+var reader = new CborReader(deeplyNestedBuffer);
+
+for (int i = 0; i < 65; i++)
+{
+ reader.ReadStartArray(); // Throws CborContentException on the 65th call
+}
+```
+
+```csharp
+// Throws InvalidOperationException when nesting depth exceeds 1000
+var writer = new CborWriter();
+
+for (int i = 0; i < 1001; i++)
+{
+ writer.WriteStartArray(1); // Throws InvalidOperationException on the 1001st call
+}
+```
+
+## Type of breaking change
+
+This change is a [behavioral change](../../categories.md#behavioral-change).
+
+## Reason for change
+
+This change limits the nesting depth to prevent excessive memory consumption and execution time. When you skip over a deeply nested array or map, the system must process every element in the structure, which can use a surprising amount of memory. This change is also consistent with the behavior of and .
+
+## Recommended action
+
+If your application processes CBOR data nested more deeply than the defaults allow (64 levels for reading, 1000 levels for writing), use the new options types to specify a larger limit:
+
+```csharp
+// For reading CBOR data nested more than 64 levels deep
+var options = new CborReaderOptions { MaxDepth = 256 };
+var reader = new CborReader(data, options);
+```
+
+```csharp
+// For writing CBOR data nested more than 1000 levels deep
+var writerOptions = new CborWriterOptions { MaxDepth = 2000 };
+var writer = new CborWriter(writerOptions);
+```
+
+> [!NOTE]
+> Unlike `Utf8JsonReader`/`Utf8JsonWriter`, setting `MaxDepth = 0` in CBOR means *no nesting is allowed* (not "use the runtime default"). To use the runtime default, set `MaxDepth = -1` or omit the property when constructing `CborReaderOptions`/`CborWriterOptions`.
+
+There is no AppContext switch to restore the previous unlimited-depth behavior.
+
+## Affected APIs
+
+-
+-
+-
+-
+-
+-
+-
+-
diff --git a/docs/core/compatibility/core-libraries/8.0/complex-format.md b/docs/core/compatibility/core-libraries/8.0/complex-format.md
index 7e88328b7b72c..7a0a30cf6a4c6 100644
--- a/docs/core/compatibility/core-libraries/8.0/complex-format.md
+++ b/docs/core/compatibility/core-libraries/8.0/complex-format.md
@@ -39,4 +39,4 @@ If you need the previous format, you can use a custom string formatting mechanis
## See also
-- [Format a complex number](../../../../fundamentals/runtime-libraries/system-numerics-complex.md#format-a-complex-number)
+- [Format a complex number](xref:System.Numerics.Complex#format-a-complex-number)
diff --git a/docs/core/compatibility/extensions/10.0/configuration-null-values-preserved.md b/docs/core/compatibility/extensions/10.0/configuration-null-values-preserved.md
index f3db0f28140c1..c8e92e9adb1ed 100644
--- a/docs/core/compatibility/extensions/10.0/configuration-null-values-preserved.md
+++ b/docs/core/compatibility/extensions/10.0/configuration-null-values-preserved.md
@@ -1,7 +1,7 @@
---
title: "Breaking change: Null values preserved in configuration"
description: "Learn about the breaking change in .NET 10 where configuration providers now preserve null values instead of treating them as missing values."
-ms.date: 08/07/2025
+ms.date: 06/17/2026
ai-usage: ai-assisted
ms.custom: https://github.com/dotnet/docs/issues/46890
---
@@ -98,6 +98,20 @@ Array1: 'null', 'null'
Array2:
```
+### Non-nullable value types
+
+The binder now also binds `null` to non-nullable value-type properties (for example, `int`, `bool`, or an enum) by setting them to the type's default value (`default(T)`).
+
+Previously, with the JSON configuration provider, binding a `null` to such a property threw an `InvalidOperationException` similar to the following, because the provider had converted the `null` into an empty string and an empty string can't be converted to the target value type:
+
+```output
+Failed to convert configuration value at 'SomeSection:DayOfWeekProperty' to type 'System.DayOfWeek'.
+```
+
+Starting in .NET 10, the same binding succeeds and the property is set to its default value. For example, a `null` bound to a `DayOfWeek` property results in `DayOfWeek.Sunday` (`0`), and a `null` bound to an `int` property results in `0`. No exception is thrown.
+
+Providers that store a real `null` value, such as the in-memory provider, already bound `null` to non-nullable value-type properties by setting the default value, even before .NET 10, and the configuration source generator also matches this behavior. The change makes the JSON provider and the reflection-based binder consistent with that behavior.
+
## Type of breaking change
This is a [behavioral change](../../categories.md#behavioral-change).
@@ -112,6 +126,7 @@ If you prefer the previous behavior, you can adjust your configuration according
- When using the JSON configuration provider, replace `null` values with empty strings (`""`) to restore the original behavior, where empty strings are bound instead of `null`.
- For other providers that support `null` values, remove the `null` entries from the configuration to replicate the earlier behavior, where missing values are ignored and existing property values remain unchanged.
+- If you previously relied on an exception when a `null` value was bound to a non-nullable value-type property, note that the binder now sets the property to its default value instead. To distinguish a missing or `null` value from a real value, make the property nullable (for example, `int?` or `DayOfWeek?`) and check for `null` after binding, or validate the configuration explicitly.
## Affected APIs
diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml
index 97df21670dd6d..1395fa691738d 100644
--- a/docs/core/compatibility/toc.yml
+++ b/docs/core/compatibility/toc.yml
@@ -10,6 +10,8 @@ items:
href: 11.md
- name: Core .NET libraries
items:
+ - name: CborReader and CborWriter enforce a default maximum nesting depth
+ href: core-libraries/11/cbor-max-depth.md
- name: CRC32 validation added when reading ZIP archive entries
href: core-libraries/11/ziparchive-entry-crc32-validation.md
- name: DateOnly and TimeOnly TryParse methods throw for invalid input
diff --git a/docs/core/diagnostics/ambient-metadata/snippets/buildmetadata-usebuildmetadata/buildmetadata-usebuildmetadata.csproj b/docs/core/diagnostics/ambient-metadata/snippets/buildmetadata-usebuildmetadata/buildmetadata-usebuildmetadata.csproj
index af555e337e37e..3c24d3c0f730d 100644
--- a/docs/core/diagnostics/ambient-metadata/snippets/buildmetadata-usebuildmetadata/buildmetadata-usebuildmetadata.csproj
+++ b/docs/core/diagnostics/ambient-metadata/snippets/buildmetadata-usebuildmetadata/buildmetadata-usebuildmetadata.csproj
@@ -8,8 +8,8 @@
-
-
+
+
diff --git a/docs/core/diagnostics/snippets/resource-monitoring/resource-monitoring.csproj b/docs/core/diagnostics/snippets/resource-monitoring/resource-monitoring.csproj
index 40f65e6c216e4..4593b310d035c 100644
--- a/docs/core/diagnostics/snippets/resource-monitoring/resource-monitoring.csproj
+++ b/docs/core/diagnostics/snippets/resource-monitoring/resource-monitoring.csproj
@@ -8,10 +8,10 @@
-
-
-
-
+
+
+
+
diff --git a/docs/core/extensions/dependency-injection/snippets/basics/di-basics.csproj b/docs/core/extensions/dependency-injection/snippets/basics/di-basics.csproj
index bb46ed144bc4a..1c7fa5786be25 100644
--- a/docs/core/extensions/dependency-injection/snippets/basics/di-basics.csproj
+++ b/docs/core/extensions/dependency-injection/snippets/basics/di-basics.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/docs/core/extensions/dependency-injection/snippets/console/console-di.csproj b/docs/core/extensions/dependency-injection/snippets/console/console-di.csproj
index d478447db2d51..95db851be3e58 100644
--- a/docs/core/extensions/dependency-injection/snippets/console/console-di.csproj
+++ b/docs/core/extensions/dependency-injection/snippets/console/console-di.csproj
@@ -9,8 +9,8 @@
-
-
+
+
diff --git a/docs/core/extensions/snippets/async-state/csharp/AspNetCoreIntegration/AspNetCoreIntegration.csproj b/docs/core/extensions/snippets/async-state/csharp/AspNetCoreIntegration/AspNetCoreIntegration.csproj
index c3af359935fc2..f52ac0d633aab 100644
--- a/docs/core/extensions/snippets/async-state/csharp/AspNetCoreIntegration/AspNetCoreIntegration.csproj
+++ b/docs/core/extensions/snippets/async-state/csharp/AspNetCoreIntegration/AspNetCoreIntegration.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/docs/core/extensions/snippets/configuration/binding-scenarios/DictionaryBinding/DictionaryBinding.csproj b/docs/core/extensions/snippets/configuration/binding-scenarios/DictionaryBinding/DictionaryBinding.csproj
index af80e28f3a09b..4b4efdfa3d435 100644
--- a/docs/core/extensions/snippets/configuration/binding-scenarios/DictionaryBinding/DictionaryBinding.csproj
+++ b/docs/core/extensions/snippets/configuration/binding-scenarios/DictionaryBinding/DictionaryBinding.csproj
@@ -8,8 +8,8 @@
-
-
+
+
diff --git a/docs/core/extensions/snippets/configuration/console-basic-builder/console-basic-builder.csproj b/docs/core/extensions/snippets/configuration/console-basic-builder/console-basic-builder.csproj
index 6d8c75bbce702..a188d03bad934 100644
--- a/docs/core/extensions/snippets/configuration/console-basic-builder/console-basic-builder.csproj
+++ b/docs/core/extensions/snippets/configuration/console-basic-builder/console-basic-builder.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/docs/core/extensions/snippets/logging/getting-started-type-category-name/getting-started-type-category-name.csproj b/docs/core/extensions/snippets/logging/getting-started-type-category-name/getting-started-type-category-name.csproj
index 1f4dd6265f502..dc0acb6fd64ff 100644
--- a/docs/core/extensions/snippets/logging/getting-started-type-category-name/getting-started-type-category-name.csproj
+++ b/docs/core/extensions/snippets/logging/getting-started-type-category-name/getting-started-type-category-name.csproj
@@ -8,8 +8,8 @@
-
-
+
+
diff --git a/docs/core/porting/net-framework-tech-unavailable.md b/docs/core/porting/net-framework-tech-unavailable.md
index b07b4367e8c74..f7975f91363b2 100644
--- a/docs/core/porting/net-framework-tech-unavailable.md
+++ b/docs/core/porting/net-framework-tech-unavailable.md
@@ -59,9 +59,9 @@ Windows Workflow Foundation (WF) is not supported in .NET 6+. For an alternative
-
-
-In .NET 9, a `PersistedAssemblyBuilder` was implemented and the method was added back to the reflection emit library. To learn more about how to use this API, see [System.Reflection.Emit.PersistedAssemblyBuilder class](../../fundamentals/runtime-libraries/system-reflection-emit-persistedassemblybuilder.md).
+In .NET 9, a `PersistedAssemblyBuilder` was implemented and the method was added back to the reflection emit library. To learn more about how to use this API, see .
-For more information about the different AssemblyBuilder implementations in .NET, see [System.Reflection.Emit.AssemblyBuilder class](../../fundamentals/runtime-libraries/system-reflection-emit-assemblybuilder.md).
+For more information about the different AssemblyBuilder implementations in .NET, see .
## Loading multi-module assemblies
diff --git a/docs/core/versions/selection.md b/docs/core/versions/selection.md
index e79a1cceb2fb2..83bfb86d17e18 100644
--- a/docs/core/versions/selection.md
+++ b/docs/core/versions/selection.md
@@ -14,6 +14,9 @@ This article explains the policies used by the .NET tools, SDK, and runtime for
- Easy and efficient deployment of .NET, including security and reliability updates.
- Use the latest tools and commands independent of target runtime.
+> [!TIP]
+> If you reached this page from a "compatible .NET SDK was not found" build error, [download the .NET SDK](https://dotnet.microsoft.com/download/dotnet) to install the required version. Alternatively, update your *global.json* file to match a version that's already installed.
+
Version selection occurs:
- When you run an SDK command, [the SDK uses the latest installed version](#the-sdk-uses-the-latest-installed-version).
diff --git a/docs/core/whats-new/dotnet-9/libraries.md b/docs/core/whats-new/dotnet-9/libraries.md
index fe708a44dfe34..715b643d5f793 100644
--- a/docs/core/whats-new/dotnet-9/libraries.md
+++ b/docs/core/whats-new/dotnet-9/libraries.md
@@ -405,7 +405,7 @@ To create a `PersistedAssemblyBuilder` instance, call its constructor and pass t
:::code language="csharp" source="../snippets/dotnet-9/csharp/Reflection.cs" id="SaveAssembly":::
-The new class includes PDB support. You can emit symbol info and use it to debug a generated assembly. The API has a similar shape to the .NET Framework implementation. For more information, see [Emit symbols and generate PDB](../../../fundamentals/runtime-libraries/system-reflection-emit-persistedassemblybuilder.md#emit-symbols-and-generate-pdb).
+The new class includes PDB support. You can emit symbol info and use it to debug a generated assembly. The API has a similar shape to the .NET Framework implementation. For more information, see [Emit symbols and generate PDB](xref:System.Reflection.Emit.PersistedAssemblyBuilder#emit-symbols-and-generate-pdb).
### Type-name parsing
diff --git a/docs/csharp/distinguish-delegates-events.md b/docs/csharp/distinguish-delegates-events.md
index aa8d5ddee749c..53cad03b4a799 100644
--- a/docs/csharp/distinguish-delegates-events.md
+++ b/docs/csharp/distinguish-delegates-events.md
@@ -4,7 +4,7 @@ description: Learn the difference between delegates and events and when to use e
ms.date: 03/11/2025
ms.subservice: fundamentals
---
-# Distinguishing Delegates and Events
+# Delegates vs. events
[Previous](modern-events.md)
@@ -14,7 +14,7 @@ Both offer a late binding scenario: they enable scenarios where a component comm
With all those similarities, it's easy to have trouble determining when to use which.
-## Listening to Events is Optional
+## Listening to events is optional
The most important consideration in determining which language feature to use is whether or not there must be an attached subscriber. If your code must call the code supplied by the subscriber, you should use a design based on delegates when you need to implement callback. If your code can complete all its work without calling any subscribers, you should use a design based on events.
@@ -22,22 +22,22 @@ Consider the examples built during this section. The code you built using `List.
Consider the `Progress` event. It reports progress on a task. The task continues to proceed whether or not there are any listeners. The `FileSearcher` is another example. It would still search and find all the files that were sought, even with no event subscribers attached. UX controls still work correctly, even when there are no subscribers listening to the events. They both use designs based on events.
-## Return Values Require Delegates
+## Return values require delegates
Another consideration is the method prototype you would want for your delegate method. As you saw, the delegates used for events all have a void return type. There are idioms to create event handlers that do pass information back to event sources through modifying properties of the event argument object. While these idioms do work, they aren't as natural as returning a value from a method.
Notice that these two heuristics can often both be present: If your delegate method returns a value, it affects the algorithm in some way.
-## Events Have Private Invocation
+## Events have private invocation
Classes other than the one in which an event is contained can only add and remove event listeners; only the class containing the event can invoke the event. Events are typically public class members. By comparison, delegates are often passed as parameters and stored as private class members, if they're stored at all.
-## Event Listeners Often Have Longer Lifetimes
+## Event listeners often have longer lifetimes
The longer lifetime of event listeners is a slightly weaker justification. However, you might find that event-based designs are more natural when the event source is raising events over a long period of time. You can see examples of event-based design for UX controls on many systems. Once you subscribe to an event, the event source can raise events throughout the lifetime of the program. (You can unsubscribe from events when you no longer need them.)
Contrast that with many delegate-based designs, where a delegate is used as an argument to a method, and the delegate isn't used after that method returns.
-## Evaluate Carefully
+## Evaluate carefully
The above considerations aren't hard and fast rules. Instead, they represent guidance that can help you decide which choice is best for your particular usage. Because they're similar, you can even prototype both, and consider which would be more natural to work with. They both handle late binding scenarios well. Use the one that communicates your design the best.
diff --git a/docs/csharp/fundamentals/types/generics.md b/docs/csharp/fundamentals/types/generics.md
index fb73aeb92ed46..e808621c35893 100644
--- a/docs/csharp/fundamentals/types/generics.md
+++ b/docs/csharp/fundamentals/types/generics.md
@@ -18,7 +18,7 @@ You encounter generics constantly in everyday C#. Collections, async return type
:::code language="csharp" source="snippets/generics/Program.cs" ID="EverydayGenerics":::
-In each case, the type argument in angle brackets (``, ``, ``) tells the generic type what kind of data it holds or operates on. The compiler enforces type safety. You can't accidentally add a `string` to a `List`.
+In each case, the type argument in angle brackets (``, ``, ``) tells the generic type what kind of data it holds or operates on. The compiler enforces type safety. You can't accidentally add a `string` to a `List`.
## Consuming generic types
@@ -30,7 +30,7 @@ The namespace provides type-safe collection cl
:::code language="csharp" source="snippets/generics/Program.cs" ID="GenericCollections":::
-Generic collections prevent type errors at runtime because the errors surface at compile time instead. These collections also avoid boxing for value types, which improves performance.
+Generic collections prevent type errors at runtime because the errors surface at compile time instead. These collections also avoid boxing for value types, which improves performance.
### Generic methods
diff --git a/docs/csharp/language-reference/builtin-types/enum.md b/docs/csharp/language-reference/builtin-types/enum.md
index 1d5a74b5b009b..45b0dc49dfc47 100644
--- a/docs/csharp/language-reference/builtin-types/enum.md
+++ b/docs/csharp/language-reference/builtin-types/enum.md
@@ -63,7 +63,7 @@ If you want an enumeration type to represent a combination of choices, define en
:::code language="csharp" source="snippets/shared/EnumType.cs" id="SnippetFlags":::
-For more information and examples, see the API reference page and the [Non-exclusive members and the Flags attribute](../../../fundamentals/runtime-libraries/system-enum.md#non-exclusive-members-and-the-flags-attribute) section of the API reference page.
+For more information and examples, see and [Non-exclusive members and the Flags attribute](xref:System.Enum#non-exclusive-members-and-the-flags-attribute).
## The System.Enum type and enum constraint
diff --git a/docs/csharp/modern-events.md b/docs/csharp/modern-events.md
index 1503d8bfa8289..7c602f201ed36 100644
--- a/docs/csharp/modern-events.md
+++ b/docs/csharp/modern-events.md
@@ -10,7 +10,7 @@ ms.subservice: fundamentals
The previous article discussed the most common event patterns. .NET Core has a more relaxed pattern. In this version, the `EventHandler` definition no longer has the constraint that `TEventArgs` must be a class derived from `System.EventArgs`.
-This increases flexibility for you, and is backwards compatible. Let's start with the flexibility. The implementation for uses a method defined in one method: , which creates a shallow copy of the object. That method must use reflection in order to implement its functionality for any class derived from `EventArgs`. That functionality is easier to create in a specific derived class. That effectively means that deriving from System.EventArgs is a constraint that limits your designs, but doesn't provide any extra benefit. In fact, you can change the definitions of `FileFoundArgs` and `SearchDirectoryArgs` so that they don't derive from `EventArgs`. The program works exactly the same.
+This increases flexibility for you and is backward compatible. Let's start with the flexibility. The implementation of uses a method defined in : , which creates a shallow copy of the object. That method must use reflection in order to implement its functionality for any class derived from `EventArgs`. That functionality is easier to create in a specific derived class. That effectively means that deriving from System.EventArgs is a constraint that limits your designs, but doesn't provide any extra benefit. In fact, you can change the definitions of `FileFoundArgs` and `SearchDirectoryArgs` so that they don't derive from `EventArgs`. The program works exactly the same.
You could also change the `SearchDirectoryArgs` to a struct, if you make one more change:
@@ -22,7 +22,7 @@ You shouldn't change the `FileFoundArgs` from a class (reference type) to a stru
Next, let's consider how this change can be backwards compatible. The removal of the constraint doesn't affect any existing code. Any existing event argument types do still derive from `System.EventArgs`. Backwards compatibility is one major reason why they continue to derive from `System.EventArgs`. Any existing event subscribers are subscribers to an event that followed the classic pattern.
-Following similar logic, any event argument type created now wouldn't have any subscribers in any existing codebases. New event types that don't derive from `System.EventArgs` doesn't break those codebases.
+Following similar logic, any event argument type created now wouldn't have any subscribers in any existing codebases. New event types that don't derive from `System.EventArgs` don't break those codebases.
## Events with Async subscribers
@@ -34,7 +34,7 @@ You need to reconcile this opposing guidance. Somehow, you must create a safe `a
First, notice that the handler is marked as an async handler. Because it's being assigned to an event handler delegate type, it has a void return type. That means you must follow the pattern shown in the handler, and not allow any exceptions to be thrown out of the context of the async handler. Because it doesn't return a task, there's no task that can report the error by entering the faulted state. Because the method is async, the method can't throw the exception. (The calling method continues execution because it's `async`.) The actual runtime behavior is defined differently for different environments. It might terminate the thread or the process that owns the thread, or leave the process in an indeterminate state. All of these potential outcomes are highly undesirable.
-You should wrap the `await` expression for the async Task in your own try block. If it does cause a faulted task, you can log the error. If it's an error from which your application can't recover, you can exit the program quickly and gracefully
+You should wrap the `await` expression for the async Task in your own try block. If it does cause a faulted task, you can log the error. If it's an error from which your application can't recover, you can exit the program quickly and gracefully.
This article explained the major updates to the .NET event pattern. You might see many examples of the earlier versions in the libraries you work with. However, you should understand what the latest patterns are as well. You can see the finished code for the sample at [Program.cs](https://github.com/dotnet/docs/blob/main/docs/csharp/snippets/events/Program.cs).
diff --git a/docs/csharp/toc.yml b/docs/csharp/toc.yml
index e943cb48281bd..d73629ec9f0f5 100644
--- a/docs/csharp/toc.yml
+++ b/docs/csharp/toc.yml
@@ -412,10 +412,6 @@ items:
href: advanced-topics/expression-trees/debugging-expression-trees-in-visual-studio.md
- name: DebugView Syntax
href: advanced-topics/expression-trees/debugview-syntax.md
- - name: Supplemental API - Expression class add method
- href: ../fundamentals/runtime-libraries/system-linq-expressions-expression-add.md
- - name: Supplemental API - BinaryExpression class
- href: ../fundamentals/runtime-libraries/system-linq-expressions-binaryexpression.md
- name: Native interoperability
items:
- name: Overview
diff --git a/docs/csharp/tour-of-csharp/overview.md b/docs/csharp/tour-of-csharp/overview.md
index 8a487afbd4cc5..c007db14acabb 100644
--- a/docs/csharp/tour-of-csharp/overview.md
+++ b/docs/csharp/tour-of-csharp/overview.md
@@ -118,7 +118,7 @@ Callers can iterate the collection by using an `await foreach` statement:
:::code language="csharp" source="./snippets/shared/AsyncSamples.cs" id="UseReadSequence":::
-Finally, as part of the .NET ecosystem, you can use [Visual Studio](https://visualstudio.microsoft.com/vs), or [Visual Studio Code](https://code.visualstudio.com) with the [C# DevKit](https://code.visualstudio.com/docs/csharp/get-started). These tools provide rich understanding of C#, including the code you write. They also provide debugging capabilities.
+Finally, as part of the .NET ecosystem, you can use [Visual Studio](https://visualstudio.microsoft.com/vs) or [Visual Studio Code](https://code.visualstudio.com) with the [C# Dev Kit](https://code.visualstudio.com/docs/csharp/get-started). These tools provide a rich understanding of C#, including the code you write. They also provide debugging capabilities.
> [!TIP]
> To learn more about pattern matching, LINQ, and async programming, see the [functional techniques](../fundamentals/functional/pattern-matching.md), [LINQ overview](../linq/index.md), and [asynchronous programming](../asynchronous-programming/index.md) sections.
diff --git a/docs/csharp/tour-of-csharp/tutorials/numbers-in-csharp.md b/docs/csharp/tour-of-csharp/tutorials/numbers-in-csharp.md
index 41a12101cd0ba..e139c1aa14809 100644
--- a/docs/csharp/tour-of-csharp/tutorials/numbers-in-csharp.md
+++ b/docs/csharp/tour-of-csharp/tutorials/numbers-in-csharp.md
@@ -99,7 +99,7 @@ void WorkWithIntegers()
## Explore order of operations
-1. Comment out the call to `WorkingWithIntegers()`. This change makes the output less cluttered as you work in this section:
+1. Comment out the call to `WorkWithIntegers()`. This change makes the output less cluttered as you work in this section:
```csharp
//WorkWithIntegers();
@@ -251,7 +251,7 @@ You saw the basic numeric types in C#: integers and doubles. There's one other t
***Challenge***
-Now that you know the different numeric types, write code that calculates the area of a circle whose radius is 2.50 centimeters. Remember that the area of a circle is the radius squared multiplied by PI. One hint: the runtime contains a constant for PI, that you can use for that value. , like all constants declared in the `System.Math` namespace, is a `double` value. For that reason, you should use `double` instead of `decimal` values for this challenge.
+Now that you know the different numeric types, write code that calculates the area of a circle whose radius is 2.50 centimeters. Remember that the area of a circle is the radius squared multiplied by pi. One hint: the runtime contains a constant for pi: . Because `Math.PI` is a `double` value, you should use `double` instead of `decimal` values for this challenge.
You should get an answer between 19 and 20.
diff --git a/docs/framework/app-domains/toc.yml b/docs/framework/app-domains/toc.yml
index 80b9314f6029e..d28b02187bbc5 100644
--- a/docs/framework/app-domains/toc.yml
+++ b/docs/framework/app-domains/toc.yml
@@ -48,9 +48,5 @@ items:
href: shadow-copy-assemblies.md
- name: "How to: Receive First-Chance Exception Notifications"
href: how-to-receive-first-chance-exception-notifications.md
- - name: Supplemental API remarks
- items:
- - name: AppDomain.UnhandledException event
- href: ../../fundamentals/runtime-libraries/system-appdomain-unhandledexception.md
- name: Run Intranet Applications in Full Trust
href: running-intranet-applications-in-full-trust.md
diff --git a/docs/framework/network-programming/toc.yml b/docs/framework/network-programming/toc.yml
index 8fa29f66309d9..c4e3963ae0b64 100644
--- a/docs/framework/network-programming/toc.yml
+++ b/docs/framework/network-programming/toc.yml
@@ -49,10 +49,6 @@ items:
href: how-to-upload-files-with-ftp.md
- name: List Directory Contents with FTP
href: how-to-list-directory-contents-with-ftp.md
- - name: Supplemental API remarks
- items:
- - name: FtpWebRequest.Proxy property
- href: ../../fundamentals/runtime-libraries/system-net-ftpwebrequest-proxy.md
- name: UDP
href: using-udp-services.md
- name: Security in Network Programming
diff --git a/docs/framework/unmanaged-api/fusion/identity-attribute-blob-structure.md b/docs/framework/unmanaged-api/fusion/identity-attribute-blob-structure.md
index de1f8ca36d7c5..c80a8391b7006 100644
--- a/docs/framework/unmanaged-api/fusion/identity-attribute-blob-structure.md
+++ b/docs/framework/unmanaged-api/fusion/identity-attribute-blob-structure.md
@@ -177,7 +177,7 @@ int _cdecl wmain(int argc, LPCWSTR argv[])
goto Exit;
}
- if (! cbUsed) {
+ if (!cbUsed) {
break;
}
diff --git a/docs/fundamentals/runtime-libraries/includes/c-and-posix-cultures.md b/docs/fundamentals/runtime-libraries/includes/c-and-posix-cultures.md
deleted file mode 100644
index 1f96cbf12117c..0000000000000
--- a/docs/fundamentals/runtime-libraries/includes/c-and-posix-cultures.md
+++ /dev/null
@@ -1,2 +0,0 @@
-> [!NOTE]
-> **.NET Core running on Linux and macOS systems only:** The collation behavior for the C and Posix cultures is always case-sensitive because these cultures do not use the expected Unicode collation order. We recommend that you use a culture other than C or Posix for performing culture-sensitive, case-insensitive sorting operations.
diff --git a/docs/fundamentals/runtime-libraries/includes/calendar-era.md b/docs/fundamentals/runtime-libraries/includes/calendar-era.md
deleted file mode 100644
index cedfe03539359..0000000000000
--- a/docs/fundamentals/runtime-libraries/includes/calendar-era.md
+++ /dev/null
@@ -1,3 +0,0 @@
-
-> [!IMPORTANT]
-> Eras in the Japanese calendars are based on the emperor's reign and are therefore expected to change. For example, May 1, 2019 marked the beginning of the Reiwa era in the and . Such a change of era affects all applications that use these calendars. For more information and to determine whether your applications are affected, see [Handling a new era in the Japanese calendar in .NET](https://devblogs.microsoft.com/dotnet/handling-a-new-era-in-the-japanese-calendar-in-net/). For information on testing your applications on Windows systems to ensure their readiness for the era change, see [Prepare your application for the Japanese era change](/windows/uwp/design/globalizing/japanese-era-change). For features in .NET that support calendars with multiple eras and for best practices when working with calendars that support multiple eras, see [Working with eras](../../../standard/datetime/working-with-calendars.md#work-with-eras).
diff --git a/docs/fundamentals/runtime-libraries/includes/context.md b/docs/fundamentals/runtime-libraries/includes/context.md
deleted file mode 100644
index 48e7573b5ca2e..0000000000000
--- a/docs/fundamentals/runtime-libraries/includes/context.md
+++ /dev/null
@@ -1,2 +0,0 @@
-> [!NOTE]
-> This article provides supplementary remarks to the reference documentation for this API.
diff --git a/docs/fundamentals/runtime-libraries/includes/interpolated-strings.md b/docs/fundamentals/runtime-libraries/includes/interpolated-strings.md
deleted file mode 100644
index b5ec035942008..0000000000000
--- a/docs/fundamentals/runtime-libraries/includes/interpolated-strings.md
+++ /dev/null
@@ -1,2 +0,0 @@
-> [!IMPORTANT]
-> Instead of calling the **String.Format** method or using [composite format strings](../../../standard/base-types/composite-formatting.md), you can use *interpolated strings* if your language supports them. An interpolated string is a string that contains *interpolated expressions*. Each interpolated expression is resolved with the expression's value and included in the result string when the string is assigned. For more information, see [String interpolation (C# Reference)](../../../csharp/language-reference/tokens/interpolated.md) and [Interpolated strings (Visual Basic Reference)](../../../visual-basic/programming-guide/language-features/strings/interpolated-strings.md).
diff --git a/docs/fundamentals/runtime-libraries/includes/stringbuilder-perf-note.md b/docs/fundamentals/runtime-libraries/includes/stringbuilder-perf-note.md
deleted file mode 100644
index 776d65f66985e..0000000000000
--- a/docs/fundamentals/runtime-libraries/includes/stringbuilder-perf-note.md
+++ /dev/null
@@ -1,27 +0,0 @@
-Using character-based indexing with the property can be extremely slow under the following conditions:
-
-- The instance is large (for example, it consists of several tens of thousands of characters).
-- The is "chunky." That is, repeated calls to methods such as have automatically expanded the object's property and allocated new chunks of memory to it.
-
-Performance is severely impacted because each character access walks the entire linked list of chunks to find the correct buffer to index into.
-
-> [!NOTE]
-> Even for a large "chunky" object, using the property for index-based access to one or a small number of characters has a negligible performance impact; typically, it is an **O(n)** operation. The significant performance impact occurs when iterating the characters in the object, which is an **O(n^2)** operation.
-
-If you encounter performance issues when using character-based indexing with objects, you can use any of the following workarounds:
-
-- Convert the instance to a by calling the method, then access the characters in the string.
-
-- Copy the contents of the existing object to a new pre-sized object. Performance improves because the new object is not chunky. For example:
-
- ```csharp
- // sbOriginal is the existing StringBuilder object
- var sbNew = new StringBuilder(sbOriginal.ToString(), sbOriginal.Length);
- ```
-
- ```vb
- ' sbOriginal is the existing StringBuilder object
- Dim sbNew = New StringBuilder(sbOriginal.ToString(), sbOriginal.Length)
- ```
-
-- Set the initial capacity of the object to a value that is approximately equal to its maximum expected size by calling the constructor. Note that this allocates the entire block of memory even if the rarely reaches its maximum capacity.
diff --git a/docs/fundamentals/runtime-libraries/includes/system-drawing-common.md b/docs/fundamentals/runtime-libraries/includes/system-drawing-common.md
deleted file mode 100644
index 40e5838c17578..0000000000000
--- a/docs/fundamentals/runtime-libraries/includes/system-drawing-common.md
+++ /dev/null
@@ -1,2 +0,0 @@
-> [!NOTE]
-> In .NET 6 and later versions, the [System.Drawing.Common package](https://www.nuget.org/packages/System.Drawing.Common/), which includes this type, is only supported on Windows operating systems. Use of this type in cross-platform apps causes compile-time warnings and runtime exceptions. For more information, see [System.Drawing.Common only supported on Windows](../../../core/compatibility/core-libraries/6.0/system-drawing-common-windows-only.md).
diff --git a/docs/fundamentals/runtime-libraries/includes/unicode-categories.md b/docs/fundamentals/runtime-libraries/includes/unicode-categories.md
deleted file mode 100644
index 678e1ca7bc000..0000000000000
--- a/docs/fundamentals/runtime-libraries/includes/unicode-categories.md
+++ /dev/null
@@ -1,19 +0,0 @@
-.NET maintains its own table of characters and their corresponding categories, which ensures that a specific version of a .NET implementation running on different platforms returns identical character category information. On all .NET versions and across all OS platforms, character category information is provided by the [Unicode Character Database](https://www.unicode.org/ucd/).
-
-The following table lists .NET versions and the versions of the Unicode Standard on which their character categories are based.
-
-|.NET version|Version of the Unicode Standard|
-|----------------------------|-------------------------------------|
-|.NET Framework 1.1|[The Unicode Standard, Version 4.0.0](https://www.unicode.org/versions/Unicode4.0.0/)|
-|.NET Framework 2.0|[The Unicode Standard, Version 5.0.0](https://www.unicode.org/versions/Unicode5.0.0)|
-|.NET Framework 3.5|[The Unicode Standard, Version 5.0.0](https://www.unicode.org/versions/Unicode5.0.0)|
-|.NET Framework 4|[The Unicode Standard, Version 5.0.0](https://www.unicode.org/versions/Unicode5.0.0)|
-|.NET Framework 4.5|[The Unicode Standard, Version 6.3.0](https://www.unicode.org/versions/Unicode6.3.0/)|
-|.NET Framework 4.5.1|[The Unicode Standard, Version 6.3.0](https://www.unicode.org/versions/Unicode6.3.0/)|
-|.NET Framework 4.5.2|[The Unicode Standard, Version 6.3.0](https://www.unicode.org/versions/Unicode6.3.0/)|
-|.NET Framework 4.6|[The Unicode Standard, Version 6.3.0](https://www.unicode.org/versions/Unicode6.3.0/)|
-|.NET Framework 4.6.1|[The Unicode Standard, Version 6.3.0](https://www.unicode.org/versions/Unicode6.3.0/)|
-|.NET Framework 4.6.2 and later versions|[The Unicode Standard, Version 8.0.0](https://www.unicode.org/versions/Unicode8.0.0/)|
-|.NET Core 2.1|[The Unicode Standard, Version 8.0.0](https://www.unicode.org/versions/Unicode8.0.0/)|
-|.NET Core 3.1|[The Unicode Standard, Version 11.0.0](https://www.unicode.org/versions/Unicode11.0.0/)|
-|.NET 5|[The Unicode Standard, Version 13.0.0](https://www.unicode.org/versions/Unicode13.0.0/)|
diff --git a/docs/fundamentals/runtime-libraries/includes/untrusted-data-class-note.md b/docs/fundamentals/runtime-libraries/includes/untrusted-data-class-note.md
deleted file mode 100644
index 334a62cba7b43..0000000000000
--- a/docs/fundamentals/runtime-libraries/includes/untrusted-data-class-note.md
+++ /dev/null
@@ -1,2 +0,0 @@
-> [!IMPORTANT]
-> Calling methods from this class with untrusted data is a security risk. Call the methods from this class only with trusted data. For more information, see [Validate All Inputs](https://owasp.org/www-project-proactive-controls/v3/en/c5-validate-inputs).
diff --git a/docs/fundamentals/runtime-libraries/media/gdip-art10.gif b/docs/fundamentals/runtime-libraries/media/gdip-art10.gif
deleted file mode 100644
index 5853ca9cbb364..0000000000000
Binary files a/docs/fundamentals/runtime-libraries/media/gdip-art10.gif and /dev/null differ
diff --git a/docs/fundamentals/runtime-libraries/media/gdip-art12.gif b/docs/fundamentals/runtime-libraries/media/gdip-art12.gif
deleted file mode 100644
index 140c14f3ccae5..0000000000000
Binary files a/docs/fundamentals/runtime-libraries/media/gdip-art12.gif and /dev/null differ
diff --git a/docs/fundamentals/runtime-libraries/microsoft-win32-registry.md b/docs/fundamentals/runtime-libraries/microsoft-win32-registry.md
deleted file mode 100644
index 8731a2a88ae6d..0000000000000
--- a/docs/fundamentals/runtime-libraries/microsoft-win32-registry.md
+++ /dev/null
@@ -1,36 +0,0 @@
----
-title: Microsoft.Win32.Registry class
-description: Learn about the Microsoft.Win32.Registry class.
-ms.date: 12/31/2023
----
-# The Microsoft.Win32.Registry class
-
-[!INCLUDE [context](includes/context.md)]
-
-The class provides the set of standard root keys found in the registry on machines running Windows. The registry is a storage facility for information about applications, users, and default system settings. Applications can use the registry for storing information that needs to be preserved after the application is closed, and access that same information when the application is reloaded. For example, you can store color preferences, screen locations, or the size of a window. You can control this data for each user by storing the information in a different location in the registry.
-
-The base, or root, instances that are exposed by the `Registry` class delineate the basic storage mechanism for subkeys and values in the registry. All keys are read-only because the registry depends on their existence. The keys exposed by `Registry` are:
-
-| Key | Description |
-|-------------------------------------------------|--------------------------------------------------------------------|
-| | Stores information about user preferences. |
-| | Stores configuration information for the local machine. |
-| | Stores information about types (and classes) and their properties. |
-| | Stores information about the default user configuration. |
-| | Stores performance information for software components. |
-| | Stores non-user-specific hardware information. |
-| | Stores dynamic data. |
-
-Once you've identified the root key under which you want to store/retrieve information from the registry, you can use the class to add or remove subkeys and manipulate the values for a given key.
-
-Hardware devices can place information in the registry automatically using the Plug and Play interface. Software for installing device drivers can place information in the registry by writing to standard APIs.
-
-## Static methods for getting and setting values
-
-The class also contains `static` and methods for setting and retrieving values from registry keys. These methods open and close registry keys each time they're used. So when you access a large number of values, they don't perform as well as analogous methods in the class.
-
-The class also provides methods that allow you to:
-
-- Set Windows access control security for registry keys.
-- Test the data type of a value before retrieving it.
-- Delete keys.
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/List/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/List/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/List/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/List/Overview/vb/module1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/List/Overview/vb/module1.vb
deleted file mode 100644
index 155af7209feec..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/List/Overview/vb/module1.vb
+++ /dev/null
@@ -1,183 +0,0 @@
-'
-
-' Simple business object. A PartId is used to identify the type of part
-' but the part name can change.
-Public Class Part
- Implements IEquatable(Of Part)
- Public Property PartName() As String
- Get
- Return m_PartName
- End Get
- Set(value As String)
- m_PartName = value
- End Set
- End Property
- Private m_PartName As String
-
- Public Property PartId() As Integer
- Get
- Return m_PartId
- End Get
- Set(value As Integer)
- m_PartId = value
- End Set
- End Property
- Private m_PartId As Integer
-
- Public Overrides Function ToString() As String
- Return "ID: " & PartId & " Name: " & PartName
- End Function
- Public Overrides Function Equals(obj As Object) As Boolean
- If obj Is Nothing Then
- Return False
- End If
- Dim objAsPart As Part = TryCast(obj, Part)
- If objAsPart Is Nothing Then
- Return False
- Else
- Return Equals(objAsPart)
- End If
- End Function
- Public Overrides Function GetHashCode() As Integer
- Return PartId
- End Function
- Public Overloads Function Equals(other As Part) As Boolean _
- Implements IEquatable(Of Part).Equals
- If other Is Nothing Then
- Return False
- End If
- Return (Me.PartId.Equals(other.PartId))
- End Function
- ' Should also override == and != operators.
-
-End Class
-Public Class Example
- Public Shared Sub Main()
- ' Create a list of parts.
- Dim parts As New List(Of Part)()
-
- ' Add parts to the list.
- parts.Add(New Part() With {
- .PartName = "crank arm",
- .PartId = 1234
- })
- parts.Add(New Part() With {
- .PartName = "chain ring",
- .PartId = 1334
- })
- parts.Add(New Part() With {
- .PartName = "regular seat",
- .PartId = 1434
- })
- parts.Add(New Part() With {
- .PartName = "banana seat",
- .PartId = 1444
- })
- parts.Add(New Part() With {
- .PartName = "cassette",
- .PartId = 1534
- })
- parts.Add(New Part() With {
- .PartName = "shift lever",
- .PartId = 1634
- })
-
-
-
- ' Write out the parts in the list. This will call the overridden ToString method
- ' in the Part class.
- Console.WriteLine()
- For Each aPart As Part In parts
- Console.WriteLine(aPart)
- Next
-
-
- ' Check the list for part #1734. This calls the IEquatable.Equals method
- ' of the Part class, which checks the PartId for equality.
- Console.WriteLine(vbLf & "Contains(""1734""): {0}", parts.Contains(New Part() With {
- .PartId = 1734,
- .PartName = ""
- }))
-
- ' Insert a new item at position 2.
- Console.WriteLine(vbLf & "Insert(2, ""1834"")")
- parts.Insert(2, New Part() With {
- .PartName = "brake lever",
- .PartId = 1834
- })
-
-
- 'Console.WriteLine();
- For Each aPart As Part In parts
- Console.WriteLine(aPart)
- Next
-
- Console.WriteLine(vbLf & "Parts[3]: {0}", parts(3))
-
- Console.WriteLine(vbLf & "Remove(""1534"")")
-
- ' This will remove part 1534 even though the PartName is different,
- ' because the Equals method only checks PartId for equality.
- parts.Remove(New Part() With {
- .PartId = 1534,
- .PartName = "cogs"
- })
-
- Console.WriteLine()
- For Each aPart As Part In parts
- Console.WriteLine(aPart)
- Next
-
- Console.WriteLine(vbLf & "RemoveAt(3)")
- ' This will remove part at index 3.
- parts.RemoveAt(3)
-
- Console.WriteLine()
- For Each aPart As Part In parts
- Console.WriteLine(aPart)
- Next
- End Sub
- '
- ' This example code produces the following output:
- ' ID: 1234 Name: crank arm
- ' ID: 1334 Name: chain ring
- ' ID: 1434 Name: regular seat
- ' ID: 1444 Name: banana seat
- ' ID: 1534 Name: cassette
- ' ID: 1634 Name: shift lever
- '
- ' Contains("1734"): False
- '
- ' Insert(2, "1834")
- ' ID: 1234 Name: crank arm
- ' ID: 1334 Name: chain ring
- ' ID: 1834 Name: brake lever
- ' ID: 1434 Name: regular seat
- ' ID: 1444 Name: banana seat
- ' ID: 1534 Name: cassette
- ' ID: 1634 Name: shift lever
- '
- ' Parts[3]: ID: 1434 Name: regular seat
- '
- ' Remove("1534")
- '
- ' ID: 1234 Name: crank arm
- ' ID: 1334 Name: chain ring
- ' ID: 1834 Name: brake lever
- ' ID: 1434 Name: regular seat
- ' ID: 1444 Name: banana seat
- ' ID: 1634 Name: shift lever
- ' '
- ' RemoveAt(3)
- '
- ' ID: 1234 Name: crank arm
- ' ID: 1334 Name: chain ring
- ' ID: 1834 Name: brake lever
- ' ID: 1444 Name: banana seat
- ' ID: 1634 Name: shift lever
- '
-
-End Class
-'
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/List/Overview/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/List/Overview/vb/source.vb
deleted file mode 100644
index 99fd775472da2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/List/Overview/vb/source.vb
+++ /dev/null
@@ -1,100 +0,0 @@
-'
-Public Class Example2
-
- Public Shared Sub Main()
- '
- Dim dinosaurs As New List(Of String)
-
- Console.WriteLine(vbLf & "Capacity: {0}", dinosaurs.Capacity)
-
- dinosaurs.Add("Tyrannosaurus")
- dinosaurs.Add("Amargasaurus")
- dinosaurs.Add("Mamenchisaurus")
- dinosaurs.Add("Deinonychus")
- dinosaurs.Add("Compsognathus")
- '
-
- Console.WriteLine()
- For Each dinosaur As String In dinosaurs
- Console.WriteLine(dinosaur)
- Next
-
- Console.WriteLine(vbLf & "Capacity: {0}", dinosaurs.Capacity)
- Console.WriteLine("Count: {0}", dinosaurs.Count)
-
- Console.WriteLine(vbLf & "Contains(""Deinonychus""): {0}",
- dinosaurs.Contains("Deinonychus"))
-
- Console.WriteLine(vbLf & "Insert(2, ""Compsognathus"")")
- dinosaurs.Insert(2, "Compsognathus")
-
- Console.WriteLine()
- For Each dinosaur As String In dinosaurs
- Console.WriteLine(dinosaur)
- Next
- '
- ' Shows how to access the list using the Item property.
- Console.WriteLine(vbLf & "dinosaurs(3): {0}", dinosaurs(3))
- '
- Console.WriteLine(vbLf & "Remove(""Compsognathus"")")
- dinosaurs.Remove("Compsognathus")
-
- Console.WriteLine()
- For Each dinosaur As String In dinosaurs
- Console.WriteLine(dinosaur)
- Next
-
- dinosaurs.TrimExcess()
- Console.WriteLine(vbLf & "TrimExcess()")
- Console.WriteLine("Capacity: {0}", dinosaurs.Capacity)
- Console.WriteLine("Count: {0}", dinosaurs.Count)
-
- dinosaurs.Clear()
- Console.WriteLine(vbLf & "Clear()")
- Console.WriteLine("Capacity: {0}", dinosaurs.Capacity)
- Console.WriteLine("Count: {0}", dinosaurs.Count)
- End Sub
-End Class
-
-' This code example produces the following output:
-'
-'Capacity: 0
-'
-'Tyrannosaurus
-'Amargasaurus
-'Mamenchisaurus
-'Deinonychus
-'Compsognathus
-'
-'Capacity: 8
-'Count: 5
-'
-'Contains("Deinonychus"): True
-'
-'Insert(2, "Compsognathus")
-'
-'Tyrannosaurus
-'Amargasaurus
-'Compsognathus
-'Mamenchisaurus
-'Deinonychus
-'Compsognathus
-'
-'dinosaurs(3): Mamenchisaurus
-'
-'Remove("Compsognathus")
-'
-'Tyrannosaurus
-'Amargasaurus
-'Mamenchisaurus
-'Deinonychus
-'Compsognathus
-'
-'TrimExcess()
-'Capacity: 5
-'Count: 5
-'
-'Clear()
-'Capacity: 5
-'Count: 0
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/csharp/program.cs b/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/csharp/program.cs
deleted file mode 100644
index b6fd5ec5718b4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/csharp/program.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-// Simple business object. A PartId is used to identify the type of part
-// but the part name can change.
-public class Part : IEquatable
-{
- public string PartName { get; set; }
-
- public int PartId { get; set; }
-
- public override string ToString()
- {
- return "ID: " + PartId + " Name: " + PartName;
- }
- public override bool Equals(object obj)
- {
- if (obj == null) return false;
- Part objAsPart = obj as Part;
- if (objAsPart == null) return false;
- else return Equals(objAsPart);
- }
- public override int GetHashCode()
- {
- return PartId;
- }
- public bool Equals(Part other)
- {
- if (other == null) return false;
- return (this.PartId.Equals(other.PartId));
- }
- // Should also override == and != operators.
-}
-
-public class Example
-{
- public static void Main()
- {
- // Create a list of parts.
- List parts =
- [
- // Add parts to the list.
- new Part() { PartName = "crank arm", PartId = 1234 },
- new Part() { PartName = "chain ring", PartId = 1334 },
- new Part() { PartName = "regular seat", PartId = 1434 },
- new Part() { PartName = "banana seat", PartId = 1444 },
- new Part() { PartName = "cassette", PartId = 1534 },
- new Part() { PartName = "shift lever", PartId = 1634 },
- ];
-
- // Write out the parts in the list. This will call the overridden ToString method
- // in the Part class.
- Console.WriteLine();
- foreach (Part aPart in parts)
- {
- Console.WriteLine(aPart);
- }
-
- // Check the list for part #1734. This calls the IEquatable.Equals method
- // of the Part class, which checks the PartId for equality.
- Console.WriteLine($"""
- Contains("1734"): {parts.Contains(new Part { PartId = 1734, PartName = "" })}
- """);
-
- // Insert a new item at position 2.
- Console.WriteLine("\nInsert(2, \"1834\")");
- parts.Insert(2, new Part() { PartName = "brake lever", PartId = 1834 });
-
- //Console.WriteLine();
- foreach (Part aPart in parts)
- {
- Console.WriteLine(aPart);
- }
-
- Console.WriteLine($"\nParts[3]: {parts[3]}");
-
- Console.WriteLine("\nRemove(\"1534\")");
-
- // This will remove part 1534 even though the PartName is different,
- // because the Equals method only checks PartId for equality.
- parts.Remove(new Part() { PartId = 1534, PartName = "cogs" });
-
- Console.WriteLine();
- foreach (Part aPart in parts)
- {
- Console.WriteLine(aPart);
- }
- Console.WriteLine("\nRemoveAt(3)");
- // This will remove the part at index 3.
- parts.RemoveAt(3);
-
- Console.WriteLine();
- foreach (Part aPart in parts)
- {
- Console.WriteLine(aPart);
- }
-
- /*
-
- ID: 1234 Name: crank arm
- ID: 1334 Name: chain ring
- ID: 1434 Name: regular seat
- ID: 1444 Name: banana seat
- ID: 1534 Name: cassette
- ID: 1634 Name: shift lever
-
- Contains("1734"): False
-
- Insert(2, "1834")
- ID: 1234 Name: crank arm
- ID: 1334 Name: chain ring
- ID: 1834 Name: brake lever
- ID: 1434 Name: regular seat
- ID: 1444 Name: banana seat
- ID: 1534 Name: cassette
- ID: 1634 Name: shift lever
-
- Parts[3]: ID: 1434 Name: regular seat
-
- Remove("1534")
-
- ID: 1234 Name: crank arm
- ID: 1334 Name: chain ring
- ID: 1834 Name: brake lever
- ID: 1434 Name: regular seat
- ID: 1444 Name: banana seat
- ID: 1634 Name: shift lever
-
- RemoveAt(3)
-
- ID: 1234 Name: crank arm
- ID: 1334 Name: chain ring
- ID: 1834 Name: brake lever
- ID: 1444 Name: banana seat
- ID: 1634 Name: shift lever
-
-
- */
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/csharp/source.cs
deleted file mode 100644
index 412fe738ae214..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/csharp/source.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-public class Example2
-{
- public static void Main()
- {
- //
- //
- List dinosaurs = new List();
-
- Console.WriteLine($"\nCapacity: {dinosaurs.Capacity}");
-
- dinosaurs.Add("Tyrannosaurus");
- dinosaurs.Add("Amargasaurus");
- dinosaurs.Add("Mamenchisaurus");
- dinosaurs.Add("Deinonychus");
- dinosaurs.Add("Compsognathus");
- //
- Console.WriteLine();
- foreach (string dinosaur in dinosaurs)
- {
- Console.WriteLine(dinosaur);
- }
-
- Console.WriteLine($"\nCapacity: {dinosaurs.Capacity}");
- Console.WriteLine($"Count: {dinosaurs.Count}");
-
- Console.WriteLine($"""\nContains("Deinonychus"): {dinosaurs.Contains("Deinonychus")}""");
-
- Console.WriteLine("\nInsert(2, \"Compsognathus\")");
- dinosaurs.Insert(2, "Compsognathus");
-
- Console.WriteLine();
- foreach (string dinosaur in dinosaurs)
- {
- Console.WriteLine(dinosaur);
- }
-
- //
- // Shows accessing the list using the Item property.
- Console.WriteLine($"\ndinosaurs[3]: {dinosaurs[3]}");
- //
-
- Console.WriteLine("\nRemove(\"Compsognathus\")");
- dinosaurs.Remove("Compsognathus");
-
- Console.WriteLine();
- foreach (string dinosaur in dinosaurs)
- {
- Console.WriteLine(dinosaur);
- }
-
- dinosaurs.TrimExcess();
- Console.WriteLine("\nTrimExcess()");
- Console.WriteLine($"Capacity: {dinosaurs.Capacity}");
- Console.WriteLine($"Count: {dinosaurs.Count}");
-
- dinosaurs.Clear();
- Console.WriteLine("\nClear()");
- Console.WriteLine($"Capacity: {dinosaurs.Capacity}");
- Console.WriteLine($"Count: {dinosaurs.Count}");
-
- /* This code example produces the following output:
-
- Capacity: 0
-
- Tyrannosaurus
- Amargasaurus
- Mamenchisaurus
- Deinonychus
- Compsognathus
-
- Capacity: 8
- Count: 5
-
- Contains("Deinonychus"): True
-
- Insert(2, "Compsognathus")
-
- Tyrannosaurus
- Amargasaurus
- Compsognathus
- Mamenchisaurus
- Deinonychus
- Compsognathus
-
- dinosaurs[3]: Mamenchisaurus
-
- Remove("Compsognathus")
-
- Tyrannosaurus
- Amargasaurus
- Mamenchisaurus
- Deinonychus
- Compsognathus
-
- TrimExcess()
- Capacity: 5
- Count: 5
-
- Clear()
- Capacity: 5
- Count: 0
- */
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/fsharp/addremoveinsert.fs b/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/fsharp/addremoveinsert.fs
deleted file mode 100644
index 2909b9f54a6c3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/fsharp/addremoveinsert.fs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-
-// Simple business object. A PartId is used to identify the type of part
-// but the part name can change.
-[]
-type Part = { PartId : int ; mutable PartName : string } with
- override this.GetHashCode() = hash this.PartId
- override this.Equals(other) =
- match other with
- | :? Part as p -> this.PartId = p.PartId
- | _ -> false
- override this.ToString() = sprintf "ID: %i Name: %s" this.PartId this.PartName
-
-[]
-let main argv =
- // We refer to System.Collections.Generic.List<'T> by its type
- // abbreviation ResizeArray<'T> to avoid conflicts with the F# List module.
- // Note: In F# code, F# linked lists are usually preferred over
- // ResizeArray<'T> when an extendable collection is required.
- let parts = ResizeArray<_>()
- parts.Add({PartName = "crank arm" ; PartId = 1234})
- parts.Add({PartName = "chain ring"; PartId = 1334 })
- parts.Add({PartName = "regular seat"; PartId = 1434 })
- parts.Add({PartName = "banana seat"; PartId = 1444 })
- parts.Add({PartName = "cassette"; PartId = 1534 })
- parts.Add({PartName = "shift lever"; PartId = 1634 })
-
- // Write out the parts in the ResizeArray. This will call the overridden ToString method
- // in the Part type
- printfn ""
- parts |> Seq.iter (fun p -> printfn "%O" p)
-
- // Check the ResizeArray for part #1734. This calls the IEquatable.Equals method
- // of the Part type, which checks the PartId for equality.
- printfn "\nContains(\"1734\"): %b" (parts.Contains({PartId=1734; PartName=""}))
-
- // Insert a new item at position 2.
- printfn "\nInsert(2, \"1834\")"
- parts.Insert(2, { PartName = "brake lever"; PartId = 1834 })
-
- // Write out all parts
- parts |> Seq.iter (fun p -> printfn "%O" p)
-
- printfn "\nParts[3]: %O" parts.[3]
-
- printfn "\nRemove(\"1534\")"
- // This will remove part 1534 even though the PartName is different,
- // because the Equals method only checks PartId for equality.
- // Since Remove returns true or false, we need to ignore the result
- parts.Remove({PartId=1534; PartName="cogs"}) |> ignore
-
- // Write out all parts
- printfn ""
- parts |> Seq.iter (fun p -> printfn "%O" p)
-
- printfn "\nRemoveAt(3)"
- // This will remove the part at index 3.
- parts.RemoveAt(3)
-
- // Write out all parts
- printfn ""
- parts |> Seq.iter (fun p -> printfn "%O" p)
-
- 0 // return an integer exit code
-
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/fsharp/listclass.fs b/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/fsharp/listclass.fs
deleted file mode 100644
index 7a462508dac72..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Collections.Generic/ListT/Overview/fsharp/listclass.fs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-
-[]
-let main argv =
- // We refer to System.Collections.Generic.List<'T> by its type
- // abbreviation ResizeArray<'T> to avoid conflict with the List module.
- // Note: In F# code, F# linked lists are usually preferred over
- // ResizeArray<'T> when an extendable collection is required.
- let dinosaurs = ResizeArray<_>()
-
- // Write out the dinosaurs in the ResizeArray.
- let printDinosaurs() =
- printfn ""
- dinosaurs |> Seq.iter (fun p -> printfn "%O" p)
-
-
- printfn "\nCapacity: %i" dinosaurs.Capacity
-
- dinosaurs.Add("Tyrannosaurus")
- dinosaurs.Add("Amargasaurus")
- dinosaurs.Add("Mamenchisaurus")
- dinosaurs.Add("Deinonychus")
- dinosaurs.Add("Compsognathus")
-
- printDinosaurs()
-
- printfn "\nCapacity: %i" dinosaurs.Capacity
- printfn "Count: %i" dinosaurs.Count
-
- printfn "\nContains(\"Deinonychus\"): %b" (dinosaurs.Contains("Deinonychus"))
-
- printfn "\nInsert(2, \"Compsognathus\")"
- dinosaurs.Insert(2, "Compsognathus")
-
- printDinosaurs()
-
- // Shows accessing the list using the Item property.
- printfn "\ndinosaurs[3]: %s" dinosaurs.[3]
-
- printfn "\nRemove(\"Compsognathus\")"
- dinosaurs.Remove("Compsognathus") |> ignore
-
- printDinosaurs()
-
- dinosaurs.TrimExcess()
- printfn "\nTrimExcess()"
- printfn "Capacity: %i" dinosaurs.Capacity
- printfn "Count: %i" dinosaurs.Count
-
- dinosaurs.Clear()
- printfn "\nClear()"
- printfn "Capacity: %i" dinosaurs.Capacity
- printfn "Count: %i" dinosaurs.Count
-
- 0 // return an integer exit code
-
- (* This code example produces the following output:
-
-Capacity: 0
-
-Tyrannosaurus
-Amargasaurus
-Mamenchisaurus
-Deinonychus
-Compsognathus
-
-Capacity: 8
-Count: 5
-
-Contains("Deinonychus"): true
-
-Insert(2, "Compsognathus")
-
-Tyrannosaurus
-Amargasaurus
-Compsognathus
-Mamenchisaurus
-Deinonychus
-Compsognathus
-
-dinosaurs[3]: Mamenchisaurus
-
-Remove("Compsognathus")
-
-Tyrannosaurus
-Amargasaurus
-Mamenchisaurus
-Deinonychus
-Compsognathus
-
-TrimExcess()
-Capacity: 5
-Count: 5
-
-Clear()
-Capacity: 5
-Count: 0
- *)
-
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/cs/project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/cs/project.csproj
deleted file mode 100644
index 9aedb06e7240e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/cs/project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net4.8
- true
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/cs/source.cs b/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/cs/source.cs
deleted file mode 100644
index 3335a193e9557..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/cs/source.cs
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-using System;
-using System.Data;
-
-class Program
-{
- static void Main(string[] args)
- {
- // Create two tables and add them into the DataSet
- DataTable orderTable = CreateOrderTable();
- DataTable orderDetailTable = CreateOrderDetailTable();
- DataSet salesSet = new DataSet();
- salesSet.Tables.Add(orderTable);
- salesSet.Tables.Add(orderDetailTable);
-
- // Set the relations between the tables and create the related constraint.
- salesSet.Relations.Add("OrderOrderDetail", orderTable.Columns["OrderId"], orderDetailTable.Columns["OrderId"], true);
-
- Console.WriteLine("After creating the foreign key constriant, you will see the following error if inserting order detail with the wrong OrderId: ");
- try
- {
- DataRow errorRow = orderDetailTable.NewRow();
- errorRow[0] = 1;
- errorRow[1] = "O0007";
- orderDetailTable.Rows.Add(errorRow);
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- }
- Console.WriteLine();
-
- // Insert the rows into the table
- InsertOrders(orderTable);
- InsertOrderDetails(orderDetailTable);
-
- Console.WriteLine("The initial Order table.");
- ShowTable(orderTable);
-
- Console.WriteLine("The OrderDetail table.");
- ShowTable(orderDetailTable);
-
- // Use the Aggregate-Sum on the child table column to get the result.
- DataColumn colSub = new DataColumn("SubTotal", typeof(Decimal), "Sum(Child.LineTotal)");
- orderTable.Columns.Add(colSub);
-
- // Compute the tax by referencing the SubTotal expression column.
- DataColumn colTax = new DataColumn("Tax", typeof(Decimal), "SubTotal*0.1");
- orderTable.Columns.Add(colTax);
-
- // If the OrderId is 'Total', compute the due on all orders; or compute the due on this order.
- DataColumn colTotal = new DataColumn("TotalDue", typeof(Decimal), "IIF(OrderId='Total',Sum(SubTotal)+Sum(Tax),SubTotal+Tax)");
- orderTable.Columns.Add(colTotal);
-
- DataRow row = orderTable.NewRow();
- row["OrderId"] = "Total";
- orderTable.Rows.Add(row);
-
- Console.WriteLine("The Order table with the expression columns.");
- ShowTable(orderTable);
-
- Console.WriteLine("Press any key to exit.....");
- Console.ReadKey();
- }
-
- private static DataTable CreateOrderTable()
- {
- DataTable orderTable = new DataTable("Order");
-
- // Define one column.
- DataColumn colId = new DataColumn("OrderId", typeof(String));
- orderTable.Columns.Add(colId);
-
- DataColumn colDate = new DataColumn("OrderDate", typeof(DateTime));
- orderTable.Columns.Add(colDate);
-
- // Set the OrderId column as the primary key.
- orderTable.PrimaryKey = new DataColumn[] { colId };
-
- return orderTable;
- }
-
- private static DataTable CreateOrderDetailTable()
- {
- DataTable orderDetailTable = new DataTable("OrderDetail");
-
- // Define all the columns once.
- DataColumn[] cols =
- {
- new DataColumn("OrderDetailId", typeof(Int32)),
- new DataColumn("OrderId", typeof(String)),
- new DataColumn("Product", typeof(String)),
- new DataColumn("UnitPrice", typeof(Decimal)),
- new DataColumn("OrderQty", typeof(Int32)),
- new DataColumn("LineTotal", typeof(Decimal), "UnitPrice*OrderQty")
- };
-
- orderDetailTable.Columns.AddRange(cols);
- orderDetailTable.PrimaryKey = new DataColumn[] { orderDetailTable.Columns["OrderDetailId"] };
- return orderDetailTable;
- }
-
- private static void InsertOrders(DataTable orderTable)
- {
- // Add one row once.
- DataRow row1 = orderTable.NewRow();
- row1["OrderId"] = "O0001";
- row1["OrderDate"] = new DateTime(2013, 3, 1);
- orderTable.Rows.Add(row1);
-
- DataRow row2 = orderTable.NewRow();
- row2["OrderId"] = "O0002";
- row2["OrderDate"] = new DateTime(2013, 3, 12);
- orderTable.Rows.Add(row2);
-
- DataRow row3 = orderTable.NewRow();
- row3["OrderId"] = "O0003";
- row3["OrderDate"] = new DateTime(2013, 3, 20);
- orderTable.Rows.Add(row3);
- }
-
- private static void InsertOrderDetails(DataTable orderDetailTable)
- {
- // Use an Object array to insert all the rows .
- // Values in the array are matched sequentially to the columns, based on the order in which they appear in the table.
- Object[] rows =
- {
- new Object[] { 1, "O0001", "Mountain Bike", 1419.5, 36 },
- new Object[] { 2, "O0001", "Road Bike", 1233.6, 16 },
- new Object[] { 3, "O0001", "Touring Bike", 1653.3, 32 },
- new Object[] { 4, "O0002", "Mountain Bike", 1419.5, 24 },
- new Object[] { 5, "O0002", "Road Bike", 1233.6, 12 },
- new Object[] { 6, "O0003", "Mountain Bike", 1419.5, 48 },
- new Object[] { 7, "O0003", "Touring Bike", 1653.3, 8 },
- };
-
- foreach (Object[] row in rows)
- {
- orderDetailTable.Rows.Add(row);
- }
- }
-
- private static void ShowTable(DataTable table)
- {
- foreach (DataColumn col in table.Columns)
- {
- Console.Write("{0,-14}", col.ColumnName);
- }
- Console.WriteLine();
-
- foreach (DataRow row in table.Rows)
- {
- foreach (DataColumn col in table.Columns)
- {
- if (col.DataType.Equals(typeof(DateTime)))
- Console.Write("{0,-14:d}", row[col]);
- else if (col.DataType.Equals(typeof(Decimal)))
- Console.Write("{0,-14:C}", row[col]);
- else
- Console.Write("{0,-14}", row[col]);
- }
- Console.WriteLine();
- }
- Console.WriteLine();
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/vb/source.vb
deleted file mode 100644
index 1b0b43cdbbe34..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Data/DataTable/Overview/vb/source.vb
+++ /dev/null
@@ -1,137 +0,0 @@
-'
-Imports System.Data
-
-Class Program
- Public Shared Sub Main(args As String())
- ' Create two tables and add them into the DataSet
- Dim orderTable As DataTable = CreateOrderTable()
- Dim orderDetailTable As DataTable = CreateOrderDetailTable()
- Dim salesSet As New DataSet()
- salesSet.Tables.Add(orderTable)
- salesSet.Tables.Add(orderDetailTable)
-
- ' Set the relations between the tables and create the related constraint.
- salesSet.Relations.Add("OrderOrderDetail", orderTable.Columns("OrderId"), orderDetailTable.Columns("OrderId"), True)
-
- Console.WriteLine("After creating the foreign key constriant, you will see the following error if inserting order detail with the wrong OrderId: ")
- Try
- Dim errorRow As DataRow = orderDetailTable.NewRow()
- errorRow(0) = 1
- errorRow(1) = "O0007"
- orderDetailTable.Rows.Add(errorRow)
- Catch e As Exception
- Console.WriteLine(e.Message)
- End Try
- Console.WriteLine()
-
- ' Insert the rows into the table
- InsertOrders(orderTable)
- InsertOrderDetails(orderDetailTable)
-
- Console.WriteLine("The initial Order table.")
- ShowTable(orderTable)
-
- Console.WriteLine("The OrderDetail table.")
- ShowTable(orderDetailTable)
-
- ' Use the Aggregate-Sum on the child table column to get the result.
- Dim colSub As New DataColumn("SubTotal", GetType([Decimal]), "Sum(Child.LineTotal)")
- orderTable.Columns.Add(colSub)
-
- ' Compute the tax by referencing the SubTotal expression column.
- Dim colTax As New DataColumn("Tax", GetType([Decimal]), "SubTotal*0.1")
- orderTable.Columns.Add(colTax)
-
- ' If the OrderId is 'Total', compute the due on all orders; or compute the due on this order.
- Dim colTotal As New DataColumn("TotalDue", GetType([Decimal]), "IIF(OrderId='Total',Sum(SubTotal)+Sum(Tax),SubTotal+Tax)")
- orderTable.Columns.Add(colTotal)
-
- Dim row As DataRow = orderTable.NewRow()
- row("OrderId") = "Total"
- orderTable.Rows.Add(row)
-
- Console.WriteLine("The Order table with the expression columns.")
- ShowTable(orderTable)
-
- Console.WriteLine("Press any key to exit.....")
- Console.ReadKey()
- End Sub
-
- Private Shared Function CreateOrderTable() As DataTable
- Dim orderTable As New DataTable("Order")
-
- ' Define one column.
- Dim colId As New DataColumn("OrderId", GetType([String]))
- orderTable.Columns.Add(colId)
-
- Dim colDate As New DataColumn("OrderDate", GetType(DateTime))
- orderTable.Columns.Add(colDate)
-
- ' Set the OrderId column as the primary key.
- orderTable.PrimaryKey = New DataColumn() {colId}
-
- Return orderTable
- End Function
-
- Private Shared Function CreateOrderDetailTable() As DataTable
- Dim orderDetailTable As New DataTable("OrderDetail")
-
- ' Define all the columns once.
- Dim cols As DataColumn() = {New DataColumn("OrderDetailId", GetType(Int32)), New DataColumn("OrderId", GetType([String])), New DataColumn("Product", GetType([String])), New DataColumn("UnitPrice", GetType([Decimal])), New DataColumn("OrderQty", GetType(Int32)), New DataColumn("LineTotal", GetType([Decimal]), "UnitPrice*OrderQty")}
-
- orderDetailTable.Columns.AddRange(cols)
- orderDetailTable.PrimaryKey = New DataColumn() {orderDetailTable.Columns("OrderDetailId")}
- Return orderDetailTable
- End Function
-
- Private Shared Sub InsertOrders(orderTable As DataTable)
- ' Add one row once.
- Dim row1 As DataRow = orderTable.NewRow()
- row1("OrderId") = "O0001"
- row1("OrderDate") = New DateTime(2013, 3, 1)
- orderTable.Rows.Add(row1)
-
- Dim row2 As DataRow = orderTable.NewRow()
- row2("OrderId") = "O0002"
- row2("OrderDate") = New DateTime(2013, 3, 12)
- orderTable.Rows.Add(row2)
-
- Dim row3 As DataRow = orderTable.NewRow()
- row3("OrderId") = "O0003"
- row3("OrderDate") = New DateTime(2013, 3, 20)
- orderTable.Rows.Add(row3)
- End Sub
-
- Private Shared Sub InsertOrderDetails(orderDetailTable As DataTable)
- ' Use an Object array to insert all the rows .
- ' Values in the array are matched sequentially to the columns, based on the order in which they appear in the table.
- Dim rows As [Object]() = {New [Object]() {1, "O0001", "Mountain Bike", 1419.5, 36}, New [Object]() {2, "O0001", "Road Bike", 1233.6, 16}, New [Object]() {3, "O0001", "Touring Bike", 1653.3, 32}, New [Object]() {4, "O0002", "Mountain Bike", 1419.5, 24}, New [Object]() {5, "O0002", "Road Bike", 1233.6, 12}, New [Object]() {6, "O0003", "Mountain Bike", 1419.5, 48}, _
- New [Object]() {7, "O0003", "Touring Bike", 1653.3, 8}}
-
- For Each row As [Object]() In rows
- orderDetailTable.Rows.Add(row)
- Next
- End Sub
-
- Private Shared Sub ShowTable(table As DataTable)
- For Each col As DataColumn In table.Columns
- Console.Write("{0,-14}", col.ColumnName)
- Next
- Console.WriteLine()
-
- For Each row As DataRow In table.Rows
- For Each col As DataColumn In table.Columns
- If col.DataType.Equals(GetType(DateTime)) Then
- Console.Write("{0,-14:d}", row(col))
- ElseIf col.DataType.Equals(GetType([Decimal])) Then
- Console.Write("{0,-14:C}", row(col))
- Else
- Console.Write("{0,-14}", row(col))
- End If
- Next
- Console.WriteLine()
- Next
- Console.WriteLine()
- End Sub
-End Class
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/Project.csproj
deleted file mode 100644
index 22dd9034898ba..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- true
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/program.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/program.cs
deleted file mode 100644
index ea0a16a39f05f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/program.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-using System.Diagnostics.Tracing;
-
-namespace Demo1
-{
- //
- sealed class MyCompanyEventSource : EventSource
- {
- public static MyCompanyEventSource Log = new MyCompanyEventSource();
-
- public void Startup() { WriteEvent(1); }
- public void OpenFileStart(string fileName) { WriteEvent(2, fileName); }
- public void OpenFileStop() { WriteEvent(3); }
- }
- //
-
- //
- class Program1
- {
- static void Main(string[] args)
- {
- MyCompanyEventSource.Log.Startup();
- // ...
- MyCompanyEventSource.Log.OpenFileStart("SomeFile");
- // ...
- MyCompanyEventSource.Log.OpenFileStop();
- }
- }
- //
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/program1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/program1.cs
deleted file mode 100644
index d8e5bf53a08a6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/program1.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-using System;
-using System.Diagnostics.Tracing;
-
-namespace Demo2
-{
- enum MyColor { Red, Yellow, Blue };
-
- [EventSource(Name = "MyCompany")]
- sealed class MyCompanyEventSource : EventSource
- {
- //
- //
- public static class Keywords
- {
- public const EventKeywords Page = (EventKeywords)1;
- public const EventKeywords DataBase = (EventKeywords)2;
- public const EventKeywords Diagnostic = (EventKeywords)4;
- public const EventKeywords Perf = (EventKeywords)8;
- }
- //
-
- //
- public static class Tasks
- {
- public const EventTask Page = (EventTask)1;
- public const EventTask DBQuery = (EventTask)2;
- }
- //
- //
-
- //
- [Event(1, Message = "Application Failure: {0}", Level = EventLevel.Error, Keywords = Keywords.Diagnostic)]
- public void Failure(string message) { WriteEvent(1, message); }
- //
-
- //
- [Event(2, Message = "Starting up.", Keywords = Keywords.Perf, Level = EventLevel.Informational)]
- public void Startup() { WriteEvent(2); }
- //
-
- //
- [Event(3, Message = "loading page {1} activityID={0}", Opcode = EventOpcode.Start,
- Task = Tasks.Page, Keywords = Keywords.Page, Level = EventLevel.Informational)]
- public void PageStart(int ID, string url) { if (IsEnabled()) WriteEvent(3, ID, url); }
- //
-
- //
- [Event(4, Opcode = EventOpcode.Stop, Task = Tasks.Page, Keywords = Keywords.Page, Level = EventLevel.Informational)]
- public void PageStop(int ID) { if (IsEnabled()) WriteEvent(4, ID); }
- //
-
- //
- [Event(5, Opcode = EventOpcode.Start, Task = Tasks.DBQuery, Keywords = Keywords.DataBase, Level = EventLevel.Informational)]
- public void DBQueryStart(string sqlQuery) { WriteEvent(5, sqlQuery); }
- //
-
- //
- [Event(6, Opcode = EventOpcode.Stop, Task = Tasks.DBQuery, Keywords = Keywords.DataBase, Level = EventLevel.Informational)]
- public void DBQueryStop() { WriteEvent(6); }
- //
-
- //
- [Event(7, Level = EventLevel.Verbose, Keywords = Keywords.DataBase)]
- public void Mark(int ID) { if (IsEnabled()) WriteEvent(7, ID); }
- //
-
- //
- [Event(8)]
- public void LogColor(MyColor color) { WriteEvent(8, (int)color); }
- //
-
- public static MyCompanyEventSource Log = new MyCompanyEventSource();
- }
-
- class Program
- {
- static void Main(string[] args)
- {
- //
- MyCompanyEventSource.Log.Startup();
- Console.WriteLine("Starting up");
-
- MyCompanyEventSource.Log.DBQueryStart("Select * from MYTable");
- var url = "http://localhost";
- for (int i = 0; i < 10; i++)
- {
- MyCompanyEventSource.Log.PageStart(i, url);
- MyCompanyEventSource.Log.Mark(i);
- MyCompanyEventSource.Log.PageStop(i);
- }
- MyCompanyEventSource.Log.DBQueryStop();
- MyCompanyEventSource.Log.LogColor(MyColor.Blue);
-
- MyCompanyEventSource.Log.Failure("This is a failure 1");
- MyCompanyEventSource.Log.Failure("This is a failure 2");
- MyCompanyEventSource.Log.Failure("This is a failure 3");
- //
- }
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/program2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/program2.cs
deleted file mode 100644
index d8021c6f89fbe..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/csharp/program2.cs
+++ /dev/null
@@ -1,199 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Diagnostics.Tracing;
-
-namespace Demo
-{
- //
- public interface IMyLogging
- {
- void Error(int errorCode, string message);
- void Warning(string message);
- }
-
- public sealed class MySource : EventSource, IMyLogging
- {
- public static MySource Log = new();
-
- [Event(1)]
- public void Error(int errorCode, string message) => WriteEvent(1, errorCode, message);
-
- [Event(2)]
- public void Warning(string message) => WriteEvent(2, message);
- }
- //
-
- //
- public abstract class UtilBaseEventSource : EventSource
- {
- protected UtilBaseEventSource()
- : base()
- { }
-
- protected UtilBaseEventSource(bool throwOnEventWriteErrors)
- : base(throwOnEventWriteErrors)
- { }
-
- // helper overload of WriteEvent for optimizing writing an event containing
- // payload properties that don't align with a provided overload. This prevents
- // EventSource from using the object[] overload which is expensive.
- protected unsafe void WriteEvent(int eventId, int arg1, short arg2, long arg3)
- {
- if (IsEnabled())
- {
- EventSource.EventData* descrs = stackalloc EventSource.EventData[3];
- descrs[0] = new EventData { DataPointer = (IntPtr)(&arg1), Size = 4 };
- descrs[1] = new EventData { DataPointer = (IntPtr)(&arg2), Size = 2 };
- descrs[2] = new EventData { DataPointer = (IntPtr)(&arg3), Size = 8 };
- WriteEventCore(eventId, 3, descrs);
- }
- }
- }
-
- public sealed class OptimizedEventSource : UtilBaseEventSource
- {
- public static OptimizedEventSource Log = new();
-
- public static class Keywords
- {
- public const EventKeywords Kwd1 = (EventKeywords)1;
- }
-
- [Event(1, Keywords = Keywords.Kwd1, Level = EventLevel.Informational, Message = "LogElements called {0}/{1}/{2}.")]
- public void LogElements(int n, short sh, long l) => WriteEvent(1, n, sh, l); // uses the overload we added!
- }
- //
-
- //
- public class ComplexComponent : IDisposable
- {
- internal static Dictionary _internalState = new();
-
- private string _name;
-
- public ComplexComponent(string name)
- {
- _name = name ?? throw new ArgumentNullException(nameof(name));
- ComplexSource.Log.NewComponent(_name);
- }
-
- public void SetState(string key, string value)
- {
- lock (_internalState)
- {
- _internalState[key] = value;
- ComplexSource.Log.SetState(_name, key, value);
- }
- }
-
- private void ExpensiveWork1() => System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(250));
- private void ExpensiveWork2() => System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(250));
- private void ExpensiveWork3() => System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(250));
- private void ExpensiveWork4() => System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(250));
-
- public void DoWork()
- {
- ComplexSource.Log.ExpensiveWorkStart(_name);
-
- ExpensiveWork1();
- ExpensiveWork2();
- ExpensiveWork3();
- ExpensiveWork4();
-
- ComplexSource.Log.ExpensiveWorkStop(_name);
- }
-
- public void Dispose()
- {
- ComplexSource.Log.ComponentDisposed(_name);
- }
- }
-
- internal sealed class ComplexSource : EventSource
- {
- public static ComplexSource Log = new();
-
- public static class Keywords
- {
- public const EventKeywords ComponentLifespan = (EventKeywords)1;
- public const EventKeywords StateChanges = (EventKeywords)(1 << 1);
- public const EventKeywords Performance = (EventKeywords)(1 << 2);
- public const EventKeywords DumpState = (EventKeywords)(1 << 3);
- // a utility keyword for a common combination of keywords users might enable
- public const EventKeywords StateTracking = ComponentLifespan & StateChanges & DumpState;
- }
-
- protected override void OnEventCommand(EventCommandEventArgs args)
- {
- base.OnEventCommand(args);
-
- if (args.Command == EventCommand.Enable)
- {
- DumpComponentState();
- }
- }
-
- [Event(1, Keywords = Keywords.ComponentLifespan, Message = "New component with name '{0}'.")]
- public void NewComponent(string name) => WriteEvent(1, name);
-
- [Event(2, Keywords = Keywords.ComponentLifespan, Message = "Component with name '{0}' disposed.")]
- public void ComponentDisposed(string name) => WriteEvent(2, name);
-
- [Event(3, Keywords = Keywords.StateChanges)]
- public void SetState(string name, string key, string value) => WriteEvent(3, name, key, value);
-
- [Event(4, Keywords = Keywords.Performance)]
- public void ExpensiveWorkStart(string name) => WriteEvent(4, name);
-
- [Event(5, Keywords = Keywords.Performance)]
- public void ExpensiveWorkStop(string name) => WriteEvent(5, name);
-
- [Event(6, Keywords = Keywords.DumpState)]
- public void ComponentState(string key, string value) => WriteEvent(6, key, value);
-
- [NonEvent]
- public void DumpComponentState()
- {
- if (IsEnabled(EventLevel.Informational, Keywords.DumpState))
- {
- lock (ComplexComponent._internalState)
- {
- foreach (var (key, value) in ComplexComponent._internalState)
- ComponentState(key, value);
- }
- }
- }
- }
- //
-
- //
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine($"PID: {System.Diagnostics.Process.GetCurrentProcess().Id}");
-
- long i = 0;
- while (true)
- {
- using ComplexComponent c1 = new($"COMPONENT_{i++}");
- using ComplexComponent c2 = new($"COMPONENT_{i++}");
- using ComplexComponent c3 = new($"COMPONENT_{i++}");
- using ComplexComponent c4 = new($"COMPONENT_{i++}");
-
- c1.SetState("key1", "value1");
- c2.SetState("key2", "value2");
- c3.SetState("key3", "value3");
- c4.SetState("key4", "value4");
-
- c1.DoWork();
- c2.DoWork();
- c3.DoWork();
- c4.DoWork();
- }
- }
- }
- //
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/vb/program.vb b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/vb/program.vb
deleted file mode 100644
index 95de28d88a350..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/vb/program.vb
+++ /dev/null
@@ -1,36 +0,0 @@
-'
-Imports System.Diagnostics.Tracing
-
-'
-Class MyCompanyEventSource
- Inherits EventSource
- Public Shared Log As New MyCompanyEventSource()
-
- Public Sub Startup()
- WriteEvent(1)
- End Sub
-
- Public Sub OpenFileStart(ByVal fileName As String)
- WriteEvent(2, fileName)
- End Sub
-
- Public Sub OpenFileStop()
- WriteEvent(3)
- End Sub
-End Class
-'
-
-'
-Class Program
-
- Shared Sub Main(ByVal args() As String)
- MyCompanyEventSource.Log.Startup()
- ' ...
- MyCompanyEventSource.Log.OpenFileStart("SomeFile")
- ' ...
- MyCompanyEventSource.Log.OpenFileStop()
-
- End Sub
-End Class
-'
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/vb/program1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/vb/program1.vb
deleted file mode 100644
index 41046ab377890..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics.Tracing/EventSource/Overview/vb/program1.vb
+++ /dev/null
@@ -1,118 +0,0 @@
-'
-Imports System.Diagnostics.Tracing
-
-Enum MyColor
- Red
- Yellow
- Blue
-End Enum 'MyColor
-
-Class MyCompanyEventSource1
- Inherits EventSource
-
- '
- '
- Public Class Keywords
- Public Const Page As EventKeywords = CType(1, EventKeywords)
- Public Const DataBase As EventKeywords = CType(2, EventKeywords)
- Public Const Diagnostic As EventKeywords = CType(4, EventKeywords)
- Public Const Perf As EventKeywords = CType(8, EventKeywords)
- End Class
- '
-
- '
- Public Class Tasks
- Public Const Page As EventTask = CType(1, EventTask)
- Public Const DBQuery As EventTask = CType(1, EventTask)
- End Class
- '
- '
-
- '
- <[Event](1, Message:="Application Failure: {0}", Level:=EventLevel.Error, Keywords:=Keywords.Diagnostic)>
- Public Sub Failure(ByVal message As String)
- WriteEvent(1, message)
- End Sub
- '
-
- '
- <[Event](2, Message:="Starting up.", Keywords:=Keywords.Perf, Level:=EventLevel.Informational)>
- Public Sub Startup()
- WriteEvent(2)
- End Sub
- '
-
- '
- <[Event](3, Message:="loading page {1} activityID={0}", Opcode:=EventOpcode.Start, Task:=Tasks.Page, Keywords:=Keywords.Page, Level:=EventLevel.Informational)>
- Public Sub PageStart(ByVal ID As Integer, ByVal url As String)
- If IsEnabled() Then
- WriteEvent(3, ID, url)
- End If
- End Sub
- '
-
- '
- <[Event](4, Opcode:=EventOpcode.Stop, Task:=Tasks.Page, Keywords:=Keywords.Page, Level:=EventLevel.Informational)>
- Public Sub PageStop(ByVal ID As Integer)
- If IsEnabled() Then
- WriteEvent(4, ID)
- End If
- End Sub
- '
-
- '
- <[Event](5, Opcode:=EventOpcode.Start, Task:=Tasks.DBQuery, Keywords:=Keywords.DataBase, Level:=EventLevel.Informational)>
- Public Sub DBQueryStart(ByVal sqlQuery As String)
- WriteEvent(5, sqlQuery)
- End Sub
- '
-
- '
- <[Event](6, Opcode:=EventOpcode.Stop, Task:=Tasks.DBQuery, Keywords:=Keywords.DataBase, Level:=EventLevel.Informational)>
- Public Sub DBQueryStop()
- WriteEvent(6)
- End Sub
- '
-
- '
- <[Event](7, Level:=EventLevel.Verbose, Keywords:=Keywords.DataBase)>
- Public Sub Mark(ByVal ID As Integer)
- If IsEnabled() Then
- WriteEvent(7, ID)
- End If
- End Sub
- '
-
- '
- <[Event](8)>
- Public Sub LogColor(ByVal color As MyColor)
- WriteEvent(8, Fix(color))
- End Sub
- '
- Public Shared Log As New MyCompanyEventSource1()
-End Class
-
-Class Program1
-
- Shared Sub Main(ByVal args() As String)
- '
- MyCompanyEventSource1.Log.Startup()
- Console.WriteLine("Starting up")
- MyCompanyEventSource1.Log.DBQueryStart("Select * from MYTable")
- Dim url As String = "http:'localhost"
- Dim i As Integer
- For i = 0 To 9
- MyCompanyEventSource1.Log.PageStart(i, url)
- MyCompanyEventSource1.Log.Mark(i)
- MyCompanyEventSource1.Log.PageStop(i)
- Next i
- MyCompanyEventSource1.Log.DBQueryStop()
- MyCompanyEventSource1.Log.LogColor(MyColor.Blue)
-
- MyCompanyEventSource1.Log.Failure("This is a failure 1")
- MyCompanyEventSource1.Log.Failure("This is a failure 2")
- MyCompanyEventSource1.Log.Failure("This is a failure 3")
- '
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/CounterCreationData/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/CounterCreationData/Overview/csharp/Project.csproj
deleted file mode 100644
index 2da0e2c488701..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/CounterCreationData/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/CounterCreationData/Overview/csharp/averagecount32.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/CounterCreationData/Overview/csharp/averagecount32.cs
deleted file mode 100644
index 684897f09fa9f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/CounterCreationData/Overview/csharp/averagecount32.cs
+++ /dev/null
@@ -1,169 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Runtime.Versioning;
-
-[SupportedOSPlatform("Windows")]
-public class App
-{
- private static PerformanceCounter avgCounter64Sample;
- private static PerformanceCounter avgCounter64SampleBase;
-
- public static void Main()
- {
- ArrayList samplesList = new ArrayList();
-
- // If the category does not exist, create the category and exit.
- // Performance counters should not be created and immediately used.
- // There is a latency time to enable the counters, they should be created
- // prior to executing the application that uses the counters.
- // Execute this sample a second time to use the category.
- if (SetupCategory())
- return;
- CreateCounters();
- CollectSamples(samplesList);
- CalculateResults(samplesList);
- }
-
- private static bool SetupCategory()
- {
- if (!PerformanceCounterCategory.Exists("AverageCounter64SampleCategory"))
- {
- CounterCreationDataCollection counterDataCollection = new CounterCreationDataCollection();
-
- // Add the counter.
- CounterCreationData averageCount64 = new CounterCreationData();
- averageCount64.CounterType = PerformanceCounterType.AverageCount64;
- averageCount64.CounterName = "AverageCounter64Sample";
- counterDataCollection.Add(averageCount64);
-
- // Add the base counter.
- CounterCreationData averageCount64Base = new CounterCreationData();
- averageCount64Base.CounterType = PerformanceCounterType.AverageBase;
- averageCount64Base.CounterName = "AverageCounter64SampleBase";
- counterDataCollection.Add(averageCount64Base);
-
- // Create the category.
- PerformanceCounterCategory.Create("AverageCounter64SampleCategory",
- "Demonstrates usage of the AverageCounter64 performance counter type.",
- PerformanceCounterCategoryType.SingleInstance, counterDataCollection);
-
- return (true);
- }
- else
- {
- Console.WriteLine("Category exists - AverageCounter64SampleCategory");
- return (false);
- }
- }
-
- private static void CreateCounters()
- {
- // Create the counters.
-
- //
- avgCounter64Sample = new PerformanceCounter("AverageCounter64SampleCategory",
- "AverageCounter64Sample",
- false);
-
- //
-
- avgCounter64SampleBase = new PerformanceCounter("AverageCounter64SampleCategory",
- "AverageCounter64SampleBase",
- false);
-
- avgCounter64Sample.RawValue = 0;
- avgCounter64SampleBase.RawValue = 0;
- }
- //
- private static void CollectSamples(ArrayList samplesList)
- {
-
- Random r = new Random(DateTime.Now.Millisecond);
-
- // Loop for the samples.
- for (int j = 0; j < 100; j++)
- {
-
- int value = r.Next(1, 10);
- Console.Write(j + " = " + value);
-
- avgCounter64Sample.IncrementBy(value);
-
- avgCounter64SampleBase.Increment();
-
- if ((j % 10) == 9)
- {
- OutputSample(avgCounter64Sample.NextSample());
- samplesList.Add(avgCounter64Sample.NextSample());
- }
- else
- {
- Console.WriteLine();
- }
-
- System.Threading.Thread.Sleep(50);
- }
- }
- //
-
- private static void CalculateResults(ArrayList samplesList)
- {
- for (int i = 0; i < (samplesList.Count - 1); i++)
- {
- // Output the sample.
- OutputSample((CounterSample)samplesList[i]);
- OutputSample((CounterSample)samplesList[i + 1]);
-
- // Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
- CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
-
- // Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
- MyComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
- }
- }
-
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- // Description - This counter type shows how many items are processed, on average,
- // during an operation. Counters of this type display a ratio of the items
- // processed (such as bytes sent) to the number of operations completed. The
- // ratio is calculated by comparing the number of items processed during the
- // last interval to the number of operations completed during the last interval.
- // Generic type - Average
- // Formula - (N1 - N0) / (D1 - D0), where the numerator (N) represents the number
- // of items processed during the last sample interval and the denominator (D)
- // represents the number of operations completed during the last two sample
- // intervals.
- // Average (Nx - N0) / (Dx - D0)
- // Example PhysicalDisk\ Avg. Disk Bytes/Transfer
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
- {
- Single numerator = (Single)s1.RawValue - (Single)s0.RawValue;
- Single denomenator = (Single)s1.BaseValue - (Single)s0.BaseValue;
- Single counterValue = numerator / denomenator;
- return (counterValue);
- }
-
- // Output information about the counter sample.
- private static void OutputSample(CounterSample s)
- {
- Console.WriteLine("\r\n+++++++++++");
- Console.WriteLine("Sample values - \r\n");
- Console.WriteLine(" BaseValue = " + s.BaseValue);
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency);
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
- Console.WriteLine(" CounterType = " + s.CounterType);
- Console.WriteLine(" RawValue = " + s.RawValue);
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency);
- Console.WriteLine(" TimeStamp = " + s.TimeStamp);
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
- Console.WriteLine("++++++++++++++++++++++");
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounter/NextValue/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounter/NextValue/csharp/Project.csproj
deleted file mode 100644
index 2da0e2c488701..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounter/NextValue/csharp/Project.csproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounter/NextValue/csharp/elapsedtime.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounter/NextValue/csharp/elapsedtime.cs
deleted file mode 100644
index bb9916d1596b8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounter/NextValue/csharp/elapsedtime.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-// Notice that the sample is conditionally compiled for Everett vs.
-// Whidbey builds. Whidbey introduced new APIs that are not available
-// in Everett. Snippet IDs do not overlap between Whidbey and Everett;
-// Snippet #1 is Everett, Snippet #2 and #3 are Whidbey.
-
-#if (BELOW_WHIDBEY_BUILD)
-
-//
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-public class App
-{
- private static PerformanceCounter PC;
-
-
- public static void Main()
- {
- ArrayList samplesList = new ArrayList();
-
- SetupCategory();
- CreateCounters();
- CollectSamples(samplesList);
- }
-
-
- private static bool SetupCategory()
- {
- if ( !PerformanceCounterCategory.Exists("ElapsedTimeSampleCategory") )
- {
-
- CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
-
- // Add the counter.
- CounterCreationData ETimeData = new CounterCreationData();
- ETimeData.CounterType = PerformanceCounterType.ElapsedTime;
- ETimeData.CounterName = "ElapsedTimeSample";
- CCDC.Add(ETimeData);
-
- // Create the category.
- PerformanceCounterCategory.Create("ElapsedTimeSampleCategory",
- "Demonstrates usage of the ElapsedTime performance counter type.",
- CCDC);
-
- return(true);
- }
- else
- {
- Console.WriteLine("Category exists - ElapsedTimeSampleCategory");
- return(false);
- }
- }
-
- private static void CreateCounters()
- {
- // Create the counter.
- PC = new PerformanceCounter("ElapsedTimeSampleCategory",
- "ElapsedTimeSample",
- false);
-
- }
-
- private static void CollectSamples(ArrayList samplesList)
- {
-
- long pcValue;
- DateTime Start;
-
- // Initialize the counter.
- QueryPerformanceCounter(out pcValue);
- PC.RawValue = pcValue;
- Start = DateTime.Now;
-
- // Loop for the samples.
- for (int j = 0; j < 1000; j++)
- {
- // Output the values.
- if ((j % 10) == 9)
- {
- Console.WriteLine("NextValue() = " + PC.NextValue().ToString());
- Console.WriteLine("Actual elapsed time = " + DateTime.Now.Subtract(Start).ToString());
- OutputSample(PC.NextSample());
- samplesList.Add( PC.NextSample() );
- }
-
- // Reset the counter on 100th iteration.
- if (j % 100 == 0)
- {
- QueryPerformanceCounter(out pcValue);
- PC.RawValue = pcValue;
- Start = DateTime.Now;
- }
- System.Threading.Thread.Sleep(50);
- }
-
- Console.WriteLine("Elapsed time = " + DateTime.Now.Subtract(Start).ToString());
- }
-
-
- private static void OutputSample(CounterSample s)
- {
- Console.WriteLine("\r\n+++++++++++");
- Console.WriteLine("Sample values - \r\n");
- Console.WriteLine(" BaseValue = " + s.BaseValue);
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency);
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
- Console.WriteLine(" CounterType = " + s.CounterType);
- Console.WriteLine(" RawValue = " + s.RawValue);
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency);
- Console.WriteLine(" TimeStamp = " + s.TimeStamp);
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
- Console.WriteLine("++++++++++++++++++++++");
- }
-
-
- // Reads the counter information to enable setting the RawValue.
- [DllImport("Kernel32.dll")]
- public static extern bool QueryPerformanceCounter(out long value);
-}
-//
-
-#else
-// Build sample for Whidbey or higher.
-
-//
-
-using System;
-using System.Diagnostics;
-using System.Runtime.Versioning;
-
-[SupportedOSPlatform("Windows")]
-public class App
-{
- public static void Main()
- {
- CollectSamples();
- }
-
- public static void CollectSamples()
- {
- const String categoryName = "ElapsedTimeSampleCategory";
- const String counterName = "ElapsedTimeSample";
-
- // If the category does not exist, create the category and exit.
- // Performance counters should not be created and immediately used.
- // There is a latency time to enable the counters, they should be created
- // prior to executing the application that uses the counters.
- // Execute this sample a second time to use the category.
- if ( !PerformanceCounterCategory.Exists(categoryName) )
- {
-
- CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
-
- // Add the counter.
- CounterCreationData ETimeData = new CounterCreationData();
- ETimeData.CounterType = PerformanceCounterType.ElapsedTime;
- ETimeData.CounterName = counterName;
- CCDC.Add(ETimeData);
-
- // Create the category.
- PerformanceCounterCategory.Create(categoryName,
- "Demonstrates ElapsedTime performance counter usage.",
- PerformanceCounterCategoryType.SingleInstance, CCDC);
- // Return, rerun the application to make use of the new counters.
- return;
- }
- else
- {
- Console.WriteLine($"Category exists - {categoryName}");
- }
-
- //
- // Create the performance counter.
- PerformanceCounter PC = new PerformanceCounter(categoryName,
- counterName,
- false);
- // Initialize the counter.
- PC.RawValue = Stopwatch.GetTimestamp();
- //
-
- DateTime Start = DateTime.Now;
-
- // Loop for the samples.
- for (int j = 0; j < 100; j++)
- {
- // Output the values.
- if ((j % 10) == 9)
- {
- Console.WriteLine("NextValue() = " + PC.NextValue().ToString());
- Console.WriteLine("Actual elapsed time = " + DateTime.Now.Subtract(Start).ToString());
- OutputSample(PC.NextSample());
- }
-
- // Reset the counter on every 20th iteration.
- if (j % 20 == 0)
- {
- PC.RawValue = Stopwatch.GetTimestamp();
- Start = DateTime.Now;
- }
- System.Threading.Thread.Sleep(50);
- }
-
- Console.WriteLine("Elapsed time = " + DateTime.Now.Subtract(Start).ToString());
- }
-
- private static void OutputSample(CounterSample s)
- {
- Console.WriteLine("\r\n+++++++++++");
- Console.WriteLine("Sample values - \r\n");
- Console.WriteLine(" BaseValue = " + s.BaseValue);
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency);
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
- Console.WriteLine(" CounterType = " + s.CounterType);
- Console.WriteLine(" RawValue = " + s.RawValue);
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency);
- Console.WriteLine(" TimeStamp = " + s.TimeStamp);
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
- Console.WriteLine("++++++++++++++++++++++");
- }
-}
-//
-#endif
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/Project.csproj
deleted file mode 100644
index 2da0e2c488701..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/averagetimer32.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/averagetimer32.cs
deleted file mode 100644
index a729d165f2bd5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/averagetimer32.cs
+++ /dev/null
@@ -1,370 +0,0 @@
-// Notice that the sample is conditionally compiled for Everett vs.
-// Whidbey builds. Whidbey introduced new APIs that are not available
-// in Everett. Snippet IDs do not overlap between Whidbey and Everett;
-// Snippet #1 is Everett, Snippet #2 and #3 are Whidbey.
-
-#if (BELOW_WHIDBEY_BUILD)
-
-//
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-public class App
-{
-
- private static PerformanceCounter PC;
- private static PerformanceCounter BPC;
-
- public static void Main()
- {
- ArrayList samplesList = new ArrayList();
-
- SetupCategory();
- CreateCounters();
- CollectSamples(samplesList);
- CalculateResults(samplesList);
- }
-
-
-
-
- private static bool SetupCategory()
- {
-
- if ( !PerformanceCounterCategory.Exists("AverageTimer32SampleCategory") )
- {
-
- CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
-
- // Add the counter.
- CounterCreationData averageTimer32 = new CounterCreationData();
- averageTimer32.CounterType = PerformanceCounterType.AverageTimer32;
- averageTimer32.CounterName = "AverageTimer32Sample";
- CCDC.Add(averageTimer32);
-
- // Add the base counter.
- CounterCreationData averageTimer32Base = new CounterCreationData();
- averageTimer32Base.CounterType = PerformanceCounterType.AverageBase;
- averageTimer32Base.CounterName = "AverageTimer32SampleBase";
- CCDC.Add(averageTimer32Base);
-
- // Create the category.
- PerformanceCounterCategory.Create("AverageTimer32SampleCategory",
- "Demonstrates usage of the AverageTimer32 performance counter type",
- CCDC);
-
- return(true);
- }
- else
- {
- Console.WriteLine("Category exists - " + "AverageTimer32SampleCategory");
- return(false);
- }
- }
-
- private static void CreateCounters()
- {
- // Create the counters.
- PC = new PerformanceCounter("AverageTimer32SampleCategory",
- "AverageTimer32Sample",
- false);
-
- BPC = new PerformanceCounter("AverageTimer32SampleCategory",
- "AverageTimer32SampleBase",
- false);
-
- PC.RawValue = 0;
- BPC.RawValue = 0;
- }
-
-
- private static void CollectSamples(ArrayList samplesList)
- {
-
- long perfTime = 0;
- Random r = new Random( DateTime.Now.Millisecond );
-
- // Loop for the samples.
- for (int i = 0; i < 10; i++) {
-
- QueryPerformanceCounter(out perfTime);
- PC.RawValue = perfTime;
-
- BPC.IncrementBy(10);
-
- System.Threading.Thread.Sleep(1000);
- Console.WriteLine("Next value = " + PC.NextValue().ToString());
- samplesList.Add(PC.NextSample());
- }
-
- }
-
- private static void CalculateResults(ArrayList samplesList)
- {
- for(int i = 0; i < (samplesList.Count - 1); i++)
- {
- // Output the sample.
- OutputSample( (CounterSample)samplesList[i] );
- OutputSample( (CounterSample)samplesList[i+1] );
-
- // Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
- CounterSample.Calculate((CounterSample)samplesList[i],
- (CounterSample)samplesList[i+1]) );
-
- // Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
- MyComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i+1]) );
-
- }
- }
-
-
-
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
- // PERF_AVERAGE_TIMER
- // Description - This counter type measures the time it takes, on
- // average, to complete a process or operation. Counters of this
- // type display a ratio of the total elapsed time of the sample
- // interval to the number of processes or operations completed
- // during that time. This counter type measures time in ticks
- // of the system clock. The F variable represents the number of
- // ticks per second. The value of F is factored into the equation
- // so that the result can be displayed in seconds.
- //
- // Generic type - Average
- //
- // Formula - ((N1 - N0) / F) / (D1 - D0), where the numerator (N)
- // represents the number of ticks counted during the last
- // sample interval, F represents the frequency of the ticks,
- // and the denominator (D) represents the number of operations
- // completed during the last sample interval.
- //
- // Average - ((Nx - N0) / F) / (Dx - D0)
- //
- // Example - PhysicalDisk\ Avg. Disk sec/Transfer
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
- private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
- {
- Int64 n1 = s1.RawValue;
- Int64 n0 = s0.RawValue;
- ulong f = (ulong)s1.SystemFrequency;
- Int64 d1 = s1.BaseValue;
- Int64 d0 = s0.BaseValue;
-
- double numerator = (double)(n1 - n0);
- double denominator = (double)(d1 - d0);
- Single counterValue = (Single)(( numerator / f ) / denominator);
- return(counterValue);
- }
-
- // Output information about the counter sample.
- private static void OutputSample(CounterSample s)
- {
- Console.WriteLine("+++++++++++");
- Console.WriteLine("Sample values - \r\n");
- Console.WriteLine(" BaseValue = " + s.BaseValue);
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency);
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
- Console.WriteLine(" CounterType = " + s.CounterType);
- Console.WriteLine(" RawValue = " + s.RawValue);
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency);
- Console.WriteLine(" TimeStamp = " + s.TimeStamp);
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
- Console.WriteLine("++++++++++++++++++++++");
- }
-
-
- [DllImport("Kernel32.dll")]
- public static extern bool QueryPerformanceCounter(out long value);
-
-}
-
-//
-#else
-// Build sample for Whidbey or higher.
-
-//
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Runtime.Versioning;
-
-[SupportedOSPlatform("Windows")]
-public class App2
-{
- private static PerformanceCounter PC;
- private static PerformanceCounter BPC;
-
- private const String categoryName = "AverageTimer32SampleCategory";
- private const String counterName = "AverageTimer32Sample";
- private const String baseCounterName = "AverageTimer32SampleBase";
-
- public static void Main()
- {
- ArrayList samplesList = new ArrayList();
-
- // If the category does not exist, create the category and exit.
- // Performance counters should not be created and immediately used.
- // There is a latency time to enable the counters, they should be created
- // prior to executing the application that uses the counters.
- // Execute this sample a second time to use the category.
- if (SetupCategory())
- return;
- CreateCounters();
- CollectSamples(samplesList);
- CalculateResults(samplesList);
- }
-
- private static bool SetupCategory()
- {
- if (!PerformanceCounterCategory.Exists(categoryName))
- {
-
- CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
-
- // Add the counter.
- CounterCreationData averageTimer32 = new CounterCreationData();
- averageTimer32.CounterType = PerformanceCounterType.AverageTimer32;
- averageTimer32.CounterName = counterName;
- CCDC.Add(averageTimer32);
-
- // Add the base counter.
- CounterCreationData averageTimer32Base = new CounterCreationData();
- averageTimer32Base.CounterType = PerformanceCounterType.AverageBase;
- averageTimer32Base.CounterName = baseCounterName;
- CCDC.Add(averageTimer32Base);
-
- // Create the category.
- PerformanceCounterCategory.Create(categoryName,
- "Demonstrates usage of the AverageTimer32 performance counter type",
- PerformanceCounterCategoryType.SingleInstance, CCDC);
-
- Console.WriteLine("Category created - " + categoryName);
-
- return (true);
- }
- else
- {
- Console.WriteLine("Category exists - " + categoryName);
- return (false);
- }
- }
-
- private static void CreateCounters()
- {
- // Create the counters.
- PC = new PerformanceCounter(categoryName,
- counterName,
- false);
-
- BPC = new PerformanceCounter(categoryName,
- baseCounterName,
- false);
-
- PC.RawValue = 0;
- BPC.RawValue = 0;
- }
-
- private static void CollectSamples(ArrayList samplesList)
- {
-
- Random r = new Random(DateTime.Now.Millisecond);
-
- // Loop for the samples.
- for (int i = 0; i < 10; i++)
- {
-
- PC.RawValue = Stopwatch.GetTimestamp();
-
- BPC.IncrementBy(10);
-
- System.Threading.Thread.Sleep(1000);
-
- Console.WriteLine("Next value = " + PC.NextValue().ToString());
- samplesList.Add(PC.NextSample());
- }
- }
-
- private static void CalculateResults(ArrayList samplesList)
- {
- for (int i = 0; i < (samplesList.Count - 1); i++)
- {
- // Output the sample.
- OutputSample((CounterSample)samplesList[i]);
- OutputSample((CounterSample)samplesList[i + 1]);
-
- // Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
- CounterSample.Calculate((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
-
- // Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
- MyComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
- }
- }
-
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
- // PERF_AVERAGE_TIMER
- // Description - This counter type measures the time it takes, on
- // average, to complete a process or operation. Counters of this
- // type display a ratio of the total elapsed time of the sample
- // interval to the number of processes or operations completed
- // during that time. This counter type measures time in ticks
- // of the system clock. The F variable represents the number of
- // ticks per second. The value of F is factored into the equation
- // so that the result can be displayed in seconds.
- //
- // Generic type - Average
- //
- // Formula - ((N1 - N0) / F) / (D1 - D0), where the numerator (N)
- // represents the number of ticks counted during the last
- // sample interval, F represents the frequency of the ticks,
- // and the denominator (D) represents the number of operations
- // completed during the last sample interval.
- //
- // Average - ((Nx - N0) / F) / (Dx - D0)
- //
- // Example - PhysicalDisk\ Avg. Disk sec/Transfer
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
- private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
- {
- Int64 n1 = s1.RawValue;
- Int64 n0 = s0.RawValue;
- ulong f = (ulong)s1.SystemFrequency;
- Int64 d1 = s1.BaseValue;
- Int64 d0 = s0.BaseValue;
-
- double numerator = (double)(n1 - n0);
- double denominator = (double)(d1 - d0);
- Single counterValue = (Single)((numerator / f) / denominator);
- return (counterValue);
- }
-
- // Output information about the counter sample.
- private static void OutputSample(CounterSample s)
- {
- Console.WriteLine("+++++++++++");
- Console.WriteLine("Sample values - \r\n");
- Console.WriteLine(" CounterType = " + s.CounterType);
- Console.WriteLine(" RawValue = " + s.RawValue);
- Console.WriteLine(" BaseValue = " + s.BaseValue);
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency);
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency);
- Console.WriteLine(" TimeStamp = " + s.TimeStamp);
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
- Console.WriteLine("++++++++++++++++++++++");
- }
-}
-
-//
-
-#endif
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/numberofitems32.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/numberofitems32.cs
deleted file mode 100644
index 18eee683b867d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/numberofitems32.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Diagnostics;
-
-public class NumberOfItems64
-{
-
- private static PerformanceCounter PC;
-
- public static void Main()
- {
- ArrayList samplesList = new ArrayList();
-
- // If the category does not exist, create the category and exit.
- // Performance counters should not be created and immediately used.
- // There is a latency time to enable the counters, they should be created
- // prior to executing the application that uses the counters.
- // Execute this sample a second time to use the category.
- if (SetupCategory())
- return;
- CreateCounters();
- CollectSamples(samplesList);
- CalculateResults(samplesList);
- }
-
- private static bool SetupCategory()
- {
- if ( !PerformanceCounterCategory.Exists("NumberOfItems32SampleCategory") )
- {
-
- CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
-
- // Add the counter.
- CounterCreationData NOI64 = new CounterCreationData();
- NOI64.CounterType = PerformanceCounterType.NumberOfItems64;
- NOI64.CounterName = "NumberOfItems32Sample";
- CCDC.Add(NOI64);
-
- // Create the category.
- PerformanceCounterCategory.Create("NumberOfItems32SampleCategory",
- "Demonstrates usage of the NumberOfItems32 performance counter type.",
- PerformanceCounterCategoryType.SingleInstance, CCDC);
-
- return(true);
- }
- else
- {
- Console.WriteLine("Category exists - NumberOfItems32SampleCategory");
- return(false);
- }
- }
-
- private static void CreateCounters()
- {
- // Create the counter.
- PC = new PerformanceCounter("NumberOfItems32SampleCategory",
- "NumberOfItems32Sample",
- false);
-
- PC.RawValue=0;
- }
-
- private static void CollectSamples(ArrayList samplesList)
- {
-
- Random r = new Random( DateTime.Now.Millisecond );
-
- // Loop for the samples.
- for (int j = 0; j < 100; j++)
- {
-
- int value = r.Next(1, 10);
- Console.Write(j + " = " + value);
-
- PC.IncrementBy(value);
-
- if ((j % 10) == 9)
- {
- OutputSample(PC.NextSample());
- samplesList.Add( PC.NextSample() );
- }
- else
- {
- Console.WriteLine();
- }
-
- System.Threading.Thread.Sleep(50);
- }
- }
-
- private static void CalculateResults(ArrayList samplesList)
- {
- for(int i = 0; i < (samplesList.Count - 1); i++)
- {
- // Output the sample.
- OutputSample( (CounterSample)samplesList[i] );
- OutputSample( (CounterSample)samplesList[i+1] );
-
- // Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
- CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i+1]) );
-
- // Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
- MyComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i+1]) );
- }
- }
-
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
- {
- Single counterValue = s1.RawValue;
- return(counterValue);
- }
-
- // Output information about the counter sample.
- private static void OutputSample(CounterSample s)
- {
- Console.WriteLine("\r\n+++++++++++");
- Console.WriteLine("Sample values - \r\n");
- Console.WriteLine(" BaseValue = " + s.BaseValue);
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency);
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
- Console.WriteLine(" CounterType = " + s.CounterType);
- Console.WriteLine(" RawValue = " + s.RawValue);
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency);
- Console.WriteLine(" TimeStamp = " + s.TimeStamp);
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
- Console.WriteLine("++++++++++++++++++++++");
- }
-}
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/numberofitems64.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/numberofitems64.cs
deleted file mode 100644
index ca73e6be7ff37..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/numberofitems64.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Runtime.Versioning;
-
-[SupportedOSPlatform("Windows")]
-public class NumberOfItems64_1
-{
- private static PerformanceCounter PC;
-
- public static void Main()
- {
- ArrayList samplesList = new ArrayList();
-
- // If the category does not exist, create the category and exit.
- // Perfomance counters should not be created and immediately used.
- // There is a latency time to enable the counters, they should be created
- // prior to executing the application that uses the counters.
- // Execute this sample a second time to use the category.
- if (SetupCategory())
- return;
- CreateCounters();
- CollectSamples(samplesList);
- CalculateResults(samplesList);
- }
-
- private static bool SetupCategory()
- {
- if (!PerformanceCounterCategory.Exists("NumberOfItems64SampleCategory"))
- {
- CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
-
- // Add the counter.
- CounterCreationData NOI64 = new CounterCreationData();
- NOI64.CounterType = PerformanceCounterType.NumberOfItems64;
- NOI64.CounterName = "NumberOfItems64Sample";
- CCDC.Add(NOI64);
-
- // Create the category.
- PerformanceCounterCategory.Create("NumberOfItems64SampleCategory",
- "Demonstrates usage of the NumberOfItems64 performance counter type.",
- PerformanceCounterCategoryType.SingleInstance, CCDC);
- return (true);
- }
- else
- {
- Console.WriteLine("Category exists - NumberOfItems64SampleCategory");
- return (false);
- }
- }
-
- private static void CreateCounters()
- {
- // Create the counters.
- PC = new PerformanceCounter("NumberOfItems64SampleCategory",
- "NumberOfItems64Sample",
- false);
-
- PC.RawValue = 0;
- }
-
- private static void CollectSamples(ArrayList samplesList)
- {
- Random r = new Random(DateTime.Now.Millisecond);
-
- // Loop for the samples.
- for (int j = 0; j < 100; j++)
- {
-
- int value = r.Next(1, 10);
- Console.Write(j + " = " + value);
-
- PC.IncrementBy(value);
-
- if ((j % 10) == 9)
- {
- OutputSample(PC.NextSample());
- samplesList.Add(PC.NextSample());
- }
- else
- {
- Console.WriteLine();
- }
-
- System.Threading.Thread.Sleep(50);
- }
- }
-
- private static void CalculateResults(ArrayList samplesList)
- {
- for (int i = 0; i < (samplesList.Count - 1); i++)
- {
- // Output the sample.
- OutputSample((CounterSample)samplesList[i]);
- OutputSample((CounterSample)samplesList[i + 1]);
-
- // Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
- CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
-
- // Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
- MyComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
- }
- }
-
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
- {
- Single counterValue = s1.RawValue;
- return (counterValue);
- }
-
- // Output information about the counter sample.
- private static void OutputSample(CounterSample s)
- {
- Console.WriteLine("\r\n+++++++++++");
- Console.WriteLine("Sample values - \r\n");
- Console.WriteLine(" BaseValue = " + s.BaseValue);
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency);
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
- Console.WriteLine(" CounterType = " + s.CounterType);
- Console.WriteLine(" RawValue = " + s.RawValue);
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency);
- Console.WriteLine(" TimeStamp = " + s.TimeStamp);
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
- Console.WriteLine("++++++++++++++++++++++");
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/program.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/program.cs
deleted file mode 100644
index 6cdc59d744bdd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/program.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Diagnostics;
-
-// Provides a SampleFraction counter to measure the percentage of the user processor
-// time for this process to total processor time for the process.
-public class App
-{
-
- private static PerformanceCounter perfCounter;
- private static PerformanceCounter basePerfCounter;
- private static Process thisProcess = Process.GetCurrentProcess();
-
- public static void Main()
- {
-
- ArrayList samplesList = new ArrayList();
-
- // If the category does not exist, create the category and exit.
- // Performance counters should not be created and immediately used.
- // There is a latency time to enable the counters, they should be created
- // prior to executing the application that uses the counters.
- // Execute this sample a second time to use the category.
- if (SetupCategory())
- return;
- CreateCounters();
- CollectSamples(samplesList);
- CalculateResults(samplesList);
- }
-
- private static bool SetupCategory()
- {
- if (!PerformanceCounterCategory.Exists("SampleFractionCategory"))
- {
-
- CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
-
- // Add the counter.
- CounterCreationData sampleFraction = new CounterCreationData();
- sampleFraction.CounterType = PerformanceCounterType.SampleFraction;
- sampleFraction.CounterName = "SampleFractionSample";
- CCDC.Add(sampleFraction);
-
- // Add the base counter.
- CounterCreationData sampleFractionBase = new CounterCreationData();
- sampleFractionBase.CounterType = PerformanceCounterType.SampleBase;
- sampleFractionBase.CounterName = "SampleFractionSampleBase";
- CCDC.Add(sampleFractionBase);
-
- // Create the category.
- PerformanceCounterCategory.Create("SampleFractionCategory",
- "Demonstrates usage of the SampleFraction performance counter type.",
- PerformanceCounterCategoryType.SingleInstance, CCDC);
-
- return (true);
- }
- else
- {
- Console.WriteLine("Category exists - SampleFractionCategory");
- return (false);
- }
- }
-
- private static void CreateCounters()
- {
- // Create the counters.
-
- perfCounter = new PerformanceCounter("SampleFractionCategory",
- "SampleFractionSample",
- false);
-
- basePerfCounter = new PerformanceCounter("SampleFractionCategory",
- "SampleFractionSampleBase",
- false);
-
- perfCounter.RawValue = thisProcess.UserProcessorTime.Ticks;
- basePerfCounter.RawValue = thisProcess.TotalProcessorTime.Ticks;
- }
- private static void CollectSamples(ArrayList samplesList)
- {
-
- // Loop for the samples.
- for (int j = 0; j < 100; j++)
- {
-
- perfCounter.IncrementBy(thisProcess.UserProcessorTime.Ticks);
-
- basePerfCounter.IncrementBy(thisProcess.TotalProcessorTime.Ticks);
-
- if ((j % 10) == 9)
- {
- OutputSample(perfCounter.NextSample());
- samplesList.Add(perfCounter.NextSample());
- }
- else
- {
- Console.WriteLine();
- }
-
- System.Threading.Thread.Sleep(50);
- }
- }
-
- private static void CalculateResults(ArrayList samplesList)
- {
- for (int i = 0; i < (samplesList.Count - 1); i++)
- {
- // Output the sample.
- OutputSample((CounterSample)samplesList[i]);
- OutputSample((CounterSample)samplesList[i + 1]);
-
- // Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
- CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
-
- // Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
- MyComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
- }
- }
-
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- // Description - This counter type provides A percentage counter that shows the
- // average ratio of user proccessor time to total processor time during the last
- // two sample intervals.
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
- {
- Single numerator = (Single)s1.RawValue - (Single)s0.RawValue;
- Single denomenator = (Single)s1.BaseValue - (Single)s0.BaseValue;
- Single counterValue = 100 * (numerator / denomenator);
- return (counterValue);
- }
-
- // Output information about the counter sample.
- private static void OutputSample(CounterSample s)
- {
- Console.WriteLine("\r\n+++++++++++");
- Console.WriteLine("Sample values - \r\n");
- Console.WriteLine(" BaseValue = " + s.BaseValue);
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency);
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
- Console.WriteLine(" CounterType = " + s.CounterType);
- Console.WriteLine(" RawValue = " + s.RawValue);
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency);
- Console.WriteLine(" TimeStamp = " + s.TimeStamp);
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
- Console.WriteLine("++++++++++++++++++++++");
- }
-}
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/rateofcountspersecond32.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/rateofcountspersecond32.cs
deleted file mode 100644
index 0ccd952350c2e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/rateofcountspersecond32.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Runtime.Versioning;
-
-[SupportedOSPlatform("Windows")]
-public class App3
-{
- private static PerformanceCounter PC;
-
- public static void Main()
- {
- ArrayList samplesList = new ArrayList();
-
- // If the category does not exist, create the category and exit.
- // Perfomance counters should not be created and immediately used.
- // There is a latency time to enable the counters, they should be created
- // prior to executing the application that uses the counters.
- // Execute this sample a second time to use the category.
- if (SetupCategory())
- return;
- CreateCounters();
- CollectSamples(samplesList);
- CalculateResults(samplesList);
- }
-
- private static bool SetupCategory()
- {
- if (!PerformanceCounterCategory.Exists("RateOfCountsPerSecond32SampleCategory"))
- {
-
- CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
-
- // Add the counter.
- CounterCreationData rateOfCounts32 = new CounterCreationData();
- rateOfCounts32.CounterType = PerformanceCounterType.RateOfCountsPerSecond32;
- rateOfCounts32.CounterName = "RateOfCountsPerSecond32Sample";
- CCDC.Add(rateOfCounts32);
-
- // Create the category.
- PerformanceCounterCategory.Create("RateOfCountsPerSecond32SampleCategory",
- "Demonstrates usage of the RateOfCountsPerSecond32 performance counter type.",
- PerformanceCounterCategoryType.SingleInstance, CCDC);
- return (true);
- }
- else
- {
- Console.WriteLine("Category exists - RateOfCountsPerSecond32SampleCategory");
- return (false);
- }
- }
-
- private static void CreateCounters()
- {
- // Create the counter.
- PC = new PerformanceCounter("RateOfCountsPerSecond32SampleCategory",
- "RateOfCountsPerSecond32Sample",
- false);
-
- PC.RawValue = 0;
- }
-
- private static void CollectSamples(ArrayList samplesList)
- {
-
- Random r = new Random(DateTime.Now.Millisecond);
-
- // Initialize the performance counter.
- PC.NextSample();
-
- // Loop for the samples.
- for (int j = 0; j < 100; j++)
- {
-
- int value = r.Next(1, 10);
- PC.IncrementBy(value);
- Console.Write(j + " = " + value);
-
- if ((j % 10) == 9)
- {
- Console.WriteLine("; NextValue() = " + PC.NextValue().ToString());
- OutputSample(PC.NextSample());
- samplesList.Add(PC.NextSample());
- }
- else
- {
- Console.WriteLine();
- }
-
- System.Threading.Thread.Sleep(50);
- }
- }
-
- private static void CalculateResults(ArrayList samplesList)
- {
- for (int i = 0; i < (samplesList.Count - 1); i++)
- {
- // Output the sample.
- OutputSample((CounterSample)samplesList[i]);
- OutputSample((CounterSample)samplesList[i + 1]);
-
- // Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
- CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
-
- // Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
- MyComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
- }
- }
-
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- // PERF_COUNTER_COUNTER
- // Description - This counter type shows the average number of operations completed
- // during each second of the sample interval. Counters of this type
- // measure time in ticks of the system clock. The F variable represents
- // the number of ticks per second. The value of F is factored into the
- // equation so that the result can be displayed in seconds.
- //
- // Generic type - Difference
- //
- // Formula - (N1 - N0) / ( (D1 - D0) / F), where the numerator (N) represents the number
- // of operations performed during the last sample interval, the denominator
- // (D) represents the number of ticks elapsed during the last sample
- // interval, and F is the frequency of the ticks.
- //
- // Average - (Nx - N0) / ((Dx - D0) / F)
- //
- // Example - System\ File Read Operations/sec
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
- {
- Single numerator = (Single)(s1.RawValue - s0.RawValue);
- Single denomenator = (Single)(s1.TimeStamp - s0.TimeStamp) / (Single)s1.SystemFrequency;
- Single counterValue = numerator / denomenator;
- return (counterValue);
- }
-
- // Output information about the counter sample.
- private static void OutputSample(CounterSample s)
- {
- Console.WriteLine("\r\n+++++++++++");
- Console.WriteLine("Sample values - \r\n");
- Console.WriteLine(" BaseValue = " + s.BaseValue);
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency);
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
- Console.WriteLine(" CounterType = " + s.CounterType);
- Console.WriteLine(" RawValue = " + s.RawValue);
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency);
- Console.WriteLine(" TimeStamp = " + s.TimeStamp);
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
- Console.WriteLine("++++++++++++++++++++++");
- }
-}
-
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/rateofcountspersecond64.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/rateofcountspersecond64.cs
deleted file mode 100644
index 8e3c492d8628a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/rateofcountspersecond64.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Runtime.Versioning;
-
-[SupportedOSPlatform("Windows")]
-public class App4
-{
- private static PerformanceCounter PC;
-
- public static void Main()
- {
- ArrayList samplesList = new ArrayList();
-
- // If the category does not exist, create the category and exit.
- // Perfomance counters should not be created and immediately used.
- // There is a latency time to enable the counters, they should be created
- // prior to executing the application that uses the counters.
- // Execute this sample a second time to use the category.
- if (SetupCategory())
- return;
- CreateCounters();
- CollectSamples(samplesList);
- CalculateResults(samplesList);
- }
-
- private static bool SetupCategory()
- {
-
- if (!PerformanceCounterCategory.Exists("RateOfCountsPerSecond64SampleCategory"))
- {
-
- CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
-
- // Add the counter.
- CounterCreationData rateOfCounts64 = new CounterCreationData();
- rateOfCounts64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64;
- rateOfCounts64.CounterName = "RateOfCountsPerSecond64Sample";
- CCDC.Add(rateOfCounts64);
-
- // Create the category.
- PerformanceCounterCategory.Create("RateOfCountsPerSecond64SampleCategory",
- "Demonstrates usage of the RateOfCountsPerSecond64 performance counter type.",
- PerformanceCounterCategoryType.SingleInstance, CCDC);
- return (true);
- }
- else
- {
- Console.WriteLine("Category exists - RateOfCountsPerSecond64SampleCategory");
- return (false);
- }
- }
-
- private static void CreateCounters()
- {
- // Create the counter.
- PC = new PerformanceCounter("RateOfCountsPerSecond64SampleCategory",
- "RateOfCountsPerSecond64Sample",
- false);
-
- PC.RawValue = 0;
- }
-
- private static void CollectSamples(ArrayList samplesList)
- {
-
- Random r = new Random(DateTime.Now.Millisecond);
-
- // Initialize the performance counter.
- PC.NextSample();
-
- // Loop for the samples.
- for (int j = 0; j < 100; j++)
- {
-
- int value = r.Next(1, 10);
- PC.IncrementBy(value);
- Console.Write(j + " = " + value);
-
- if ((j % 10) == 9)
- {
- Console.WriteLine("; NextValue() = " + PC.NextValue().ToString());
- OutputSample(PC.NextSample());
- samplesList.Add(PC.NextSample());
- }
- else
- {
- Console.WriteLine();
- }
-
- System.Threading.Thread.Sleep(50);
- }
- }
-
- private static void CalculateResults(ArrayList samplesList)
- {
- for (int i = 0; i < (samplesList.Count - 1); i++)
- {
- // Output the sample.
- OutputSample((CounterSample)samplesList[i]);
- OutputSample((CounterSample)samplesList[i + 1]);
-
- // Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
- CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
-
- // Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
- MyComputeCounterValue((CounterSample)samplesList[i],
- (CounterSample)samplesList[i + 1]));
- }
- }
-
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- // PERF_COUNTER_COUNTER
- // Description - This counter type shows the average number of operations completed
- // during each second of the sample interval. Counters of this type
- // measure time in ticks of the system clock. The F variable represents
- // the number of ticks per second. The value of F is factored into the
- // equation so that the result can be displayed in seconds.
- //
- // Generic type - Difference
- //
- // Formula - (N1 - N0) / ( (D1 - D0) / F), where the numerator (N) represents the number
- // of operations performed during the last sample interval, the denominator
- // (D) represents the number of ticks elapsed during the last sample
- // interval, and F is the frequency of the ticks.
- //
- // Average - (Nx - N0) / ((Dx - D0) / F)
- //
- // Example - System\ File Read Operations/sec
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
- {
- Single numerator = (Single)(s1.RawValue - s0.RawValue);
- Single denomenator = (Single)(s1.TimeStamp - s0.TimeStamp) / (Single)s1.SystemFrequency;
- Single counterValue = numerator / denomenator;
- return (counterValue);
- }
-
- private static void OutputSample(CounterSample s)
- {
- Console.WriteLine("\r\n+++++++++++");
- Console.WriteLine("Sample values - \r\n");
- Console.WriteLine(" BaseValue = " + s.BaseValue);
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency);
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
- Console.WriteLine(" CounterType = " + s.CounterType);
- Console.WriteLine(" RawValue = " + s.RawValue);
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency);
- Console.WriteLine(" TimeStamp = " + s.TimeStamp);
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
- Console.WriteLine("++++++++++++++++++++++");
- }
-}
-
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/rawfraction.cs b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/rawfraction.cs
deleted file mode 100644
index 008ab43884ce8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/csharp/rawfraction.cs
+++ /dev/null
@@ -1,172 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Runtime.Versioning;
-
-[SupportedOSPlatform("Windows")]
-public class App5
-{
- private static PerformanceCounter PC;
- private static PerformanceCounter BPC;
-
- public static void Main()
- {
- ArrayList samplesList = new ArrayList();
-
- // If the category does not exist, create the category and exit.
- // Performance counters should not be created and immediately used.
- // There is a latency time to enable the counters, they should be created
- // prior to executing the application that uses the counters.
- // Execute this sample a second time to use the counters.
- if (SetupCategory())
- return;
- CreateCounters();
- CollectSamples(samplesList);
- CalculateResults(samplesList);
- }
-
- private static bool SetupCategory()
- {
-
- if (!PerformanceCounterCategory.Exists("RawFractionSampleCategory"))
- {
-
- CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
-
- // Add the counter.
- CounterCreationData rf = new CounterCreationData();
- rf.CounterType = PerformanceCounterType.RawFraction;
- rf.CounterName = "RawFractionSample";
- CCDC.Add(rf);
-
- // Add the base counter.
- CounterCreationData rfBase = new CounterCreationData();
- rfBase.CounterType = PerformanceCounterType.RawBase;
- rfBase.CounterName = "RawFractionSampleBase";
- CCDC.Add(rfBase);
-
- // Create the category.
- PerformanceCounterCategory.Create("RawFractionSampleCategory",
- "Demonstrates usage of the RawFraction performance counter type.",
- PerformanceCounterCategoryType.SingleInstance, CCDC);
-
- return (true);
- }
- else
- {
- Console.WriteLine("Category exists - RawFractionSampleCategory");
- return (false);
- }
- }
-
- private static void CreateCounters()
- {
- // Create the counters.
- PC = new PerformanceCounter("RawFractionSampleCategory",
- "RawFractionSample",
- false);
-
- BPC = new PerformanceCounter("RawFractionSampleCategory",
- "RawFractionSampleBase",
- false);
-
- PC.RawValue = 0;
- BPC.RawValue = 0;
- }
-
- private static void CollectSamples(ArrayList samplesList)
- {
-
- Random r = new Random(DateTime.Now.Millisecond);
-
- // Initialize the performance counter.
- PC.NextSample();
-
- // Loop for the samples.
- for (int j = 0; j < 100; j++)
- {
- int value = r.Next(1, 10);
- Console.Write(j + " = " + value);
-
- // Increment the base every time, because the counter measures the number
- // of high hits (raw fraction value) against all the hits (base value).
- BPC.Increment();
-
- // Get the % of samples that are 9 or 10 out of all the samples taken.
- if (value >= 9)
- PC.Increment();
-
- // Copy out the next value every ten times around the loop.
- if ((j % 10) == 9)
- {
- Console.WriteLine("; NextValue() = " + PC.NextValue().ToString());
- OutputSample(PC.NextSample());
- samplesList.Add(PC.NextSample());
- }
- else
- {
- Console.WriteLine();
- }
-
- System.Threading.Thread.Sleep(50);
- }
- }
-
- private static void CalculateResults(ArrayList samplesList)
- {
- for (int i = 0; i < samplesList.Count; i++)
- {
- // Output the sample.
- OutputSample((CounterSample)samplesList[i]);
-
- // Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
- CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i]));
-
- // Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
- MyComputeCounterValue((CounterSample)samplesList[i]));
- }
- }
-
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- // Formula from MSDN -
- // Description - This counter type shows the ratio of a subset to its set as a percentage.
- // For example, it compares the number of bytes in use on a disk to the
- // total number of bytes on the disk. Counters of this type display the
- // current percentage only, not an average over time.
- //
- // Generic type - Instantaneous, Percentage
- // Formula - (N0 / D0), where D represents a measured attribute and N represents one
- // component of that attribute.
- //
- // Average - SUM (N / D) /x
- // Example - Paging File\% Usage Peak
- //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- private static Single MyComputeCounterValue(CounterSample rfSample)
- {
- Single numerator = (Single)rfSample.RawValue;
- Single denomenator = (Single)rfSample.BaseValue;
- Single counterValue = (numerator / denomenator) * 100;
- return (counterValue);
- }
-
- // Output information about the counter sample.
- private static void OutputSample(CounterSample s)
- {
- Console.WriteLine("+++++++++++");
- Console.WriteLine("Sample values - \r\n");
- Console.WriteLine(" BaseValue = " + s.BaseValue);
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency);
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
- Console.WriteLine(" CounterType = " + s.CounterType);
- Console.WriteLine(" RawValue = " + s.RawValue);
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency);
- Console.WriteLine(" TimeStamp = " + s.TimeStamp);
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
- Console.WriteLine("++++++++++++++++++++++");
- }
-}
-
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/Project.vbproj
deleted file mode 100644
index 2da0e2c488701..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/averagecount32.vb b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/averagecount32.vb
deleted file mode 100644
index 067203ae7ecea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/averagecount32.vb
+++ /dev/null
@@ -1,149 +0,0 @@
-'
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.Diagnostics
-Imports System.Runtime.Versioning
-
-
-Public Class App1
-
- Private Shared avgCounter64Sample As PerformanceCounter
- Private Shared avgCounter64SampleBase As PerformanceCounter
-
- Public Shared Sub Main()
-
- Dim samplesList As New ArrayList()
- 'If the category does not exist, create the category and exit.
- 'Performance counters should not be created and immediately used.
- 'There is a latency time to enable the counters, they should be created
- 'prior to executing the App1lication that uses the counters.
- 'Execute this sample a second time to use the counters.
- If Not (SetupCategory()) Then
- CreateCounters()
- CollectSamples(samplesList)
- CalculateResults(samplesList)
- End If
-
- End Sub
-
- Private Shared Function SetupCategory() As Boolean
- If Not PerformanceCounterCategory.Exists("AverageCounter64SampleCategory") Then
-
- Dim counterDataCollection As New CounterCreationDataCollection()
-
- ' Add the counter.
- Dim averageCount64 As New CounterCreationData()
- averageCount64.CounterType = PerformanceCounterType.AverageCount64
- averageCount64.CounterName = "AverageCounter64Sample"
- counterDataCollection.Add(averageCount64)
-
- ' Add the base counter.
- Dim averageCount64Base As New CounterCreationData()
- averageCount64Base.CounterType = PerformanceCounterType.AverageBase
- averageCount64Base.CounterName = "AverageCounter64SampleBase"
- counterDataCollection.Add(averageCount64Base)
-
- ' Create the category.
- PerformanceCounterCategory.Create("AverageCounter64SampleCategory",
- "Demonstrates usage of the AverageCounter64 performance counter type.",
- PerformanceCounterCategoryType.SingleInstance, counterDataCollection)
-
- Return True
- Else
- Console.WriteLine("Category exists - AverageCounter64SampleCategory")
- Return False
- End If
- End Function 'SetupCategory
-
- Private Shared Sub CreateCounters()
- ' Create the counters.
-
- '
- avgCounter64Sample = New PerformanceCounter("AverageCounter64SampleCategory", "AverageCounter64Sample", False)
- '
-
- avgCounter64SampleBase = New PerformanceCounter("AverageCounter64SampleCategory", "AverageCounter64SampleBase", False)
-
- avgCounter64Sample.RawValue = 0
- avgCounter64SampleBase.RawValue = 0
- End Sub
-
- '
- Private Shared Sub CollectSamples(ByVal samplesList As ArrayList)
-
- Dim r As New Random(DateTime.Now.Millisecond)
-
- ' Loop for the samples.
- Dim j As Integer
- For j = 0 To 99
-
- Dim value As Integer = r.Next(1, 10)
- Console.Write(j.ToString() + " = " + value.ToString())
-
- avgCounter64Sample.IncrementBy(value)
-
- avgCounter64SampleBase.Increment()
-
- If j Mod 10 = 9 Then
- OutputSample(avgCounter64Sample.NextSample())
- samplesList.Add(avgCounter64Sample.NextSample())
- Else
- Console.WriteLine()
- End If
- System.Threading.Thread.Sleep(50)
- Next j
- End Sub
- '
-
- Private Shared Sub CalculateResults(ByVal samplesList As ArrayList)
- Dim i As Integer
- For i = 0 To (samplesList.Count - 1) - 1
- ' Output the sample.
- OutputSample(CType(samplesList(i), CounterSample))
- OutputSample(CType(samplesList((i + 1)), CounterSample))
-
- ' Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " + CounterSampleCalculator.ComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
-
- ' Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " + MyComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
- Next i
- End Sub
-
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- ' Description - This counter type shows how many items are processed, on average,
- ' during an operation. Counters of this type display a ratio of the items
- ' processed (such as bytes sent) to the number of operations completed. The
- ' ratio is calculated by comparing the number of items processed during the
- ' last interval to the number of operations completed during the last interval.
- ' Generic type - Average
- ' Formula - (N1 - N0) / (D1 - D0), where the numerator (N) represents the number
- ' of items processed during the last sample interval and the denominator (D)
- ' represents the number of operations completed during the last two sample
- ' intervals.
- ' Average (Nx - N0) / (Dx - D0)
- ' Example PhysicalDisk\ Avg. Disk Bytes/Transfer
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- Private Shared Function MyComputeCounterValue(ByVal s0 As CounterSample, ByVal s1 As CounterSample) As [Single]
- Dim numerator As [Single] = CType(s1.RawValue, [Single]) - CType(s0.RawValue, [Single])
- Dim denomenator As [Single] = CType(s1.BaseValue, [Single]) - CType(s0.BaseValue, [Single])
- Dim counterValue As [Single] = numerator / denomenator
- Return counterValue
- End Function 'MyComputeCounterValue
-
- ' Output information about the counter sample.
- Private Shared Sub OutputSample(ByVal s As CounterSample)
- Console.WriteLine(ControlChars.Lf + ControlChars.Cr + "+++++++++++")
- Console.WriteLine("Sample values - " + ControlChars.Lf + ControlChars.Cr)
- Console.WriteLine((" BaseValue = " + s.BaseValue.ToString()))
- Console.WriteLine((" CounterFrequency = " + s.CounterFrequency.ToString()))
- Console.WriteLine((" CounterTimeStamp = " + s.CounterTimeStamp.ToString()))
- Console.WriteLine((" CounterType = " + s.CounterType.ToString()))
- Console.WriteLine((" RawValue = " + s.RawValue.ToString()))
- Console.WriteLine((" SystemFrequency = " + s.SystemFrequency.ToString()))
- Console.WriteLine((" TimeStamp = " + s.TimeStamp.ToString()))
- Console.WriteLine((" TimeStamp100nSec = " + s.TimeStamp100nSec.ToString()))
- Console.WriteLine("++++++++++++++++++++++")
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/averagetimer32.vb b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/averagetimer32.vb
deleted file mode 100644
index a415b8951c5c1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/averagetimer32.vb
+++ /dev/null
@@ -1,392 +0,0 @@
-' Notice that the sample is conditionally compiled for Everett vs.
-' Whidbey builds. Whidbey introduced new APIs that are not available
-' in Everett. Snippet IDs do not overlap between Whidbey and Everett;
-' Snippet #1 is Everett, Snippet #2 and #3 are Whidbey.
-
-#If BELOW_WHIDBEY_BUILD Then
-
-'
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.Diagnostics
-Imports System.Runtime.InteropServices
-
-Public Class App
-
- Private Shared PC As PerformanceCounter
- Private Shared BPC As PerformanceCounter
-
-
- Public Shared Sub Main()
- Dim samplesList As New ArrayList()
-
- 'If the category does not exist, create the category and exit.
- 'Performance counters should not be created and immediately used.
- 'There is a latency time to enable the counters, they should be created
- 'prior to executing the application that uses the counters.
- 'Execute this sample a second time to use the counters.
- If Not (SetupCategory()) Then
- CreateCounters()
- CollectSamples(samplesList)
- CalculateResults(samplesList)
- End If
- End Sub
-
-
- Private Shared Function SetupCategory() As Boolean
-
- If Not PerformanceCounterCategory.Exists("AverageTimer32SampleCategory") Then
-
- Dim CCDC As New CounterCreationDataCollection()
-
- ' Add the counter.
- Dim averageTimer32 As New CounterCreationData()
- averageTimer32.CounterType = PerformanceCounterType.AverageTimer32
- averageTimer32.CounterName = "AverageTimer32Sample"
- CCDC.Add(averageTimer32)
-
- ' Add the base counter.
- Dim averageTimer32Base As New CounterCreationData()
- averageTimer32Base.CounterType = PerformanceCounterType.AverageBase
- averageTimer32Base.CounterName = "AverageTimer32SampleBase"
- CCDC.Add(averageTimer32Base)
-
- ' Create the category.
- PerformanceCounterCategory.Create( _
- "AverageTimer32SampleCategory", _
- "Demonstrates usage of the AverageTimer32 performance counter type", _
- PerformanceCounterCategoryType.SingleInstance, CCDC)
-
- Return True
- Else
- Console.WriteLine(("Category exists - " + _
- "AverageTimer32SampleCategory"))
- Return False
- End If
- End Function
-
-
- Private Shared Sub CreateCounters()
- ' Create the counters.
- PC = New PerformanceCounter("AverageTimer32SampleCategory", _
- "AverageTimer32Sample", False)
-
- BPC = New PerformanceCounter("AverageTimer32SampleCategory", _
- "AverageTimer32SampleBase", False)
-
- PC.RawValue = 0
- BPC.RawValue = 0
- End Sub
-
-
- Private Shared Sub CollectSamples(samplesList As ArrayList)
-
- Dim perfTime As Long = 0
- Dim r As New Random(DateTime.Now.Millisecond)
-
- ' Loop for the samples.
- Dim i As Integer
- For i = 0 To 9
-
- QueryPerformanceCounter(perfTime)
- PC.RawValue = perfTime
-
- BPC.IncrementBy(10)
-
- System.Threading.Thread.Sleep(1000)
- Console.WriteLine(("Next value = " + PC.NextValue().ToString()))
- samplesList.Add(PC.NextSample())
- Next i
- End Sub
-
-
- Private Shared Sub CalculateResults(samplesList As ArrayList)
- Dim i As Integer
- Dim sample1 As CounterSample
- Dim sample2 As CounterSample
- For i = 0 To (samplesList.Count - 1) - 1
- ' Output the sample.
- sample1 = CType(samplesList(i), CounterSample)
- sample2 = CType(samplesList(i+1), CounterSample)
- OutputSample(sample1)
- OutputSample(sample2)
-
- ' Use .NET to calculate the counter value.
- Console.WriteLine((".NET computed counter value = " _
- + CounterSample.Calculate(sample1, sample2).ToString()))
-
- ' Calculate the counter value manually.
- Console.WriteLine(("My computed counter value = " _
- + MyComputeCounterValue(sample1, sample2).ToString()))
-
- Next i
- End Sub
-
-
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
- ' PERF_AVERAGE_TIMER
- ' Description - This counter type measures the time it takes, on
- ' average, to complete a process or operation. Counters of this
- ' type display a ratio of the total elapsed time of the sample
- ' interval to the number of processes or operations completed
- ' during that time. This counter type measures time in ticks
- ' of the system clock. The F variable represents the number of
- ' ticks per second. The value of F is factored into the equation
- ' so that the result can be displayed in seconds.
- '
- ' Generic type - Average
- '
- ' Formula - ((N1 - N0) / F) / (D1 - D0), where the numerator (N)
- ' represents the number of ticks counted during the last
- ' sample interval, F represents the frequency of the ticks,
- ' and the denominator (D) represents the number of operations
- ' completed during the last sample interval.
- '
- ' Average - ((Nx - N0) / F) / (Dx - D0)
- '
- ' Example - PhysicalDisk\ Avg. Disk sec/Transfer
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
- Private Shared Function MyComputeCounterValue( _
- s0 As CounterSample, _
- s1 As CounterSample) As Single
- Dim n1 As Int64 = s1.RawValue
- Dim n0 As Int64 = s0.RawValue
- Dim f As Decimal = CType(s1.SystemFrequency, Decimal)
- Dim d1 As Int64 = s1.BaseValue
- Dim d0 As Int64 = s0.BaseValue
-
- Dim numerator As Double = System.Convert.ToDouble(n1 - n0)
- Dim denominator As Double = System.Convert.ToDouble(d1 - d0)
- Dim counterValue As Single = CType(numerator, Single)
- counterValue = counterValue / CType(f, Single)
- counterValue = counterValue / CType(denominator, Single)
-
- Return counterValue
- End Function
-
-
- ' Output information about the counter sample.
- Private Shared Sub OutputSample(s As CounterSample)
- Console.WriteLine("+++++++++++")
- Console.WriteLine("Sample values - " + ControlChars.Cr _
- + ControlChars.Lf)
- Console.WriteLine((" BaseValue = " _
- + s.BaseValue.ToString()))
- Console.WriteLine((" CounterFrequency = " + _
- s.CounterFrequency.ToString()))
- Console.WriteLine((" CounterTimeStamp = " + _
- s.CounterTimeStamp.ToString()))
- Console.WriteLine((" CounterType = " + _
- s.CounterType.ToString()))
- Console.WriteLine((" RawValue = " + _
- s.RawValue.ToString()))
- Console.WriteLine((" SystemFrequency = " + _
- s.SystemFrequency.ToString()))
- Console.WriteLine((" TimeStamp = " + _
- s.TimeStamp.ToString()))
- Console.WriteLine((" TimeStamp100nSec = " + _
- s.TimeStamp100nSec.ToString()))
- Console.WriteLine("++++++++++++++++++++++")
- End Sub
-
- _
- Public Shared Function _
- QueryPerformanceCounter(ByRef value As Long) As Boolean
- End Function
-
-End Class
-
-'
-
-#Else
-
-'
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.Diagnostics
-Imports System.Runtime.InteropServices
-Imports System.Runtime.Versioning
-
-
-Public Class App
-
- Private Const categoryName As String = "AverageTimer32SampleCategory"
- Private Const counterName As String = "AverageTimer32Sample"
- Private Const baseCounterName As String = "AverageTimer32SampleBase"
-
- Private Shared PC As PerformanceCounter
- Private Shared BPC As PerformanceCounter
-
-
- Public Shared Sub Main()
- Dim samplesList As New ArrayList()
-
- SetupCategory()
- CreateCounters()
- CollectSamples(samplesList)
- CalculateResults(samplesList)
- End Sub
-
-
- Private Shared Function SetupCategory() As Boolean
-
- If Not PerformanceCounterCategory.Exists(categoryName) Then
-
- Dim CCDC As New CounterCreationDataCollection()
-
- ' Add the counter.
- Dim averageTimer32 As New CounterCreationData()
- averageTimer32.CounterType = PerformanceCounterType.AverageTimer32
- averageTimer32.CounterName = counterName
- CCDC.Add(averageTimer32)
-
- ' Add the base counter.
- Dim averageTimer32Base As New CounterCreationData()
- averageTimer32Base.CounterType = PerformanceCounterType.AverageBase
- averageTimer32Base.CounterName = baseCounterName
- CCDC.Add(averageTimer32Base)
-
- ' Create the category.
- PerformanceCounterCategory.Create( _
- categoryName, _
- "Demonstrates usage of the AverageTimer32 performance counter type", _
- PerformanceCounterCategoryType.SingleInstance, CCDC)
-
- Console.WriteLine("Category created - " + categoryName)
-
- Return True
- Else
- Console.WriteLine(("Category exists - " + _
- categoryName))
- Return False
- End If
- End Function
-
-
- Private Shared Sub CreateCounters()
- ' Create the counters.
- PC = New PerformanceCounter(categoryName, _
- counterName, False)
-
- BPC = New PerformanceCounter(categoryName, _
- baseCounterName, False)
-
- PC.RawValue = 0
- BPC.RawValue = 0
- End Sub
-
-
- Private Shared Sub CollectSamples(ByVal samplesList As ArrayList)
-
- Dim r As New Random(DateTime.Now.Millisecond)
-
- ' Loop for the samples.
- Dim i As Integer
- For i = 0 To 9
-
- PC.RawValue = Stopwatch.GetTimeStamp()
-
- BPC.IncrementBy(10)
-
- System.Threading.Thread.Sleep(1000)
- Console.WriteLine(("Next value = " + PC.NextValue().ToString()))
- samplesList.Add(PC.NextSample())
- Next i
- End Sub
-
-
- Private Shared Sub CalculateResults(ByVal samplesList As ArrayList)
- Dim i As Integer
- Dim sample1 As CounterSample
- Dim sample2 As CounterSample
- For i = 0 To (samplesList.Count - 1) - 1
- ' Output the sample.
- sample1 = CType(samplesList(i), CounterSample)
- sample2 = CType(samplesList(i + 1), CounterSample)
- OutputSample(sample1)
- OutputSample(sample2)
-
- ' Use .NET to calculate the counter value.
- Console.WriteLine((".NET computed counter value = " _
- + CounterSample.Calculate(sample1, sample2).ToString()))
-
- ' Calculate the counter value manually.
- Console.WriteLine(("My computed counter value = " _
- + MyComputeCounterValue(sample1, sample2).ToString()))
-
- Next i
- End Sub
-
-
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
- ' PERF_AVERAGE_TIMER
- ' Description - This counter type measures the time it takes, on
- ' average, to complete a process or operation. Counters of this
- ' type display a ratio of the total elapsed time of the sample
- ' interval to the number of processes or operations completed
- ' during that time. This counter type measures time in ticks
- ' of the system clock. The F variable represents the number of
- ' ticks per second. The value of F is factored into the equation
- ' so that the result can be displayed in seconds.
- '
- ' Generic type - Average
- '
- ' Formula - ((N1 - N0) / F) / (D1 - D0), where the numerator (N)
- ' represents the number of ticks counted during the last
- ' sample interval, F represents the frequency of the ticks,
- ' and the denominator (D) represents the number of operations
- ' completed during the last sample interval.
- '
- ' Average - ((Nx - N0) / F) / (Dx - D0)
- '
- ' Example - PhysicalDisk\ Avg. Disk sec/Transfer
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
- Private Shared Function MyComputeCounterValue( _
- ByVal s0 As CounterSample, _
- ByVal s1 As CounterSample) As Single
- Dim n1 As Int64 = s1.RawValue
- Dim n0 As Int64 = s0.RawValue
- Dim f As Decimal = CType(s1.SystemFrequency, Decimal)
- Dim d1 As Int64 = s1.BaseValue
- Dim d0 As Int64 = s0.BaseValue
-
- Dim numerator As Double = System.Convert.ToDouble(n1 - n0)
- Dim denominator As Double = System.Convert.ToDouble(d1 - d0)
- Dim counterValue As Single = CType(numerator, Single)
- counterValue = counterValue / CType(f, Single)
- counterValue = counterValue / CType(denominator, Single)
-
- Return counterValue
- End Function
-
-
- ' Output information about the counter sample.
- Private Shared Sub OutputSample(ByVal s As CounterSample)
- Console.WriteLine("+++++++++++")
- Console.WriteLine("Sample values - " + ControlChars.Cr _
- + ControlChars.Lf)
- Console.WriteLine((" CounterType = " + _
- s.CounterType.ToString()))
- Console.WriteLine((" RawValue = " + _
- s.RawValue.ToString()))
- Console.WriteLine((" BaseValue = " _
- + s.BaseValue.ToString()))
- Console.WriteLine((" CounterFrequency = " + _
- s.CounterFrequency.ToString()))
- Console.WriteLine((" CounterTimeStamp = " + _
- s.CounterTimeStamp.ToString()))
- Console.WriteLine((" SystemFrequency = " + _
- s.SystemFrequency.ToString()))
- Console.WriteLine((" TimeStamp = " + _
- s.TimeStamp.ToString()))
- Console.WriteLine((" TimeStamp100nSec = " + _
- s.TimeStamp100nSec.ToString()))
- Console.WriteLine("++++++++++++++++++++++")
- End Sub
-
-
-End Class
-
-'
-
-#End If
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/elapsedtime.vb b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/elapsedtime.vb
deleted file mode 100644
index abcbfba55d23e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/elapsedtime.vb
+++ /dev/null
@@ -1,237 +0,0 @@
-' Notice that the sample is conditionally compiled for Everett vs.
-' Whidbey builds. Whidbey introduced new APIs that are not available
-' in Everett. Snippet IDs do not overlap between Whidbey and Everett;
-' Snippet #1 is Everett, Snippet #2 and #3 are Whidbey.
-
-#If BELOW_WHIDBEY_BUILD Then
-
- '
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.Diagnostics
-Imports System.Runtime.InteropServices
-
-Public Class App2
- Private Shared PC As PerformanceCounter
-
- Public Shared Sub Main()
- Dim samplesList As New ArrayList()
-
- 'If the category does not exist, create the category and exit.
- 'Performance counters should not be created and immediately used.
- 'There is a latency time to enable the counters, they should be created
- 'prior to executing the App2lication that uses the counters.
- 'Execute this sample a second time to use the counters.
- If Not (SetupCategory()) Then
- CreateCounters()
- CollectSamples(samplesList)
- End If
-
- End Sub
-
-
- Private Shared Function SetupCategory() As Boolean
- If Not PerformanceCounterCategory.Exists("ElapsedTimeSampleCategory") Then
-
- Dim CCDC As New CounterCreationDataCollection()
-
- ' Add the counter.
- Dim ETimeData As New CounterCreationData()
- ETimeData.CounterType = PerformanceCounterType.ElapsedTime
- ETimeData.CounterName = "ElapsedTimeSample"
- CCDC.Add(ETimeData)
-
- ' Create the category.
- PerformanceCounterCategory.Create("ElapsedTimeSampleCategory", _
- "Demonstrates usage of the ElapsedTime performance counter type.", CCDC)
-
- Return True
- Else
- Console.WriteLine("Category exists - ElapsedTimeSampleCategory")
- Return False
- End If
- End Function 'SetupCategory
-
-
- Private Shared Sub CreateCounters()
- ' Create the counter.
- PC = New PerformanceCounter("ElapsedTimeSampleCategory", _
- "ElapsedTimeSample", False)
- End Sub
-
-
-
- Private Shared Sub CollectSamples(samplesList As ArrayList)
-
- Dim pcValue As Long
- Dim Start As DateTime
-
- ' Initialize the counter.
- QueryPerformanceCounter(pcValue)
- PC.RawValue = pcValue
- Start = DateTime.Now
-
- ' Loop for the samples.
- Dim j As Integer
- For j = 0 To 999
- ' Output the values.
- If j Mod 10 = 9 Then
- Console.WriteLine(("NextValue() = " _
- + PC.NextValue().ToString()))
- Console.WriteLine(("Actual elapsed time = " _
- + DateTime.Now.Subtract(Start).ToString()))
- OutputSample(PC.NextSample())
- samplesList.Add(PC.NextSample())
- End If
-
- ' reset the counter on 100th iteration.
- If j Mod 100 = 0 Then
- QueryPerformanceCounter(pcValue)
- PC.RawValue = pcValue
- Start = DateTime.Now
- End If
- System.Threading.Thread.Sleep(50)
- Next j
-
- Console.WriteLine(("Elapsed time = " + _
- DateTime.Now.Subtract(Start).ToString()))
- End Sub
-
-
- Private Shared Sub OutputSample(s As CounterSample)
- Console.WriteLine(ControlChars.Lf + ControlChars.Cr + "+++++++")
-
- Console.WriteLine("Sample values - " + ControlChars.Cr _
- + ControlChars.Lf)
- Console.WriteLine((" BaseValue = " _
- + s.BaseValue.ToString()))
- Console.WriteLine((" CounterFrequency = " + _
- s.CounterFrequency.ToString()))
- Console.WriteLine((" CounterTimeStamp = " + _
- s.CounterTimeStamp.ToString()))
- Console.WriteLine((" CounterType = " + _
- s.CounterType.ToString()))
- Console.WriteLine((" RawValue = " + _
- s.RawValue.ToString()))
- Console.WriteLine((" SystemFrequency = " + _
- s.SystemFrequency.ToString()))
- Console.WriteLine((" TimeStamp = " + _
- s.TimeStamp.ToString()))
- Console.WriteLine((" TimeStamp100nSec = " + _
- s.TimeStamp100nSec.ToString()))
-
- Console.WriteLine("+++++++")
- End Sub
-
- ' Reads the counter information to enable setting the RawValue.
- _
- Public Shared Function _
- QueryPerformanceCounter(ByRef value As Long) As Boolean
- End Function
-End Class
-'
-
-#Else
-'
-
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.Diagnostics
-Imports System.Runtime.InteropServices
-Imports System.Runtime.Versioning
-
-
-Public Class App2
-
- Public Shared Sub Main()
- CollectSamples()
- End Sub
-
- Private Shared Sub CollectSamples()
-
- Dim categoryName As String = "ElapsedTimeSampleCategory"
- Dim counterName As String = "ElapsedTimeSample"
-
- If Not PerformanceCounterCategory.Exists(categoryName) Then
-
- Dim CCDC As New CounterCreationDataCollection()
-
- ' Add the counter.
- Dim ETimeData As New CounterCreationData()
- ETimeData.CounterType = PerformanceCounterType.ElapsedTime
- ETimeData.CounterName = counterName
- CCDC.Add(ETimeData)
-
- ' Create the category.
- PerformanceCounterCategory.Create(categoryName,
- "Demonstrates ElapsedTime performance counter usage.",
- PerformanceCounterCategoryType.SingleInstance, CCDC)
-
- Else
- Console.WriteLine("Category exists - {0}", categoryName)
- End If
-
- '
- ' Create the counter.
- Dim PC As PerformanceCounter
- PC = New PerformanceCounter(categoryName, counterName, False)
-
- ' Initialize the counter.
- PC.RawValue = Stopwatch.GetTimestamp()
- '
-
- Dim Start As DateTime = DateTime.Now
-
- ' Loop for the samples.
- Dim j As Integer
- For j = 0 To 99
- ' Output the values.
- If j Mod 10 = 9 Then
- Console.WriteLine(("NextValue() = " _
- + PC.NextValue().ToString()))
- Console.WriteLine(("Actual elapsed time = " _
- + DateTime.Now.Subtract(Start).ToString()))
- OutputSample(PC.NextSample())
- End If
-
- ' Reset the counter every 20th iteration.
- If j Mod 20 = 0 Then
- PC.RawValue = Stopwatch.GetTimestamp()
- Start = DateTime.Now
- End If
- System.Threading.Thread.Sleep(50)
- Next j
-
- Console.WriteLine(("Elapsed time = " +
- DateTime.Now.Subtract(Start).ToString()))
- End Sub
-
-
- Private Shared Sub OutputSample(ByVal s As CounterSample)
- Console.WriteLine(ControlChars.Lf + ControlChars.Cr + "+++++++")
-
- Console.WriteLine("Sample values - " + ControlChars.Cr _
- + ControlChars.Lf)
- Console.WriteLine((" BaseValue = " _
- + s.BaseValue.ToString()))
- Console.WriteLine((" CounterFrequency = " +
- s.CounterFrequency.ToString()))
- Console.WriteLine((" CounterTimeStamp = " +
- s.CounterTimeStamp.ToString()))
- Console.WriteLine((" CounterType = " +
- s.CounterType.ToString()))
- Console.WriteLine((" RawValue = " +
- s.RawValue.ToString()))
- Console.WriteLine((" SystemFrequency = " +
- s.SystemFrequency.ToString()))
- Console.WriteLine((" TimeStamp = " +
- s.TimeStamp.ToString()))
- Console.WriteLine((" TimeStamp100nSec = " +
- s.TimeStamp100nSec.ToString()))
-
- Console.WriteLine("+++++++")
- End Sub
-End Class
-'
-
-#End If
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/numberofitems32.vb b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/numberofitems32.vb
deleted file mode 100644
index c075e12f5fb77..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/numberofitems32.vb
+++ /dev/null
@@ -1,131 +0,0 @@
-'
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.Diagnostics
-Imports System.Runtime.Versioning
-
-
-Public Class NumberOfItems64
-
- Private Shared PC As PerformanceCounter
-
-
- Public Shared Sub Main()
- Dim samplesList As New ArrayList()
- 'If the category does not exist, create the category and exit.
- 'Performance counters should not be created and immediately used.
- 'There is a latency time to enable the counters, they should be created
- 'prior to executing the application that uses the counters.
- 'Execute this sample a second time to use the counters.
- If Not (SetupCategory()) Then
- CreateCounters()
- CollectSamples(samplesList)
- CalculateResults(samplesList)
- End If
- End Sub
-
-
- Private Shared Function SetupCategory() As Boolean
- If Not PerformanceCounterCategory.Exists("NumberOfItems32SampleCategory") Then
-
- Dim CCDC As New CounterCreationDataCollection()
-
- ' Add the counter.
- Dim NOI64 As New CounterCreationData()
- NOI64.CounterType = PerformanceCounterType.NumberOfItems64
- NOI64.CounterName = "NumberOfItems32Sample"
- CCDC.Add(NOI64)
-
- ' Create the category.
- PerformanceCounterCategory.Create("NumberOfItems32SampleCategory", _
- "Demonstrates usage of the NumberOfItems32 performance counter type.", _
- PerformanceCounterCategoryType.SingleInstance, CCDC)
-
- Return True
- Else
- Console.WriteLine("Category exists - NumberOfItems32SampleCategory")
- Return False
- End If
- End Function 'SetupCategory
-
-
- Private Shared Sub CreateCounters()
- ' Create the counter.
- PC = New PerformanceCounter("NumberOfItems32SampleCategory", "NumberOfItems32Sample", False)
-
- PC.RawValue = 0
- End Sub
-
-
- Private Shared Sub CollectSamples(ByVal samplesList As ArrayList)
-
-
-
- Dim r As New Random(DateTime.Now.Millisecond)
-
- ' Loop for the samples.
- Dim j As Integer
- For j = 0 To 99
-
- Dim value As Integer = r.Next(1, 10)
- Console.Write(j.ToString() + " = " + value.ToString())
-
- PC.IncrementBy(value)
-
- If j Mod 10 = 9 Then
- OutputSample(PC.NextSample())
- samplesList.Add(PC.NextSample())
- Else
- Console.WriteLine()
- End If
- System.Threading.Thread.Sleep(50)
- Next j
- End Sub
-
-
-
-
- Private Shared Sub CalculateResults(ByVal samplesList As ArrayList)
- Dim i As Integer
- For i = 0 To (samplesList.Count - 1) - 1
- ' Output the sample.
- OutputSample(CType(samplesList(i), CounterSample))
- OutputSample(CType(samplesList((i + 1)), CounterSample))
-
- ' Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " + CounterSampleCalculator.ComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
-
- ' Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " + MyComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
- Next i
- End Sub
-
-
-
-
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- Private Shared Function MyComputeCounterValue(ByVal s0 As CounterSample, ByVal s1 As CounterSample) As [Single]
- Dim counterValue As [Single] = s1.RawValue
- Return counterValue
- End Function 'MyComputeCounterValue
-
-
- ' Output information about the counter sample.
- Private Shared Sub OutputSample(ByVal s As CounterSample)
- Console.WriteLine(ControlChars.Lf + ControlChars.Cr + "+++++++++++")
- Console.WriteLine("Sample values - " + ControlChars.Lf + ControlChars.Cr)
- Console.WriteLine(" BaseValue = " + s.BaseValue.ToString())
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency.ToString())
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp.ToString())
- Console.WriteLine(" CounterType = " + s.CounterType.ToString())
- Console.WriteLine(" RawValue = " + s.RawValue.ToString())
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency.ToString())
- Console.WriteLine(" TimeStamp = " + s.TimeStamp.ToString())
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec.ToString())
- Console.WriteLine("++++++++++++++++++++++")
- End Sub
-End Class
-
-
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/numberofitems64.vb b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/numberofitems64.vb
deleted file mode 100644
index 7708ef509b933..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/numberofitems64.vb
+++ /dev/null
@@ -1,126 +0,0 @@
-'
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.Diagnostics
-Imports System.Runtime.Versioning
-
-
-Public Class NumberOfItems64_1
-
- Private Shared PC As PerformanceCounter
-
- Public Shared Sub Main()
- Dim samplesList As New ArrayList()
-
- 'If the category does not exist, create the category and exit.
- 'Performance counters should not be created and immediately used.
- 'There is a latency time to enable the counters, they should be created
- 'prior to executing the application that uses the counters.
- 'Execute this sample a second time to use the counters.
- If Not (SetupCategory()) Then
- CreateCounters()
- CollectSamples(samplesList)
- CalculateResults(samplesList)
- End If
-
- End Sub
-
-
- Private Shared Function SetupCategory() As Boolean
- If Not PerformanceCounterCategory.Exists("NumberOfItems64SampleCategory") Then
-
- Dim CCDC As New CounterCreationDataCollection()
-
- ' Add the counter.
- Dim NOI64 As New CounterCreationData()
- NOI64.CounterType = PerformanceCounterType.NumberOfItems64
- NOI64.CounterName = "NumberOfItems64Sample"
- CCDC.Add(NOI64)
-
- ' Create the category.
- PerformanceCounterCategory.Create("NumberOfItems64SampleCategory",
- "Demonstrates usage of the NumberOfItems64_1 performance counter type.",
- PerformanceCounterCategoryType.SingleInstance, CCDC)
-
- Return True
- Else
- Console.WriteLine("Category exists - NumberOfItems64SampleCategory")
- Return False
- End If
- End Function 'SetupCategory
-
-
- Private Shared Sub CreateCounters()
- ' Create the counters.
- PC = New PerformanceCounter("NumberOfItems64SampleCategory", "NumberOfItems64Sample", False)
-
- PC.RawValue = 0
- End Sub
-
-
- Private Shared Sub CollectSamples(ByVal samplesList As ArrayList)
-
- Dim r As New Random(DateTime.Now.Millisecond)
-
- ' Loop for the samples.
- Dim j As Integer
- For j = 0 To 99
-
- Dim value As Integer = r.Next(1, 10)
- Console.Write((j.ToString() + " = " + value.ToString()))
-
- PC.IncrementBy(value)
-
- If j Mod 10 = 9 Then
- OutputSample(PC.NextSample())
- samplesList.Add(PC.NextSample())
- Else
- Console.WriteLine()
- End If
- System.Threading.Thread.Sleep(50)
- Next j
- End Sub
-
-
- Private Shared Sub CalculateResults(ByVal samplesList As ArrayList)
- Dim i As Integer
- For i = 0 To (samplesList.Count - 1) - 1
- ' Output the sample.
- OutputSample(CType(samplesList(i), CounterSample))
- OutputSample(CType(samplesList((i + 1)), CounterSample))
-
- ' Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " + CounterSampleCalculator.ComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
-
- ' Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " + MyComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
- Next i
- End Sub
-
-
-
-
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- Private Shared Function MyComputeCounterValue(ByVal s0 As CounterSample, ByVal s1 As CounterSample) As [Single]
- Dim counterValue As [Single] = s1.RawValue
- Return counterValue
- End Function 'MyComputeCounterValue
-
-
- ' Output information about the counter sample.
- Private Shared Sub OutputSample(ByVal s As CounterSample)
- Console.WriteLine(ControlChars.Lf + ControlChars.Cr + "+++++++++++")
- Console.WriteLine("Sample values - " + ControlChars.Lf + ControlChars.Cr)
- Console.WriteLine((" BaseValue = " + s.BaseValue.ToString()))
- Console.WriteLine((" CounterFrequency = " + s.CounterFrequency.ToString()))
- Console.WriteLine((" CounterTimeStamp = " + s.CounterTimeStamp.ToString()))
- Console.WriteLine((" CounterType = " + s.CounterType.ToString()))
- Console.WriteLine((" RawValue = " + s.RawValue.ToString()))
- Console.WriteLine((" SystemFrequency = " + s.SystemFrequency.ToString()))
- Console.WriteLine((" TimeStamp = " + s.TimeStamp.ToString()))
- Console.WriteLine((" TimeStamp100nSec = " + s.TimeStamp100nSec.ToString()))
- Console.WriteLine("++++++++++++++++++++++")
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/program.vb b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/program.vb
deleted file mode 100644
index 029e8b13ea92a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/program.vb
+++ /dev/null
@@ -1,153 +0,0 @@
-'
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.Diagnostics
-Imports System.Runtime.Versioning
-
-
-' Provides a SampleFraction counter to measure the percentage of the user processor
-' time for this process to total processor time for the process.
-
-
-Public Class App3
-
- Private Shared perfCounter As PerformanceCounter
- Private Shared basePerfCounter As PerformanceCounter
- Private Shared thisProcess As Process = Process.GetCurrentProcess()
-
-
- Public Shared Sub Main()
-
- Dim samplesList As New ArrayList()
-
- ' If the category does not exist, create the category and exit.
- ' Performance counters should not be created and immediately used.
- ' There is a latency time to enable the counters, they should be created
- ' prior to executing the application that uses the counters.
- ' Execute this sample a second time to use the category.
- If SetupCategory() Then
- Return
- End If
- CreateCounters()
- CollectSamples(samplesList)
- CalculateResults(samplesList)
-
- End Sub
-
-
-
- Private Shared Function SetupCategory() As Boolean
- If Not PerformanceCounterCategory.Exists("SampleFractionCategory") Then
-
- Dim CCDC As New CounterCreationDataCollection()
-
- ' Add the counter.
- Dim sampleFraction As New CounterCreationData()
- sampleFraction.CounterType = PerformanceCounterType.SampleFraction
- sampleFraction.CounterName = "SampleFractionSample"
- CCDC.Add(sampleFraction)
-
- ' Add the base counter.
- Dim sampleFractionBase As New CounterCreationData()
- sampleFractionBase.CounterType = PerformanceCounterType.SampleBase
- sampleFractionBase.CounterName = "SampleFractionSampleBase"
- CCDC.Add(sampleFractionBase)
-
- ' Create the category.
- PerformanceCounterCategory.Create("SampleFractionCategory", "Demonstrates usage of the SampleFraction performance counter type.", PerformanceCounterCategoryType.SingleInstance, CCDC)
-
- Return True
- Else
- Console.WriteLine("Category exists - SampleFractionCategory")
- Return False
- End If
-
- End Function 'SetupCategory
-
-
- Private Shared Sub CreateCounters()
- ' Create the counters.
- perfCounter = New PerformanceCounter("SampleFractionCategory", "SampleFractionSample", False)
-
-
- basePerfCounter = New PerformanceCounter("SampleFractionCategory", "SampleFractionSampleBase", False)
-
-
- perfCounter.RawValue = thisProcess.UserProcessorTime.Ticks
- basePerfCounter.RawValue = thisProcess.TotalProcessorTime.Ticks
-
- End Sub
-
- Private Shared Sub CollectSamples(ByVal samplesList As ArrayList)
-
-
- ' Loop for the samples.
- Dim j As Integer
- For j = 0 To 99
-
- perfCounter.IncrementBy(thisProcess.UserProcessorTime.Ticks)
-
- basePerfCounter.IncrementBy(thisProcess.TotalProcessorTime.Ticks)
-
- If j Mod 10 = 9 Then
- OutputSample(perfCounter.NextSample())
- samplesList.Add(perfCounter.NextSample())
- Else
- Console.WriteLine()
- End If
- System.Threading.Thread.Sleep(50)
- Next j
-
- End Sub
-
-
- Private Shared Sub CalculateResults(ByVal samplesList As ArrayList)
- Dim i As Integer
- For i = 0 To (samplesList.Count - 1)
- ' Output the sample.
- OutputSample(CType(samplesList(i), CounterSample))
- OutputSample(CType(samplesList((i + 1)), CounterSample))
-
- ' Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " + CounterSampleCalculator.ComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)))
-
- ' Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " + MyComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)))
- Next i
-
- End Sub
-
-
-
-
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- ' Description - This counter type provides A percentage counter that shows the
- ' average ratio of user proccessor time to total processor time during the last
- ' two sample intervals.
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- Private Shared Function MyComputeCounterValue(ByVal s0 As CounterSample, ByVal s1 As CounterSample) As [Single]
- Dim numerator As [Single] = CType(s1.RawValue, [Single]) - CType(s0.RawValue, [Single])
- Dim denomenator As [Single] = CType(s1.BaseValue, [Single]) - CType(s0.BaseValue, [Single])
- Dim counterValue As [Single] = 100 * (numerator / denomenator)
- Return counterValue
-
- End Function 'MyComputeCounterValue
-
-
- ' Output information about the counter sample.
- Private Shared Sub OutputSample(ByVal s As CounterSample)
- Console.WriteLine(vbCr + vbLf + "+++++++++++")
- Console.WriteLine("Sample values - " + vbCr + vbLf)
- Console.WriteLine(" BaseValue = " + s.BaseValue)
- Console.WriteLine(" CounterFrequency = " + s.CounterFrequency)
- Console.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp)
- Console.WriteLine(" CounterType = " + s.CounterType)
- Console.WriteLine(" RawValue = " + s.RawValue)
- Console.WriteLine(" SystemFrequency = " + s.SystemFrequency)
- Console.WriteLine(" TimeStamp = " + s.TimeStamp)
- Console.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec)
- Console.WriteLine("++++++++++++++++++++++")
-
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/rateofcountspersecond32.vb b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/rateofcountspersecond32.vb
deleted file mode 100644
index e4b597c0e5a23..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/rateofcountspersecond32.vb
+++ /dev/null
@@ -1,151 +0,0 @@
-'
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.Diagnostics
-Imports System.Runtime.Versioning
-
-
-Public Class App4
- Private Shared PC As PerformanceCounter
-
-
- Public Shared Sub Main()
- Dim samplesList As New ArrayList()
-
- 'If the category does not exist, create the category and exit.
- 'Performance counters should not be created and immediately used.
- 'There is a latency time to enable the counters, they should be created
- 'prior to executing the App4lication that uses the counters.
- 'Execute this sample a second time to use the counters.
- If Not (SetupCategory()) Then
- CreateCounters()
- CollectSamples(samplesList)
- CalculateResults(samplesList)
- End If
- End Sub
-
-
- Private Shared Function SetupCategory() As Boolean
-
- If Not PerformanceCounterCategory.Exists("RateOfCountsPerSecond32SampleCategory") Then
-
-
- Dim CCDC As New CounterCreationDataCollection()
-
- ' Add the counter.
- Dim rateOfCounts32 As New CounterCreationData()
- rateOfCounts32.CounterType = PerformanceCounterType.RateOfCountsPerSecond32
- rateOfCounts32.CounterName = "RateOfCountsPerSecond32Sample"
- CCDC.Add(rateOfCounts32)
-
- ' Create the category.
- PerformanceCounterCategory.Create("RateOfCountsPerSecond32SampleCategory", _
- "Demonstrates usage of the RateOfCountsPerSecond32 performance counter type.", _
- PerformanceCounterCategoryType.SingleInstance, CCDC)
- Return True
- Else
- Console.WriteLine("Category exists - RateOfCountsPerSecond32SampleCategory")
- Return False
- End If
- End Function 'SetupCategory
-
-
- Private Shared Sub CreateCounters()
- ' Create the counter.
- PC = New PerformanceCounter("RateOfCountsPerSecond32SampleCategory", "RateOfCountsPerSecond32Sample", False)
-
- PC.RawValue = 0
- End Sub
-
-
- Private Shared Sub CollectSamples(ByVal samplesList As ArrayList)
-
- Dim r As New Random(DateTime.Now.Millisecond)
-
- ' Initialize the performance counter.
- PC.NextSample()
-
- ' Loop for the samples.
- Dim j As Integer
- For j = 0 To 99
-
- Dim value As Integer = r.Next(1, 10)
- PC.IncrementBy(value)
- Console.Write((j.ToString() + " = " + value.ToString()))
-
- If j Mod 10 = 9 Then
- Console.WriteLine(("; NextValue() = " + PC.NextValue().ToString()))
- OutputSample(PC.NextSample())
- samplesList.Add(PC.NextSample())
- Else
- Console.WriteLine()
- End If
- System.Threading.Thread.Sleep(50)
- Next j
- End Sub
-
-
- Private Shared Sub CalculateResults(ByVal samplesList As ArrayList)
- Dim i As Integer
- For i = 0 To (samplesList.Count - 1) - 1
- ' Output the sample.
- OutputSample(CType(samplesList(i), CounterSample))
- OutputSample(CType(samplesList((i + 1)), CounterSample))
-
-
- ' Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " + CounterSampleCalculator.ComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
-
- ' Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " + MyComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
- Next i
- End Sub
-
-
-
-
-
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- ' PERF_COUNTER_COUNTER
- ' Description - This counter type shows the average number of operations completed
- ' during each second of the sample interval. Counters of this type
- ' measure time in ticks of the system clock. The F variable represents
- ' the number of ticks per second. The value of F is factored into the
- ' equation so that the result can be displayed in seconds.
- '
- ' Generic type - Difference
- '
- ' Formula - (N1 - N0) / ( (D1 - D0) / F), where the numerator (N) represents the number
- ' of operations performed during the last sample interval, the denominator
- ' (D) represents the number of ticks elapsed during the last sample
- ' interval, and F is the frequency of the ticks.
- '
- ' Average - (Nx - N0) / ((Dx - D0) / F)
- '
- ' Example - System\ File Read Operations/sec
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- Private Shared Function MyComputeCounterValue(ByVal s0 As CounterSample, ByVal s1 As CounterSample) As [Single]
- Dim numerator As [Single] = CType(s1.RawValue - s0.RawValue, [Single])
- Dim denomenator As [Single] = CType(s1.TimeStamp - s0.TimeStamp, [Single]) / CType(s1.SystemFrequency, [Single])
- Dim counterValue As [Single] = numerator / denomenator
- Return counterValue
- End Function 'MyComputeCounterValue
-
-
- ' Output information about the counter sample.
- Private Shared Sub OutputSample(ByVal s As CounterSample)
- Console.WriteLine(ControlChars.Lf + ControlChars.Cr + "+++++++++++")
- Console.WriteLine("Sample values - " + ControlChars.Lf + ControlChars.Cr)
- Console.WriteLine((" BaseValue = " + s.BaseValue.ToString()))
- Console.WriteLine((" CounterFrequency = " + s.CounterFrequency.ToString()))
- Console.WriteLine((" CounterTimeStamp = " + s.CounterTimeStamp.ToString()))
- Console.WriteLine((" CounterType = " + s.CounterType.ToString()))
- Console.WriteLine((" RawValue = " + s.RawValue.ToString()))
- Console.WriteLine((" SystemFrequency = " + s.SystemFrequency.ToString()))
- Console.WriteLine((" TimeStamp = " + s.TimeStamp.ToString()))
- Console.WriteLine((" TimeStamp100nSec = " + s.TimeStamp100nSec.ToString()))
- Console.WriteLine("++++++++++++++++++++++")
- End Sub
-End Class
-
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/rateofcountspersecond64.vb b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/rateofcountspersecond64.vb
deleted file mode 100644
index ea2d3f1f8f753..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/rateofcountspersecond64.vb
+++ /dev/null
@@ -1,151 +0,0 @@
-'
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.Diagnostics
-Imports System.Runtime.Versioning
-
-
-Public Class App5
- Private Shared PC As PerformanceCounter
-
-
- Public Shared Sub Main()
- Dim samplesList As New ArrayList()
- 'If the category does not exist, create the category and exit.
- 'Performance counters should not be created and immediately used.
- 'There is a latency time to enable the counters, they should be created
- 'prior to executing the App5lication that uses the counters.
- 'Execute this sample a second time to use the counters.
- If Not (SetupCategory()) Then
- CreateCounters()
- CollectSamples(samplesList)
- CalculateResults(samplesList)
- End If
- End Sub
-
-
- Private Shared Function SetupCategory() As Boolean
-
-
- If Not PerformanceCounterCategory.Exists("RateOfCountsPerSecond64SampleCategory") Then
-
-
- Dim CCDC As New CounterCreationDataCollection()
-
- ' Add the counter.
- Dim rateOfCounts64 As New CounterCreationData()
- rateOfCounts64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64
- rateOfCounts64.CounterName = "RateOfCountsPerSecond64Sample"
- CCDC.Add(rateOfCounts64)
-
- ' Create the category.
- PerformanceCounterCategory.Create("RateOfCountsPerSecond64SampleCategory", _
- "Demonstrates usage of the RateOfCountsPerSecond64 performance counter type.", _
- PerformanceCounterCategoryType.SingleInstance, CCDC)
- Return True
- Else
- Console.WriteLine("Category exists - RateOfCountsPerSecond64SampleCategory")
- Return False
- End If
- End Function 'SetupCategory
-
-
- Private Shared Sub CreateCounters()
- ' Create the counter.
- PC = New PerformanceCounter("RateOfCountsPerSecond64SampleCategory", "RateOfCountsPerSecond64Sample", False)
-
- PC.RawValue = 0
- End Sub
-
-
- Private Shared Sub CollectSamples(ByVal samplesList As ArrayList)
-
- Dim r As New Random(DateTime.Now.Millisecond)
-
- ' Initialize the performance counter.
- PC.NextSample()
-
- ' Loop for the samples.
- Dim j As Integer
- For j = 0 To 99
-
- Dim value As Integer = r.Next(1, 10)
- PC.IncrementBy(value)
- Console.Write((j.ToString() + " = " + value.ToString()))
-
- If j Mod 10 = 9 Then
- Console.WriteLine(("; NextValue() = " + PC.NextValue().ToString()))
- OutputSample(PC.NextSample())
- samplesList.Add(PC.NextSample())
- Else
- Console.WriteLine()
- End If
- System.Threading.Thread.Sleep(50)
- Next j
- End Sub
-
-
- Private Shared Sub CalculateResults(ByVal samplesList As ArrayList)
- Dim i As Integer
- For i = 0 To (samplesList.Count - 1) - 1
- ' Output the sample.
- OutputSample(CType(samplesList(i), CounterSample))
- OutputSample(CType(samplesList((i + 1)), CounterSample))
-
-
- ' Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " + _
- CounterSampleCalculator.ComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
-
- ' Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " + _
- MyComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
- Next i
- End Sub
-
-
-
-
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- ' PERF_COUNTER_COUNTER
- ' Description - This counter type shows the average number of operations completed
- ' during each second of the sample interval. Counters of this type
- ' measure time in ticks of the system clock. The F variable represents
- ' the number of ticks per second. The value of F is factored into the
- ' equation so that the result can be displayed in seconds.
- '
- ' Generic type - Difference
- '
- ' Formula - (N1 - N0) / ( (D1 - D0) / F), where the numerator (N) represents the number
- ' of operations performed during the last sample interval, the denominator
- ' (D) represents the number of ticks elapsed during the last sample
- ' interval, and F is the frequency of the ticks.
- '
- ' Average - (Nx - N0) / ((Dx - D0) / F)
- '
- ' Example - System\ File Read Operations/sec
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- Private Shared Function MyComputeCounterValue(ByVal s0 As CounterSample, ByVal s1 As CounterSample) As [Single]
- Dim numerator As [Single] = CType(s1.RawValue - s0.RawValue, [Single])
- Dim denomenator As [Single] = CType(s1.TimeStamp - s0.TimeStamp, [Single]) / CType(s1.SystemFrequency, [Single])
- Dim counterValue As [Single] = numerator / denomenator
- Return counterValue
- End Function 'MyComputeCounterValue
-
-
- Private Shared Sub OutputSample(ByVal s As CounterSample)
- Console.WriteLine(ControlChars.Lf + ControlChars.Cr + "+++++++++++")
- Console.WriteLine("Sample values - " + ControlChars.Lf + ControlChars.Cr)
- Console.WriteLine((" BaseValue = " + s.BaseValue.ToString()))
- Console.WriteLine((" CounterFrequency = " + s.CounterFrequency.ToString()))
- Console.WriteLine((" CounterTimeStamp = " + s.CounterTimeStamp.ToString()))
- Console.WriteLine((" CounterType = " + s.CounterType.ToString()))
- Console.WriteLine((" RawValue = " + s.RawValue.ToString()))
- Console.WriteLine((" SystemFrequency = " + s.SystemFrequency.ToString()))
- Console.WriteLine((" TimeStamp = " + s.TimeStamp.ToString()))
- Console.WriteLine((" TimeStamp100nSec = " + s.TimeStamp100nSec.ToString()))
- Console.WriteLine("++++++++++++++++++++++")
- End Sub
-End Class
-
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/rawfraction.vb b/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/rawfraction.vb
deleted file mode 100644
index 3c0595ecf34ee..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Diagnostics/PerformanceCounterType/Overview/vb/rawfraction.vb
+++ /dev/null
@@ -1,162 +0,0 @@
-'
-Imports System.Collections
-Imports System.Collections.Specialized
-Imports System.Diagnostics
-Imports System.Runtime.Versioning
-
-
-Public Class App6
- Private Shared PC As PerformanceCounter
- Private Shared BPC As PerformanceCounter
-
- Public Shared Sub Main()
- Dim samplesList As New ArrayList()
-
- 'If the category does not exist, create the category and exit.
- 'Performance counters should not be created and immediately used.
- 'There is a latency time to enable the counters, they should be created
- 'prior to executing the App6lication that uses the counters.
- 'Execute this sample a second time to use the counters.
- If Not (SetupCategory()) Then
- CreateCounters()
- CollectSamples(samplesList)
- CalculateResults(samplesList)
- End If
-
- End Sub
-
- Private Shared Function SetupCategory() As Boolean
-
-
- If Not PerformanceCounterCategory.Exists("RawFractionSampleCategory") Then
-
-
- Dim CCDC As New CounterCreationDataCollection()
-
- ' Add the counter.
- Dim rf As New CounterCreationData()
- rf.CounterType = PerformanceCounterType.RawFraction
- rf.CounterName = "RawFractionSample"
- CCDC.Add(rf)
-
- ' Add the base counter.
- Dim rfBase As New CounterCreationData()
- rfBase.CounterType = PerformanceCounterType.RawBase
- rfBase.CounterName = "RawFractionSampleBase"
- CCDC.Add(rfBase)
-
- ' Create the category.
- PerformanceCounterCategory.Create("RawFractionSampleCategory",
- "Demonstrates usage of the RawFraction performance counter type.",
- PerformanceCounterCategoryType.SingleInstance, CCDC)
-
- Return True
- Else
- Console.WriteLine("Category exists - RawFractionSampleCategory")
- Return False
- End If
- End Function 'SetupCategory
-
-
- Private Shared Sub CreateCounters()
- ' Create the counters.
- PC = New PerformanceCounter("RawFractionSampleCategory", "RawFractionSample", False)
-
- BPC = New PerformanceCounter("RawFractionSampleCategory", "RawFractionSampleBase", False)
-
- PC.RawValue = 0
- BPC.RawValue = 0
- End Sub
-
-
- Private Shared Sub CollectSamples(ByVal samplesList As ArrayList)
-
- Dim r As New Random(DateTime.Now.Millisecond)
-
- ' Initialize the performance counter.
- PC.NextSample()
-
- ' Loop for the samples.
- Dim j As Integer
- For j = 0 To 99
- Dim value As Integer = r.Next(1, 10)
- Console.Write((j.ToString() + " = " + value.ToString()))
-
- ' Increment the base every time, because the counter measures the number
- ' of high hits (raw fraction value) against all the hits (base value).
- BPC.Increment()
-
- ' Get the % of samples that are 9 or 10 out of all the samples taken.
- If value >= 9 Then
- PC.Increment()
- End If
- ' Copy out the next value every ten times around the loop.
- If j Mod 10 = 9 Then
- Console.WriteLine(("; NextValue() = " + PC.NextValue().ToString()))
- OutputSample(PC.NextSample())
- samplesList.Add(PC.NextSample())
- Else
- Console.WriteLine()
- End If
- System.Threading.Thread.Sleep(50)
- Next j
- End Sub
-
-
-
- Private Shared Sub CalculateResults(ByVal samplesList As ArrayList)
- Dim i As Integer
- For i = 0 To samplesList.Count - 1
- ' Output the sample.
- OutputSample(CType(samplesList(i), CounterSample))
-
- ' Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " + CounterSampleCalculator.ComputeCounterValue(CType(samplesList(i), CounterSample)).ToString())
-
- ' Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " + MyComputeCounterValue(CType(samplesList(i), CounterSample)).ToString())
- Next i
- End Sub
-
-
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- ' Formula from MSDN -
- ' Description - This counter type shows the ratio of a subset to its set as a percentage.
- ' For example, it compares the number of bytes in use on a disk to the
- ' total number of bytes on the disk. Counters of this type display the
- ' current percentage only, not an average over time.
- '
- ' Generic type - Instantaneous, Percentage
- ' Formula - (N0 / D0), where D represents a measured attribute and N represents one
- ' component of that attribute.
- '
- ' Average - SUM (N / D) /x
- ' Example - Paging File\% Usage Peak
- '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- Private Shared Function MyComputeCounterValue(ByVal rfSample As CounterSample) As [Single]
- Dim numerator As [Single] = CType(rfSample.RawValue, [Single])
- Dim denomenator As [Single] = CType(rfSample.BaseValue, [Single])
- Dim counterValue As [Single] = numerator / denomenator * 100
- Return counterValue
- End Function 'MyComputeCounterValue
-
-
- ' Output information about the counter sample.
- Private Shared Sub OutputSample(ByVal s As CounterSample)
- Console.WriteLine("+++++++++++")
- Console.WriteLine("Sample values - " + ControlChars.Lf + ControlChars.Cr)
- Console.WriteLine((" BaseValue = " + s.BaseValue.ToString()))
- Console.WriteLine((" CounterFrequency = " + s.CounterFrequency.ToString()))
- Console.WriteLine((" CounterTimeStamp = " + s.CounterTimeStamp.ToString()))
- Console.WriteLine((" CounterType = " + s.CounterType.ToString()))
- Console.WriteLine((" RawValue = " + s.RawValue.ToString()))
- Console.WriteLine((" SystemFrequency = " + s.SystemFrequency.ToString()))
- Console.WriteLine((" TimeStamp = " + s.TimeStamp.ToString()))
- Console.WriteLine((" TimeStamp100nSec = " + s.TimeStamp100nSec.ToString()))
- Console.WriteLine("++++++++++++++++++++++")
- End Sub
-End Class
-
-
-
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/csharp/Class1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/csharp/Class1.cs
deleted file mode 100644
index 73e41ac56aba0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/csharp/Class1.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-using System;
-using System.Windows.Forms;
-using System.Drawing;
-using System.Collections;
-using System.Xml;
-using System.Drawing.Imaging;
-using System.Drawing.Drawing2D;
-
-public class Form1 : Form
-{
- [STAThread]
- public static void Main()
- {
- Application.EnableVisualStyles();
- Application.Run(new Form1());
- }
-
- Pen myPen = Pens.Red;
-
- // 0659fe00-9e0c-41c4-9118-016f2404c905
- // Matrix Representation of Transformations
-
- public void Method11()
- {
- Graphics myGraphics = this.CreateGraphics();
- //
- Matrix myMatrix = new Matrix();
- myMatrix.Rotate(30);
- myMatrix.Scale(1, 2, MatrixOrder.Append);
- myMatrix.Translate(5, 0, MatrixOrder.Append);
- //
- }
- // b601d66d-d572-4f11-9d2e-92f0dc8893f3
- // Global and Local Transformations
-
- public void Method21()
- {
- Graphics myGraphics = this.CreateGraphics();
- //
- myGraphics.DrawEllipse(myPen, 0, 0, 100, 50);
- myGraphics.ScaleTransform(1, 0.5f);
- myGraphics.TranslateTransform(50, 0, MatrixOrder.Append);
- myGraphics.RotateTransform(30, MatrixOrder.Append);
- myGraphics.DrawEllipse(myPen, 0, 0, 100, 50);
- //
- }
- public void Method22()
- {
- Graphics myGraphics = this.CreateGraphics();
- GraphicsPath myGraphicsPath = new GraphicsPath();
- //
- Matrix myMatrix = new Matrix();
- myMatrix.Rotate(45);
- myGraphicsPath.Transform(myMatrix);
- myGraphics.DrawRectangle(myPen, 10, 10, 100, 50);
- myGraphics.DrawPath(myPen, myGraphicsPath);
- //
- }
- public void Method23()
- {
- Graphics myGraphics = this.CreateGraphics();
- //
- Matrix myMatrix = new Matrix(1, 0, 0, -1, 0, 0);
- myGraphics.Transform = myMatrix;
- myGraphics.TranslateTransform(200, 150, MatrixOrder.Append);
- //
- }
- public void Method24()
- {
- Graphics myGraphics = this.CreateGraphics();
- SolidBrush mySolidBrush1 = new SolidBrush(Color.Red);
- SolidBrush mySolidBrush2 = new SolidBrush(Color.Black);
- //
- // Create the path.
- GraphicsPath myGraphicsPath = new GraphicsPath();
- Rectangle myRectangle = new Rectangle(0, 0, 60, 60);
- myGraphicsPath.AddRectangle(myRectangle);
-
- // Fill the path on the new coordinate system.
- // No local transformation
- myGraphics.FillPath(mySolidBrush1, myGraphicsPath);
-
- // Set the local transformation of the GraphicsPath object.
- Matrix myPathMatrix = new Matrix();
- myPathMatrix.Scale(2, 1);
- myPathMatrix.Rotate(30, MatrixOrder.Append);
- myGraphicsPath.Transform(myPathMatrix);
-
- // Fill the transformed path on the new coordinate system.
- myGraphics.FillPath(mySolidBrush2, myGraphicsPath);
- //
- }
- // c61ff50a-eb1d-4e6c-83cd-f7e9764cfa9f
- // Types of Coordinate Systems
-
- public void Method31()
- {
- Graphics myGraphics = this.CreateGraphics();
- //
- myGraphics.TranslateTransform(100, 50);
- myGraphics.DrawLine(myPen, 0, 0, 160, 80);
- //
- }
- public void Method32()
- {
- Graphics myGraphics = this.CreateGraphics();
- //
- myGraphics.PageUnit = GraphicsUnit.Inch;
- myGraphics.DrawLine(myPen, 0, 0, 2, 1);
- //
- }
- public void Method33()
- {
- Graphics myGraphics = this.CreateGraphics();
- //
- Pen myPen = new Pen(Color.Black, 1 / myGraphics.DpiX);
- //
- }
- public void Method34()
- {
- Graphics myGraphics = this.CreateGraphics();
- //
- myGraphics.TranslateTransform(2, 0.5f);
- myGraphics.PageUnit = GraphicsUnit.Inch;
- myGraphics.DrawLine(myPen, 0, 0, 2, 1);
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/csharp/Project.csproj
deleted file mode 100644
index 78bf0e843cd9a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- WinExe
- net10.0-windows
- true
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/vb/Class1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/vb/Class1.vb
deleted file mode 100644
index 6a43c7576404e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/vb/Class1.vb
+++ /dev/null
@@ -1,128 +0,0 @@
-Option Explicit On
-Option Strict On
-
-Imports System.Windows.Forms
-Imports System.Drawing
-Imports System.Collections
-Imports System.Xml
-Imports System.Drawing.Imaging
-Imports System.Drawing.Drawing2D
-
-Public Class Form1
- Inherits Form
-
- _
- Public Shared Sub Main()
- Application.EnableVisualStyles()
- Application.Run(New Form1())
- End Sub
-
- Dim myPen As Pen = Pens.Black
- ' 0659fe00-9e0c-41c4-9118-016f2404c905
- ' Matrix Representation of Transformations
- Public Sub Method11()
- Dim myGraphics As Graphics = Me.CreateGraphics()
- '
- Dim myMatrix As New Matrix()
- myMatrix.Rotate(30)
- myMatrix.Scale(1, 2, MatrixOrder.Append)
- myMatrix.Translate(5, 0, MatrixOrder.Append)
-
- '
- End Sub
- ' b601d66d-d572-4f11-9d2e-92f0dc8893f3
- ' Global and Local Transformations
- Public Sub Method21()
- Dim myGraphics As Graphics = Me.CreateGraphics()
- '
- myGraphics.DrawEllipse(myPen, 0, 0, 100, 50)
- myGraphics.ScaleTransform(1, 0.5F)
- myGraphics.TranslateTransform(50, 0, MatrixOrder.Append)
- myGraphics.RotateTransform(30, MatrixOrder.Append)
- myGraphics.DrawEllipse(myPen, 0, 0, 100, 50)
-
- '
- End Sub
- Public Sub Method22()
- Dim myGraphics As Graphics = Me.CreateGraphics()
- Dim myGraphicsPath As New GraphicsPath()
- '
- Dim myMatrix As New Matrix()
- myMatrix.Rotate(45)
- myGraphicsPath.Transform(myMatrix)
- myGraphics.DrawRectangle(myPen, 10, 10, 100, 50)
- myGraphics.DrawPath(myPen, myGraphicsPath)
-
- '
- End Sub
- Public Sub Method23()
- Dim myGraphics As Graphics = Me.CreateGraphics()
- '
- Dim myMatrix As New Matrix(1, 0, 0, -1, 0, 0)
- myGraphics.Transform = myMatrix
- myGraphics.TranslateTransform(200, 150, MatrixOrder.Append)
-
- '
- End Sub
- Public Sub Method24()
- Dim myGraphics As Graphics = Me.CreateGraphics()
- Dim mySolidBrush1 As New SolidBrush(Color.Red)
- Dim mySolidBrush2 As New SolidBrush(Color.Black)
-
- '
- ' Create the path.
- Dim myGraphicsPath As New GraphicsPath()
- Dim myRectangle As New Rectangle(0, 0, 60, 60)
- myGraphicsPath.AddRectangle(myRectangle)
-
- ' Fill the path on the new coordinate system.
- ' No local transformation
- myGraphics.FillPath(mySolidBrush1, myGraphicsPath)
-
- ' Set the local transformation of the GraphicsPath object.
- Dim myPathMatrix As New Matrix()
- myPathMatrix.Scale(2, 1)
- myPathMatrix.Rotate(30, MatrixOrder.Append)
- myGraphicsPath.Transform(myPathMatrix)
-
- ' Fill the transformed path on the new coordinate system.
- myGraphics.FillPath(mySolidBrush2, myGraphicsPath)
-
- '
- End Sub
- ' c61ff50a-eb1d-4e6c-83cd-f7e9764cfa9f
- ' Types of Coordinate Systems
- Public Sub Method31()
- Dim myGraphics As Graphics = Me.CreateGraphics()
- '
- myGraphics.TranslateTransform(100, 50)
- myGraphics.DrawLine(myPen, 0, 0, 160, 80)
-
- '
- End Sub
- Public Sub Method32()
- Dim myGraphics As Graphics = Me.CreateGraphics()
- '
- myGraphics.PageUnit = GraphicsUnit.Inch
- myGraphics.DrawLine(myPen, 0, 0, 2, 1)
-
- '
- End Sub
- Public Sub Method33()
- Dim myGraphics As Graphics = Me.CreateGraphics()
- '
- Dim myPen As New Pen(Color.Black, 1 / myGraphics.DpiX)
-
- '
- End Sub
- Public Sub Method34()
- Dim myGraphics As Graphics = Me.CreateGraphics()
- '
- myGraphics.TranslateTransform(2, 0.5F)
- myGraphics.PageUnit = GraphicsUnit.Inch
- myGraphics.DrawLine(myPen, 0, 0, 2, 1)
-
- '
- End Sub
-End Class
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/vb/Project.vbproj
deleted file mode 100644
index c86794b1506cc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Drawing.Drawing2D/Matrix/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- WinExe
- net48
- true
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/csharp/program.cs b/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/csharp/program.cs
deleted file mode 100644
index c33c081ff4002..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/csharp/program.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Dynamic;
-using System.ComponentModel;
-
-namespace N1
-{
- class Program
- {
- static void Test(string[] args)
- {
- //
- dynamic sampleObject = new ExpandoObject();
- //
-
- //
- sampleObject.test = "Dynamic Property";
- Console.WriteLine(sampleObject.test);
- Console.WriteLine(sampleObject.test.GetType());
- // This code example produces the following output:
- // Dynamic Property
- // System.String
- //
-
- //
- sampleObject.number = 10;
- sampleObject.Increment = (Action)(() => { sampleObject.number++; });
-
- // Before calling the Increment method.
- Console.WriteLine(sampleObject.number);
-
- sampleObject.Increment();
-
- // After calling the Increment method.
- Console.WriteLine(sampleObject.number);
- // This code example produces the following output:
- // 10
- // 11
- //
-
- //
- dynamic employee = new ExpandoObject();
- employee.Name = "John Smith";
- employee.Age = 33;
-
- foreach (var property in (IDictionary)employee)
- {
- Console.WriteLine(property.Key + ": " + property.Value);
- }
- // This code example produces the following output:
- // Name: John Smith
- // Age: 33
- //
- }
-
- static void Test2()
- {
- //
- dynamic employee = new ExpandoObject();
- employee.Name = "John Smith";
- ((IDictionary)employee).Remove("Name");
- //
- }
- }
-}
-
-namespace n2
-{
- //
- class Program
- {
- static void Main(string[] args)
- {
- dynamic employee, manager;
-
- employee = new ExpandoObject();
- employee.Name = "John Smith";
- employee.Age = 33;
-
- manager = new ExpandoObject();
- manager.Name = "Allison Brown";
- manager.Age = 42;
- manager.TeamSize = 10;
-
- WritePerson(manager);
- WritePerson(employee);
- }
- private static void WritePerson(dynamic person)
- {
- Console.WriteLine($"{person.Name} is {person.Age} years old.");
- // The following statement causes an exception
- // if you pass the employee object.
- // Console.WriteLine($"Manages {person.TeamSize} people");
- }
- }
- // This code example produces the following output:
- // John Smith is 33 years old.
- // Allison Brown is 42 years old.
- //
-}
-
-namespace n3
-{
- //
- // Add "using System.ComponentModel;" line
- // to the beginning of the file.
- class Program
- {
- static void Test()
- {
- dynamic employee = new ExpandoObject();
- ((INotifyPropertyChanged)employee).PropertyChanged +=
- new PropertyChangedEventHandler(HandlePropertyChanges);
- employee.Name = "John Smith";
- }
-
- private static void HandlePropertyChanges(
- object sender, PropertyChangedEventArgs e)
- {
- Console.WriteLine($"{e.PropertyName} has changed.");
- }
- }
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/vb/module1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/vb/module1.vb
deleted file mode 100644
index ec306ff784c67..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Dynamic/ExpandoObject/Overview/vb/module1.vb
+++ /dev/null
@@ -1,109 +0,0 @@
-Imports System.Dynamic
-Imports System.ComponentModel
-Imports System.Linq
-Imports System.Collections.Generic
-
-Module Module2
-
- Sub Test()
- '
- Dim sampleObject As Object = New ExpandoObject()
- '
-
- '
- sampleObject.Test = "Dynamic Property"
- Console.WriteLine(sampleObject.test)
- Console.WriteLine(sampleObject.test.GetType())
- ' This code example produces the following output:
- ' Dynamic Property
- ' System.String
- '
-
- '
- sampleObject.Number = 10
- sampleObject.Increment = Function() sampleObject.Number + 1
- ' Before calling the Increment method.
- Console.WriteLine(sampleObject.number)
-
- sampleObject.Increment.Invoke()
-
- ' After calling the Increment method.
- Console.WriteLine(sampleObject.number)
- ' This code example produces the following output:
- ' 10
- ' 11
- '
-
- '
- Dim employee As Object = New ExpandoObject()
- employee.Name = "John Smith"
- employee.Age = 33
- For Each member In CType(employee, IDictionary(Of String, Object))
- Console.WriteLine(member.Key & ": " & member.Value)
- Next
- ' This code example produces the following output:
- ' Name: John Smith
- ' Age: 33
- '
- End Sub
-
- Sub Test2()
- '
- Dim employee As Object = New ExpandoObject()
- employee.Name = "John Smith"
- CType(employee, IDictionary(Of String, Object)).Remove("Name")
- '
- End Sub
-
-End Module
-
-Module Module1
-
- '
- Sub Main()
- Dim employee, manager As Object
-
- employee = New ExpandoObject()
- employee.Name = "John Smith"
- employee.Age = 33
-
- manager = New ExpandoObject()
- manager.Name = "Allison Brown"
- manager.Age = 42
- manager.TeamSize = 10
-
- WritePerson(manager)
- WritePerson(employee)
- End Sub
-
- Private Sub WritePerson(ByVal person As Object)
-
- Console.WriteLine("{0} is {1} years old.",
- person.Name, person.Age)
- ' The following statement causes an exception
- ' if you pass the employee object.
- ' Console.WriteLine("Manages {0} people", person.TeamSize)
-
- End Sub
- '
-End Module
-
-Module M3
- '
- ' Add "Imports System.ComponentModel" line
- ' to the beginning of the file.
- Sub Main()
- Dim employee As Object = New ExpandoObject
- AddHandler CType(
- employee, INotifyPropertyChanged).PropertyChanged,
- AddressOf HandlePropertyChanges
- employee.Name = "John Smith"
- End Sub
-
- Private Sub HandlePropertyChanges(
- ByVal sender As Object, ByVal e As PropertyChangedEventArgs)
- Console.WriteLine("{0} has changed.", e.PropertyName)
- End Sub
- '
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/Async1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/Async1.cs
deleted file mode 100644
index 862b15bbfd777..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/Async1.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Runtime.Versioning;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class Example14
-{
- public static async Task Main()
- {
- var tasks = new List();
- Console.WriteLine($"The current culture is {Thread.CurrentThread.CurrentCulture.Name}");
- Thread.CurrentThread.CurrentCulture = new CultureInfo("pt-BR");
- // Change the current culture to Portuguese (Brazil).
- Console.WriteLine($"Current culture changed to {Thread.CurrentThread.CurrentCulture.Name}");
- Console.WriteLine($"Application thread is thread {Thread.CurrentThread.ManagedThreadId}");
- // Launch six tasks and display their current culture.
- for (int ctr = 0; ctr <= 5; ctr++)
- tasks.Add(Task.Run(() =>
- {
- Console.WriteLine($"Culture of task {Task.CurrentId} on thread {Thread.CurrentThread.ManagedThreadId} is {Thread.CurrentThread.CurrentCulture.Name}");
- }));
-
- await Task.WhenAll(tasks.ToArray());
- }
-}
-// The example displays output like the following:
-// The current culture is en-US
-// Current culture changed to pt-BR
-// Application thread is thread 9
-// Culture of task 2 on thread 11 is pt-BR
-// Culture of task 1 on thread 10 is pt-BR
-// Culture of task 3 on thread 11 is pt-BR
-// Culture of task 5 on thread 11 is pt-BR
-// Culture of task 6 on thread 11 is pt-BR
-// Culture of task 4 on thread 10 is pt-BR
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/Get1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/Get1.cs
deleted file mode 100644
index f07ebd7151e4d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/Get1.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example5
-{
- public static void Main()
- {
- CultureInfo culture = CultureInfo.CurrentCulture;
- Console.WriteLine($"The current culture is {culture.NativeName} [{culture.Name}]");
- }
-}
-// The example displays output like the following:
-// The current culture is English (United States) [en-US]
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/aspculture13.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/aspculture13.cs
deleted file mode 100644
index f35caeb4dc867..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/aspculture13.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class Example13
-{
- public static void Main()
- {
- //
- CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture(Request13.UserLanguages[0]);
- //
- }
-}
-
-public class Request13
-{
- private static string[] langs = new string[3];
-
- public static string[] UserLanguages { get { return langs; } }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/changeculture11.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/changeculture11.cs
deleted file mode 100644
index 699931f424220..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/changeculture11.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class Info11 : MarshalByRefObject
-{
- public void ShowCurrentCulture()
- {
- Console.WriteLine($"Culture of {Thread.CurrentThread.Name} in application domain {AppDomain.CurrentDomain.FriendlyName}: {CultureInfo.CurrentCulture.Name}");
- }
-}
-
-public class Example11
-{
- public static void Main()
- {
- Info11 inf = new Info11();
- // Set the current culture to Dutch (Netherlands).
- Thread.CurrentThread.Name = "MainThread";
- CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("nl-NL");
- inf.ShowCurrentCulture();
-
- // Create a new application domain.
- AppDomain ad = AppDomain.CreateDomain("Domain2");
- Info11 inf2 = (Info11)ad.CreateInstanceAndUnwrap(typeof(Info11).Assembly.FullName, "Info11");
- inf2.ShowCurrentCulture();
- }
-}
-// The example displays the following output:
-// Culture of MainThread in application domain ChangeCulture1.exe: nl-NL
-// Culture of MainThread in application domain Domain2: nl-NL
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/specific12.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/specific12.cs
deleted file mode 100644
index 85f7b6e54eba8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/csharp/specific12.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class Example12
-{
- public static void Main()
- {
- double value = 1634.92;
- CultureInfo.CurrentCulture = new CultureInfo("fr-CA");
- Console.WriteLine($"Current Culture: {CultureInfo.CurrentCulture.Name}");
- Console.WriteLine($"{value:C2}\n");
-
- Thread.CurrentThread.CurrentCulture = new CultureInfo("fr");
- Console.WriteLine($"Current Culture: {CultureInfo.CurrentCulture.Name}");
- Console.WriteLine($"{value:C2}");
- }
-}
-// The example displays the following output:
-// Current Culture: fr-CA
-// 1 634,92 $
-//
-// Current Culture: fr
-// 1 634,92 €
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Async1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Async1.vb
deleted file mode 100644
index 1a14275abd1b4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Async1.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-' Visual Basic .NET Document
-Option Infer On
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Threading
-
-Module Example1
- Public Sub S1()
- Dim tasks As New List(Of Task)
- Console.WriteLine("The current culture is {0}",
- Thread.CurrentThread.CurrentCulture.Name)
- Thread.CurrentThread.CurrentCulture = New CultureInfo("pt-BR")
- ' Change the current culture to Portuguese (Brazil).
- Console.WriteLine("Current culture changed to {0}",
- Thread.CurrentThread.CurrentCulture.Name)
- Console.WriteLine("Application thread is thread {0}",
- Thread.CurrentThread.ManagedThreadId)
- ' Launch six tasks and display their current culture.
- For ctr As Integer = 0 To 5
- tasks.Add(Task.Run(Sub()
- Console.WriteLine("Culture of task {0} on thread {1} is {2}",
- Task.CurrentId,
- Thread.CurrentThread.ManagedThreadId,
- Thread.CurrentThread.CurrentCulture.Name)
- End Sub))
- Next
- Task.WaitAll(tasks.ToArray())
- End Sub
-End Module
-' The example displays output like the following:
-' The current culture is en-US
-' Current culture changed to pt-BR
-' Application thread is thread 9
-' Culture of task 2 on thread 11 is pt-BR
-' Culture of task 1 on thread 10 is pt-BR
-' Culture of task 3 on thread 11 is pt-BR
-' Culture of task 5 on thread 11 is pt-BR
-' Culture of task 6 on thread 11 is pt-BR
-' Culture of task 4 on thread 10 is pt-BR
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Get1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Get1.vb
deleted file mode 100644
index 6bc28fe84f897..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Get1.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-
-Module Example3
- Public Sub S1()
- Dim culture As CultureInfo = CultureInfo.CurrentCulture
- Console.WriteLine("The current culture is {0} [{1}]",
- culture.NativeName, culture.Name)
- End Sub
-End Module
-' The example displays output like the following:
-' The current culture is English (United States) [en-US]
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Program.vb b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Program.vb
deleted file mode 100644
index 95f459e37e4df..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Program.vb
+++ /dev/null
@@ -1,5 +0,0 @@
-Public Class Program
- Public Shared Sub Main()
- Example1.S1()
- End Sub
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Project.vbproj
deleted file mode 100644
index f99395b4b2b39..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Exe
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/aspculture13.vb b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/aspculture13.vb
deleted file mode 100644
index 91257a0b53ff6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/aspculture13.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Globalization
-Imports System.Threading
-
-Module Example
- Public Sub S1()
- '
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages(0))
- '
- End Sub
-End Module
-
-
-Public Class Request
- Private Shared langs(3) As String
- Public Shared ReadOnly Property UserLanguages As String()
- Get
- Return langs
- End Get
- End Property
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/changeculture11.vb b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/changeculture11.vb
deleted file mode 100644
index 59a555902417c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/changeculture11.vb
+++ /dev/null
@@ -1,35 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Threading
-
-Public Class Info : Inherits MarshalByRefObject
- Public Sub ShowCurrentCulture()
- Console.WriteLine("Culture of {0} in application domain {1}: {2}",
- Thread.CurrentThread.Name,
- AppDomain.CurrentDomain.FriendlyName,
- CultureInfo.CurrentCulture.Name)
- End Sub
-End Class
-
-Module Example2
- Public Sub S1()
- Dim inf As New Info()
- ' Set the current culture to Dutch (Netherlands).
- Thread.CurrentThread.Name = "MainThread"
- CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("nl-NL")
- inf.ShowCurrentCulture()
-
- ' Create a new application domain.
- Dim ad As AppDomain = AppDomain.CreateDomain("Domain2")
- Dim inf2 As Info = CType(ad.CreateInstanceAndUnwrap(GetType(Info).Assembly.FullName, "Info"),
- Info)
- inf2.ShowCurrentCulture()
- End Sub
-End Module
-' This example displays the following output:
-' Culture of MainThread in application domain Example.exe: nl-NL
-' Culture of MainThread in application domain Domain2: nl-NL
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/specific12.vb b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/specific12.vb
deleted file mode 100644
index 87380dd0c01e5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentCulture/vb/specific12.vb
+++ /dev/null
@@ -1,30 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Threading
-
-Module Example4
- Public Sub S1()
- Dim value As Double = 1634.92
- CultureInfo.CurrentCulture = New CultureInfo("fr-CA")
- Console.WriteLine("Current Culture: {0}",
- CultureInfo.CurrentCulture.Name)
- Console.WriteLine("{0:C2}", value)
- Console.WriteLine()
-
- Thread.CurrentThread.CurrentCulture = New CultureInfo("fr")
- Console.WriteLine("Current Culture: {0}",
- CultureInfo.CurrentCulture.Name)
- Console.WriteLine("{0:C2}", value)
- End Sub
-End Module
-' The example displays the following output:
-' Current Culture: fr-CA
-' 1 634,92 $
-'
-' Current Culture: fr
-' 1 634,92 €
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/Async1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/Async1.cs
deleted file mode 100644
index 37fc057397157..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/Async1.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Runtime.Versioning;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class Example
-{
- public static async Task Main()
- {
- var tasks = new List();
- Console.WriteLine($"The current UI culture is {Thread.CurrentThread.CurrentUICulture.Name}");
- Thread.CurrentThread.CurrentUICulture = new CultureInfo("pt-BR");
- // Change the current UI culture to Portuguese (Brazil).
- Console.WriteLine($"Current UI culture changed to {Thread.CurrentThread.CurrentUICulture.Name}");
- Console.WriteLine($"Application thread is thread {Thread.CurrentThread.ManagedThreadId}");
- // Launch six tasks and display their current culture.
- for (int ctr = 0; ctr <= 5; ctr++)
- tasks.Add(Task.Run(() =>
- {
- Console.WriteLine($"UI Culture of task {Task.CurrentId} on thread {Thread.CurrentThread.ManagedThreadId} is {Thread.CurrentThread.CurrentUICulture.Name}");
- }));
-
- await Task.WhenAll(tasks.ToArray());
- }
-}
-// The example displays output like the following:
-// The current UI culture is en-US
-// Current UI culture changed to pt-BR
-// Application thread is thread 9
-// UI Culture of task 2 on thread 11 is pt-BR
-// UI Culture of task 1 on thread 10 is pt-BR
-// UI Culture of task 3 on thread 11 is pt-BR
-// UI Culture of task 5 on thread 11 is pt-BR
-// UI Culture of task 6 on thread 11 is pt-BR
-// UI Culture of task 4 on thread 10 is pt-BR
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/Get1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/Get1.cs
deleted file mode 100644
index 62eb67f1b7d56..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/Get1.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example2
-{
- public static void Main()
- {
- CultureInfo culture = CultureInfo.CurrentUICulture;
- Console.WriteLine($"The current UI culture is {culture.NativeName} [{culture.Name}]");
- }
-}
-// The example displays output like the following:
-// The current UI culture is English (United States) [en-US]
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/currentuiculture1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/currentuiculture1.cs
deleted file mode 100644
index 8c1432d78290c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/csharp/currentuiculture1.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example1
-{
- public static void Main()
- {
- Console.WriteLine($"The current UI culture: {CultureInfo.CurrentUICulture.Name}");
-
- CultureInfo.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr-FR");
- Console.WriteLine($"The current UI culture: {CultureInfo.CurrentUICulture.Name}");
- }
-}
-// The example displays output like the following:
-// The current UI culture: en-US
-// The current UI culture: fr-FR
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/Async1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/Async1.vb
deleted file mode 100644
index 1b6cc161e699d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/Async1.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-' Visual Basic .NET Document
-Option Infer On
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Threading
-
-Module Example1
- Public Sub Main()
- Dim tasks As New List(Of Task)
- Console.WriteLine("The current UI culture is {0}",
- Thread.CurrentThread.CurrentUICulture.Name)
- Thread.CurrentThread.CurrentUICulture = New CultureInfo("pt-BR")
- ' Change the current UI culture to Portuguese (Brazil).
- Console.WriteLine("Current culture changed to {0}",
- Thread.CurrentThread.CurrentUICulture.Name)
- Console.WriteLine("Application thread is thread {0}",
- Thread.CurrentThread.ManagedThreadId)
- ' Launch six tasks and display their current culture.
- For ctr As Integer = 0 To 5
- tasks.Add(Task.Run(Sub()
- Console.WriteLine("Culture of task {0} on thread {1} is {2}",
- Task.CurrentId,
- Thread.CurrentThread.ManagedThreadId,
- Thread.CurrentThread.CurrentUICulture.Name)
- End Sub))
- Next
- Task.WaitAll(tasks.ToArray())
- End Sub
-End Module
-' The example displays output like the following:
-' The current culture is en-US
-' Current culture changed to pt-BR
-' Application thread is thread 9
-' Culture of task 2 on thread 11 is pt-BR
-' Culture of task 1 on thread 10 is pt-BR
-' Culture of task 3 on thread 11 is pt-BR
-' Culture of task 5 on thread 11 is pt-BR
-' Culture of task 6 on thread 11 is pt-BR
-' Culture of task 4 on thread 10 is pt-BR
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/Get1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/Get1.vb
deleted file mode 100644
index 96b9294dac3c1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/Get1.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-
-Module Example3
- Public Sub Main()
- Dim culture As CultureInfo = CultureInfo.CurrentCulture
- Console.WriteLine("The current UI culture is {0} [{1}]",
- culture.NativeName, culture.Name)
- End Sub
-End Module
-' The example displays output like the following:
-' The current UI culture is English (United States) [en-US]
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/currentuiculture1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/currentuiculture1.vb
deleted file mode 100644
index 2dfafdb269224..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/CurrentUICulture/vb/currentuiculture1.vb
+++ /dev/null
@@ -1,20 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-
-Module Example2
- Public Sub Main()
- Console.WriteLine("The current UI culture: {0}",
- CultureInfo.CurrentUICulture.Name)
-
- CultureInfo.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr-FR")
- Console.WriteLine("The current UI culture: {0}",
- CultureInfo.CurrentUICulture.Name)
- End Sub
-End Module
-' The example displays output like the following:
-' The current UI culture: en-US
-' The current UI culture: fr-FR
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/csharp/persist1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/csharp/persist1.cs
deleted file mode 100644
index 9d21620ea6a3b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/csharp/persist1.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Globalization;
-
-public class Example
-{
- public static void Main()
- {
- // Persist the date and time data.
- StreamWriter sw = new StreamWriter(@".\DateData.dat");
-
- // Create a DateTime value.
- DateTime dtIn = DateTime.Now;
- // Retrieve a CultureInfo object.
- CultureInfo invC = CultureInfo.InvariantCulture;
-
- // Convert the date to a string and write it to a file.
- sw.WriteLine(dtIn.ToString("r", invC));
- sw.Close();
-
- // Restore the date and time data.
- StreamReader sr = new StreamReader(@".\DateData.dat");
- String input;
- while ((input = sr.ReadLine()) != null)
- {
- Console.WriteLine($"Stored data: {input}\n");
-
- // Parse the stored string.
- DateTime dtOut = DateTime.Parse(input, invC, DateTimeStyles.RoundtripKind);
-
- // Create a French (France) CultureInfo object.
- CultureInfo frFr = new CultureInfo("fr-FR");
- // Displays the date formatted for the "fr-FR" culture.
- Console.WriteLine($"Date formatted for the {frFr.Name} culture: {dtOut.ToString("f", frFr)}");
-
- // Creates a German (Germany) CultureInfo object.
- CultureInfo deDe= new CultureInfo("de-De");
- // Displays the date formatted for the "de-DE" culture.
- Console.WriteLine($"Date formatted for {deDe.Name} culture: {dtOut.ToString("f", deDe)}");
- }
- sr.Close();
- }
-}
-// The example displays the following output:
-// Stored data: Tue, 15 May 2012 16:34:16 GMT
-//
-// Date formatted for the fr-FR culture: mardi 15 mai 2012 16:34
-// Date formatted for de-DE culture: Dienstag, 15. Mai 2012 16:34
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/vb/persist1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/vb/persist1.vb
deleted file mode 100644
index cb6e6ef721d52..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/InvariantCulture/vb/persist1.vb
+++ /dev/null
@@ -1,53 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.IO
-
-Module Example
- Public Sub Main()
- ' Persist the date and time data.
- Dim sw As New StreamWriter(".\DateData.dat")
-
- ' Create a DateTime value.
- Dim dtIn As DateTime = DateTime.Now
- ' Retrieve a CultureInfo object.
- Dim invC As CultureInfo = CultureInfo.InvariantCulture
-
- ' Convert the date to a string and write it to a file.
- sw.WriteLine(dtIn.ToString("r", invC))
- sw.Close()
-
- ' Restore the date and time data.
- Dim sr As New StreamReader(".\DateData.dat")
- Dim input As String = String.Empty
- Do While sr.Peek() >= 0
- input = sr.ReadLine()
- Console.WriteLine("Stored data: {0}" , input)
- Console.WriteLine()
-
- ' Parse the stored string.
- Dim dtOut As DateTime = DateTime.Parse(input, invC, DateTimeStyles.RoundtripKind)
-
- ' Create a French (France) CultureInfo object.
- Dim frFr As New CultureInfo("fr-FR")
- ' Displays the date formatted for the "fr-FR" culture.
- Console.WriteLine("Date formatted for the {0} culture: {1}" ,
- frFr.Name, dtOut.ToString("f", frFr))
-
- ' Creates a German (Germany) CultureInfo object.
- Dim deDe As New CultureInfo("de-De")
- ' Displays the date formatted for the "de-DE" culture.
- Console.WriteLine("Date formatted for {0} culture: {1}" ,
- deDe.Name, dtOut.ToString("f", deDe))
- Loop
- sr.Close()
- End Sub
-End Module
-' The example displays the following output:
-' Stored data: Tue, 15 May 2012 16:34:16 GMT
-'
-' Date formatted for the fr-FR culture: mardi 15 mai 2012 16:34
-' Date formatted for de-DE culture: Dienstag, 15. Mai 2012 16:34
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/appdomainex1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/appdomainex1.cs
deleted file mode 100644
index 2fac9bc192820..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/appdomainex1.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example
-{
- public static void Main()
- {
- // Set the default culture and display the current date in the current application domain.
- Info info1 = new Info();
- SetAppDomainCultures("fr-FR");
-
- // Create a second application domain.
- AppDomainSetup setup = new AppDomainSetup();
- setup.AppDomainInitializer = SetAppDomainCultures;
- setup.AppDomainInitializerArguments = new string[] { "ru-RU" };
- AppDomain domain = AppDomain.CreateDomain("Domain2", null, setup);
- // Create an Info object in the new application domain.
- Info info2 = (Info)domain.CreateInstanceAndUnwrap(typeof(Example).Assembly.FullName,
- "Info");
-
- // Execute methods in the two application domains.
- info2.DisplayDate();
- info2.DisplayCultures();
-
- info1.DisplayDate();
- info1.DisplayCultures();
- }
-
- public static void SetAppDomainCultures(string[] names)
- {
- SetAppDomainCultures(names[0]);
- }
-
- public static void SetAppDomainCultures(string name)
- {
- try
- {
- CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture(name);
- CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.CreateSpecificCulture(name);
- }
- // If an exception occurs, we'll just fall back to the system default.
- catch (CultureNotFoundException)
- {
- return;
- }
- catch (ArgumentException)
- {
- return;
- }
- }
-}
-
-public class Info : MarshalByRefObject
-{
- public void DisplayDate()
- {
- Console.WriteLine($"Today is {DateTime.Now:D}");
- }
-
- public void DisplayCultures()
- {
- Console.WriteLine($"Application domain is {AppDomain.CurrentDomain.Id}");
- Console.WriteLine($"Default Culture: {CultureInfo.DefaultThreadCurrentCulture}");
- Console.WriteLine($"Default UI Culture: {CultureInfo.DefaultThreadCurrentUICulture}");
- }
-}
-// The example displays the following output:
-// Today is 14 октября 2011 г.
-// Application domain is 2
-// Default Culture: ru-RU
-// Default UI Culture: ru-RU
-// Today is vendredi 14 octobre 2011
-// Application domain is 1
-// Default Culture: fr-FR
-// Default UI Culture: fr-FR
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/asyncculture1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/asyncculture1.cs
deleted file mode 100644
index f92562bd469ad..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/asyncculture1.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class AsyncCultureEx1
-{
- public static void Main()
- {
- decimal[] values = { 163025412.32m, 18905365.59m };
- string formatString = "C2";
-
- string FormatDelegate()
- {
- string output = $"Formatting using the {CultureInfo.CurrentCulture.Name} " +
- $"culture on thread {Thread.CurrentThread.ManagedThreadId}.\n";
- foreach (decimal value in values)
- output += $"{value.ToString(formatString)} ";
-
- output += Environment.NewLine;
- return output;
- }
-
- Console.WriteLine($"The example is running on thread {Thread.CurrentThread.ManagedThreadId}");
- // Make the current culture different from the system culture.
- Console.WriteLine($"The current culture is {CultureInfo.CurrentCulture.Name}");
- if (CultureInfo.CurrentCulture.Name == "fr-FR")
- Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
- else
- Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
-
- Console.WriteLine($"Changed the current culture to {CultureInfo.CurrentCulture.Name}.\n");
-
- // Execute the delegate synchronously.
- Console.WriteLine("Executing the delegate synchronously:");
- Console.WriteLine(FormatDelegate());
-
- // Call an async delegate to format the values using one format string.
- Console.WriteLine("Executing a task asynchronously:");
- var t1 = Task.Run(FormatDelegate);
- Console.WriteLine(t1.Result);
-
- Console.WriteLine("Executing a task synchronously:");
- var t2 = new Task(FormatDelegate);
- t2.RunSynchronously();
- Console.WriteLine(t2.Result);
- }
-}
-// The example displays the following output:
-// The example is running on thread 1
-// The current culture is en-US
-// Changed the current culture to fr-FR.
-//
-// Executing the delegate synchronously:
-// Formatting using the fr-FR culture on thread 1.
-// 163 025 412,32 € 18 905 365,59 €
-//
-// Executing a task asynchronously:
-// Formatting using the fr-FR culture on thread 3.
-// 163 025 412,32 € 18 905 365,59 €
-//
-// Executing a task synchronously:
-// Formatting using the fr-FR culture on thread 1.
-// 163 025 412,32 € 18 905 365,59 €
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/asyncculture3.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/asyncculture3.cs
deleted file mode 100644
index 2e54eb2466b0b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/asyncculture3.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class AsyncCultureEx3
-{
- public static void Main()
- {
- decimal[] values = { 163025412.32m, 18905365.59m };
- string formatString = "C2";
- Func formatDelegate = () =>
- {
- string output = String.Format("Formatting using the {0} culture on thread {1}.\n",
- CultureInfo.CurrentCulture.Name,
- Thread.CurrentThread.ManagedThreadId);
- foreach (var value in values)
- output += String.Format("{0} ", value.ToString(formatString));
-
- output += Environment.NewLine;
- return output;
- };
-
- Console.WriteLine($"The example is running on thread {Thread.CurrentThread.ManagedThreadId}");
- // Make the current culture different from the system culture.
- Console.WriteLine($"The current culture is {CultureInfo.CurrentCulture.Name}");
- if (CultureInfo.CurrentCulture.Name == "fr-FR")
- Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
- else
- Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
-
- Console.WriteLine($"Changed the current culture to {CultureInfo.CurrentCulture.Name}.\n");
- CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CurrentCulture;
-
- // Execute the delegate synchronously.
- Console.WriteLine("Executing the delegate synchronously:");
- Console.WriteLine(formatDelegate());
-
- // Call an async delegate to format the values using one format string.
- Console.WriteLine("Executing a task asynchronously:");
- var t1 = Task.Run(formatDelegate);
- Console.WriteLine(t1.Result);
-
- Console.WriteLine("Executing a task synchronously:");
- var t2 = new Task(formatDelegate);
- t2.RunSynchronously();
- Console.WriteLine(t2.Result);
- }
-}
-// The example displays the following output:
-// The example is running on thread 1
-// The current culture is en-US
-// Changed the current culture to fr-FR.
-//
-// Executing the delegate synchronously:
-// Formatting using the fr-FR culture on thread 1.
-// 163 025 412,32 € 18 905 365,59 €
-//
-// Executing a task asynchronously:
-// Formatting using the fr-FR culture on thread 3.
-// 163 025 412,32 € 18 905 365,59 €
-//
-// Executing a task synchronously:
-// Formatting using the fr-FR culture on thread 1.
-// 163 025 412,32 € 18 905 365,59 €
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/change1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/change1.cs
deleted file mode 100644
index b30ae399951e7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/change1.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class ChangeEx1
-{
- public static void Main()
- {
- CultureInfo current = CultureInfo.CurrentCulture;
- Console.WriteLine($"The current culture is {current.Name}");
- CultureInfo newCulture;
- if (current.Name.Equals("fr-FR"))
- newCulture = new CultureInfo("fr-LU");
- else
- newCulture = new CultureInfo("fr-FR");
-
- CultureInfo.CurrentCulture = newCulture;
- Console.WriteLine($"The current culture is now {CultureInfo.CurrentCulture.Name}");
- }
-}
-// The example displays output like the following:
-// The current culture is en-US
-// The current culture is now fr-FR
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/changeui1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/changeui1.cs
deleted file mode 100644
index 6c2a2aa7c2395..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/changeui1.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class ChangeUICultureEx
-{
- public static void Main()
- {
- CultureInfo current = CultureInfo.CurrentUICulture;
- Console.WriteLine($"The current UI culture is {current.Name}");
- CultureInfo newUICulture;
- if (current.Name.Equals("sl-SI"))
- newUICulture = new CultureInfo("hr-HR");
- else
- newUICulture = new CultureInfo("sl-SI");
-
- CultureInfo.CurrentUICulture = newUICulture;
- Console.WriteLine($"The current UI culture is now {CultureInfo.CurrentUICulture.Name}");
- }
-}
-// The example displays output like the following:
-// The current UI culture is en-US
-// The current UI culture is now sl-SI
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/current1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/current1.cs
deleted file mode 100644
index a29a841509768..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/current1.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class CurrentCultureEx
-{
- public static void Main()
- {
- CultureInfo culture1 = CultureInfo.CurrentCulture;
- CultureInfo culture2 = Thread.CurrentThread.CurrentCulture;
- Console.WriteLine($"The current culture is {culture1.Name}");
- Console.WriteLine($"The two CultureInfo objects are equal: {culture1 == culture2}");
- }
-}
-// The example displays output like the following:
-// The current culture is en-US
-// The two CultureInfo objects are equal: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/currentui1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/currentui1.cs
deleted file mode 100644
index aabecca7d5dec..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/currentui1.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class CurrentUIEx
-{
- public static void Main()
- {
- CultureInfo uiCulture1 = CultureInfo.CurrentUICulture;
- CultureInfo uiCulture2 = Thread.CurrentThread.CurrentUICulture;
- Console.WriteLine($"The current UI culture is {uiCulture1.Name}");
- Console.WriteLine($"The two CultureInfo objects are equal: {uiCulture1 == uiCulture2}");
- }
-}
-// The example displays output like the following:
-// The current UI culture is en-US
-// The two CultureInfo objects are equal: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/defaultthread1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/defaultthread1.cs
deleted file mode 100644
index ab7f9e4ae1324..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/defaultthread1.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class DefaultThreadEx
-{
- static Random rnd = new Random();
-
- public static void Main()
- {
- if (Thread.CurrentThread.CurrentCulture.Name != "fr-FR")
- {
- // If current culture is not fr-FR, set culture to fr-FR.
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR");
- Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr-FR");
- }
- else
- {
- // Set culture to en-US.
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
- Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("en-US");
- }
- ThreadProc();
-
- Thread worker = new Thread(ThreadProc);
- worker.Name = "WorkerThread";
- worker.Start();
- }
-
- private static void DisplayThreadInfo()
- {
- Console.WriteLine($"\nCurrent Thread Name: '{Thread.CurrentThread.Name}'");
- Console.WriteLine($"Current Thread Culture/UI Culture: {Thread.CurrentThread.CurrentCulture.Name}/{Thread.CurrentThread.CurrentUICulture.Name}");
- }
-
- private static void DisplayValues()
- {
- // Create new thread and display three random numbers.
- Console.WriteLine("Some currency values:");
- for (int ctr = 0; ctr <= 3; ctr++)
- Console.WriteLine($" {rnd.NextDouble() * 10:C2}");
- }
-
- private static void ThreadProc()
- {
- DisplayThreadInfo();
- DisplayValues();
- }
-}
-// The example displays output similar to the following:
-// Current Thread Name: ''
-// Current Thread Culture/UI Culture: fr-FR/fr-FR
-// Some currency values:
-// 8,11 €
-// 1,48 €
-// 8,99 €
-// 9,04 €
-//
-// Current Thread Name: 'WorkerThread'
-// Current Thread Culture/UI Culture: en-US/en-US
-// Some currency values:
-// $6.72
-// $6.35
-// $2.90
-// $7.72
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/getcultures1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/getcultures1.cs
deleted file mode 100644
index ffcdfa70ff2e5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/getcultures1.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class GetCulturesEx
-{
- public static void Main()
- {
- // Get all custom cultures.
- CultureInfo[] custom = CultureInfo.GetCultures(CultureTypes.UserCustomCulture);
- if (custom.Length == 0)
- {
- Console.WriteLine("There are no user-defined custom cultures.");
- }
- else
- {
- Console.WriteLine("Custom cultures:");
- foreach (var culture in custom)
- Console.WriteLine($" {culture.Name} -- {culture.DisplayName}");
- }
- Console.WriteLine();
-
- // Get all replacement cultures.
- CultureInfo[] replacements = CultureInfo.GetCultures(CultureTypes.ReplacementCultures);
- if (replacements.Length == 0)
- {
- Console.WriteLine("There are no replacement cultures.");
- }
- else
- {
- Console.WriteLine("Replacement cultures:");
- foreach (var culture in replacements)
- Console.WriteLine($" {culture.Name} -- {culture.DisplayName}");
- }
- Console.WriteLine();
- }
-}
-// The example displays output like the following:
-// Custom cultures:
-// x-en-US-sample -- English (United States)
-// fj-FJ -- Boumaa Fijian (Viti)
-//
-// There are no replacement cultures.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/project.csproj
deleted file mode 100644
index 2508cb7fae22e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net481
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/setthreads1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/setthreads1.cs
deleted file mode 100644
index f848f7d914009..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/CultureInfo/csharp/setthreads1.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class SetThreadsEx
-{
- static Random rnd = new Random();
-
- public static void Main()
- {
- if (Thread.CurrentThread.CurrentCulture.Name != "fr-FR")
- {
- // If current culture is not fr-FR, set culture to fr-FR.
- CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR");
- CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.CreateSpecificCulture("fr-FR");
- }
- else
- {
- // Set culture to en-US.
- CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
- CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.CreateSpecificCulture("en-US");
- }
- ThreadProc();
-
- Thread worker = new Thread(SetThreadsEx.ThreadProc);
- worker.Name = "WorkerThread";
- worker.Start();
- }
-
- private static void DisplayThreadInfo()
- {
- Console.WriteLine($"\nCurrent Thread Name: '{Thread.CurrentThread.Name}'");
- Console.WriteLine($"Current Thread Culture/UI Culture: {Thread.CurrentThread.CurrentCulture.Name}/{Thread.CurrentThread.CurrentUICulture.Name}");
- }
-
- private static void DisplayValues()
- {
- // Create new thread and display three random numbers.
- Console.WriteLine("Some currency values:");
- for (int ctr = 0; ctr <= 3; ctr++)
- Console.WriteLine($" {rnd.NextDouble() * 10:C2}");
- }
-
- private static void ThreadProc()
- {
- DisplayThreadInfo();
- DisplayValues();
- }
-}
-// The example displays output similar to the following:
-// Current Thread Name: ''
-// Current Thread Culture/UI Culture: fr-FR/fr-FR
-// Some currency values:
-// 6,83 €
-// 3,47 €
-// 6,07 €
-// 1,70 €
-//
-// Current Thread Name: 'WorkerThread'
-// Current Thread Culture/UI Culture: fr-FR/fr-FR
-// Some currency values:
-// 9,54 €
-// 9,50 €
-// 0,58 €
-// 6,91 €
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/create1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/create1.cs
deleted file mode 100644
index 9c54c076ec027..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/create1.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-using System;
-
-public class Example
-{
- public static void Main()
- {
- CreateInvariant1();
- Console.WriteLine();
- CreateNeutral2();
- Console.WriteLine();
- CreateSpecific3();
- }
-
- private static void CreateInvariant1()
- {
- //
- System.Globalization.DateTimeFormatInfo dtfi;
-
- dtfi = System.Globalization.DateTimeFormatInfo.InvariantInfo;
- Console.WriteLine(dtfi.IsReadOnly);
-
- dtfi = new System.Globalization.DateTimeFormatInfo();
- Console.WriteLine(dtfi.IsReadOnly);
-
- dtfi = System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat;
- Console.WriteLine(dtfi.IsReadOnly);
- // The example displays the following output:
- // True
- // False
- // True
- //
- }
-
- private static void CreateNeutral2()
- {
- //
- System.Globalization.CultureInfo specific, neutral;
- System.Globalization.DateTimeFormatInfo dtfi;
-
- // Instantiate a culture by creating a specific culture and using its Parent property.
- specific = System.Globalization.CultureInfo.GetCultureInfo("fr-FR");
- neutral = specific.Parent;
- dtfi = neutral.DateTimeFormat;
- Console.WriteLine($"{neutral.Name} from Parent property: {dtfi.IsReadOnly}");
-
- dtfi = System.Globalization.CultureInfo.GetCultureInfo("fr-FR").Parent.DateTimeFormat;
- Console.WriteLine($"{neutral.Name} from Parent property: {dtfi.IsReadOnly}");
-
- // Instantiate a neutral culture using the CultureInfo constructor.
- neutral = new System.Globalization.CultureInfo("fr");
- dtfi = neutral.DateTimeFormat;
- Console.WriteLine($"{neutral.Name} from CultureInfo constructor: {dtfi.IsReadOnly}");
-
- // Instantiate a culture using CreateSpecificCulture.
- neutral = System.Globalization.CultureInfo.CreateSpecificCulture("fr");
- dtfi = neutral.DateTimeFormat;
- Console.WriteLine($"{neutral.Name} from CreateSpecificCulture: {dtfi.IsReadOnly}");
-
- // Retrieve a culture by calling the GetCultureInfo method.
- neutral = System.Globalization.CultureInfo.GetCultureInfo("fr");
- dtfi = neutral.DateTimeFormat;
- Console.WriteLine($"{neutral.Name} from GetCultureInfo: {dtfi.IsReadOnly}");
-
- // Instantiate a DateTimeFormatInfo object by calling GetInstance.
- neutral = System.Globalization.CultureInfo.CreateSpecificCulture("fr");
- dtfi = System.Globalization.DateTimeFormatInfo.GetInstance(neutral);
- Console.WriteLine($"{neutral.Name} from GetInstance: {dtfi.IsReadOnly}");
-
- // The example displays the following output:
- // fr from Parent property: False
- // fr from Parent property: False
- // fr from CultureInfo constructor: False
- // fr-FR from CreateSpecificCulture: False
- // fr from GetCultureInfo: True
- // fr-FR from GetInstance: False
- //
- }
-
- private static void CreateSpecific3()
- {
- //
- System.Globalization.CultureInfo ci = null;
- System.Globalization.DateTimeFormatInfo dtfi = null;
-
- // Instantiate a culture using CreateSpecificCulture.
- ci = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
- dtfi = ci.DateTimeFormat;
- Console.WriteLine($"{ci.Name} from CreateSpecificCulture: {dtfi.IsReadOnly}");
-
- // Instantiate a culture using the CultureInfo constructor.
- ci = new System.Globalization.CultureInfo("en-CA");
- dtfi = ci.DateTimeFormat;
- Console.WriteLine($"{ci.Name} from CultureInfo constructor: {dtfi.IsReadOnly}");
-
- // Retrieve a culture by calling the GetCultureInfo method.
- ci = System.Globalization.CultureInfo.GetCultureInfo("en-AU");
- dtfi = ci.DateTimeFormat;
- Console.WriteLine($"{ci.Name} from GetCultureInfo: {dtfi.IsReadOnly}");
-
- // Instantiate a DateTimeFormatInfo object by calling DateTimeFormatInfo.GetInstance.
- ci = System.Globalization.CultureInfo.CreateSpecificCulture("en-GB");
- dtfi = System.Globalization.DateTimeFormatInfo.GetInstance(ci);
- Console.WriteLine($"{ci.Name} from GetInstance: {dtfi.IsReadOnly}");
-
- // The example displays the following output:
- // en-US from CreateSpecificCulture: False
- // en-CA from CultureInfo constructor: False
- // en-AU from GetCultureInfo: True
- // en-GB from GetInstance: False
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/create2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/create2.cs
deleted file mode 100644
index 01e02d14e15c0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/create2.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-using System.Globalization;
-
-public class Create2Ex
-{
- public static void Main()
- {
- //
- DateTimeFormatInfo dtfi;
-
- dtfi = DateTimeFormatInfo.CurrentInfo;
- Console.WriteLine(dtfi.IsReadOnly);
-
- dtfi = CultureInfo.CurrentCulture.DateTimeFormat;
- Console.WriteLine(dtfi.IsReadOnly);
-
- dtfi = DateTimeFormatInfo.GetInstance(CultureInfo.CurrentCulture);
- Console.WriteLine(dtfi.IsReadOnly);
- // The example displays the following output:
- // True
- // True
- // True
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example1.cs
deleted file mode 100644
index 329b9ee31e813..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example1.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example1
-{
- public static void Main()
- {
- DateTime dateValue = new DateTime(2013, 8, 18);
- CultureInfo enUS = CultureInfo.CreateSpecificCulture("en-US");
- DateTimeFormatInfo dtfi = enUS.DateTimeFormat;
-
- Console.WriteLine("Before modifying DateTimeFormatInfo object: ");
- Console.WriteLine($"{dtfi.ShortDatePattern}: {dateValue.ToString("d", enUS)}\n");
-
- // Modify the short date pattern.
- dtfi.ShortDatePattern = "yyyy-MM-dd";
- Console.WriteLine("After modifying DateTimeFormatInfo object: ");
- Console.WriteLine($"{dtfi.ShortDatePattern}: {dateValue.ToString("d", enUS)}");
- }
-}
-// The example displays the following output:
-// Before modifying DateTimeFormatInfo object:
-// M/d/yyyy: 8/18/2013
-//
-// After modifying DateTimeFormatInfo object:
-// yyyy-MM-dd: 2013-08-18
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example2.cs
deleted file mode 100644
index 3ff54e26a150e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example2.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example2
-{
- public static void Main()
- {
- DateTime value = new DateTime(2013, 7, 9);
- CultureInfo enUS = CultureInfo.CreateSpecificCulture("en-US");
- DateTimeFormatInfo dtfi = enUS.DateTimeFormat;
- String[] formats = { "D", "F", "f" };
-
- // Display date before modifying properties.
- foreach (var fmt in formats)
- Console.WriteLine($"{fmt}: {value.ToString(fmt, dtfi)}");
-
- Console.WriteLine();
-
- // We don't want to change the FullDateTimePattern, so we need to save it.
- String originalFullDateTimePattern = dtfi.FullDateTimePattern;
-
- // Modify day name abbreviations and long date pattern.
- dtfi.AbbreviatedDayNames = new String[] { "Su", "M", "Tu", "W", "Th", "F", "Sa" };
- dtfi.LongDatePattern = "ddd dd-MMM-yyyy";
- dtfi.FullDateTimePattern = originalFullDateTimePattern;
- foreach (var fmt in formats)
- Console.WriteLine($"{fmt}: {value.ToString(fmt, dtfi)}");
- }
-}
-// The example displays the following output:
-// D: Tuesday, July 9, 2013
-// F: Tuesday, July 9, 2013 12:00:00 AM
-// f: Tuesday, July 9, 2013 12:00 AM
-//
-// D: Tu 09-Jul-2013
-// F: Tuesday, July 9, 2013 12:00:00 AM
-// f: Tu 09-Jul-2013 12:00 AM
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example3.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example3.cs
deleted file mode 100644
index 925227609f5e6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example3.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example3
-{
- public static void Main()
- {
- DateTime dateValue = new DateTime(2013, 08, 28);
- CultureInfo frFR = CultureInfo.CreateSpecificCulture("fr-FR");
- DateTimeFormatInfo dtfi = frFR.DateTimeFormat;
-
- Console.WriteLine($"Before modifying DateSeparator property: {dateValue.ToString("g", frFR)}");
-
- // Modify the date separator.
- dtfi.DateSeparator = "-";
- Console.WriteLine($"After modifying the DateSeparator property: {dateValue.ToString("g", frFR)}");
- }
-}
-// The example displays the following output:
-// Before modifying DateSeparator property: 28/08/2013 00:00
-// After modifying the DateSeparator property: 28-08-2013 00:00
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example4.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example4.cs
deleted file mode 100644
index 14f4fc8140451..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example4.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example4
-{
- public static void Main()
- {
- DateTime dateValue = new DateTime(2013, 5, 18, 13, 30, 0);
- String[] formats = { "D", "f", "F" };
-
- CultureInfo enUS = CultureInfo.CreateSpecificCulture("en-US");
- DateTimeFormatInfo dtfi = enUS.DateTimeFormat;
- String originalLongDatePattern = dtfi.LongDatePattern;
-
- // Display the default form of three long date formats.
- foreach (var fmt in formats)
- Console.WriteLine(dateValue.ToString(fmt, dtfi));
-
- Console.WriteLine();
-
- // Modify the long date pattern.
- dtfi.LongDatePattern = originalLongDatePattern + " g";
- foreach (var fmt in formats)
- Console.WriteLine(dateValue.ToString(fmt, dtfi));
-
- Console.WriteLine();
-
- // Change A.D. to C.E. (for Common Era)
- dtfi.LongDatePattern = originalLongDatePattern + @" 'C.E.'";
- foreach (var fmt in formats)
- Console.WriteLine(dateValue.ToString(fmt, dtfi));
- }
-}
-// The example displays the following output:
-// Saturday, May 18, 2013
-// Saturday, May 18, 2013 1:30 PM
-// Saturday, May 18, 2013 1:30:00 PM
-//
-// Saturday, May 18, 2013 A.D.
-// Saturday, May 18, 2013 A.D. 1:30 PM
-// Saturday, May 18, 2013 A.D. 1:30:00 PM
-//
-// Saturday, May 18, 2013 C.E.
-// Saturday, May 18, 2013 C.E. 1:30 PM
-// Saturday, May 18, 2013 C.E. 1:30:00 PM
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example5.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example5.cs
deleted file mode 100644
index e23c4454dad1b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example5.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Text.RegularExpressions;
-
-public class Example5
-{
- public static void Main()
- {
- CultureInfo enUS = CultureInfo.CreateSpecificCulture("en-US");
- DateTimeFormatInfo dtfi = enUS.DateTimeFormat;
-
- Console.WriteLine("Original Property Values:");
- Console.WriteLine("ShortTimePattern: " + dtfi.ShortTimePattern);
- Console.WriteLine("LongTimePattern: " + dtfi.LongTimePattern);
- Console.WriteLine("FullDateTimePattern: " + dtfi.FullDateTimePattern);
- Console.WriteLine();
-
- dtfi.LongTimePattern = ReplaceWith24HourClock(dtfi.LongTimePattern);
- dtfi.ShortTimePattern = ReplaceWith24HourClock(dtfi.ShortTimePattern);
-
- Console.WriteLine("Modififed Property Values:");
- Console.WriteLine("ShortTimePattern: " + dtfi.ShortTimePattern);
- Console.WriteLine("LongTimePattern: " + dtfi.LongTimePattern);
- Console.WriteLine("FullDateTimePattern: " + dtfi.FullDateTimePattern);
- }
-
- private static string ReplaceWith24HourClock(string fmt)
- {
- string pattern = @"^(?\s*t+\s*)? " +
- @"(?(openAMPM) h+(?[^ht]+)$ " +
- @"| \s*h+(?[^ht]+)\s*t+)";
- return Regex.Replace(fmt, pattern, "HH${nonHours}",
- RegexOptions.IgnorePatternWhitespace);
- }
-}
-// The example displays the following output:
-// Original Property Values:
-// ShortTimePattern: h:mm tt
-// LongTimePattern: h:mm:ss tt
-// FullDateTimePattern: dddd, MMMM dd, yyyy h:mm:ss tt
-//
-// Modififed Property Values:
-// ShortTimePattern: HH:mm
-// LongTimePattern: HH:mm:ss
-// FullDateTimePattern: dddd, MMMM dd, yyyy HH:mm:ss
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/formatprovider1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/formatprovider1.cs
deleted file mode 100644
index 1cdaa7e5fd958..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/formatprovider1.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class CurrentCultureFormatProvider : IFormatProvider
-{
- public Object GetFormat(Type formatType)
- {
- Console.WriteLine($"Requesting an object of type {formatType.Name}");
- if (formatType == typeof(NumberFormatInfo))
- return NumberFormatInfo.CurrentInfo;
- else if (formatType == typeof(DateTimeFormatInfo))
- return DateTimeFormatInfo.CurrentInfo;
- else
- return null;
- }
-}
-
-public class FormatProviderEx1
-{
- public static void Main()
- {
- DateTime dateValue = new DateTime(2013, 5, 28, 13, 30, 0);
- string value = dateValue.ToString("F", new CurrentCultureFormatProvider());
- Console.WriteLine(value);
- Console.WriteLine();
- string composite = String.Format(new CurrentCultureFormatProvider(),
- "Date: {0:d} Amount: {1:C} Description: {2}",
- dateValue, 1264.03m, "Service Charge");
- Console.WriteLine(composite);
- Console.WriteLine();
- }
-}
-// The example displays output like the following:
-// Requesting an object of type DateTimeFormatInfo
-// Tuesday, May 28, 2013 1:30:00 PM
-//
-// Requesting an object of type ICustomFormatter
-// Requesting an object of type DateTimeFormatInfo
-// Requesting an object of type NumberFormatInfo
-// Date: 5/28/2013 Amount: $1,264.03 Description: Service Charge
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/instantiate2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/instantiate2.cs
deleted file mode 100644
index fde2e0a0c06aa..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/instantiate2.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class InstantiateEx1
-{
- public static void Main()
- {
- DateTimeFormatInfo current1 = DateTimeFormatInfo.CurrentInfo;
- current1 = (DateTimeFormatInfo)current1.Clone();
- Console.WriteLine(current1.IsReadOnly);
-
- CultureInfo culture2 = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name);
- DateTimeFormatInfo current2 = culture2.DateTimeFormat;
- Console.WriteLine(current2.IsReadOnly);
- }
-}
-// The example displays the following output:
-// False
-// False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/instantiate3.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/instantiate3.cs
deleted file mode 100644
index 5eb266248b6d5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/instantiate3.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class InstantiateEx3
-{
- public static void Main()
- {
- CultureInfo culture;
- DateTimeFormatInfo dtfi;
-
- culture = CultureInfo.CurrentCulture;
- dtfi = culture.DateTimeFormat;
- Console.WriteLine($"Culture Name: {culture.Name}");
- Console.WriteLine($"User Overrides: {culture.UseUserOverride}");
- Console.WriteLine($"Long Time Pattern: {culture.DateTimeFormat.LongTimePattern}\n");
-
- culture = new CultureInfo(CultureInfo.CurrentCulture.Name, false);
- Console.WriteLine($"Culture Name: {culture.Name}");
- Console.WriteLine($"User Overrides: {culture.UseUserOverride}");
- Console.WriteLine($"Long Time Pattern: {culture.DateTimeFormat.LongTimePattern}\n");
- }
-}
-// The example displays the following output:
-// Culture Name: en-US
-// User Overrides: True
-// Long Time Pattern: HH:mm:ss
-//
-// Culture Name: en-US
-// User Overrides: False
-// Long Time Pattern: h:mm:ss tt
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/instantiate6.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/instantiate6.cs
deleted file mode 100644
index 2a1235fde3522..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/instantiate6.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Reflection;
-
-public class InstantiateEx6
-{
- public static void Main()
- {
- // Get all the neutral cultures
- List names = new List();
- Array.ForEach(CultureInfo.GetCultures(CultureTypes.NeutralCultures),
- culture => names.Add(culture.Name));
- names.Sort();
- foreach (var name in names)
- {
- // Ignore the invariant culture.
- if (name == "") continue;
-
- ListSimilarChildCultures(name);
- }
- }
-
- private static void ListSimilarChildCultures(String name)
- {
- // Create the neutral DateTimeFormatInfo object.
- DateTimeFormatInfo dtfi = CultureInfo.GetCultureInfo(name).DateTimeFormat;
- // Retrieve all specific cultures of the neutral culture.
- CultureInfo[] cultures = Array.FindAll(CultureInfo.GetCultures(CultureTypes.SpecificCultures),
- culture => culture.Name.StartsWith(name + "-", StringComparison.OrdinalIgnoreCase));
- // Create an array of DateTimeFormatInfo properties
- PropertyInfo[] properties = typeof(DateTimeFormatInfo).GetProperties(BindingFlags.Instance | BindingFlags.Public);
- bool hasOneMatch = false;
-
- foreach (var ci in cultures)
- {
- bool match = true;
- // Get the DateTimeFormatInfo for a specific culture.
- DateTimeFormatInfo specificDtfi = ci.DateTimeFormat;
- // Compare the property values of the two.
- foreach (var prop in properties)
- {
- // We're not interested in the value of IsReadOnly.
- if (prop.Name == "IsReadOnly") continue;
-
- // For arrays, iterate the individual elements to see if they are the same.
- if (prop.PropertyType.IsArray)
- {
- IList nList = (IList)prop.GetValue(dtfi, null);
- IList sList = (IList)prop.GetValue(specificDtfi, null);
- if (nList.Count != sList.Count)
- {
- match = false;
- Console.WriteLine($" Different n in {prop.Name} array for {name} and {ci.Name}");
- break;
- }
-
- for (int ctr = 0; ctr < nList.Count; ctr++)
- {
- if (!nList[ctr].Equals(sList[ctr]))
- {
- match = false;
- Console.WriteLine($" {prop.Name} value different for {name} and {ci.Name}");
- break;
- }
- }
-
- if (!match) break;
- }
- // Get non-array values.
- else
- {
- Object specificValue = prop.GetValue(specificDtfi);
- Object neutralValue = prop.GetValue(dtfi);
-
- // Handle comparison of Calendar objects.
- if (prop.Name == "Calendar")
- {
- // The cultures have a different calendar type.
- if (specificValue.ToString() != neutralValue.ToString())
- {
- Console.WriteLine($" Different calendar types for {name} and {ci.Name}");
- match = false;
- break;
- }
-
- if (specificValue is GregorianCalendar)
- {
- if (((GregorianCalendar)specificValue).CalendarType != ((GregorianCalendar)neutralValue).CalendarType)
- {
- Console.WriteLine($" Different Gregorian calendar types for {name} and {ci.Name}");
- match = false;
- break;
- }
- }
- }
- else if (!specificValue.Equals(neutralValue))
- {
- match = false;
- Console.WriteLine($" Different {prop.Name} values for {name} and {ci.Name}");
- break;
- }
- }
- }
- if (match)
- {
- Console.WriteLine($"DateTimeFormatInfo object for '{name}' matches '{ci.Name}'");
- hasOneMatch = true;
- }
- }
- if (!hasOneMatch)
- Console.WriteLine($"DateTimeFormatInfo object for '{name}' --> No Match");
-
- Console.WriteLine();
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/parse1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/parse1.cs
deleted file mode 100644
index d1a51b3cf63ef..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/parse1.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class ParseEx1
-{
- public static void Main()
- {
- string[] dateStrings = { "08/18/2014", "01/02/2015" };
- string[] cultureNames = { "en-US", "en-GB", "fr-FR", "fi-FI" };
-
- foreach (var cultureName in cultureNames)
- {
- CultureInfo culture = CultureInfo.CreateSpecificCulture(cultureName);
- Console.WriteLine($"Parsing strings using the {culture.Name} culture.");
- foreach (var dateStr in dateStrings)
- {
- try
- {
- Console.WriteLine(String.Format(culture,
- " '{0}' --> {1:D}", dateStr,
- DateTime.Parse(dateStr, culture)));
- }
- catch (FormatException)
- {
- Console.WriteLine($" Unable to parse '{dateStr}'");
- }
- }
- }
- }
-}
-// The example displays the following output:
-// Parsing strings using the en-US culture.
-// '08/18/2014' --> Monday, August 18, 2014
-// '01/02/2015' --> Friday, January 02, 2015
-// Parsing strings using the en-GB culture.
-// Unable to parse '08/18/2014'
-// '01/02/2015' --> 01 February 2015
-// Parsing strings using the fr-FR culture.
-// Unable to parse '08/18/2014'
-// '01/02/2015' --> dimanche 1 février 2015
-// Parsing strings using the fi-FI culture.
-// Unable to parse '08/18/2014'
-// '01/02/2015' --> 1. helmikuuta 2015
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/parse2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/parse2.cs
deleted file mode 100644
index 3888b6215d933..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/parse2.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class ParseEx2
-{
- public static void Main()
- {
- string inputDate = "14/05/10";
-
- CultureInfo[] cultures = { CultureInfo.GetCultureInfo("en-US"),
- CultureInfo.CreateSpecificCulture("en-US") };
-
- foreach (var culture in cultures)
- {
- try
- {
- Console.WriteLine($"{culture.Name} culture reflects user overrides: {culture.UseUserOverride}");
- DateTime occasion = DateTime.Parse(inputDate, culture);
- Console.WriteLine($"'{inputDate}' --> {occasion.ToString("D", CultureInfo.InvariantCulture)}");
- }
- catch (FormatException)
- {
- Console.WriteLine($"Unable to parse '{inputDate}'");
- }
- Console.WriteLine();
- }
- }
-}
-// The example displays the following output:
-// en-US culture reflects user overrides: False
-// Unable to parse '14/05/10'
-//
-// en-US culture reflects user overrides: True
-// '14/05/10' --> Saturday, 10 May 2014
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/project.csproj
deleted file mode 100644
index cb4ea68ebe389..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- enable
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/serialize1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/serialize1.cs
deleted file mode 100644
index c7b73185d3fe5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/serialize1.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.IO;
-
-public class SerializeEx1
-{
- public static void Main()
- {
- StreamWriter sw = new StreamWriter(@".\DateData.dat");
- // Define a date and time to serialize.
- DateTime originalDate = new DateTime(2014, 08, 18, 08, 16, 35);
- // Display information on the date and time.
- Console.WriteLine($"Date to serialize: {originalDate:F}");
- Console.WriteLine($"Current Culture: {CultureInfo.CurrentCulture.Name}");
- Console.WriteLine($"Time Zone: {TimeZoneInfo.Local.DisplayName}");
- // Convert the date value to UTC.
- DateTime utcDate = originalDate.ToUniversalTime();
- // Serialize the UTC value.
- sw.Write(utcDate.ToString("o", DateTimeFormatInfo.InvariantInfo));
- sw.Close();
- }
-}
-// The example displays the following output:
-// Date to serialize: Monday, August 18, 2014 8:16:35 AM
-// Current Culture: en-US
-// Time Zone: (UTC-08:00) Pacific Time (US & Canada)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/serialize2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/serialize2.cs
deleted file mode 100644
index 42e02b9c5924d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/serialize2.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.IO;
-
-public class SerializeEx2
-{
- public static void Main()
- {
- // Open the file and retrieve the date string.
- StreamReader sr = new StreamReader(@".\DateData.dat");
- String dateValue = sr.ReadToEnd();
-
- // Parse the date.
- DateTime parsedDate = DateTime.ParseExact(dateValue, "o",
- DateTimeFormatInfo.InvariantInfo);
- // Convert it to local time.
- DateTime restoredDate = parsedDate.ToLocalTime();
- // Display information on the date and time.
- Console.WriteLine($"Deserialized date: {restoredDate:F}");
- Console.WriteLine($"Current Culture: {CultureInfo.CurrentCulture.Name}");
- Console.WriteLine($"Time Zone: {TimeZoneInfo.Local.DisplayName}");
- }
-}
-// The example displays the following output:
-// Deserialized date: lundi 18 août 2014 17:16:35
-// Current Culture: fr-FR
-// Time Zone: (UTC+01:00) Brussels, Copenhagen, Madrid, Paris
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/customize_currency1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/customize_currency1.cs
deleted file mode 100644
index 1e5cb5579d2fc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/customize_currency1.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example
-{
- public static void Main()
- {
- // Retrieve a writable NumberFormatInfo object.
- CultureInfo enUS = CultureInfo.CreateSpecificCulture("en-US");
- NumberFormatInfo nfi = enUS.NumberFormat;
-
- // Use the ISO currency symbol instead of the native currency symbol.
- nfi.CurrencySymbol = (new RegionInfo(enUS.Name)).ISOCurrencySymbol;
- // Change the positive currency pattern to .
- nfi.CurrencyPositivePattern = 2;
- // Change the negative currency pattern to .
- nfi.CurrencyNegativePattern = 12;
-
- // Produce the result strings by calling ToString.
- Decimal[] values = { 1065.23m, 19.89m, -.03m, -175902.32m };
- foreach (var value in values)
- Console.WriteLine(value.ToString("C", enUS));
-
- Console.WriteLine();
-
- // Produce the result strings by calling a composite formatting method.
- foreach (var value in values)
- Console.WriteLine(String.Format(enUS, "{0:C}", value));
- }
-}
-// The example displays the following output:
-// USD 1,065.23
-// USD 19.89
-// USD -0.03
-// USD -175,902.32
-//
-// USD 1,065.23
-// USD 19.89
-// USD -0.03
-// USD -175,902.32
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/customize_ssn1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/customize_ssn1.cs
deleted file mode 100644
index 1e91cac484a24..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/customize_ssn1.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class CustomizeSSNEx
-{
- public static void Main()
- {
- // Instantiate a read-only NumberFormatInfo object.
- CultureInfo enUS = CultureInfo.CreateSpecificCulture("en-US");
- NumberFormatInfo nfi = enUS.NumberFormat;
-
- // Modify the relevant properties.
- nfi.NumberGroupSeparator = "-";
- nfi.NumberGroupSizes = new int[] { 3, 2, 4 };
- nfi.NumberDecimalDigits = 0;
-
- int[] ids = { 111223333, 999776666 };
-
- // Produce the result string by calling ToString.
- foreach (var id in ids)
- Console.WriteLine(id.ToString("N", enUS));
-
- Console.WriteLine();
-
- // Produce the result string using composite formatting.
- foreach (var id in ids)
- Console.WriteLine(String.Format(enUS, "{0:N}", id));
- }
-}
-// The example displays the following output:
-// 1112-23-333
-// 9997-76-666
-//
-// 1112-23-333
-// 9997-76-666
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/formatprovider1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/formatprovider1.cs
deleted file mode 100644
index de769d0f2cb43..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/formatprovider1.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class CurrentCultureFormatProvider : IFormatProvider
-{
- public Object GetFormat(Type formatType)
- {
- Console.WriteLine($"Requesting an object of type {formatType.Name}");
- if (formatType == typeof(NumberFormatInfo))
- return NumberFormatInfo.CurrentInfo;
- else if (formatType == typeof(DateTimeFormatInfo))
- return DateTimeFormatInfo.CurrentInfo;
- else
- return null;
- }
-}
-
-public class FormatProviderEx
-{
- public static void Main()
- {
- Decimal amount = 1203.541m;
- string value = amount.ToString("C2", new CurrentCultureFormatProvider());
- Console.WriteLine(value);
- Console.WriteLine();
- string composite = String.Format(new CurrentCultureFormatProvider(),
- "Date: {0} Amount: {1} Description: {2}",
- DateTime.Now, 1264.03m, "Service Charge");
- Console.WriteLine(composite);
- Console.WriteLine();
- }
-}
-// The example displays output like the following:
-// Requesting an object of type NumberFormatInfo
-// $1,203.54
-//
-// Requesting an object of type ICustomFormatter
-// Requesting an object of type DateTimeFormatInfo
-// Requesting an object of type NumberFormatInfo
-// Date: 11/15/2012 2:00:01 PM Amount: 1264.03 Description: Service Charge
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate1.cs
deleted file mode 100644
index 9f1517d5dadcd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate1.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class InstantiateEx1
-{
- public static void Main()
- {
- NumberFormatInfo current1 = CultureInfo.CurrentCulture.NumberFormat;
- Console.WriteLine(current1.IsReadOnly);
-
- NumberFormatInfo current2 = NumberFormatInfo.CurrentInfo;
- Console.WriteLine(current2.IsReadOnly);
-
- NumberFormatInfo current3 = NumberFormatInfo.GetInstance(CultureInfo.CurrentCulture);
- Console.WriteLine(current3.IsReadOnly);
- }
-}
-// The example displays the following output:
-// True
-// True
-// True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate2.cs
deleted file mode 100644
index 940e39567844f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate2.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class InstantiateEx2
-{
- public static void Main()
- {
- NumberFormatInfo current1 = NumberFormatInfo.CurrentInfo;
- current1 = (NumberFormatInfo)current1.Clone();
- Console.WriteLine(current1.IsReadOnly);
-
- CultureInfo culture2 = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name);
- NumberFormatInfo current2 = culture2.NumberFormat;
- Console.WriteLine(current2.IsReadOnly);
- }
-}
-// The example displays the following output:
-// False
-// False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate3.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate3.cs
deleted file mode 100644
index 82e9576ce113a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate3.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class InstantiateEx3
-{
- public static void Main()
- {
- CultureInfo culture;
- NumberFormatInfo nfi;
-
- culture = CultureInfo.CurrentCulture;
- nfi = culture.NumberFormat;
- Console.WriteLine($"Culture Name: {culture.Name}");
- Console.WriteLine($"User Overrides: {culture.UseUserOverride}");
- Console.WriteLine($"Currency Symbol: {culture.NumberFormat.CurrencySymbol}\n");
-
- culture = new CultureInfo(CultureInfo.CurrentCulture.Name, false);
- Console.WriteLine($"Culture Name: {culture.Name}");
- Console.WriteLine($"User Overrides: {culture.UseUserOverride}");
- Console.WriteLine($"Currency Symbol: {culture.NumberFormat.CurrencySymbol}");
- }
-}
-// The example displays the following output:
-// Culture Name: en-US
-// User Overrides: True
-// Currency Symbol: USD
-//
-// Culture Name: en-US
-// User Overrides: False
-// Currency Symbol: $
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate4.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate4.cs
deleted file mode 100644
index 6156482cc1f39..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate4.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class InstantiateEx4
-{
- public static void Main()
- {
- NumberFormatInfo nfi;
-
- nfi = System.Globalization.NumberFormatInfo.InvariantInfo;
- Console.WriteLine(nfi.IsReadOnly);
-
- nfi = CultureInfo.InvariantCulture.NumberFormat;
- Console.WriteLine(nfi.IsReadOnly);
-
- nfi = new NumberFormatInfo();
- Console.WriteLine(nfi.IsReadOnly);
- }
-}
-// The example displays the following output:
-// True
-// True
-// False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate5.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate5.cs
deleted file mode 100644
index c43d50b1c1bcb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate5.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class InstantiateEx5
-{
- public static void Main()
- {
- CultureInfo culture;
- NumberFormatInfo nfi;
-
- nfi = CultureInfo.GetCultureInfo("id-ID").NumberFormat;
- Console.WriteLine($"Read-only: {nfi.IsReadOnly}");
-
- culture = new CultureInfo("id-ID");
- nfi = NumberFormatInfo.GetInstance(culture);
- Console.WriteLine($"Read-only: {nfi.IsReadOnly}");
-
- culture = CultureInfo.CreateSpecificCulture("id-ID");
- nfi = culture.NumberFormat;
- Console.WriteLine($"Read-only: {nfi.IsReadOnly}");
-
- culture = new CultureInfo("id-ID");
- nfi = culture.NumberFormat;
- Console.WriteLine($"Read-only: {nfi.IsReadOnly}");
- }
-}
-// The example displays the following output:
-// Read-only: True
-// Read-only: False
-// Read-only: False
-// Read-only: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate6.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate6.cs
deleted file mode 100644
index a115ceb3a7338..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/instantiate6.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Reflection;
-
-public class InstantiateEx6
-{
- public static void Main()
- {
- // Get all the neutral cultures
- List names = new List();
- Array.ForEach(CultureInfo.GetCultures(CultureTypes.NeutralCultures),
- culture => names.Add(culture.Name));
- names.Sort();
- foreach (var name in names)
- {
- // Ignore the invariant culture.
- if (name == "") continue;
-
- ListSimilarChildCultures(name);
- }
- }
-
- private static void ListSimilarChildCultures(string name)
- {
- // Create the neutral NumberFormatInfo object.
- NumberFormatInfo nfi = CultureInfo.GetCultureInfo(name).NumberFormat;
- // Retrieve all specific cultures of the neutral culture.
- CultureInfo[] cultures = Array.FindAll(CultureInfo.GetCultures(CultureTypes.SpecificCultures),
- culture => culture.Name.StartsWith(name + "-", StringComparison.OrdinalIgnoreCase));
- // Create an array of NumberFormatInfo properties
- PropertyInfo[] properties = typeof(NumberFormatInfo).GetProperties(BindingFlags.Instance | BindingFlags.Public);
- bool hasOneMatch = false;
-
- foreach (var ci in cultures)
- {
- bool match = true;
- // Get the NumberFormatInfo for a specific culture.
- NumberFormatInfo specificNfi = ci.NumberFormat;
- // Compare the property values of the two.
- foreach (var prop in properties)
- {
- // We're not interested in the value of IsReadOnly.
- if (prop.Name == "IsReadOnly") continue;
-
- // For arrays, iterate the individual elements to see if they are the same.
- if (prop.PropertyType.IsArray)
- {
- IList nList = (IList)prop.GetValue(nfi, null);
- IList sList = (IList)prop.GetValue(specificNfi, null);
- if (nList.Count != sList.Count)
- {
- match = false;
- break;
- }
-
- for (int ctr = 0; ctr < nList.Count; ctr++)
- {
- if (!nList[ctr].Equals(sList[ctr]))
- {
- match = false;
- break;
- }
- }
- }
- else if (!prop.GetValue(specificNfi).Equals(prop.GetValue(nfi)))
- {
- match = false;
- break;
- }
- }
- if (match)
- {
- Console.WriteLine($"NumberFormatInfo object for '{name}' matches '{ci.Name}'");
- hasOneMatch = true;
- }
- }
- if (!hasOneMatch)
- Console.WriteLine($"NumberFormatInfo object for '{name}' --> No Match");
-
- Console.WriteLine();
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/parse1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/parse1.cs
deleted file mode 100644
index 1ccddbbfa6185..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/parse1.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class ParseEx1
-{
- public static void Main()
- {
- String[] values = { "1,034,562.91", "9 532 978,07" };
- String[] cultureNames = { "en-US", "fr-FR", "" };
-
- foreach (var value in values)
- {
- foreach (var cultureName in cultureNames)
- {
- CultureInfo culture = CultureInfo.CreateSpecificCulture(cultureName);
- String name = culture.Name == "" ? "Invariant" : culture.Name;
- try
- {
- Decimal amount = Decimal.Parse(value, culture);
- Console.WriteLine($"'{value}' --> {amount} ({name})");
- }
- catch (FormatException)
- {
- Console.WriteLine($"'{value}': FormatException ({name})");
- }
- }
- Console.WriteLine();
- }
- }
-}
-// The example displays the following output:
-// '1,034,562.91' --> 1034562.91 (en-US)
-// '1,034,562.91': FormatException (fr-FR)
-// '1,034,562.91' --> 1034562.91 (Invariant)
-//
-// '9 532 978,07': FormatException (en-US)
-// '9 532 978,07' --> 9532978.07 (fr-FR)
-// '9 532 978,07': FormatException (Invariant)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/parsepersisted.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/parsepersisted.cs
deleted file mode 100644
index 23e05bd954e21..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/parsepersisted.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Threading;
-
-public class ParsePersistedEx
-{
- public static void Main()
- {
- CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
- PersistData();
-
- CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("pt-BR");
- RestoreData();
- }
-
- private static void PersistData()
- {
- // Define an array of floating-point values.
- Double[] values = { 160325.972, 8631.16, 1.304e5, 98017554.385,
- 8.5938287084321676e94 };
- Console.WriteLine("Original values: ");
- foreach (var value in values)
- Console.WriteLine(value.ToString("R", CultureInfo.InvariantCulture));
-
- // Serialize an array of doubles to a file
- StreamWriter sw = new StreamWriter(@".\NumericData.bin");
- for (int ctr = 0; ctr < values.Length; ctr++)
- {
- sw.Write(values[ctr].ToString("R"));
- if (ctr < values.Length - 1) sw.Write("|");
- }
- sw.Close();
- Console.WriteLine();
- }
-
- private static void RestoreData()
- {
- // Deserialize the data
- StreamReader sr = new StreamReader(@".\NumericData.bin");
- String data = sr.ReadToEnd();
- sr.Close();
-
- String[] stringValues = data.Split('|');
- List newValueList = new List();
-
- foreach (var stringValue in stringValues)
- {
- try
- {
- newValueList.Add(Double.Parse(stringValue));
- }
- catch (FormatException)
- {
- newValueList.Add(Double.NaN);
- }
- }
-
- Console.WriteLine("Restored values:");
- foreach (var newValue in newValueList)
- Console.WriteLine(newValue.ToString("R", NumberFormatInfo.InvariantInfo));
- }
-}
-// The example displays the following output:
-// Original values:
-// 160325.972
-// 8631.16
-// 130400
-// 98017554.385
-// 8.5938287084321671E+94
-//
-// Restored values:
-// 160325972
-// 863116
-// 130400
-// 98017554385
-// 8.5938287084321666E+110
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/parseuser1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/parseuser1.cs
deleted file mode 100644
index 662c8e55016ef..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/parseuser1.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class ParseUserEx
-{
- public static void Main()
- {
- CultureInfo stdCulture = CultureInfo.GetCultureInfo("en-US");
- CultureInfo custCulture = CultureInfo.CreateSpecificCulture("en-US");
-
- String value = "310,16";
- try
- {
- Console.WriteLine($"{stdCulture.Name} culture reflects user overrides: {stdCulture.UseUserOverride}");
- Decimal amount = Decimal.Parse(value, stdCulture);
- Console.WriteLine($"'{value}' --> {amount.ToString(CultureInfo.InvariantCulture)}");
- }
- catch (FormatException)
- {
- Console.WriteLine($"Unable to parse '{value}'");
- }
- Console.WriteLine();
-
- try
- {
- Console.WriteLine($"{custCulture.Name} culture reflects user overrides: {custCulture.UseUserOverride}");
- Decimal amount = Decimal.Parse(value, custCulture);
- Console.WriteLine($"'{value}' --> {amount.ToString(CultureInfo.InvariantCulture)}");
- }
- catch (FormatException)
- {
- Console.WriteLine($"Unable to parse '{value}'");
- }
- }
-}
-// The example displays the following output:
-// en-US culture reflects user overrides: False
-// '310,16' --> 31016
-//
-// en-US culture reflects user overrides: True
-// '310,16' --> 310.16
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/project.csproj
deleted file mode 100644
index cb4ea68ebe389..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- enable
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/properties1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/properties1.cs
deleted file mode 100644
index 3be5c7e9cb886..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/properties1.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class PropertiesEx1
-{
- public static void Main()
- {
- string[] formatStrings = { "C2", "E1", "F", "G3", "N",
- "#,##0.000", "0,000,000,000.0##" };
- CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
- Decimal[] values = { 1345.6538m, 1921651.16m };
-
- foreach (var value in values)
- {
- foreach (var formatString in formatStrings)
- {
- string resultString = value.ToString(formatString, culture);
- Console.WriteLine("{0,-18} --> {1}", formatString, resultString);
- }
- Console.WriteLine();
- }
- }
-}
-// The example displays the following output:
-// C2 --> $1,345.65
-// E1 --> 1.3E+003
-// F --> 1345.65
-// G3 --> 1.35E+03
-// N --> 1,345.65
-// #,##0.000 --> 1,345.654
-// 0,000,000,000.0## --> 0,000,001,345.654
-//
-// C2 --> $1,921,651.16
-// E1 --> 1.9E+006
-// F --> 1921651.16
-// G3 --> 1.92E+06
-// N --> 1,921,651.16
-// #,##0.000 --> 1,921,651.160
-// 0,000,000,000.0## --> 0,001,921,651.16
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/properties2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/properties2.cs
deleted file mode 100644
index dee3c390c4ad0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/NumberFormatInfo/csharp/properties2.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-using System;
-
-public class PropertiesEx2
-{
- public static void Main()
- {
- Decimal[] values = { 1345.6538m, 1921651.16m };
-
- foreach (var value in values)
- {
- string resultString = value.ToString();
- Console.WriteLine(resultString);
- Console.WriteLine();
- }
- }
-}
-// The example displays the following output:
-// 1345.6538
-//
-// 1921651.16
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/RegionInfo/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/RegionInfo/csharp/Project.csproj
deleted file mode 100644
index a369cfa8a8090..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/RegionInfo/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/RegionInfo/csharp/propertyvalues1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Globalization/RegionInfo/csharp/propertyvalues1.cs
deleted file mode 100644
index 18ebcf53bbdae..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Globalization/RegionInfo/csharp/propertyvalues1.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Reflection;
-
-public class Example
-{
- public static void Main()
- {
- // Instantiate three Belgian RegionInfo objects.
- RegionInfo BE = new RegionInfo("BE");
- RegionInfo frBE = new RegionInfo("fr-BE");
- RegionInfo nlBE = new RegionInfo("nl-BE");
-
- RegionInfo[] regions = { BE, frBE, nlBE };
- PropertyInfo[] props = typeof(RegionInfo).GetProperties(BindingFlags.Instance | BindingFlags.Public);
-
- Console.WriteLine("{0,-30}{1,18}{2,18}{3,18}\n",
- "RegionInfo Property", "BE", "fr-BE", "nl-BE");
- foreach (var prop in props)
- {
- Console.Write("{0,-30}", prop.Name);
- foreach (var region in regions)
- Console.Write("{0,18}", prop.GetValue(region, null));
-
- Console.WriteLine();
- }
- }
-}
-// The example displays the following output:
-// RegionInfo Property BE fr-BE nl-BE
-//
-// Name BE fr-BE nl-BE
-// EnglishName Belgium Belgium Belgium
-// DisplayName Belgium Belgium Belgium
-// NativeName België Belgique België
-// TwoLetterISORegionName BE BE BE
-// ThreeLetterISORegionName BEL BEL BEL
-// ThreeLetterWindowsRegionName BEL BEL BEL
-// IsMetric True True True
-// GeoId 21 21 21
-// CurrencyEnglishName Euro Euro Euro
-// CurrencyNativeName euro euro euro
-// CurrencySymbol € € €
-// ISOCurrencySymbol EUR EUR EUR
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/BigInteger_Examples.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/BigInteger_Examples.cs
deleted file mode 100644
index 57efe9e4e1721..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/BigInteger_Examples.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-using System;
-using System.Numerics;
-
-public class Example
-{
- public static void Main()
- {
- //
- BigInteger bigIntFromDouble = new BigInteger(179032.6541);
- Console.WriteLine(bigIntFromDouble);
- BigInteger bigIntFromInt64 = new BigInteger(934157136952);
- Console.WriteLine(bigIntFromInt64);
- // The example displays the following output:
- // 179032
- // 934157136952
- //
-
- Console.WriteLine();
-
- //
- long longValue = 6315489358112;
- BigInteger assignedFromLong = longValue;
- Console.WriteLine(assignedFromLong);
- // The example displays the following output:
- // 6315489358112
- //
-
- Console.WriteLine();
- Console.WriteLine("Casting:");
- //
- BigInteger assignedFromDouble = (BigInteger) 179032.6541;
- Console.WriteLine(assignedFromDouble);
- BigInteger assignedFromDecimal = (BigInteger) 64312.65m;
- Console.WriteLine(assignedFromDecimal);
- // The example displays the following output:
- // 179032
- // 64312
- //
-
- Console.WriteLine();
-
- //
- byte[] byteArray = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
- BigInteger newBigInt = new BigInteger(byteArray);
- Console.WriteLine($"The value of newBigInt is {newBigInt} (or 0x{newBigInt:x}).");
- // The example displays the following output:
- // The value of newBigInt is 4759477275222530853130 (or 0x102030405060708090a).
- //
-
- Console.WriteLine();
-
- //
- string positiveString = "91389681247993671255432112000000";
- string negativeString = "-90315837410896312071002088037140000";
- BigInteger posBigInt = 0;
- BigInteger negBigInt = 0;
-
- try {
- posBigInt = BigInteger.Parse(positiveString);
- Console.WriteLine(posBigInt);
- }
- catch (FormatException)
- {
- Console.WriteLine($"Unable to convert the string '{positiveString}' to a BigInteger value.");
- }
-
- if (BigInteger.TryParse(negativeString, out negBigInt))
- Console.WriteLine(negBigInt);
- else
- Console.WriteLine($"Unable to convert the string '{negativeString}' to a BigInteger value.");
-
- // The example displays the following output:
- // 9.1389681247993671255432112E+31
- // -9.0315837410896312071002088037E+34
- //
-
- Console.WriteLine();
-
- //
- BigInteger number = BigInteger.Pow(UInt64.MaxValue, 3);
- Console.WriteLine(number);
- // The example displays the following output:
- // 6277101735386680762814942322444851025767571854389858533375
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/ByteAndHex_Examples.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/ByteAndHex_Examples.cs
deleted file mode 100644
index 8d4dd1b6bda05..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/ByteAndHex_Examples.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-using System;
-using System.Globalization;
-using System.Numerics;
-
-public class ByteHexExample
-{
- public static void Main()
- {
- RoundtripBigInteger();
- Console.WriteLine();
- RoundtripInt16();
- Console.WriteLine();
- HandleSignsInByteArray();
- Console.WriteLine();
- RoundtripAmbiguous();
- Console.WriteLine();
- RoundtripWithHex();
- }
-
- private static void RoundtripBigInteger()
- {
- Console.WriteLine("Round-trip bytes");
-
- //
- BigInteger number = BigInteger.Pow(Int64.MaxValue, 2);
- Console.WriteLine(number);
-
- // Write the BigInteger value to a byte array.
- byte[] bytes = number.ToByteArray();
-
- // Display the byte array.
- foreach (byte byteValue in bytes)
- Console.Write("0x{0:X2} ", byteValue);
- Console.WriteLine();
-
- // Restore the BigInteger value from a Byte array.
- BigInteger newNumber = new BigInteger(bytes);
- Console.WriteLine(newNumber);
- // The example displays the following output:
- // 8.5070591730234615847396907784E+37
- // 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x3F
- //
- // 8.5070591730234615847396907784E+37
- //
- }
-
- private static void RoundtripInt16()
- {
- Console.WriteLine();
- Console.WriteLine("Round-trip an Int16 value:");
- //
- short originalValue = 30000;
- Console.WriteLine(originalValue);
-
- // Convert the Int16 value to a byte array.
- byte[] bytes = BitConverter.GetBytes(originalValue);
-
- // Display the byte array.
- foreach (byte byteValue in bytes)
- Console.Write("0x{0} ", byteValue.ToString("X2"));
- Console.WriteLine();
-
- // Pass byte array to the BigInteger constructor.
- BigInteger number = new BigInteger(bytes);
- Console.WriteLine(number);
- // The example displays the following output:
- // 30000
- // 0x30 0x75
- // 30000
- //
- }
-
- private static void HandleSignsInByteArray()
- {
- //
- int negativeNumber = -1000000;
- uint positiveNumber = 4293967296;
-
- byte[] negativeBytes = BitConverter.GetBytes(negativeNumber);
- BigInteger negativeBigInt = new BigInteger(negativeBytes);
- Console.WriteLine(negativeBigInt.ToString("N0"));
-
- byte[] tempPosBytes = BitConverter.GetBytes(positiveNumber);
- byte[] positiveBytes = new byte[tempPosBytes.Length + 1];
- Array.Copy(tempPosBytes, positiveBytes, tempPosBytes.Length);
- BigInteger positiveBigInt = new BigInteger(positiveBytes);
- Console.WriteLine(positiveBigInt.ToString("N0"));
- // The example displays the following output:
- // -1,000,000
- // 4,293,967,296
- //
- }
-
- private static void RoundtripAmbiguous()
- {
- Console.WriteLine("Round-trip an Ambiguous Value:");
- //
- BigInteger positiveValue = 15777216;
- BigInteger negativeValue = -1000000;
-
- Console.WriteLine("Positive value: " + positiveValue.ToString("N0"));
- byte[] bytes = positiveValue.ToByteArray();
-
- foreach (byte byteValue in bytes)
- Console.Write("{0:X2} ", byteValue);
- Console.WriteLine();
- positiveValue = new BigInteger(bytes);
- Console.WriteLine("Restored positive value: " + positiveValue.ToString("N0"));
-
- Console.WriteLine();
-
- Console.WriteLine("Negative value: " + negativeValue.ToString("N0"));
- bytes = negativeValue.ToByteArray();
- foreach (byte byteValue in bytes)
- Console.Write("{0:X2} ", byteValue);
- Console.WriteLine();
- negativeValue = new BigInteger(bytes);
- Console.WriteLine("Restored negative value: " + negativeValue.ToString("N0"));
- // The example displays the following output:
- // Positive value: 15,777,216
- // C0 BD F0 00
- // Restored positive value: 15,777,216
- //
- // Negative value: -1,000,000
- // C0 BD F0
- // Restored negative value: -1,000,000
- //
- }
-
- private static void RoundtripWithHex()
- {
- //
- BigInteger negativeNumber = -1000000;
- BigInteger positiveNumber = 15777216;
-
- string negativeHex = negativeNumber.ToString("X");
- string positiveHex = positiveNumber.ToString("X");
-
- BigInteger negativeNumber2, positiveNumber2;
- negativeNumber2 = BigInteger.Parse(negativeHex,
- NumberStyles.HexNumber);
- positiveNumber2 = BigInteger.Parse(positiveHex,
- NumberStyles.HexNumber);
-
- Console.WriteLine($"Converted {negativeNumber:N0} to {negativeHex} back to {negativeNumber2:N0}.");
- Console.WriteLine($"Converted {positiveNumber:N0} to {positiveHex} back to {positiveNumber2:N0}.");
- // The example displays the following output:
- // Converted -1,000,000 to F0BDC0 back to -1,000,000.
- // Converted 15,777,216 to 0F0BDC0 back to 15,777,216.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/ByteAndHex_Examples2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/ByteAndHex_Examples2.cs
deleted file mode 100644
index d64472f7df290..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/ByteAndHex_Examples2.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Numerics;
-
-public struct HexValue
-{
- public int Sign;
- public string Value;
-}
-
-public class ByteHexExample2
-{
- public static void Main()
- {
- uint positiveNumber = 4039543321;
- int negativeNumber = -255423975;
-
- // Convert the numbers to hex strings.
- HexValue hexValue1, hexValue2;
- hexValue1.Value = positiveNumber.ToString("X");
- hexValue1.Sign = Math.Sign(positiveNumber);
-
- hexValue2.Value = Convert.ToString(negativeNumber, 16);
- hexValue2.Sign = Math.Sign(negativeNumber);
-
- // Round-trip the hexadecimal values to BigInteger values.
- string hexString;
- BigInteger positiveBigInt, negativeBigInt;
-
- hexString = (hexValue1.Sign == 1 ? "0" : "") + hexValue1.Value;
- positiveBigInt = BigInteger.Parse(hexString, NumberStyles.HexNumber);
- Console.WriteLine($"Converted {positiveNumber} to {hexValue1.Value} and back to {positiveBigInt}.");
-
- hexString = (hexValue2.Sign == 1 ? "0" : "") + hexValue2.Value;
- negativeBigInt = BigInteger.Parse(hexString, NumberStyles.HexNumber);
- Console.WriteLine($"Converted {negativeNumber} to {hexValue2.Value} and back to {negativeBigInt}.");
- }
-}
-// The example displays the following output:
-// Converted 4039543321 to F0C68A19 and back to 4039543321.
-// Converted -255423975 to f0c68a19 and back to -255423975.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/Mutability_Examples.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/Mutability_Examples.cs
deleted file mode 100644
index 929cde2f07db5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/Mutability_Examples.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Numerics;
-
-public class MutabilityEx
-{
- public static void Main()
- {
- ShowSimpleAdd();
- PerformBigIntegerOperation();
- PerformWithIntermediary();
- }
-
- private static void ShowSimpleAdd()
- {
- //
- BigInteger number = BigInteger.Multiply(Int64.MaxValue, 3);
- number++;
- Console.WriteLine(number);
- //
- }
-
- private static void PerformBigIntegerOperation()
- {
- Stopwatch sw = Stopwatch.StartNew();
-
- //
- BigInteger number = Int64.MaxValue ^ 5;
- int repetitions = 1000000;
- // Perform some repetitive operation 1 million times.
- for (int ctr = 0; ctr <= repetitions; ctr++)
- {
- // Perform some operation. If it fails, exit the loop.
- if (!SomeOperationSucceeds()) break;
- // The following code executes if the operation succeeds.
- number++;
- }
- //
-
- sw.Stop();
- Console.WriteLine("Incrementing a BigInteger: " + sw.Elapsed.ToString());
- }
-
- private static void PerformWithIntermediary()
- {
- Stopwatch sw = Stopwatch.StartNew();
-
- //
- BigInteger number = Int64.MaxValue ^ 5;
- int repetitions = 1000000;
- int actualRepetitions = 0;
- // Perform some repetitive operation 1 million times.
- for (int ctr = 0; ctr <= repetitions; ctr++)
- {
- // Perform some operation. If it fails, exit the loop.
- if (!SomeOperationSucceeds()) break;
- // The following code executes if the operation succeeds.
- actualRepetitions++;
- }
- number += actualRepetitions;
- //
-
- sw.Stop();
- Console.WriteLine("Incrementing a BigInteger: " + sw.Elapsed.ToString());
- }
-
- private static bool SomeOperationSucceeds()
- {
- return true;
- }
-}
-
-//
-// CAPS bug: snippet2 is seen as duplicated, even though it isn't.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/BigInteger_Examples.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/BigInteger_Examples.vb
deleted file mode 100644
index 7416d8050f4fe..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/BigInteger_Examples.vb
+++ /dev/null
@@ -1,86 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Numerics
-
-Module Example1
- Public Sub Main()
- '
- Dim bigIntFromDouble As New BigInteger(179032.6541)
- Console.WriteLine(bigIntFromDouble)
- Dim bigIntFromInt64 As New BigInteger(934157136952)
- Console.WriteLine(bigIntFromInt64)
- ' The example displays the following output:
- ' 179032
- ' 934157136952
- '
-
- Console.WriteLine()
-
- '
- Dim longValue As Long = 6315489358112
- Dim assignedFromLong As BigInteger = longValue
- Console.WriteLine(assignedFromLong)
- ' The example displays the following output:
- ' 6315489358112
- '
-
- Console.WriteLine()
-
- '
- Dim assignedFromDouble As BigInteger = CType(179032.6541, BigInteger)
- Console.WriteLine(assignedFromDouble)
- Dim assignedFromDecimal As BigInteger = CType(64312.65D, BigInteger)
- Console.WriteLine(assignedFromDecimal)
- ' The example displays the following output:
- ' 179032
- ' 64312
- '
-
- Console.WriteLine()
-
- '
- Dim byteArray() As Byte = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}
- Dim newBigInt As New BigInteger(byteArray)
- Console.WriteLine("The value of newBigInt is {0} (or 0x{0:x}).", newBigInt)
- ' The example displays the following output:
- ' The value of newBigInt is 4759477275222530853130 (or 0x102030405060708090a).
- '
-
- Console.WriteLine()
-
- '
- Dim positiveString As String = "91389681247993671255432112000000"
- Dim negativeString As String = "-90315837410896312071002088037140000"
- Dim posBigInt As BigInteger = 0
- Dim negBigInt As BigInteger = 0
-
- Try
- posBigInt = BigInteger.Parse(positiveString)
- Console.WriteLine(posBigInt)
- Catch e As FormatException
- Console.WriteLine("Unable to convert the string '{0}' to a BigInteger value.",
- positiveString)
- End Try
-
- If BigInteger.TryParse(negativeString, negBigInt) Then
- Console.WriteLine(negBigInt)
- Else
- Console.WriteLine("Unable to convert the string '{0}' to a BigInteger value.",
- negativeString)
- End If
- ' The example displays the following output:
- ' 9.1389681247993671255432112E+31
- ' -9.0315837410896312071002088037E+34
- '
-
- Console.WriteLine()
-
- '
- Dim number As BigInteger = BigInteger.Pow(UInt64.MaxValue, 3)
- Console.WriteLine(number)
- ' The example displays the following output:
- ' 6277101735386680762814942322444851025767571854389858533375
- '
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/ByteAndHex_Examples.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/ByteAndHex_Examples.vb
deleted file mode 100644
index 3cf3022a05fa9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/ByteAndHex_Examples.vb
+++ /dev/null
@@ -1,154 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Globalization
-Imports System.Numerics
-
-Module Example
- Public Sub Main()
- RoundtripBigInteger()
- Console.WriteLIne()
- RoundtripInt16()
- Console.WriteLine()
- HandleSignsInByteArray()
- Console.WriteLine()
- RoundtripAmbiguous()
- Console.WriteLine()
- RoundtripWithHex()
- Console.WriteLine()
- End Sub
-
- Private Sub RoundTripBigInteger()
- Console.WriteLine("Round-trip bytes")
-
- '
- Dim number As BigInteger = BigInteger.Pow(Int64.MaxValue, 2)
- Console.WriteLine(number)
-
- ' Write the BigInteger value to a byte array.
- Dim bytes() As Byte = number.ToByteArray()
-
- ' Display the byte array.
- For Each byteValue As Byte In bytes
- Console.Write("0x{0:X2} ", byteValue)
- Next
- Console.WriteLine()
-
- ' Restore the BigInteger value from a Byte array.
- Dim newNumber As BigInteger = New BigInteger(bytes)
- Console.WriteLine(newNumber)
- ' The example displays the following output:
- ' 8.5070591730234615847396907784E+37
- ' 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x3F
- '
- ' 8.5070591730234615847396907784E+37
- '
- End Sub
-
- Private Sub RoundTripInt16()
- Console.WriteLine()
- Console.WriteLine("Round-trip an Int16 value:")
- '
- Dim originalValue As Short = 30000
- Console.WriteLine(originalValue)
-
- ' Convert the Int16 value to a byte array.
- Dim bytes() As Byte = BitConverter.GetBytes(originalValue)
-
- ' Display the byte array.
- For Each byteValue As Byte In bytes
- Console.Write("0x{0} ", byteValue.ToString("X2"))
- Next
- Console.WriteLine()
-
- ' Pass byte array to the BigInteger constructor.
- Dim number As BigInteger = New BigInteger(bytes)
- Console.WriteLine(number)
- ' The example displays the following output:
- ' 30000
- ' 0x30 0x75
- ' 30000
- '
- End Sub
-
- PRivate Sub HandleSignsInByteArray()
- '
- Dim negativeNumber As Integer = -1000000
- Dim positiveNumber As UInteger = 4293967296
-
- Dim negativeBytes() As Byte = BitConverter.GetBytes(negativeNumber)
- Dim negativeBigInt As New BigInteger(negativeBytes)
- Console.WriteLine(negativeBigInt.ToString("N0"))
-
- Dim tempPosBytes() As Byte = BitConverter.GetBytes(positiveNumber)
- Dim positiveBytes(tempposBytes.Length) As Byte
- Array.Copy(tempPosBytes, positiveBytes, tempPosBytes.Length)
- Dim positiveBigInt As New BigInteger(positiveBytes)
- Console.WriteLine(positiveBigInt.ToString("N0"))
- ' The example displays the following output:
- ' -1,000,000
- ' 4,293,967,296
- '
- End Sub
-
- Private Sub RoundtripAmbiguous()
- '
- Dim positiveValue As BigInteger = 15777216
- Dim negativeValue As BigInteger = -1000000
-
- Console.WriteLine("Positive value: " + positiveValue.ToString("N0"))
- Dim bytes() As Byte = positiveValue.ToByteArray()
- For Each byteValue As Byte In bytes
- Console.Write("{0:X2} ", byteValue)
- Next
- Console.WriteLine()
- positiveValue = New BigInteger(bytes)
- Console.WriteLine("Restored positive value: " + positiveValue.ToString("N0"))
-
- Console.WriteLine()
-
- Console.WriteLIne("Negative value: " + negativeValue.ToString("N0"))
- bytes = negativeValue.ToByteArray()
- For Each byteValue As Byte In bytes
- Console.Write("{0:X2} ", byteValue)
- Next
- Console.WriteLine()
- negativeValue = New BigInteger(bytes)
- Console.WriteLine("Restored negative value: " + negativeValue.ToString("N0"))
- ' The example displays the following output:
- ' Positive value: 15,777,216
- ' C0 BD F0 00
- ' Restored positive value: 15,777,216
- '
- ' Negative value: -1,000,000
- ' C0 BD F0
- ' Restored negative value: -1,000,000
- '
- End Sub
-
- Private Sub RoundtripWithHex()
- '
- Dim negativeNumber As BigInteger = -1000000
- Dim positiveNumber As BigInteger = 15777216
-
- Dim negativeHex As String = negativeNumber.ToString("X")
- Dim positiveHex As string = positiveNumber.ToString("X")
-
- Dim negativeNumber2, positiveNumber2 As BigInteger
- negativeNumber2 = BigInteger.Parse(negativeHex,
- NumberStyles.HexNumber)
- positiveNumber2 = BigInteger.Parse(positiveHex,
- NumberStyles.HexNumber)
-
- Console.WriteLine("Converted {0:N0} to {1} back to {2:N0}.",
- negativeNumber, negativeHex, negativeNumber2)
- Console.WriteLine("Converted {0:N0} to {1} back to {2:N0}.",
- positiveNumber, positiveHex, positiveNumber2)
- ' The example displays the following output:
- ' Converted -1,000,000 to F0BDC0 back to -1,000,000.
- ' Converted 15,777,216 to 0F0BDC0 back to 15,777,216.
- '
- End Sub
-
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/ByteAndHex_Examples2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/ByteAndHex_Examples2.vb
deleted file mode 100644
index 6f649590f1ced..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/ByteAndHex_Examples2.vb
+++ /dev/null
@@ -1,45 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Numerics
-
-Public Structure HexValue
- Public Sign As Integer
- Public Value As String
-End Structure
-
-Module Example2
- Public Sub Main()
- Dim positiveNumber As UInteger = 4039543321
- Dim negativeNumber As Integer = -255423975
-
- ' Convert the numbers to hex strings.
- Dim hexValue1, hexValue2 As HexValue
- hexValue1.Value = positiveNumber.ToString("X")
- hexValue1.Sign = Math.Sign(positiveNumber)
-
- hexValue2.Value = Convert.ToString(negativeNumber, 16)
- hexValue2.Sign = Math.Sign(negativeNumber)
-
- ' Round-trip the hexadecimal values to BigInteger values.
- Dim hexString As String
- Dim positiveBigInt, negativeBigInt As BigInteger
-
- hexString = CStr(IIf(hexValue1.Sign = 1, "0", "")) + hexValue1.Value
- positiveBigInt = BigInteger.Parse(hexString, NumberStyles.HexNumber)
- Console.WriteLine("Converted {0} to {1} and back to {2}.",
- positiveNumber, hexValue1.Value, positiveBigInt)
-
- hexString = CStr(IIf(hexValue2.Sign = 1, "0", "")) + hexValue2.Value
- negativeBigInt = BigInteger.Parse(hexString, NumberStyles.HexNumber)
- Console.WriteLine("Converted {0} to {1} and back to {2}.",
- negativeNumber, hexValue2.Value, negativeBigInt)
-
- End Sub
-End Module
-' The example displays the following output:
-' Converted 4039543321 to F0C68A19 and back to 4039543321.
-' Converted -255423975 to f0c68a19 and back to -255423975.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/Mutability_Examples.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/Mutability_Examples.vb
deleted file mode 100644
index 015b627a072b3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/Mutability_Examples.vb
+++ /dev/null
@@ -1,69 +0,0 @@
-' Visual Basic .NET Document
-'Option Strict On
-
-Imports System.Diagnostics
-Imports System.Numerics
-
-Module Example3
- Public Sub Main()
- ShowSimpleAdd()
- PerformBigIntegerOperation()
- PerformWithIntermediary()
- End Sub
-
- Private Sub ShowSimpleAdd()
- '
- Dim number As BigInteger = BigInteger.Multiply(Int64.MaxValue, 3)
- number += 1
- Console.WriteLine(number)
- '
- End Sub
-
- Private Sub PerformBigIntegerOperation()
- Dim sw As Stopwatch = Stopwatch.StartNew()
-
- '
- Dim number As BigInteger = Int64.MaxValue ^ 5
- Dim repetitions As Integer = 1000000
- ' Perform some repetitive operation 1 million times.
- For ctr As Integer = 0 To repetitions
- ' Perform some operation. If it fails, exit the loop.
- If Not SomeOperationSucceeds() Then Exit For
- ' The following code executes if the operation succeeds.
- number += 1
- Next
- '
-
- sw.Stop()
- Console.WriteLine("Incrementing a BigInteger: " + sw.Elapsed.ToString())
- End Sub
-
- Private Sub PerformWithIntermediary()
- Dim sw As Stopwatch = Stopwatch.StartNew()
-
- '
- Dim number As BigInteger = Int64.MaxValue ^ 5
- Dim repetitions As Integer = 1000000
- Dim actualRepetitions As Integer = 0
- ' Perform some repetitive operation 1 million times.
- For ctr As Integer = 0 To repetitions
- ' Perform some operation. If it fails, exit the loop.
- If Not SomeOperationSucceeds() Then Exit For
- ' The following code executes if the operation succeeds.
- actualRepetitions += 1
- Next
- number += actualRepetitions
- '
-
- sw.Stop()
- Console.WriteLine("Incrementing a BigInteger: " + sw.Elapsed.ToString())
- End Sub
-
- Private Function SomeOperationSucceeds() As Boolean
- Return True
- End Function
-End Module
-
-'
-' CAPS bug: snippet2 is seen as duplicated, even though it isn't.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/BigInteger/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Program.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Program.cs
deleted file mode 100644
index 99e6662d51bc0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Program.cs
+++ /dev/null
@@ -1 +0,0 @@
-CustomFormatEx.Run();
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Project.csproj
deleted file mode 100644
index f99395b4b2b39..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Exe
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/create1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/create1.cs
deleted file mode 100644
index 10d20d59111f9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/create1.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-using System;
-using System.Numerics;
-
-public class CreateEx
-{
- public static void Run()
- {
- // Create a complex number by calling its class constructor.
- Complex c1 = new Complex(12, 6);
- Console.WriteLine(c1);
-
- // Assign a Double to a complex number.
- Complex c2 = 3.14;
- Console.WriteLine(c2);
-
- // Cast a Decimal to a complex number.
- Complex c3 = (Complex)12.3m;
- Console.WriteLine(c3);
-
- // Assign the return value of a method to a Complex variable.
- Complex c4 = Complex.Pow(Complex.One, -1);
- Console.WriteLine(c4);
-
- // Assign the value returned by an operator to a Complex variable.
- Complex c5 = Complex.One + Complex.One;
- Console.WriteLine(c5);
-
- // Instantiate a complex number from its polar coordinates.
- Complex c6 = Complex.FromPolarCoordinates(10, .524);
- Console.WriteLine(c6);
- }
-}
-// The example displays the following output:
-// (12, 6)
-// (3.14, 0)
-// (12.3, 0)
-// (1, 0)
-// (2, 0)
-// (8.65824721882145, 5.00347430269914)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/customfmt1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/customfmt1.cs
deleted file mode 100644
index 6040075babea1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/customfmt1.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-using System;
-using System.Numerics;
-
-public class ComplexFormatter : IFormatProvider, ICustomFormatter
-{
- public object GetFormat(Type formatType)
- {
- if (formatType == typeof(ICustomFormatter))
- return this;
- else
- return null;
- }
-
- public string Format(string format, object arg,
- IFormatProvider provider)
- {
- if (arg is Complex c1)
- {
- // Check if the format string has a precision specifier.
- int precision;
- string fmtString = string.Empty;
- if (format.Length > 1)
- {
- try
- {
- precision = int.Parse(format.Substring(1));
- }
- catch (FormatException)
- {
- precision = 0;
- }
- fmtString = "N" + precision.ToString();
- }
- if (format.Substring(0, 1).Equals("I", StringComparison.OrdinalIgnoreCase))
- {
- // Determine the sign to display.
- char sign = c1.Imaginary < 0 ? '-' : '+';
- // Display the determined sign and the absolute value of the imaginary part.
- return c1.Real.ToString(fmtString) + " " + sign + " " + Math.Abs(c1.Imaginary).ToString(fmtString) + "i";
- }
- else if (format.Substring(0, 1).Equals("J", StringComparison.OrdinalIgnoreCase))
- {
- // Determine the sign to display.
- char sign = c1.Imaginary < 0 ? '-' : '+';
- // Display the determined sign and the absolute value of the imaginary part.
- return c1.Real.ToString(fmtString) + " " + sign + " " + Math.Abs(c1.Imaginary).ToString(fmtString) + "j";
- }
- else
- return c1.ToString(format, provider);
- }
- else
- {
- if (arg is IFormattable formattable)
- return formattable.ToString(format, provider);
- else if (arg != null)
- return arg.ToString();
- else
- return string.Empty;
- }
- }
-}
-//
-
-//
-public class CustomFormatEx
-{
- public static void Run()
- {
- Complex c1 = new(12.1, 15.4);
- Console.WriteLine($"Formatting with ToString: {c1}");
- Console.WriteLine($"Formatting with ToString(format): {c1:N2}");
- Console.WriteLine($"Custom formatting with I0:\t" +
- $" {string.Format(new ComplexFormatter(), "{0:I0}", c1)}");
- Console.WriteLine($"Custom formatting with J3:\t" +
- $" {string.Format(new ComplexFormatter(), "{0:J3}", c1)}");
- }
-}
-
-// The example displays the following output:
-// Formatting with ToString(): <12.1; 15.4>
-// Formatting with ToString(format): <12.10; 15.40>
-// Custom formatting with I0: 12 + 15i
-// Custom formatting with J3: 12.100 + 15.400j
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/nan1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/nan1.cs
deleted file mode 100644
index c91485224155b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/nan1.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-using System;
-using System.Numerics;
-
-public class NaNEx
-{
- public static void Run()
- {
- Complex c1 = new Complex(Double.MaxValue / 2, Double.MaxValue / 2);
-
- Complex c2 = c1 / Complex.Zero;
- Console.WriteLine(c2.ToString());
- c2 = c2 * new Complex(1.5, 1.5);
- Console.WriteLine(c2.ToString());
- Console.WriteLine();
-
- Complex c3 = c1 * new Complex(2.5, 3.5);
- Console.WriteLine(c3.ToString());
- c3 = c3 + new Complex(Double.MinValue / 2, Double.MaxValue / 2);
- Console.WriteLine(c3);
- }
-}
-// The example displays the following output:
-// (NaN, NaN)
-// (NaN, NaN)
-// (NaN, Infinity)
-// (NaN, Infinity)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/precision1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/precision1.cs
deleted file mode 100644
index c2e851c3b5a49..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/precision1.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Numerics;
-
-public class PrecisionEx
-{
- public static void Run()
- {
- //
- Complex value = new Complex(Double.MinValue / 2, Double.MinValue / 2);
- Complex value2 = Complex.Exp(Complex.Log(value));
- Console.WriteLine($"{value} \n{value2} \nEqual: {value == value2}");
- // The example displays the following output:
- // (-8.98846567431158E+307, -8.98846567431158E+307)
- // (-8.98846567431161E+307, -8.98846567431161E+307)
- // Equal: False
- //
-
- Console.WriteLine();
- ShowPlatform();
- }
-
- private static void ShowPlatform()
- {
- //
- Complex minusOne = new Complex(-1, 0);
- Console.WriteLine(Complex.Sqrt(minusOne));
- // The example displays the following output:
- // (6.12303176911189E-17, 1) on 32-bit systems.
- // (6.12323399573677E-17,1) on IA64 systems.
- //
- }
-}
-
-// Complex minusOne = new Complex(-1,0);
-// Complex.Sqrt(minusOne) returns Complex(6.12303176911189E-17, 1) where as it returns Complex on IA64.
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Program.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Program.vb
deleted file mode 100644
index 8cd0a0ebcc1ee..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Program.vb
+++ /dev/null
@@ -1,5 +0,0 @@
-Public Class Program
- Public Shared Sub Main()
- Example2.Run()
- End Sub
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Project.vbproj
deleted file mode 100644
index f99395b4b2b39..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Exe
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/create1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/create1.vb
deleted file mode 100644
index fdfaf39259663..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/create1.vb
+++ /dev/null
@@ -1,41 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Numerics
-
-Module Example
- Public Sub Run()
- ' Create a complex number by calling its class constructor.
- Dim c1 As New Complex(12, 6)
- Console.WriteLine(c1)
-
- ' Assign a Double to a complex number.
- Dim c2 As Complex = 3.14
- Console.WriteLine(c2)
-
- ' Cast a Decimal to a complex number.
- Dim c3 As Complex = CType(12.3d, Complex)
- Console.WriteLine(c3)
-
- ' Assign the return value of a method to a Complex variable.
- Dim c4 As Complex = Complex.Pow(Complex.One, -1)
- Console.WriteLine(c4)
-
- ' Assign the value returned by an operator to a Complex variable.
- Dim c5 As Complex = Complex.One + Complex.One
- Console.WriteLine(c5)
-
- ' Instantiate a complex number from its polar coordinates.
- Dim c6 As Complex = Complex.FromPolarCoordinates(10, .524)
- Console.WriteLine(c6)
- End Sub
-End Module
-' The example displays the following output:
-' (12, 6)
-' (3.14, 0)
-' (12.3000001907349, 0)
-' (1, 0)
-' (2, 0)
-' (8.65824721882145, 5.00347430269914)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/customfmt1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/customfmt1.vb
deleted file mode 100644
index 61ee5de6b18c6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/customfmt1.vb
+++ /dev/null
@@ -1,76 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Numerics
-
-Public Class ComplexFormatter
- Implements IFormatProvider, ICustomFormatter
-
- Public Function GetFormat(formatType As Type) As Object _
- Implements IFormatProvider.GetFormat
- If formatType Is GetType(ICustomFormatter) Then
- Return Me
- Else
- Return Nothing
- End If
- End Function
-
- Public Function Format(fmt As String, arg As Object,
- provider As IFormatProvider) As String _
- Implements ICustomFormatter.Format
- If TypeOf arg Is Complex Then
- Dim c1 As Complex = DirectCast(arg, Complex)
- ' Check if the format string has a precision specifier.
- Dim precision As Integer
- Dim fmtString As String = String.Empty
- If fmt.Length > 1 Then
- Try
- precision = Integer.Parse(fmt.Substring(1))
- Catch e As FormatException
- precision = 0
- End Try
- fmtString = "N" + precision.ToString()
- End If
- ' Determine the sign to display.
- Dim sign As Char = If(c1.Imaginary < 0.0, "-"c, "+"c)
- ' Display the determined sign and the absolute value of the imaginary part.
- If fmt.Substring(0, 1).Equals("I", StringComparison.OrdinalIgnoreCase) Then
- Return c1.Real.ToString(fmtString) + " " + sign + " " + Math.Abs(c1.Imaginary).ToString(fmtString) + "i"
- ElseIf fmt.Substring(0, 1).Equals("J", StringComparison.OrdinalIgnoreCase) Then
- Return c1.Real.ToString(fmtString) + " " + sign + " " + Math.Abs(c1.Imaginary).ToString(fmtString) + "j"
- Else
- Return c1.ToString(fmt, provider)
- End If
- Else
- If TypeOf arg Is IFormattable Then
- Return DirectCast(arg, IFormattable).ToString(fmt, provider)
- ElseIf arg IsNot Nothing Then
- Return arg.ToString()
- Else
- Return String.Empty
- End If
- End If
- End Function
-End Class
-'
-
-'
-Module Example2
- Public Sub Run()
- Dim c1 As New Complex(12.1, 15.4)
- Console.WriteLine($"Formatting with ToString(): {c1}")
- Console.WriteLine($"Formatting with ToString(format): {c1:N2}")
- Console.WriteLine($"Custom formatting with I0: " +
- $"{String.Format(New ComplexFormatter(), "{0:I0}", c1)}")
- Console.WriteLine($"Custom formatting with J3: " +
- $"{String.Format(New ComplexFormatter(), "{0:J3}", c1)}")
- End Sub
-End Module
-
-' The example displays the following output:
-' Formatting with ToString(): <12.1; 15.4>
-' Formatting with ToString(format): <12.10; 15.40>
-' Custom formatting with I0: 12 + 15i
-' Custom formatting with J3: 12.100 + 15.400j
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/nan1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/nan1.vb
deleted file mode 100644
index b794990719e2c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/nan1.vb
+++ /dev/null
@@ -1,29 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Numerics
-
-Module Example4
- Public Sub Run()
- Dim c1 As Complex = New Complex(Double.MaxValue / 2, Double.MaxValue / 2)
-
- Dim c2 As Complex = c1 / Complex.Zero
- Console.WriteLine(c2.ToString())
- c2 = c2 * New Complex(1.5, 1.5)
- Console.WriteLine(c2.ToString())
- Console.WriteLine()
-
- Dim c3 As Complex = c1 * New Complex(2.5, 3.5)
- Console.WriteLine(c3.ToString())
- c3 = c3 + New Complex(Double.MinValue / 2, Double.MaxValue / 2)
- Console.WriteLine(c3)
- End Sub
-End Module
-' The example displays the following output:
-' (NaN, NaN)
-' (NaN, NaN)
-'
-' (NaN, Infinity)
-' (NaN, Infinity)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/precision1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/precision1.vb
deleted file mode 100644
index 32247a08f2201..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/precision1.vb
+++ /dev/null
@@ -1,35 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Numerics
-
-Module Example3
- Public Sub Run()
- '
- Dim value As New Complex(Double.MinValue / 2, Double.MinValue / 2)
- Dim value2 As Complex = Complex.Exp(Complex.Log(value))
- Console.WriteLine("{0} {3}{1} {3}Equal: {2}", value, value2,
- value = value2,
- vbCrLf)
- ' The example displays the following output:
- ' (-8.98846567431158E+307, -8.98846567431158E+307)
- ' (-8.98846567431161E+307, -8.98846567431161E+307)
- ' Equal: False
- '
-
- Console.WriteLine()
- ShowPlatform()
- End Sub
-
-
- Private Sub ShowPlatform()
- '
- Dim minusOne As New Complex(-1, 0)
- Console.WriteLine(Complex.Sqrt(minusOne))
- ' The example displays the following output:
- ' (6.12303176911189E-17, 1) on 32-bit systems.
- ' (6.12323399573677E-17,1) on IA64 systems.
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/csharp/Project.csproj
deleted file mode 100644
index a369cfa8a8090..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/csharp/source.cs
deleted file mode 100644
index 80fb4ba4ff306..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/csharp/source.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-
-// These classes are for demonstration purposes.
-//
-public class Example
-{
- private int id = 0;
- public Example(int id)
- {
- this.id = id;
- }
- public int ID { get { return id; }}
-}
-
-public class DerivedFromExample : Example
-{
- public DerivedFromExample(int id) : base(id) {}
-}
-
-// Two delegates are declared: UseLikeInstance treats the dynamic
-// method as if it were an instance method, and UseLikeStatic
-// treats the dynamic method in the ordinary fashion.
-//
-public delegate int UseLikeInstance(int newID);
-public delegate int UseLikeStatic(Example ex, int newID);
-
-public class Demo
-{
- public static void Main()
- {
- // This dynamic method changes the private id field. It has
- // no name; it returns the old id value (return type int);
- // it takes two parameters, an instance of Example and
- // an int that is the new value of id; and it is declared
- // with Example as the owner type, so it can access all
- // members, public and private.
- //
- DynamicMethod changeID = new DynamicMethod(
- "",
- typeof(int),
- new Type[] { typeof(Example), typeof(int) },
- typeof(Example)
- );
-
- // Get a FieldInfo for the private field 'id'.
- FieldInfo fid = typeof(Example).GetField(
- "id",
- BindingFlags.NonPublic | BindingFlags.Instance
- );
-
- ILGenerator ilg = changeID.GetILGenerator();
-
- // Push the current value of the id field onto the
- // evaluation stack. It's an instance field, so load the
- // instance of Example before accessing the field.
- ilg.Emit(OpCodes.Ldarg_0);
- ilg.Emit(OpCodes.Ldfld, fid);
-
- // Load the instance of Example again, load the new value
- // of id, and store the new field value.
- ilg.Emit(OpCodes.Ldarg_0);
- ilg.Emit(OpCodes.Ldarg_1);
- ilg.Emit(OpCodes.Stfld, fid);
-
- // The original value of the id field is now the only
- // thing on the stack, so return from the call.
- ilg.Emit(OpCodes.Ret);
-
- // Create a delegate that uses changeID in the ordinary
- // way, as a static method that takes an instance of
- // Example and an int.
- //
- UseLikeStatic uls =
- (UseLikeStatic) changeID.CreateDelegate(
- typeof(UseLikeStatic)
- );
-
- // Create an instance of Example with an id of 42.
- //
- Example ex = new Example(42);
-
- // Create a delegate that is bound to the instance of
- // of Example. This is possible because the first
- // parameter of changeID is of type Example. The
- // delegate has all the parameters of changeID except
- // the first.
- UseLikeInstance uli =
- (UseLikeInstance) changeID.CreateDelegate(
- typeof(UseLikeInstance),
- ex
- );
-
- // First, change the value of id by calling changeID as
- // a static method, passing in the instance of Example.
- //
- Console.WriteLine(
- "Change the value of id; previous value: {0}",
- uls(ex, 1492)
- );
-
- // Change the value of id again using the delegate bound
- // to the instance of Example.
- //
- Console.WriteLine(
- "Change the value of id; previous value: {0}",
- uli(2700)
- );
-
- Console.WriteLine("Final value of id: {0}", ex.ID);
-
- // Now repeat the process with a class that derives
- // from Example.
- //
- DerivedFromExample dfex = new DerivedFromExample(71);
-
- uli = (UseLikeInstance) changeID.CreateDelegate(
- typeof(UseLikeInstance),
- dfex
- );
-
- Console.WriteLine(
- "Change the value of id; previous value: {0}",
- uls(dfex, 73)
- );
- Console.WriteLine(
- "Change the value of id; previous value: {0}",
- uli(79)
- );
- Console.WriteLine("Final value of id: {0}", dfex.ID);
- }
-}
-
-/* This code example produces the following output:
-
-Change the value of id; previous value: 42
-Change the value of id; previous value: 1492
-Final value of id: 2700
-Change the value of id; previous value: 71
-Change the value of id; previous value: 73
-Final value of id: 79
- */
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/csharp/source1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/csharp/source1.cs
deleted file mode 100644
index c66da33c26c77..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/csharp/source1.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-
-public class Test
-{
- // Declare a delegate that will be used to execute the completed
- // dynamic method.
- private delegate int HelloInvoker(string msg, int ret);
-
- public static void Main()
- {
- // Create an array that specifies the types of the parameters
- // of the dynamic method. This method has a string parameter
- // and an int parameter.
- Type[] helloArgs = {typeof(string), typeof(int)};
-
- // Create a dynamic method with the name "Hello", a return type
- // of int, and two parameters whose types are specified by the
- // array helloArgs. Create the method in the module that
- // defines the Test class.
- DynamicMethod hello = new DynamicMethod("Hello",
- typeof(int),
- helloArgs,
- typeof(Test).Module);
-
- //
- // Create an array that specifies the parameter types of the
- // overload of Console.WriteLine to be used in Hello.
- Type[] writeStringArgs = {typeof(string)};
- // Get the overload of Console.WriteLine that has one
- // String parameter.
- MethodInfo writeString =
- typeof(Console).GetMethod("WriteLine", writeStringArgs);
-
- // Get an ILGenerator and emit a body for the dynamic method.
- ILGenerator il = hello.GetILGenerator();
- // Load the first argument, which is a string, onto the stack.
- il.Emit(OpCodes.Ldarg_0);
- // Call the overload of Console.WriteLine that prints a string.
- il.EmitCall(OpCodes.Call, writeString, null);
- // The Hello method returns the value of the second argument;
- // to do this, load the second argument onto the stack and return.
- il.Emit(OpCodes.Ldarg_1);
- il.Emit(OpCodes.Ret);
- //
-
- //
- // Create a delegate that represents the dynamic method. This
- // action completes the method. Further attempts to change the
- // method are ignored and no exception is thrown.
- HelloInvoker hi =
- (HelloInvoker) hello.CreateDelegate(typeof(HelloInvoker));
- //
-
- // Use the delegate to execute the dynamic method. Save and
- // print the return value.
- int retval = hi("\r\nHello, World!", 42);
- Console.WriteLine("Executing delegate hi(\"Hello, World!\", 42) returned {0}",
- retval);
-
- // Do it again, with different arguments.
- retval = hi("\r\nHi, Mom!", 5280);
- Console.WriteLine("Executing delegate hi(\"Hi, Mom!\", 5280) returned {0}",
- retval);
-
- //
- // Create an array of arguments to use with the Invoke method.
- object[] invokeArgs = {"\r\nHello, World!", 42};
- // Invoke the dynamic method using the arguments. This is much
- // slower than using the delegate, because you must create an
- // array to contain the arguments, and ValueType arguments
- // must be boxed.
- object objRet = hello.Invoke(null, invokeArgs);
- Console.WriteLine("hello.Invoke returned {0}", objRet);
- //
- }
-}
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/vb/Project.vbproj
deleted file mode 100644
index a369cfa8a8090..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/vb/source.vb
deleted file mode 100644
index 4daa8540d9153..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/vb/source.vb
+++ /dev/null
@@ -1,157 +0,0 @@
-'
-Imports System.Reflection
-Imports System.Reflection.Emit
-
-' These classes are for demonstration purposes.
-'
-Public Class Example
- Private _id As Integer = 0
-
- Public Sub New(ByVal newId As Integer)
- _id = newId
- End Sub
-
- Public ReadOnly Property ID() As Integer
- Get
- Return _id
- End Get
- End Property
-End Class
-
-Public Class DerivedFromExample
- Inherits Example
-
- Public Sub New(ByVal newId As Integer)
- MyBase.New(newId)
- End Sub
-End Class
-
-' Two delegates are declared: UseLikeInstance treats the dynamic
-' method as if it were an instance method, and UseLikeStatic
-' treats the dynamic method in the ordinary fashion.
-'
-Public Delegate Function UseLikeInstance(ByVal newID As Integer) _
- As Integer
-Public Delegate Function UseLikeStatic(ByVal ex As Example, _
- ByVal newID As Integer) As Integer
-
-Public Class Demo
-
- Public Shared Sub Main()
- ' This dynamic method changes the private _id field. It
- ' has no name; it returns the old _id value (return type
- ' Integer); it takes two parameters, an instance of Example
- ' and an Integer that is the new value of _id; and it is
- ' declared with Example as the owner type, so it can
- ' access all members, public and private.
- '
- Dim changeID As New DynamicMethod( _
- "", _
- GetType(Integer), _
- New Type() {GetType(Example), GetType(Integer)}, _
- GetType(Example) _
- )
-
- ' Get a FieldInfo for the private field '_id'.
- Dim fid As FieldInfo = GetType(Example).GetField( _
- "_id", _
- BindingFlags.NonPublic Or BindingFlags.Instance _
- )
-
- Dim ilg As ILGenerator = changeID.GetILGenerator()
-
- ' Push the current value of the id field onto the
- ' evaluation stack. It's an instance field, so load the
- ' instance of Example before accessing the field.
- ilg.Emit(OpCodes.Ldarg_0)
- ilg.Emit(OpCodes.Ldfld, fid)
-
- ' Load the instance of Example again, load the new value
- ' of id, and store the new field value.
- ilg.Emit(OpCodes.Ldarg_0)
- ilg.Emit(OpCodes.Ldarg_1)
- ilg.Emit(OpCodes.Stfld, fid)
-
- ' The original value of the id field is now the only
- ' thing on the stack, so return from the call.
- ilg.Emit(OpCodes.Ret)
-
-
- ' Create a delegate that uses changeID in the ordinary
- ' way, as a static method that takes an instance of
- ' Example and an Integer.
- '
- Dim uls As UseLikeStatic = CType( _
- changeID.CreateDelegate(GetType(UseLikeStatic)), _
- UseLikeStatic _
- )
-
- ' Create an instance of Example with an id of 42.
- '
- Dim ex As New Example(42)
-
- ' Create a delegate that is bound to the instance of
- ' of Example. This is possible because the first
- ' parameter of changeID is of type Example. The
- ' delegate has all the parameters of changeID except
- ' the first.
- Dim uli As UseLikeInstance = CType( _
- changeID.CreateDelegate( _
- GetType(UseLikeInstance), _
- ex), _
- UseLikeInstance _
- )
-
- ' First, change the value of _id by calling changeID as
- ' a static method, passing in the instance of Example.
- '
- Console.WriteLine( _
- "Change the value of _id; previous value: {0}", _
- uls(ex, 1492) _
- )
-
- ' Change the value of _id again using the delegate
- ' bound to the instance of Example.
- '
- Console.WriteLine( _
- "Change the value of _id; previous value: {0}", _
- uli(2700) _
- )
-
- Console.WriteLine("Final value of _id: {0}", ex.ID)
-
-
- ' Now repeat the process with a class that derives
- ' from Example.
- '
- Dim dfex As New DerivedFromExample(71)
-
- uli = CType( _
- changeID.CreateDelegate( _
- GetType(UseLikeInstance), _
- dfex), _
- UseLikeInstance _
- )
-
- Console.WriteLine( _
- "Change the value of _id; previous value: {0}", _
- uls(dfex, 73) _
- )
- Console.WriteLine( _
- "Change the value of _id; previous value: {0}", _
- uli(79) _
- )
- Console.WriteLine("Final value of _id: {0}", dfex.ID)
-
- End Sub
-End Class
-
-' This code example produces the following output:
-'
-'Change the value of _id; previous value: 42
-'Change the value of _id; previous value: 1492
-'Final value of _id: 2700
-'Change the value of _id; previous value: 71
-'Change the value of _id; previous value: 73
-'Final value of _id: 79'
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/vb/source1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/vb/source1.vb
deleted file mode 100644
index 4f699871bbf82..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/.ctor/vb/source1.vb
+++ /dev/null
@@ -1,92 +0,0 @@
-'
-Imports System.Reflection
-Imports System.Reflection.Emit
-
-Public Class Test
- ' Declare a delegate that will be used to execute the completed
- ' dynamic method.
- Private Delegate Function HelloInvoker(ByVal msg As String, _
- ByVal ret As Integer) As Integer
-
- Public Shared Sub Main()
- ' Create an array that specifies the types of the parameters
- ' of the dynamic method. This method has a String parameter
- ' and an Integer parameter.
- Dim helloArgs() As Type = {GetType(String), GetType(Integer)}
-
- ' Create a dynamic method with the name "Hello", a return type
- ' of Integer, and two parameters whose types are specified by
- ' the array helloArgs. Create the method in the module that
- ' defines the Test class.
- Dim hello As New DynamicMethod("Hello", _
- GetType(Integer), _
- helloArgs, _
- GetType(Test).Module)
-
- '
- ' Create an array that specifies the parameter types of the
- ' overload of Console.WriteLine to be used in Hello.
- Dim writeStringArgs() As Type = {GetType(String)}
- ' Get the overload of Console.WriteLine that has one
- ' String parameter.
- Dim writeString As MethodInfo = GetType(Console). _
- GetMethod("WriteLine", writeStringArgs)
-
- ' Get an ILGenerator and emit a body for the dynamic method.
- Dim il As ILGenerator = hello.GetILGenerator()
- ' Load the first argument, which is a string, onto the stack.
- il.Emit(OpCodes.Ldarg_0)
- ' Call the overload of Console.WriteLine that prints a string.
- il.EmitCall(OpCodes.Call, writeString, Nothing)
- ' The Hello method returns the value of the second argument;
- ' to do this, load the second argument onto the stack and return.
- il.Emit(OpCodes.Ldarg_1)
- il.Emit(OpCodes.Ret)
- '
-
- '
- ' Create a delegate that represents the dynamic method. This
- ' action completes the method, and any further attempts to
- ' change the method are ignored and don't throw an exception.
- Dim hi As HelloInvoker = _
- hello.CreateDelegate(GetType(HelloInvoker))
- '
-
- ' Use the delegate to execute the dynamic method. Save and
- ' print the return value.
- Dim retval As Integer = hi(vbCrLf & "Hello, World!", 42)
- Console.WriteLine("Executing delegate hi(""Hello, World!"", 42) returned " _
- & retval)
-
- ' Do it again, with different arguments.
- retval = hi(vbCrLf & "Hi, Mom!", 5280)
- Console.WriteLine("Executing delegate hi(""Hi, Mom!"", 5280) returned " _
- & retval)
-
- '
- ' Create an array of arguments to use with the Invoke method.
- Dim invokeArgs() As Object = {vbCrLf & "Hello, World!", 42}
- ' Invoke the dynamic method using the arguments. This is much
- ' slower than using the delegate, because you must create an
- ' array to contain the arguments, and ValueType arguments
- ' must be boxed. Note that this overload of Invoke is
- ' inherited from MethodBase, and simply calls the more
- ' complete overload of Invoke.
- Dim objRet As Object = hello.Invoke(Nothing, invokeArgs)
- Console.WriteLine("hello.Invoke returned " & objRet)
- '
- End Sub
-End Class
-
-' This code example produces the following output:
-'
-'Hello, World!
-'Executing delegate hi("Hello, World!", 42) returned 42
-'
-'Hi, Mom!
-'Executing delegate hi("Hi, Mom!", 5280) returned 5280
-'
-'Hello, World!
-'hello.Invoke returned 42
-'
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/csharp/Project.csproj
deleted file mode 100644
index a369cfa8a8090..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/csharp/source.cs
deleted file mode 100644
index b8249adec28c3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/csharp/source.cs
+++ /dev/null
@@ -1,256 +0,0 @@
-//
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-
-public class Test
-{
- // Declare a delegate type that can be used to execute the completed
- // dynamic method.
- private delegate int HelloDelegate(string msg, int ret);
-
- public static void Main()
- {
- // Create an array that specifies the types of the parameters
- // of the dynamic method. This dynamic method has a String
- // parameter and an Integer parameter.
- Type[] helloArgs = {typeof(string), typeof(int)};
-
- // Create a dynamic method with the name "Hello", a return type
- // of Integer, and two parameters whose types are specified by
- // the array helloArgs. Create the method in the module that
- // defines the String class.
- DynamicMethod hello = new DynamicMethod("Hello",
- typeof(int),
- helloArgs,
- typeof(string).Module);
-
- //
- // Create an array that specifies the parameter types of the
- // overload of Console.WriteLine to be used in Hello.
- Type[] writeStringArgs = {typeof(string)};
- // Get the overload of Console.WriteLine that has one
- // String parameter.
- MethodInfo writeString = typeof(Console).GetMethod("WriteLine",
- writeStringArgs);
-
- // Get an ILGenerator and emit a body for the dynamic method,
- // using a stream size larger than the IL that will be
- // emitted.
- ILGenerator il = hello.GetILGenerator(256);
- // Load the first argument, which is a string, onto the stack.
- il.Emit(OpCodes.Ldarg_0);
- // Call the overload of Console.WriteLine that prints a string.
- il.EmitCall(OpCodes.Call, writeString, null);
- // The Hello method returns the value of the second argument;
- // to do this, load the second argument onto the stack and return.
- il.Emit(OpCodes.Ldarg_1);
- il.Emit(OpCodes.Ret);
- //
-
- //
- // Add parameter information to the dynamic method. (This is not
- // necessary, but can be useful for debugging.) For each parameter,
- // identified by position, supply the parameter attributes and a
- // parameter name.
- hello.DefineParameter(1, ParameterAttributes.In, "message");
- hello.DefineParameter(2, ParameterAttributes.In, "valueToReturn");
- //
-
- //
- // Create a delegate that represents the dynamic method. This
- // action completes the method. Any further attempts to
- // change the method are ignored.
- HelloDelegate hi =
- (HelloDelegate) hello.CreateDelegate(typeof(HelloDelegate));
-
- // Use the delegate to execute the dynamic method.
- Console.WriteLine("\r\nUse the delegate to execute the dynamic method:");
- int retval = hi("\r\nHello, World!", 42);
- Console.WriteLine("Invoking delegate hi(\"Hello, World!\", 42) returned: " + retval);
-
- // Execute it again, with different arguments.
- retval = hi("\r\nHi, Mom!", 5280);
- Console.WriteLine("Invoking delegate hi(\"Hi, Mom!\", 5280) returned: " + retval);
- //
-
- //
- Console.WriteLine("\r\nUse the Invoke method to execute the dynamic method:");
- // Create an array of arguments to use with the Invoke method.
- object[] invokeArgs = {"\r\nHello, World!", 42};
- // Invoke the dynamic method using the arguments. This is much
- // slower than using the delegate, because you must create an
- // array to contain the arguments, and value-type arguments
- // must be boxed.
- object objRet = hello.Invoke(null, BindingFlags.ExactBinding, null, invokeArgs, new CultureInfo("en-us"));
- Console.WriteLine("hello.Invoke returned: " + objRet);
- //
-
- Console.WriteLine("\r\n ----- Display information about the dynamic method -----");
- //
- // Display MethodAttributes for the dynamic method, set when
- // the dynamic method was created.
- Console.WriteLine("\r\nMethod Attributes: {0}", hello.Attributes);
- //
-
- //
- // Display the calling convention of the dynamic method, set when the
- // dynamic method was created.
- Console.WriteLine("\r\nCalling convention: {0}", hello.CallingConvention);
- //
-
- //
- // Display the declaring type, which is always null for dynamic
- // methods.
- if (hello.DeclaringType == null)
- {
- Console.WriteLine("\r\nDeclaringType is always null for dynamic methods.");
- }
- else
- {
- Console.WriteLine("DeclaringType: {0}", hello.DeclaringType);
- }
- //
-
- //
- // Display the default value for InitLocals.
- if (hello.InitLocals)
- {
- Console.Write("\r\nThis method contains verifiable code.");
- }
- else
- {
- Console.Write("\r\nThis method contains unverifiable code.");
- }
- Console.WriteLine(" (InitLocals = {0})", hello.InitLocals);
- //
-
- //
- // Display the module specified when the dynamic method was created.
- Console.WriteLine("\r\nModule: {0}", hello.Module);
- //
-
- //
- // Display the name specified when the dynamic method was created.
- // Note that the name can be blank.
- Console.WriteLine("\r\nName: {0}", hello.Name);
- //
-
- //
- // For dynamic methods, the reflected type is always null.
- if (hello.ReflectedType == null)
- {
- Console.WriteLine("\r\nReflectedType is null.");
- }
- else
- {
- Console.WriteLine("\r\nReflectedType: {0}", hello.ReflectedType);
- }
- //
-
- //
- if (hello.ReturnParameter == null)
- {
- Console.WriteLine("\r\nMethod has no return parameter.");
- }
- else
- {
- Console.WriteLine("\r\nReturn parameter: {0}", hello.ReturnParameter);
- }
- //
-
- //
- // If the method has no return type, ReturnType is System.Void.
- Console.WriteLine("\r\nReturn type: {0}", hello.ReturnType);
- //
-
- //
- // ReturnTypeCustomAttributes returns an ICustomeAttributeProvider
- // that can be used to enumerate the custom attributes of the
- // return value. At present, there is no way to set such custom
- // attributes, so the list is empty.
- if (hello.ReturnType == typeof(void))
- {
- Console.WriteLine("The method has no return type.");
- }
- else
- {
- ICustomAttributeProvider caProvider = hello.ReturnTypeCustomAttributes;
- object[] returnAttributes = caProvider.GetCustomAttributes(true);
- if (returnAttributes.Length == 0)
- {
- Console.WriteLine("\r\nThe return type has no custom attributes.");
- }
- else
- {
- Console.WriteLine("\r\nThe return type has the following custom attributes:");
- foreach( object attr in returnAttributes )
- {
- Console.WriteLine("\t{0}", attr.ToString());
- }
- }
- }
- //
-
- //
- Console.WriteLine("\r\nToString: {0}", hello.ToString());
- //
-
- //
- // Display parameter information.
- ParameterInfo[] parameters = hello.GetParameters();
- Console.WriteLine("\r\nParameters: name, type, ParameterAttributes");
- foreach( ParameterInfo p in parameters )
- {
- Console.WriteLine("\t{0}, {1}, {2}",
- p.Name, p.ParameterType, p.Attributes);
- }
- //
- }
-}
-
-/* This code example produces the following output:
-
-Use the delegate to execute the dynamic method:
-
-Hello, World!
-Invoking delegate hi("Hello, World!", 42) returned: 42
-
-Hi, Mom!
-Invoking delegate hi("Hi, Mom!", 5280) returned: 5280
-
-Use the Invoke method to execute the dynamic method:
-
-Hello, World!
-hello.Invoke returned: 42
-
- ----- Display information about the dynamic method -----
-
-Method Attributes: PrivateScope, Public, Static
-
-Calling convention: Standard
-
-DeclaringType is always null for dynamic methods.
-
-This method contains verifiable code. (InitLocals = True)
-
-Module: CommonLanguageRuntimeLibrary
-
-Name: Hello
-
-ReflectedType is null.
-
-Method has no return parameter.
-
-Return type: System.Int32
-
-The return type has no custom attributes.
-
-ToString: Int32 Hello(System.String, Int32)
-
-Parameters: name, type, ParameterAttributes
- message, System.String, In
- valueToReturn, System.Int32, In
- */
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/vb/Project.vbproj
deleted file mode 100644
index a369cfa8a8090..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/vb/source.vb
deleted file mode 100644
index ac1c66228dbe3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/DynamicMethod/Overview/vb/source.vb
+++ /dev/null
@@ -1,246 +0,0 @@
-'
-Imports System.Reflection
-Imports System.Reflection.Emit
-Imports System.Globalization
-
-Public Class Test
- ' Declare a delegate type that can be used to execute the completed
- ' dynamic method.
- Private Delegate Function HelloDelegate(ByVal msg As String, _
- ByVal ret As Integer) As Integer
-
- Public Shared Sub Main()
- ' Create an array that specifies the types of the parameters
- ' of the dynamic method. This dynamic method has a String
- ' parameter and an Integer parameter.
- Dim helloArgs() As Type = {GetType(String), GetType(Integer)}
-
- ' Create a dynamic method with the name "Hello", a return type
- ' of Integer, and two parameters whose types are specified by
- ' the array helloArgs. Create the method in the module that
- ' defines the String class.
- Dim hello As New DynamicMethod("Hello", _
- GetType(Integer), _
- helloArgs, _
- GetType(String).Module)
-
- '
- ' Create an array that specifies the parameter types of the
- ' overload of Console.WriteLine to be used in Hello.
- Dim writeStringArgs() As Type = {GetType(String)}
- ' Get the overload of Console.WriteLine that has one
- ' String parameter.
- Dim writeString As MethodInfo = GetType(Console). _
- GetMethod("WriteLine", writeStringArgs)
-
- ' Get an ILGenerator and emit a body for the dynamic method,
- ' using a stream size larger than the IL that will be
- ' emitted.
- Dim il As ILGenerator = hello.GetILGenerator(256)
- ' Load the first argument, which is a string, onto the stack.
- il.Emit(OpCodes.Ldarg_0)
- ' Call the overload of Console.WriteLine that prints a string.
- il.EmitCall(OpCodes.Call, writeString, Nothing)
- ' The Hello method returns the value of the second argument;
- ' to do this, load the second argument onto the stack and return.
- il.Emit(OpCodes.Ldarg_1)
- il.Emit(OpCodes.Ret)
- '
-
- '
- ' Add parameter information to the dynamic method. (This is not
- ' necessary, but can be useful for debugging.) For each parameter,
- ' identified by position, supply the parameter attributes and a
- ' parameter name.
- hello.DefineParameter(1, ParameterAttributes.In, "message")
- hello.DefineParameter(2, ParameterAttributes.In, "valueToReturn")
- '
-
- '
- ' Create a delegate that represents the dynamic method. This
- ' action completes the method. Any further attempts to
- ' change the method are ignored.
- Dim hi As HelloDelegate = _
- CType(hello.CreateDelegate(GetType(HelloDelegate)), HelloDelegate)
-
- ' Use the delegate to execute the dynamic method.
- Console.WriteLine(vbCrLf & "Use the delegate to execute the dynamic method:")
- Dim retval As Integer = hi(vbCrLf & "Hello, World!", 42)
- Console.WriteLine("Invoking delegate hi(""Hello, World!"", 42) returned: " _
- & retval & ".")
-
- ' Execute it again, with different arguments.
- retval = hi(vbCrLf & "Hi, Mom!", 5280)
- Console.WriteLine("Invoking delegate hi(""Hi, Mom!"", 5280) returned: " _
- & retval & ".")
- '
-
- '
- Console.WriteLine(vbCrLf & "Use the Invoke method to execute the dynamic method:")
- ' Create an array of arguments to use with the Invoke method.
- Dim invokeArgs() As Object = {vbCrLf & "Hello, World!", 42}
- ' Invoke the dynamic method using the arguments. This is much
- ' slower than using the delegate, because you must create an
- ' array to contain the arguments, and value-type arguments
- ' must be boxed.
- Dim objRet As Object = hello.Invoke(Nothing, _
- BindingFlags.ExactBinding, Nothing, invokeArgs, _
- New CultureInfo("en-us"))
- Console.WriteLine("hello.Invoke returned: {0}", objRet)
- '
-
- Console.WriteLine(vbCrLf & _
- " ----- Display information about the dynamic method -----")
- '
- ' Display MethodAttributes for the dynamic method, set when
- ' the dynamic method was created.
- Console.WriteLine(vbCrLf & "Method Attributes: {0}", _
- hello.Attributes)
- '
-
- '
- ' Display the calling convention of the dynamic method, set when the
- ' dynamic method was created.
- Console.WriteLine(vbCrLf & "Calling convention: {0}", _
- hello.CallingConvention)
- '
-
- '
- ' Display the declaring type, which is always Nothing for dynamic
- ' methods.
- If hello.DeclaringType Is Nothing Then
- Console.WriteLine(vbCrLf & "DeclaringType is always Nothing for dynamic methods.")
- Else
- Console.WriteLine("DeclaringType: {0}", hello.DeclaringType)
- End If
- '
-
- '
- ' Display the default value for InitLocals.
- If hello.InitLocals Then
- Console.Write(vbCrLf & "This method contains verifiable code.")
- Else
- Console.Write(vbCrLf & "This method contains unverifiable code.")
- End If
- Console.WriteLine(" (InitLocals = {0})", hello.InitLocals)
- '
-
- '
- ' Display the module specified when the dynamic method was created.
- Console.WriteLine(vbCrLf & "Module: {0}", hello.Module)
- '
-
- '
- ' Display the name specified when the dynamic method was created.
- ' Note that the name can be blank.
- Console.WriteLine(vbCrLf & "Name: {0}", hello.Name)
- '
-
- '
- ' For dynamic methods, the reflected type is always Nothing.
- If hello.ReflectedType Is Nothing Then
- Console.WriteLine(vbCrLf & "ReflectedType is Nothing.")
- Else
- Console.WriteLine(vbCrLf & "ReflectedType: {0}", _
- hello.ReflectedType)
- End If
- '
-
- '
- If hello.ReturnParameter Is Nothing Then
- Console.WriteLine(vbCrLf & "Method has no return parameter.")
- Else
- Console.WriteLine(vbCrLf & "Return parameter: {0}", _
- hello.ReturnParameter)
- End If
- '
-
- '
- ' If the method has no return type, ReturnType is System.Void.
- Console.WriteLine(vbCrLf & "Return type: {0}", hello.ReturnType)
- '
-
- '
- ' ReturnTypeCustomAttributes returns an ICustomeAttributeProvider
- ' that can be used to enumerate the custom attributes of the
- ' return value. At present, there is no way to set such custom
- ' attributes, so the list is empty.
- If hello.ReturnType Is GetType(System.Void) Then
- Console.WriteLine("The method has no return type.")
- Else
- Dim caProvider As ICustomAttributeProvider = _
- hello.ReturnTypeCustomAttributes
- Dim returnAttributes() As Object = _
- caProvider.GetCustomAttributes(True)
- If returnAttributes.Length = 0 Then
- Console.WriteLine(vbCrLf _
- & "The return type has no custom attributes.")
- Else
- Console.WriteLine(vbCrLf _
- & "The return type has the following custom attributes:")
- For Each attr As Object In returnAttributes
- Console.WriteLine(vbTab & attr.ToString())
- Next attr
- End If
- End If
- '
-
- '
- Console.WriteLine(vbCrLf & "ToString: " & hello.ToString())
- '
-
- '
- ' Display parameter information.
- Dim parameters() As ParameterInfo = hello.GetParameters()
- Console.WriteLine(vbCrLf & "Parameters: name, type, ParameterAttributes")
- For Each p As ParameterInfo In parameters
- Console.WriteLine(vbTab & "{0}, {1}, {2}", _
- p.Name, p.ParameterType, p.Attributes)
- Next p
- '
- End Sub
-End Class
-
-' This code example produces the following output:
-'
-'Use the delegate to execute the dynamic method:
-'
-'Hello, World!
-'Invoking delegate hi("Hello, World!", 42) returned: 42.
-'
-'Hi, Mom!
-'Invoking delegate hi("Hi, Mom!", 5280) returned: 5280.
-'
-'Use the Invoke method to execute the dynamic method:
-'
-'Hello, World!
-'hello.Invoke returned: 42
-'
-' ----- Display information about the dynamic method -----
-'
-'Method Attributes: PrivateScope, Public, Static
-'
-'Calling convention: Standard
-'
-'DeclaringType is always Nothing for dynamic methods.
-'
-'This method contains verifiable code. (InitLocals = True)
-'
-'Module: CommonLanguageRuntimeLibrary
-'
-'Name: Hello
-'
-'ReflectedType is Nothing.
-'
-'Method has no return parameter.
-'
-'Return type: System.Int32
-'
-'The return type has no custom attributes.
-'
-'ToString: Int32 Hello(System.String, Int32)
-'
-'Parameters: name, type, ParameterAttributes
-' message, System.String, In
-' valueToReturn, System.Int32, In
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/PersistedAssemblyBuilder/Overview/csharp/CreateAndRunAssembly.cs b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/PersistedAssemblyBuilder/Overview/csharp/CreateAndRunAssembly.cs
deleted file mode 100644
index 29f6e80cad3e1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/PersistedAssemblyBuilder/Overview/csharp/CreateAndRunAssembly.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using System;
-using System.IO;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.Loader;
-using System.Runtime.InteropServices;
-
-public class CreatePersistedAssemblyExample
-{
- public static void Main()
- {
- CreateSaveAndRunAssembly();
- CreatePersistedAssemblyBuilderCoreAssemblyWithMetadataLoadContext(RuntimeEnvironment.GetRuntimeDirectory());
- }
- //
- public static void CreateSaveAndRunAssembly()
- {
- PersistedAssemblyBuilder ab = new(new AssemblyName("MyAssembly"), typeof(object).Assembly);
- ModuleBuilder mob = ab.DefineDynamicModule("MyModule");
- TypeBuilder tb = mob.DefineType(
- "MyType",
- TypeAttributes.Public | TypeAttributes.Class);
- MethodBuilder meb = tb.DefineMethod(
- "SumMethod",
- MethodAttributes.Public | MethodAttributes.Static,
- typeof(int), [typeof(int), typeof(int)]);
- ILGenerator il = meb.GetILGenerator();
- il.Emit(OpCodes.Ldarg_0);
- il.Emit(OpCodes.Ldarg_1);
- il.Emit(OpCodes.Add);
- il.Emit(OpCodes.Ret);
-
- tb.CreateType();
-
- using var stream = new MemoryStream();
- ab.Save(stream); // Or pass filename to save into a file.
- stream.Seek(0, SeekOrigin.Begin);
- Assembly assembly = AssemblyLoadContext.Default.LoadFromStream(stream);
- MethodInfo method = assembly.GetType("MyType").GetMethod("SumMethod");
- Console.WriteLine(method.Invoke(null, [5, 10]));
- }
- //
-
- //
- public static void CreatePersistedAssemblyBuilderCoreAssemblyWithMetadataLoadContext(string refAssembliesPath)
- {
- PathAssemblyResolver resolver = new(Directory.GetFiles(refAssembliesPath, "*.dll"));
- using MetadataLoadContext context = new(resolver);
- Assembly coreAssembly = context.CoreAssembly;
- PersistedAssemblyBuilder ab = new(new AssemblyName("MyDynamicAssembly"), coreAssembly);
- TypeBuilder typeBuilder = ab.DefineDynamicModule("MyModule").DefineType("Test", TypeAttributes.Public);
- MethodBuilder methodBuilder = typeBuilder.DefineMethod("Method", MethodAttributes.Public, coreAssembly.GetType(typeof(int).FullName), Type.EmptyTypes);
- // .. add members and save the assembly
- }
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/PersistedAssemblyBuilder/Overview/csharp/GenerateMetadataSnippets.cs b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/PersistedAssemblyBuilder/Overview/csharp/GenerateMetadataSnippets.cs
deleted file mode 100644
index 1b21cd5427287..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/PersistedAssemblyBuilder/Overview/csharp/GenerateMetadataSnippets.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-using System;
-using System.Collections;
-using System.Globalization;
-using System.IO;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Reflection.Metadata.Ecma335;
-using System.Reflection.Metadata;
-using System.Reflection.PortableExecutable;
-using System.Resources;
-
-public class SnippetExamples
-{
- public static void Main()
- {
- SetEntryPoint();
- SetResource();
- ReadResource();
- }
- //
- public static void SetEntryPoint()
- {
- PersistedAssemblyBuilder ab = new(new AssemblyName("MyAssembly"), typeof(object).Assembly);
- TypeBuilder tb = ab.DefineDynamicModule("MyModule").DefineType("MyType", TypeAttributes.Public | TypeAttributes.Class);
- // ...
- MethodBuilder entryPoint = tb.DefineMethod("Main", MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.Static);
- ILGenerator il2 = entryPoint.GetILGenerator();
- // ...
- il2.Emit(OpCodes.Ret);
- tb.CreateType();
-
- MetadataBuilder metadataBuilder = ab.GenerateMetadata(out BlobBuilder ilStream, out BlobBuilder fieldData);
-
- ManagedPEBuilder peBuilder = new(
- header: PEHeaderBuilder.CreateExecutableHeader(),
- metadataRootBuilder: new MetadataRootBuilder(metadataBuilder),
- ilStream: ilStream,
- mappedFieldData: fieldData,
- entryPoint: MetadataTokens.MethodDefinitionHandle(entryPoint.MetadataToken));
-
- BlobBuilder peBlob = new();
- peBuilder.Serialize(peBlob);
-
- // Create the executable:
- using FileStream fileStream = new("MyAssembly.exe", FileMode.Create, FileAccess.Write);
- peBlob.WriteContentTo(fileStream);
- }
- //
- //
- public static void SetResource()
- {
- PersistedAssemblyBuilder ab = new(new AssemblyName("MyAssembly"), typeof(object).Assembly);
- ab.DefineDynamicModule("MyModule");
- MetadataBuilder metadata = ab.GenerateMetadata(out BlobBuilder ilStream, out _);
-
- using MemoryStream stream = new();
- ResourceWriter myResourceWriter = new(stream);
- myResourceWriter.AddResource("AddResource 1", "First added resource");
- myResourceWriter.AddResource("AddResource 2", "Second added resource");
- myResourceWriter.AddResource("AddResource 3", "Third added resource");
- myResourceWriter.Close();
-
- byte[] data = stream.ToArray();
- BlobBuilder resourceBlob = new();
- resourceBlob.WriteInt32(data.Length);
- resourceBlob.WriteBytes(data);
-
- metadata.AddManifestResource(
- ManifestResourceAttributes.Public,
- metadata.GetOrAddString("MyResource.resources"),
- implementation: default,
- offset: 0);
-
- ManagedPEBuilder peBuilder = new(
- header: PEHeaderBuilder.CreateLibraryHeader(),
- metadataRootBuilder: new MetadataRootBuilder(metadata),
- ilStream: ilStream,
- managedResources: resourceBlob);
-
- BlobBuilder blob = new();
- peBuilder.Serialize(blob);
-
- // Create the assembly:
- using FileStream fileStream = new("MyAssemblyWithResource.dll", FileMode.Create, FileAccess.Write);
- blob.WriteContentTo(fileStream);
- }
- //
- //
- public static void ReadResource()
- {
- Assembly readAssembly = Assembly.LoadFile(Path.Combine(
- Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
- "MyAssemblyWithResource.dll"));
-
- // Use ResourceManager.GetString() to read the resources.
- ResourceManager rm = new("MyResource", readAssembly);
- Console.WriteLine("Using ResourceManager.GetString():");
- Console.WriteLine($"{rm.GetString("AddResource 1", CultureInfo.InvariantCulture)}");
- Console.WriteLine($"{rm.GetString("AddResource 2", CultureInfo.InvariantCulture)}");
- Console.WriteLine($"{rm.GetString("AddResource 3", CultureInfo.InvariantCulture)}");
-
- // Use ResourceSet to enumerate the resources.
- Console.WriteLine();
- Console.WriteLine("Using ResourceSet:");
- ResourceSet resourceSet = rm.GetResourceSet(CultureInfo.InvariantCulture, createIfNotExists: true, tryParents: false);
- foreach (DictionaryEntry entry in resourceSet)
- {
- Console.WriteLine($"Key: {entry.Key}, Value: {entry.Value}");
- }
-
- // Use ResourceReader to enumerate the resources.
- Console.WriteLine();
- Console.WriteLine("Using ResourceReader:");
- using Stream stream = readAssembly.GetManifestResourceStream("MyResource.resources")!;
- using ResourceReader reader = new(stream);
- foreach (DictionaryEntry entry in reader)
- {
- Console.WriteLine($"Key: {entry.Key}, Value: {entry.Value}");
- }
- }
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/PersistedAssemblyBuilder/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/PersistedAssemblyBuilder/Overview/csharp/Project.csproj
deleted file mode 100644
index 68f3d17454a03..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Reflection.Emit/PersistedAssemblyBuilder/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/CurrentCulture/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/CurrentCulture/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/CurrentCulture/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/CurrentCulture/Overview/vb/example.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/CurrentCulture/Overview/vb/example.vb
deleted file mode 100644
index 0b00c9d5ea000..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/CurrentCulture/Overview/vb/example.vb
+++ /dev/null
@@ -1,34 +0,0 @@
-'
-Imports System.Globalization
-Imports System.Resources
-Imports System.Threading
-
-Module Example
- Sub Main()
- ' Create array of supported cultures
- Dim cultures() As String = {"en-CA", "en-US", "fr-FR", "ru-RU" }
- Dim rnd As New Random()
- Dim cultureNdx As Integer = rnd.Next(0, cultures.Length)
- Dim originalCulture As CultureInfo = Thread.CurrentThread.CurrentCulture
- Dim rm As New ResourceManager("Greetings", GetType(Example).Assembly)
- Try
- Dim newCulture As New CultureInfo(cultures(cultureNdx))
- Thread.CurrentThread.CurrentCulture = newCulture
- Thread.CurrentThread.CurrentUICulture = newCulture
- Dim greeting As String = String.Format("The current culture is {0}.{1}{2}",
- Thread.CurrentThread.CurrentUICulture.Name,
- vbCrLf, rm.GetString("HelloString"))
-
- Console.WriteLine(greeting)
- Catch e As CultureNotFoundException
- Console.WriteLine("Unable to instantiate culture {0}", e.InvalidCultureName)
- Finally
- Thread.CurrentThread.CurrentCulture = originalCulture
- Thread.CurrentThread.CurrentUICulture = originalCulture
- End Try
- End Sub
-End Module
-' The example displays output like the following:
-' The current culture is ru-RU.
-' Всем привет!
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/resourcenames.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/resourcenames.cs
deleted file mode 100644
index 80c7559eb7037..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/resourcenames.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Reflection;
-
-public class Example0
-{
- public static void Main()
- {
- if (Environment.GetCommandLineArgs().Length == 1) {
- Console.WriteLine("No filename.");
- return;
- }
-
- string filename = Environment.GetCommandLineArgs()[1].Trim();
- // Check whether the file exists.
- if (! File.Exists(filename)) {
- Console.WriteLine($"{filename} does not exist.");
- return;
- }
-
- // Try to load the assembly.
- Assembly assem = Assembly.LoadFrom(filename);
- Console.WriteLine($"File: {filename}");
-
- // Enumerate the resource files.
- string[] resNames = assem.GetManifestResourceNames();
- if (resNames.Length == 0)
- Console.WriteLine(" No resources found.");
-
- foreach (var resName in resNames)
- Console.WriteLine($" Resource: {resName.Replace(".resources", "")}");
-
- Console.WriteLine();
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showdate.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showdate.cs
deleted file mode 100644
index bfbe44b414cce..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showdate.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Resources;
-using System.Threading;
-
-[assembly: NeutralResourcesLanguage("en")]
-
-public class ShowDateEx
-{
- public static void Main()
- {
- string[] cultureNames = { "en-US", "fr-FR", "ru-RU", "sv-SE" };
- ResourceManager rm = new ResourceManager("DateStrings",
- typeof(Example).Assembly);
-
- foreach (var cultureName in cultureNames)
- {
- CultureInfo culture = CultureInfo.CreateSpecificCulture(cultureName);
- Thread.CurrentThread.CurrentCulture = culture;
- Thread.CurrentThread.CurrentUICulture = culture;
-
- Console.WriteLine($"Current UI Culture: {CultureInfo.CurrentUICulture.Name}");
- string dateString = rm.GetString("DateStart");
- Console.WriteLine($"{dateString} {DateTime.Now:M}.\n");
- }
- }
-}
-// The example displays output similar to the following:
-// Current UI Culture: en-US
-// Today is February 03.
-//
-// Current UI Culture: fr-FR
-// Aujourd'hui, c'est le 3 février
-//
-// Current UI Culture: ru-RU
-// Сегодня февраля 03.
-//
-// Current UI Culture: sv-SE
-// Today is den 3 februari.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showdate1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showdate1.cs
deleted file mode 100644
index 22634f380d154..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showdate1.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Resources;
-using System.Threading;
-
-public class Example
-{
- public static void Main()
- {
- string[] cultureNames = [ "en-US", "fr-FR", "ru-RU", "sv-SE" ];
- ResourceManager rm = new ResourceManager("DateStrings",
- typeof(Example).Assembly);
-
- foreach (var cultureName in cultureNames) {
- CultureInfo culture = CultureInfo.CreateSpecificCulture(cultureName);
- Thread.CurrentThread.CurrentCulture = culture;
- Thread.CurrentThread.CurrentUICulture = culture;
-
- Console.WriteLine($"Current UI Culture: {CultureInfo.CurrentUICulture.Name}");
- string dateString = rm.GetString("DateStart");
- Console.WriteLine($"{dateString} {DateTime.Now:M}.\n");
- }
- }
-}
-// The example displays output similar to the following:
-// Current UI Culture: en-US
-// Today is February 03.
-//
-// Current UI Culture: fr-FR
-// Aujourd'hui, c'est le 3 février
-//
-// Current UI Culture: ru-RU
-// Сегодня февраля 03.
-//
-// Current UI Culture: sv-SE
-// Today is den 3 februari.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showdate2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showdate2.cs
deleted file mode 100644
index 6457a59cd3fe3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showdate2.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Resources;
-using System.Threading;
-
-public class Example2
-{
- public static void Main()
- {
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("ru-RU");
- Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("ru-RU");
-
- string[] cultureNames = [ "fr-FR", "sv-SE" ];
- ResourceManager rm = new ResourceManager("DateStrings",
- typeof(Example).Assembly);
-
- foreach (var cultureName in cultureNames)
- {
- CultureInfo culture = CultureInfo.CreateSpecificCulture(cultureName);
- string dateString = rm.GetString("DateStart", culture);
- Console.WriteLine($"{culture.DisplayName}: {dateString} {DateTime.Now.ToString("M", culture)}.");
- Console.WriteLine();
- }
- }
-}
-// The example displays output similar to the following:
-// French (France): Aujourd'hui, c'est le 7 février.
-//
-// Swedish (Sweden): Today is den 7 februari.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showtime.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showtime.cs
deleted file mode 100644
index 37990991b22d1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/csharp/showtime.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-using System;
-using System.Resources;
-
-public class ShowTimeEx
-{
- public static void Main()
- {
- ResourceManager rm = new ResourceManager("Strings",
- typeof(Example).Assembly);
- string timeString = rm.GetString("TimeHeader");
- Console.WriteLine($"{timeString} {DateTime.Now:T}");
- }
-}
-// The example displays output like the following:
-// The current time is 2:03:14 PM
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/vb/resourcenames.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/vb/resourcenames.vb
deleted file mode 100644
index d52cac32cd3ec..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/MissingManifestResourceException/Overview/vb/resourcenames.vb
+++ /dev/null
@@ -1,37 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-Imports System.Reflection
-Imports System.Resources
-
-Module Example
- Public Sub Main()
- If Environment.GetCommandLineArgs.Length = 1 Then
- Console.WriteLine("No filename.")
- Exit Sub
- End If
- Dim filename As String = Environment.GetCommandLineArgs(1).Trim()
- ' Check whether the file exists.
- If Not File.Exists(filename) Then
- Console.WriteLine("{0} does not exist.", filename)
- Exit Sub
- End If
-
- ' Try to load the assembly.
- Dim assem As Assembly = Assembly.LoadFrom(filename)
- Console.WriteLine("File: {0}", filename)
-
- ' Enumerate the resource files.
- Dim resNames() As String = assem.GetManifestResourceNames()
- If resNames.Length = 0 Then
- Console.WriteLine(" No resources found.")
- End If
- For Each resName In resNames
- Console.WriteLine(" Resource: {0}", resName.Replace(".resources", ""))
- Next
- Console.WriteLine()
- End Sub
-End Module
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/csharp/example.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/csharp/example.cs
deleted file mode 100644
index ca95766e33169..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/csharp/example.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Reflection;
-using System.Resources;
-using System.Threading;
-
-[assembly: NeutralResourcesLanguageAttribute("en")]
-public class Example
-{
- public static void Main()
- {
- // Select the current culture randomly to test resource fallback.
- string[] cultures = { "de-DE", "en-us", "fr-FR" };
- Random rnd = new Random();
- int index = rnd.Next(0, cultures.Length);
- Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(cultures[index]);
- Console.WriteLine($"The current culture is {CultureInfo.CurrentUICulture.Name}");
-
- // Retrieve the resource.
- ResourceManager rm = new ResourceManager("ExampleResources",
- typeof(Example).Assembly);
- string greeting = rm.GetString("Greeting");
-
- Console.Write("Enter your name: ");
- string name = Console.ReadLine();
- Console.WriteLine($"{greeting} {name}!");
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/vb/example.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/vb/example.vb
deleted file mode 100644
index 52a0222df66a0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/NeutralResourcesLanguageAttribute/Overview/vb/example.vb
+++ /dev/null
@@ -1,30 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Resources
-Imports System.Threading
-
-
-
-Module Example
- Public Sub Main()
- ' Select the current culture randomly to test resource fallback.
- Dim cultures() As String = { "de-DE", "en-us", "fr-FR" }
- Dim rnd As New Random()
- Dim index As Integer = rnd.Next(0, cultures.Length)
- Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(cultures(index))
- Console.WriteLine("The current culture is {0}",
- CultureInfo.CurrentUICulture.Name)
-
- ' Retrieve the resource.
- Dim rm As New ResourceManager("ExampleResources" , GetType(Example).Assembly)
- Dim greeting As String = rm.GetString("Greeting")
-
- Console.Write("Enter your name: ")
- Dim name As String = Console.ReadLine()
- Console.WriteLine("{0} {1}", greeting, name)
- End Sub
-End Module
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/ctor1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/ctor1.cs
deleted file mode 100644
index 3c829904f4a63..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/ctor1.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Resources;
-
-public class Example
-{
- public static void Main()
- {
- //
- ResourceManager rm = new ResourceManager(typeof(Resource1));
- //
- }
-}
-
-internal class Resource1
-{ }
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/example.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/example.cs
deleted file mode 100644
index 628678dc8ecfd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/example.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-using System;
-using System.Reflection;
-using System.Resources;
-
-public class Example1
-{
- public static void Main()
- {
- // Retrieve the resource.
- ResourceManager rm = new ResourceManager("ExampleResources",
- typeof(Example).Assembly);
- string greeting = rm.GetString("Greeting");
-
- Console.Write("Enter your name: ");
- string name = Console.ReadLine();
- Console.WriteLine($"{greeting} {name}!");
- }
-}
-// The example produces output similar to the following:
-// Enter your name: John
-// Hello John!
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/greet.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/greet.cs
deleted file mode 100644
index 089dd80f7a480..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/csharp/greet.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-using System;
-using System.Resources;
-using System.Globalization;
-using System.Threading;
-
-[assembly: NeutralResourcesLanguage("en")]
-
-public class Example2
-{
- public static void Main()
- {
- string[] cultureNames = [ "en-US", "fr-FR", "ru-RU", "sv-SE" ];
- DateTime noon = new DateTime(DateTime.Now.Year, DateTime.Now.Month,
- DateTime.Now.Day, 12, 0, 0);
- DateTime evening = new DateTime(DateTime.Now.Year, DateTime.Now.Month,
- DateTime.Now.Day, 18, 0, 0);
-
- ResourceManager rm = new ResourceManager(typeof(GreetingResources));
-
- foreach (var cultureName in cultureNames)
- {
- Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(cultureName);
- Console.WriteLine($"The current UI culture is {CultureInfo.CurrentUICulture.Name}");
- if (DateTime.Now < noon)
- Console.WriteLine($"{rm.GetString("Morning")}!");
- else if (DateTime.Now < evening)
- Console.WriteLine($"{rm.GetString("Afternoon")}!");
- else
- Console.WriteLine($"{rm.GetString("Evening")}!");
- Console.WriteLine();
- }
- }
-
- internal class GreetingResources
- {
- }
-}
-// The example displays output like the following:
-// The current UI culture is en-US
-// Good afternoon!
-//
-// The current UI culture is fr-FR
-// Bonjour!
-//
-// The current UI culture is ru-RU
-// Добрый день!
-//
-// The current UI culture is sv-SE
-// Good afternoon!
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/vb/example.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/vb/example.vb
deleted file mode 100644
index ab61a6bf9952d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/vb/example.vb
+++ /dev/null
@@ -1,24 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Reflection
-Imports System.Resources
-
-Module Example1
- Public Sub Main()
- ' Retrieve the resource.
- Dim rm As New ResourceManager("ExampleResources",
- GetType(Example).Assembly)
- Dim greeting As String = rm.GetString("Greeting")
-
- Console.Write("Enter your name: ")
- Dim name As String = Console.ReadLine()
- Console.WriteLine("{0} {1}!", greeting, name)
- End Sub
-End Module
-' The example produces output similar to the following:
-' Enter your name: John
-' Hello John!
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/vb/greet.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/vb/greet.vb
deleted file mode 100644
index cca544a6a4e4e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/.ctor/vb/greet.vb
+++ /dev/null
@@ -1,51 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Resources
-Imports System.Globalization
-Imports System.Threading
-
-
-
-Module Example
- Public Sub Main()
- Dim cultureNames() As String = {"en-US", "fr-FR", "ru-RU", "sv-SE" }
- Dim noon As New Date(Date.Now.Year, Date.Now.Month,
- Date.Now.Day, 12,0,0)
- Dim evening As New Date(Date.Now.Year, Date.Now.Month,
- Date.Now.Day, 18, 0, 0)
-
- Dim rm As New ResourceManager(GetType(GreetingResources))
-
- For Each cultureName In cultureNames
- Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(cultureName)
- Console.WriteLine("The current UI culture is {0}",
- CultureInfo.CurrentUICulture.Name)
- If Date.Now < noon Then
- Console.WriteLine("{0}!", rm.GetString("Morning"))
- ElseIf Date.Now < evening Then
- Console.WriteLine("{0}!", rm.GetString("Afternoon"))
- Else
- Console.WriteLine("{0}!", rm.GetString("Evening"))
- End If
- Console.WriteLine()
- Next
- End Sub
-End Module
-
-Friend Class GreetingResources
-End Class
-' The example displays output like the following:
-' The current UI culture is en-US
-' Good afternoon!
-'
-' The current UI culture is fr-FR
-' Bonjour!
-'
-' The current UI culture is ru-RU
-' Добрый день!
-'
-' The current UI culture is sv-SE
-' Good afternoon!
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/Project.csproj
deleted file mode 100644
index 731773ec4d687..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- 12
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/createresources.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/createresources.cs
deleted file mode 100644
index 4863188be2e16..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/createresources.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-using System;
-using System.Resources;
-
-public class CreateResource
-{
- public static void Main()
- {
- Numbers en = new Numbers("one", "two", "three", "four", "five",
- "six", "seven", "eight", "nine", "ten");
- CreateResourceFile(en, "en");
- Numbers fr = new Numbers("un", "deux", "trois", "quatre", "cinq",
- "six", "sept", "huit", "neuf", "dix");
- CreateResourceFile(fr, "fr");
- Numbers pt = new Numbers("um", "dois", "três", "quatro", "cinco",
- "seis", "sete", "oito", "nove", "dez");
- CreateResourceFile(pt, "pt");
- Numbers ru = new Numbers("один", "два", "три", "четыре", "пять",
- "шесть", "семь", "восемь", "девять", "десять");
- CreateResourceFile(ru, "ru");
- }
-
- public static void CreateResourceFile(Numbers n, string lang)
- {
- string filename = @".\NumberResources" +
- (lang != "en" ? "." + lang : "" ) +
- ".resx";
- ResXResourceWriter rr = new ResXResourceWriter(filename);
- rr.AddResource("Numbers", n);
- rr.Generate();
- rr.Close();
- }
-}
-//
-
-[Serializable] public class Numbers
-{
- public readonly string One;
- public readonly string Two;
- public readonly string Three;
- public readonly string Four;
- public readonly string Five;
- public readonly string Six;
- public readonly string Seven;
- public readonly string Eight;
- public readonly string Nine;
- public readonly string Ten;
-
- public Numbers(string one, string two, string three, string four,
- string five, string six, string seven, string eight,
- string nine, string ten)
- {
- this.One = one;
- this.Two = two;
- this.Three = three;
- this.Four = four;
- this.Five = five;
- this.Six = six;
- this.Seven = seven;
- this.Eight = eight;
- this.Nine = nine;
- this.Ten = ten;
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/numberinfo.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/numberinfo.cs
deleted file mode 100644
index dc06110ebd9d3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/numberinfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-using System;
-
-[Serializable] public class Numbers2
-{
- public readonly string One;
- public readonly string Two;
- public readonly string Three;
- public readonly string Four;
- public readonly string Five;
- public readonly string Six;
- public readonly string Seven;
- public readonly string Eight;
- public readonly string Nine;
- public readonly string Ten;
-
- public Numbers2(string one, string two, string three, string four,
- string five, string six, string seven, string eight,
- string nine, string ten)
- {
- this.One = one;
- this.Two = two;
- this.Three = three;
- this.Four = four;
- this.Five = five;
- this.Six = six;
- this.Seven = seven;
- this.Eight = eight;
- this.Nine = nine;
- this.Ten = ten;
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/shownumbers.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/shownumbers.cs
deleted file mode 100644
index d5e9e63e0313d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/csharp/shownumbers.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Resources;
-using System.Threading;
-
-[assembly:NeutralResourcesLanguageAttribute("en-US")]
-
-public class Example
-{
- static string[] cultureNames = [ "fr-FR", "pt-BR", "ru-RU" ];
-
- public static void Main()
- {
- // Make any non-default culture the current culture.
- Random rnd = new Random();
- CultureInfo culture = CultureInfo.CreateSpecificCulture(cultureNames[rnd.Next(0, cultureNames.Length)]);
- Thread.CurrentThread.CurrentUICulture = culture;
- Console.WriteLine($"The current culture is {CultureInfo.CurrentUICulture.Name}\n");
- CultureInfo enCulture = CultureInfo.CreateSpecificCulture("en-US");
-
- ResourceManager rm = new ResourceManager(typeof(NumberResources));
- Numbers numbers = (Numbers) rm.GetObject("Numbers");
- Numbers numbersEn = (Numbers) rm.GetObject("Numbers", enCulture);
- Console.WriteLine($"{numbers.One} --> {numbersEn.One}");
- Console.WriteLine($"{numbers.Three} --> {numbersEn.Three}");
- Console.WriteLine($"{numbers.Five} --> {numbersEn.Five}");
- Console.WriteLine($"{numbers.Seven} --> {numbersEn.Seven}");
- Console.WriteLine($"{numbers.Nine} --> {numbersEn.Nine}\n");
- }
-}
-
-internal class NumberResources
-{
-}
-// The example displays output like the following:
-// The current culture is pt-BR
-//
-// um --> one
-// três --> three
-// cinco --> five
-// sete --> seven
-// nove --> nine
-//
-
-[Serializable] public class Numbers3
-{
- public readonly string One;
- public readonly string Two;
- public readonly string Three;
- public readonly string Four;
- public readonly string Five;
- public readonly string Six;
- public readonly string Seven;
- public readonly string Eight;
- public readonly string Nine;
- public readonly string Ten;
-
- public Numbers3(string one, string two, string three, string four,
- string five, string six, string seven, string eight,
- string nine, string ten)
- {
- this.One = one;
- this.Two = two;
- this.Three = three;
- this.Four = four;
- this.Five = five;
- this.Six = six;
- this.Seven = seven;
- this.Eight = eight;
- this.Nine = nine;
- this.Ten = ten;
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/Project.vbproj
deleted file mode 100644
index 82288af1c7acc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/Project.vbproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- Library
- net48
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/createresources.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/createresources.vb
deleted file mode 100644
index 34da5fc0ed44e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/createresources.vb
+++ /dev/null
@@ -1,61 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Resources
-
-Module CreateResource
- Public Sub Main()
- Dim en As New Numbers("one", "two", "three", "four", "five",
- "six", "seven", "eight", "nine", "ten")
- CreateResourceFile(en, "en")
- Dim fr As New Numbers("un", "deux", "trois", "quatre", "cinq",
- "six", "sept", "huit", "neuf", "dix")
- CreateResourceFile(fr, "fr")
- Dim pt As New Numbers("um", "dois", "três", "quatro", "cinco",
- "seis", "sete", "oito", "nove", "dez")
- CreateResourceFile(pt, "pt")
- Dim ru As New Numbers("один", "два", "три", "четыре", "пять",
- "шесть", "семь", "восемь", "девять", "десять")
- CreateResourceFile(ru, "ru")
- End Sub
-
- Public Sub CreateResourceFile(n As Numbers, lang As String)
- Dim filename As String = ".\NumberResources" +
- If(lang <> "en", "." + lang, "") +
- ".resx"
- Dim rr As New ResXResourceWriter(filename)
- rr.AddResource("Numbers", n)
- rr.Generate()
- rr.Close()
- End Sub
-End Module
-'
-
- Public Class Numbers
- Public Readonly One As String
- Public ReadOnly Two As String
- Public ReadOnly Three As String
- Public ReadOnly Four As String
- Public ReadOnly Five As String
- Public ReadOnly Six As String
- Public ReadOnly Seven As String
- Public ReadOnly Eight As String
- Public ReadOnly Nine As String
- Public ReadOnly Ten As String
-
- Public Sub New(one As String, two As String, three As String, four As String,
- five As String, six As String, seven As String, eight As String,
- nine As String, ten As String)
- Me.One = one
- Me.Two = two
- Me.Three = three
- Me.Four = four
- Me.Five = five
- Me.Six = six
- Me.Seven = seven
- Me.Eight = eight
- Me.Nine = nine
- Me.Ten = ten
- End Sub
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/example.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/example.vb
deleted file mode 100644
index bed4c85d6b256..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/example.vb
+++ /dev/null
@@ -1,44 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-' The following is CreateResources.*
-'
-Imports System.Resources
-
-Module CreateResource1
- Public Sub Main()
- Dim table As New PersonTable("Name", "Employee Number", "Age", 30, 18, 5)
- Dim rr As New ResXResourceWriter(".\UIResources.resx")
- rr.AddResource("TableName", "Employees of Acme Corporation")
- rr.AddResource("Employees", table)
- rr.Generate()
- rr.Close()
- End Sub
-End Module
-'
-
-
-' The following is UIElements.*
-'
- Public Structure PersonTable1
- Public ReadOnly nColumns As Integer
- Public ReadOnly column1 As String
- Public ReadOnly column2 As String
- Public ReadOnly column3 As String
- Public ReadOnly width1 As Integer
- Public ReadOnly width2 As Integer
- Public ReadOnly width3 As Integer
-
- Public Sub New(column1 As String, column2 As String, column3 As String,
- width1 As Integer, width2 As Integer, width3 As Integer)
- Me.column1 = column1
- Me.column2 = column2
- Me.column3 = column3
- Me.width1 = width1
- Me.width2 = width2
- Me.width3 = width3
- Me.nColumns = Me.GetType().GetFields().Count \ 2
- End Sub
-End Structure
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/example2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/example2.vb
deleted file mode 100644
index e64ae2afeaf7b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/example2.vb
+++ /dev/null
@@ -1,55 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Resources
-
-
-
-Module Example
- Public Sub Main()
- Dim fmtString As String = String.Empty
- Dim rm As New ResourceManager("UIResources", GetType(Example).Assembly)
- Dim title As String = rm.GetString("TableName")
- Dim tableInfo As PersonTable = DirectCast(rm.GetObject("Employees"), PersonTable)
-
- If Not String.IsNullOrEmpty(title) Then
- fmtString = "{0," + ((Console.WindowWidth + title.Length) \ 2).ToString() + "}"
- Console.WriteLine(fmtString, title)
- Console.WriteLine()
- End If
-
- For ctr As Integer = 1 To tableInfo.nColumns
- Dim columnName As String = "column" + ctr.ToString()
- Dim widthName As String = "width" + ctr.ToString()
- Dim value As String = CStr(tableInfo.GetType().GetField(columnName).GetValue(tableInfo))
- Dim width As Integer = CInt(tableInfo.GetType().GetField(widthName).GetValue(tableInfo))
- fmtString = "{0,-" + width.ToString() + "}"
- Console.Write(fmtString, value)
- Next
- Console.WriteLine()
- End Sub
-End Module
-'
-
- Public Structure PersonTable
- Public ReadOnly nColumns As Integer
- Public Readonly column1 As String
- Public ReadOnly column2 As String
- Public ReadOnly column3 As String
- Public ReadOnly width1 As Integer
- Public ReadOnly width2 As Integer
- Public ReadOnly width3 As Integer
-
- Public Sub New(column1 As String, column2 As String, column3 As String,
- width1 As Integer, width2 As Integer, width3 As Integer)
- Me.column1 = column1
- Me.column2 = column2
- Me.column3 = column3
- Me.width1 = width1
- Me.width2 = width2
- Me.width3 = width3
- Me.nColumns = Me.GetType().GetFields().Count \ 2
- End Sub
-End Structure
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/numberinfo.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/numberinfo.vb
deleted file mode 100644
index 2aee0872b92f0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/numberinfo.vb
+++ /dev/null
@@ -1,29 +0,0 @@
-'
- Public Class Numbers2
- Public ReadOnly One As String
- Public ReadOnly Two As String
- Public ReadOnly Three As String
- Public ReadOnly Four As String
- Public ReadOnly Five As String
- Public ReadOnly Six As String
- Public ReadOnly Seven As String
- Public ReadOnly Eight As String
- Public ReadOnly Nine As String
- Public ReadOnly Ten As String
-
- Public Sub New(one As String, two As String, three As String, four As String,
- five As String, six As String, seven As String, eight As String,
- nine As String, ten As String)
- Me.One = one
- Me.Two = two
- Me.Three = three
- Me.Four = four
- Me.Five = five
- Me.Six = six
- Me.Seven = seven
- Me.Eight = eight
- Me.Nine = nine
- Me.Ten = ten
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/shownumbers.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/shownumbers.vb
deleted file mode 100644
index 1fddd314f0caa..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetObject/vb/shownumbers.vb
+++ /dev/null
@@ -1,73 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Resources
-Imports System.Threading
-
-Module Example2
- Dim cultureNames() As String = {"fr-FR", "pt-BR", "ru-RU"}
-
- Public Sub Main()
- ' Make any non-default culture the current culture.
- Dim rnd As New Random
- Dim culture As CultureInfo = CultureInfo.CreateSpecificCulture(cultureNames(rnd.Next(0, cultureNames.Length)))
- Thread.CurrentThread.CurrentUICulture = culture
- Console.WriteLine("The current culture is {0}", CultureInfo.CurrentUICulture.Name)
- Console.WriteLine()
- Dim enCulture As CultureInfo = CultureInfo.CreateSpecificCulture("en-US")
-
- Dim rm As New ResourceManager(GetType(NumberResources))
- Dim numbers As Numbers = CType(rm.GetObject("Numbers"), Numbers)
- Dim numbersEn As Numbers = CType(rm.GetObject("Numbers", enCulture), Numbers)
- Console.WriteLine("{0} --> {1}", numbers.One, numbersEn.One)
- Console.WriteLine("{0} --> {1}", numbers.Three, numbersEn.Three)
- Console.WriteLine("{0} --> {1}", numbers.Five, numbersEn.Five)
- Console.WriteLine("{0} --> {1}", numbers.Seven, numbersEn.Seven)
- Console.WriteLine("{0} --> {1}", numbers.Nine, numbersEn.Nine)
- Console.WriteLine()
- End Sub
-End Module
-
-
-Friend Class NumberResources
-End Class
-
-' The example displays output like the following:
-' The current culture is pt-BR
-'
-' um --> one
-' três --> three
-' cinco --> five
-' sete --> seven
-' nove --> nine
-'
-
- Public Class Numbers3
- Public ReadOnly One As String
- Public ReadOnly Two As String
- Public ReadOnly Three As String
- Public ReadOnly Four As String
- Public ReadOnly Five As String
- Public ReadOnly Six As String
- Public ReadOnly Seven As String
- Public ReadOnly Eight As String
- Public ReadOnly Nine As String
- Public ReadOnly Ten As String
-
- Public Sub New(one As String, two As String, three As String, four As String,
- five As String, six As String, seven As String, eight As String,
- nine As String, ten As String)
- Me.One = one
- Me.Two = two
- Me.Three = three
- Me.Four = four
- Me.Five = five
- Me.Six = six
- Me.Seven = seven
- Me.Eight = eight
- Me.Nine = nine
- Me.Ten = ten
- End Sub
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetString/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetString/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetString/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetString/vb/showdate.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetString/vb/showdate.vb
deleted file mode 100644
index 5b75d8c8c3851..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetString/vb/showdate.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Resources
-Imports System.Threading
-
-
-
-Module Example
- Public Sub Main()
- Dim cultureNames() As String = { "en-US", "fr-FR", "ru-RU", "sv-SE" }
- Dim rm As New ResourceManager("DateStrings",
- GetType(Example).Assembly)
-
- For Each cultureName In cultureNames
- Dim culture As CultureInfo = CultureInfo.CreateSpecificCulture(cultureName)
- Thread.CurrentThread.CurrentCulture = culture
- Thread.CurrentThread.CurrentUICulture = culture
-
- Console.WriteLine("Current UI Culture: {0}",
- CultureInfo.CurrentUICulture.Name)
- Dim dateString As String = rm.GetString("DateStart")
- Console.WriteLine("{0} {1:M}.", dateString, Date.Now)
- Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays output similar to the following:
-' Current UI Culture: en-US
-' Today is February 03.
-'
-' Current UI Culture: fr-FR
-' Aujourd'hui, c'est le 3 février
-'
-' Current UI Culture: ru-RU
-' Сегодня февраля 03.
-'
-' Current UI Culture: sv-SE
-' Today is den 3 februari.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetString/vb/showdate2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetString/vb/showdate2.vb
deleted file mode 100644
index 7791d07210de5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/GetString/vb/showdate2.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Resources
-Imports System.Threading
-
-Module Example2
- Public Sub Main()
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("ru-RU")
- Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("ru-RU")
-
- Dim cultureNames() As String = {"fr-FR", "sv-SE"}
- Dim rm As New ResourceManager("DateStrings",
- GetType(Example).Assembly)
-
- For Each cultureName In cultureNames
- Dim culture As CultureInfo = CultureInfo.CreateSpecificCulture(cultureName)
- Dim dateString As String = rm.GetString("DateStart", culture)
- Console.WriteLine("{0}: {1} {2}.", culture.DisplayName, dateString,
- Date.Now.ToString("M", culture))
- Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays output similar to the following:
-' French (France): Aujourd'hui, c'est le 7 février.
-'
-' Swedish (Sweden): Today is den 7 februari.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/Project.csproj
deleted file mode 100644
index 82288af1c7acc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- Library
- net48
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/ctor1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/ctor1.cs
deleted file mode 100644
index 4dc7b7e377a29..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/ctor1.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Resources;
-
-public class Example1
-{
- public static void Main()
- {
- CallCtor1();
- CallCtor2();
- }
-
- static void CallCtor1()
- {
- //
- ResourceManager rm = new ResourceManager("MyCompany.StringResources",
- typeof(Example).Assembly);
- //
- }
-
- static void CallCtor2()
- {
- //
- ResourceManager rm = new ResourceManager(typeof(MyCompany.StringResources));
- //
- }
-}
-
-namespace MyCompany
-{
- class StringResources { }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example.cs
deleted file mode 100644
index fd939278b0459..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Resources;
-using System.Threading;
-
-public class Example
-{
- public static void Main()
- {
- // Create array of supported cultures
- string[] cultures = { "en-CA", "en-US", "fr-FR", "ru-RU" };
- Random rnd = new Random();
- int cultureNdx = rnd.Next(0, cultures.Length);
- CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
- ResourceManager rm = new ResourceManager("Greetings", typeof(Example).Assembly);
- try
- {
- CultureInfo newCulture = new CultureInfo(cultures[cultureNdx]);
- Thread.CurrentThread.CurrentCulture = newCulture;
- Thread.CurrentThread.CurrentUICulture = newCulture;
- string greeting = String.Format("The current culture is {0}.\n{1}",
- Thread.CurrentThread.CurrentUICulture.Name,
- rm.GetString("HelloString"));
- Console.WriteLine(greeting);
- }
- catch (CultureNotFoundException e)
- {
- Console.WriteLine($"Unable to instantiate culture {e.InvalidCultureName}");
- }
- finally
- {
- Thread.CurrentThread.CurrentCulture = originalCulture;
- Thread.CurrentThread.CurrentUICulture = originalCulture;
- }
- }
-}
-// The example displays output like the following:
-// The current culture is ru-RU.
-// Всем привет!
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example1.cs
deleted file mode 100644
index 1663582493bbf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example1.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-using System;
-
-[Serializable] public struct PersonTable
-{
- public readonly int nColumns;
- public readonly string column1;
- public readonly string column2;
- public readonly string column3;
- public readonly int width1;
- public readonly int width2;
- public readonly int width3;
-
- public PersonTable(string column1, string column2, string column3,
- int width1, int width2, int width3)
- {
- this.column1 = column1;
- this.column2 = column2;
- this.column3 = column3;
- this.width1 = width1;
- this.width2 = width2;
- this.width3 = width3;
- this.nColumns = typeof(PersonTable).GetFields().Length / 2;
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example11.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example11.cs
deleted file mode 100644
index 742d0eec5726e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example11.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-using System;
-using System.Resources;
-
-public class CreateResource
-{
- public static void Main()
- {
- PersonTable table = new PersonTable("Name", "Employee Number",
- "Age", 30, 18, 5);
- ResXResourceWriter rr = new ResXResourceWriter(@".\UIResources.resx");
- rr.AddResource("TableName", "Employees of Acme Corporation");
- rr.AddResource("Employees", table);
- rr.Generate();
- rr.Close();
- }
-}
-//
-
-[Serializable] public struct PersonTable2
-{
- public readonly int nColumns;
- public readonly string column1;
- public readonly string column2;
- public readonly string column3;
- public readonly int width1;
- public readonly int width2;
- public readonly int width3;
-
- public PersonTable2(string column1, string column2, string column3,
- int width1, int width2, int width3)
- {
- this.column1 = column1;
- this.column2 = column2;
- this.column3 = column3;
- this.width1 = width1;
- this.width2 = width2;
- this.width3 = width3;
- this.nColumns = typeof(PersonTable).GetFields().Length / 2;
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example2.cs
deleted file mode 100644
index 0552ab4aaff0c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/example2.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-using System;
-using System.Resources;
-
-[assembly: NeutralResourcesLanguageAttribute("en")]
-
-public class Example3
-{
- public static void Main()
- {
- string fmtString = String.Empty;
- ResourceManager rm = new ResourceManager("UIResources", typeof(Example).Assembly);
- string title = rm.GetString("TableName");
- PersonTable tableInfo = (PersonTable) rm.GetObject("Employees");
-
- if (! String.IsNullOrEmpty(title)) {
- fmtString = "{0," + ((Console.WindowWidth + title.Length) / 2).ToString() + "}";
- Console.WriteLine(fmtString, title);
- Console.WriteLine();
- }
-
- for (int ctr = 1; ctr <= tableInfo.nColumns; ctr++) {
- string columnName = "column" + ctr.ToString();
- string widthName = "width" + ctr.ToString();
- string value = tableInfo.GetType().GetField(columnName).GetValue(tableInfo).ToString();
- int width = (int) tableInfo.GetType().GetField(widthName).GetValue(tableInfo);
- fmtString = "{0,-" + width.ToString() + "}";
- Console.Write(fmtString, value);
- }
- Console.WriteLine();
- }
-}
-//
-
-[Serializable] public struct PersonTable3
-{
- public readonly int nColumns;
- public readonly string column1;
- public readonly string column2;
- public readonly string column3;
- public readonly int width1;
- public readonly int width2;
- public readonly int width3;
-
- public PersonTable3(string column1, string column2, string column3,
- int width1, int width2, int width3)
- {
- this.column1 = column1;
- this.column2 = column2;
- this.column3 = column3;
- this.width1 = width1;
- this.width2 = width2;
- this.width3 = width3;
- this.nColumns = typeof(PersonTable).GetFields().Length / 2;
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/rmc.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/rmc.cs
deleted file mode 100644
index 20cbf63f3215a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/csharp/rmc.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Resources;
-
-class Example2
-{
- public static void Main()
- {
- string day;
- string year;
- string holiday;
- string celebrate = "{0} will occur on {1} in {2}.\n";
-
- // Create a resource manager.
- ResourceManager rm = new ResourceManager("rmc",
- typeof(Example).Assembly);
-
- Console.WriteLine("Obtain resources using the current UI culture.");
-
- // Get the resource strings for the day, year, and holiday
- // using the current UI culture.
- day = rm.GetString("day");
- year = rm.GetString("year");
- holiday = rm.GetString("holiday");
- Console.WriteLine(celebrate, holiday, day, year);
-
- // Obtain the es-MX culture.
- CultureInfo ci = new CultureInfo("es-MX");
-
- Console.WriteLine("Obtain resources using the es-MX culture.");
-
- // Get the resource strings for the day, year, and holiday
- // using the specified culture.
- day = rm.GetString("day", ci);
- year = rm.GetString("year", ci);
- holiday = rm.GetString("holiday", ci);
- // ---------------------------------------------------------------
- // Alternatively, comment the preceding 3 code statements and
- // uncomment the following 4 code statements:
- // ----------------------------------------------------------------
- // Set the current UI culture to "es-MX" (Spanish-Mexico).
- // Thread.CurrentThread.CurrentUICulture = ci;
-
- // Get the resource strings for the day, year, and holiday
- // using the current UI culture. Use those strings to
- // display a message.
- // day = rm.GetString("day");
- // year = rm.GetString("year");
- // holiday = rm.GetString("holiday");
- // ---------------------------------------------------------------
-
- // Regardless of the alternative that you choose, display a message
- // using the retrieved resource strings.
- Console.WriteLine(celebrate, holiday, day, year);
- }
-}
-/*
-This example displays the following output:
-
- Obtain resources using the current UI culture.
- "5th of May" will occur on Friday in 2006.
-
- Obtain resources using the es-MX culture.
- "Cinco de Mayo" will occur on Viernes in 2006.
-*/
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/ctor1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/ctor1.vb
deleted file mode 100644
index 8bc71ab99cf6a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/ctor1.vb
+++ /dev/null
@@ -1,26 +0,0 @@
-Imports System.Resources
-
-Public Module Example2
- Public Sub Main()
- CallCtor1()
- CallCtor2()
- End Sub
-
- Sub CallCtor1()
- '
- Dim rm As New ResourceManager("MyCompany.StringResources",
- GetType(Example2).Assembly)
- '
- End Sub
-
- Sub CallCtor2()
- '
- Dim rm As New ResourceManager(GetType(MyCompany.StringResources))
- '
- End Sub
-End Module
-
-Namespace MyCompany
- Class StringResources
- End Class
-End Namespace
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/resourcenames.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/resourcenames.vb
deleted file mode 100644
index 2aa627abb2d3e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/resourcenames.vb
+++ /dev/null
@@ -1,37 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-Imports System.Reflection
-Imports System.Resources
-
-Module Example3
- Public Sub Main()
- If Environment.GetCommandLineArgs.Length = 1 Then
- Console.WriteLine("No filename.")
- Exit Sub
- End If
- Dim filename As String = Environment.GetCommandLineArgs(1).Trim()
- ' Check whether the file exists.
- If Not File.Exists(filename) Then
- Console.WriteLine("{0} does not exist.", filename)
- Exit Sub
- End If
-
- ' Try to load the assembly.
- Dim assem As Assembly = Assembly.LoadFrom(filename)
- Console.WriteLine("File: {0}", filename)
-
- ' Enumerate the resource files.
- Dim resNames() As String = assem.GetManifestResourceNames()
- If resNames.Length = 0 Then
- Console.WriteLine(" No resources found.")
- End If
- For Each resName In resNames
- Console.WriteLine(" Resource: {0}", resName.Replace(".resources", ""))
- Next
- Console.WriteLine()
- End Sub
-End Module
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/rmc.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/rmc.vb
deleted file mode 100644
index 5de1d0c30f0e6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/rmc.vb
+++ /dev/null
@@ -1,61 +0,0 @@
-'
-Imports System.Resources
-Imports System.Reflection
-Imports System.Threading
-Imports System.Globalization
-
-Class Example4
- Public Shared Sub Main()
- Dim day As String
- Dim year As String
- Dim holiday As String
- Dim celebrate As String = "{0} will occur on {1} in {2}." & vbCrLf
-
- ' Create a resource manager.
- Dim rm As New ResourceManager("rmc", GetType(Example4).Assembly)
-
- Console.WriteLine("Obtain resources using the current UI culture.")
-
- ' Get the resource strings for the day, year, and holiday
- ' using the current UI culture.
- day = rm.GetString("day")
- year = rm.GetString("year")
- holiday = rm.GetString("holiday")
- Console.WriteLine(celebrate, holiday, day, year)
-
- ' Obtain the es-MX culture.
- Dim ci As New CultureInfo("es-MX")
-
- Console.WriteLine("Obtain resources using the es-MX culture.")
-
- ' Get the resource strings for the day, year, and holiday
- ' using the es-MX culture.
- day = rm.GetString("day", ci)
- year = rm.GetString("year", ci)
- holiday = rm.GetString("holiday", ci)
-
- ' ---------------------------------------------------------------
- ' Alternatively, comment the preceding 3 code statements and
- ' uncomment the following 4 code statements:
- ' ----------------------------------------------------------------
- ' Set the current UI culture to "es-MX" (Spanish-Mexico).
- ' Thread.CurrentThread.CurrentUICulture = ci
- ' Get the resource strings for the day, year, and holiday
- ' using the current UI culture.
- ' day = rm.GetString("day")
- ' year = rm.GetString("year")
- ' holiday = rm.GetString("holiday")
- ' ---------------------------------------------------------------
-
- ' Regardless of the alternative that you choose, display a message
- ' using the retrieved resource strings.
- Console.WriteLine(celebrate, holiday, day, year)
- End Sub
-End Class
-' This example displays the following output:
-'Obtain resources using the current UI culture.
-'"5th of May" will occur on Friday in 2006.
-'
-'Obtain resources using the es-MX culture.
-'"Cinco de Mayo" will occur on Viernes in 2006.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/showdate.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/showdate.vb
deleted file mode 100644
index 18ef5f69f97a2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/showdate.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Resources
-Imports System.Threading
-
-
-
-Module Example5
- Public Sub Main()
- Dim cultureNames() As String = {"en-US", "fr-FR", "ru-RU", "sv-SE"}
- Dim rm As New ResourceManager("DateStrings",
- GetType(Example5).Assembly)
-
- For Each cultureName In cultureNames
- Dim culture As CultureInfo = CultureInfo.CreateSpecificCulture(cultureName)
- Thread.CurrentThread.CurrentCulture = culture
- Thread.CurrentThread.CurrentUICulture = culture
-
- Console.WriteLine("Current UI Culture: {0}",
- CultureInfo.CurrentUICulture.Name)
- Dim dateString As String = rm.GetString("DateStart")
- Console.WriteLine("{0} {1:M}.", dateString, Date.Now)
- Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays output similar to the following:
-' Current UI Culture: en-US
-' Today is February 03.
-'
-' Current UI Culture: fr-FR
-' Aujourd'hui, c'est le 3 février
-'
-' Current UI Culture: ru-RU
-' Сегодня февраля 03.
-'
-' Current UI Culture: sv-SE
-' Today is den 3 februari.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/showtime.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/showtime.vb
deleted file mode 100644
index 880654e69b589..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceManager/Overview/vb/showtime.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Resources
-
-Module Example6
- Public Sub Main()
- Dim rm As New ResourceManager("Strings", GetType(Example6).Assembly)
- Dim timeString As String = rm.GetString("TimeHeader")
- Console.WriteLine("{0} {1:T}", timeString, Date.Now)
- End Sub
-End Module
-' The example displays output similar to the following:
-' The current time is 2:03:14 PM
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/Project.csproj
deleted file mode 100644
index c3fdf8b0f2976..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/class1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/class1.cs
deleted file mode 100644
index 274482d5d5413..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/class1.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Resources;
-
-public class Example1
-{
- public static void Run()
- {
- Console.WriteLine("Resources in ApplicationResources.resources:");
- ResourceReader res = new ResourceReader(@".\ApplicationResources.resources");
- IDictionaryEnumerator dict = res.GetEnumerator();
- while (dict.MoveNext())
- Console.WriteLine($" {dict.Key}: '{dict.Value}' (Type {dict.Value.GetType().Name})");
- res.Close();
- }
-}
-// The example displays the following output:
-// Resources in ApplicationResources.resources:
-// Label3: '"Last Name:"' (Type String)
-// Label2: '"Middle Name:"' (Type String)
-// Label1: '"First Name:"' (Type String)
-// Label7: '"State:"' (Type String)
-// Label6: '"City:"' (Type String)
-// Label5: '"Street Address:"' (Type String)
-// Label4: '"SSN:"' (Type String)
-// Label9: '"Home Phone:"' (Type String)
-// Label8: '"Zip Code:"' (Type String)
-// Title: '"Contact Information"' (Type String)
-// Label12: '"Other Phone:"' (Type String)
-// Label13: '"Fax:"' (Type String)
-// Label10: '"Business Phone:"' (Type String)
-// Label11: '"Mobile Phone:"' (Type String)
-// Label14: '"Email Address:"' (Type String)
-// Label15: '"Alternate Email Address:"' (Type String)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/createresourceex1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/createresourceex1.cs
deleted file mode 100644
index 753b456524914..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/createresourceex1.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.IO;
-using System.Resources;
-using System.Runtime.Versioning;
-
-public class Example5
-{
- [SupportedOSPlatform("windows")]
- public static void Run()
- {
- // Bitmap as stream.
- MemoryStream bitmapStream = new MemoryStream();
- Bitmap bmp = new Bitmap(@".\ContactsIcon.jpg");
- bmp.Save(bitmapStream, ImageFormat.Jpeg);
-
- // Define resources to be written.
- using (ResourceWriter rw = new ResourceWriter(@".\ContactResources.resources"))
- {
- rw.AddResource("Title", "Contact List");
- rw.AddResource("NColumns", 5);
- rw.AddResource("Icon", bitmapStream);
- rw.AddResource("Header1", "Name");
- rw.AddResource("Header2", "City");
- rw.AddResource("Header3", "State");
- rw.AddResource("ClientVersion", true);
- rw.Generate();
- }
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/ctor1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/ctor1.cs
deleted file mode 100644
index 806ef3c1a2403..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/ctor1.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using System;
-
-public class Example
-{
- public static void Run()
- {
- Example ex = new Example();
- ex.Standalone();
- Console.WriteLine("---");
- ex.Embedded();
- }
-
- private void Standalone()
- {
- //
- // Instantiate a standalone .resources file from its filename.
- var rr1 = new System.Resources.ResourceReader("Resources1.resources");
-
- // Instantiate a standalone .resources file from a stream.
- var fs = new System.IO.FileStream(@".\Resources2.resources",
- System.IO.FileMode.Open);
- var rr2 = new System.Resources.ResourceReader(fs);
- //
-
- Console.WriteLine($"rr1: {rr1 != null}");
- Console.WriteLine($"rr2: {rr2 != null}");
- }
-
- private void Embedded()
- {
- //
- System.Reflection.Assembly assem =
- System.Reflection.Assembly.LoadFrom(@".\MyLibrary.dll");
- System.IO.Stream fs =
- assem.GetManifestResourceStream("MyCompany.LibraryResources.resources");
- var rr = new System.Resources.ResourceReader(fs);
- //
-
- if (fs == null)
- {
- Console.WriteLine(fs == null);
- foreach (var name in assem.GetManifestResourceNames())
- Console.WriteLine(name);
-
- return;
- }
- else
- {
- Console.WriteLine(fs == null);
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/readresourceex1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/readresourceex1.cs
deleted file mode 100644
index a0b8109ec1e37..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/csharp/readresourceex1.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Drawing;
-using System.IO;
-using System.Resources;
-using System.Runtime.Versioning;
-
-public class Example6
-{
- [SupportedOSPlatform("windows")]
- public static void Run()
- {
- ResourceReader rdr = new ResourceReader(@".\ContactResources.resources");
- IDictionaryEnumerator dict = rdr.GetEnumerator();
- while (dict.MoveNext())
- {
- Console.WriteLine($"Resource Name: {dict.Key}");
- try
- {
- Console.WriteLine($" Value: {dict.Value}");
- }
- catch (FileNotFoundException)
- {
- Console.WriteLine(" Exception: A file cannot be found.");
- DisplayResourceInfo(rdr, (string)dict.Key, false);
- }
- catch (FormatException)
- {
- Console.WriteLine(" Exception: Corrupted data.");
- DisplayResourceInfo(rdr, (string)dict.Key, true);
- }
- catch (TypeLoadException)
- {
- Console.WriteLine(" Exception: Cannot load the data type.");
- DisplayResourceInfo(rdr, (string)dict.Key, false);
- }
- }
- }
-
- [SupportedOSPlatform("windows")]
- private static void DisplayResourceInfo(ResourceReader rr,
- string key, bool loaded)
- {
- string dataType = null;
- byte[] data = null;
- rr.GetResourceData(key, out dataType, out data);
-
- // Display the data type.
- Console.WriteLine($" Data Type: {dataType}");
- // Display the bytes that form the available data.
- Console.Write(" Data: ");
- int lines = 0;
- foreach (var dataItem in data)
- {
- lines++;
- Console.Write("{0:X2} ", dataItem);
- if (lines % 25 == 0)
- Console.Write("\n ");
- }
- Console.WriteLine();
- // Try to recreate current state of data.
- // Do: Bitmap, DateTimeTZI
- switch (dataType)
- {
- // Handle internally serialized string data (ResourceTypeCode members).
- case "ResourceTypeCode.String":
- BinaryReader reader = new BinaryReader(new MemoryStream(data));
- string binData = reader.ReadString();
- Console.WriteLine($" Recreated Value: {binData}");
- break;
- case "ResourceTypeCode.Int32":
- Console.WriteLine($" Recreated Value: {BitConverter.ToInt32(data, 0)}");
- break;
- case "ResourceTypeCode.Boolean":
- Console.WriteLine($" Recreated Value: {BitConverter.ToBoolean(data, 0)}");
- break;
- // .jpeg image stored as a stream.
- case "ResourceTypeCode.Stream":
- const int OFFSET = 4;
- int size = BitConverter.ToInt32(data, 0);
- Bitmap value1 = new Bitmap(new MemoryStream(data, OFFSET, size));
- Console.WriteLine($" Recreated Value: {value1}");
- break;
- default:
- break;
- }
- Console.WriteLine();
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/vb/class1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/vb/class1.vb
deleted file mode 100644
index 32cc54a9eb381..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/vb/class1.vb
+++ /dev/null
@@ -1,37 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections
-Imports System.Resources
-
-Module Example2
- Public Sub Main()
- Console.WriteLine("Resources in ApplicationResources.resources:")
- Dim res As New ResourceReader(".\ApplicationResources.resources")
- Dim dict As IDictionaryEnumerator = res.GetEnumerator()
- Do While dict.MoveNext()
- Console.WriteLine(" {0}: '{1}' (Type {2})", dict.Key, dict.Value, dict.Value.GetType().Name)
- Loop
- res.Close()
- End Sub
-End Module
-' The example displays output like the following:
-' Resources in ApplicationResources.resources:
-' Label3: '"Last Name:"' (Type String)
-' Label2: '"Middle Name:"' (Type String)
-' Label1: '"First Name:"' (Type String)
-' Label7: '"State:"' (Type String)
-' Label6: '"City:"' (Type String)
-' Label5: '"Street Address:"' (Type String)
-' Label4: '"SSN:"' (Type String)
-' Label9: '"Home Phone:"' (Type String)
-' Label8: '"Zip Code:"' (Type String)
-' Title: '"Contact Information"' (Type String)
-' Label12: '"Other Phone:"' (Type String)
-' Label13: '"Fax:"' (Type String)
-' Label10: '"Business Phone:"' (Type String)
-' Label11: '"Mobile Phone:"' (Type String)
-' Label14: '"Email Address:"' (Type String)
-' Label15: '"Alternate Email Address:"' (Type String)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/vb/ctor1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/vb/ctor1.vb
deleted file mode 100644
index 9d0a3ce02f03b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Resources/ResourceReader/Overview/vb/ctor1.vb
+++ /dev/null
@@ -1,46 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example
- Public Sub Main()
- Standalone()
- Console.WriteLine("---")
- Embedded
- End Sub
-
- Private Sub Standalone()
- '
- ' Instantiate a standalone .resources file from its filename.
- Dim rr1 As New System.Resources.ResourceReader("Resources1.resources")
-
- ' Instantiate a standalone .resources file from a stream.
- Dim fs As New System.IO.FileStream(".\Resources2.resources",
- System.IO.FileMode.Open)
- Dim rr2 As New System.Resources.ResourceReader(fs)
- '
-
- Console.WriteLine("rr1: {0}", rr1 IsNot Nothing)
- Console.WriteLine("rr2: {0}", rr2 IsNot Nothing)
- End Sub
-
- Private Sub Embedded()
- '
- Dim assem As System.Reflection.Assembly =
- System.Reflection.Assembly.LoadFrom(".\MyLibrary.dll")
- Dim fs As System.IO.Stream =
- assem.GetManifestResourceStream("MyCompany.LibraryResources.resources")
- Dim rr As New System.Resources.ResourceReader(fs)
- '
-
- If fs Is Nothing Then
- Console.WriteLine(fs Is Nothing)
- For Each name In assem.GetManifestResourceNames()
- Console.WriteLine(name)
- Next
- Exit Sub
- Else
- Console.WriteLine(fs Is Nothing)
- End If
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/csharp/multiple1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/csharp/multiple1.cs
deleted file mode 100644
index 25b9cbfd39e30..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/csharp/multiple1.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-
-//
-[assembly:InternalsVisibleTo("Friend1a")]
-[assembly:InternalsVisibleTo("Friend1b")]
-//
-
-public class StringUtilities
-{
- internal string ToTitleCase(string value)
- {
- string retval = null;
- for (int ctr = 0; ctr <= value.Length - 1; ctr++)
- if (ctr == 0)
- retval += Char.ToUpper(value[ctr]);
- else if (ctr > 0 && Char.IsWhiteSpace(value[ctr - 1]))
- retval += Char.ToUpper(value[ctr]);
- else
- retval += value[ctr];
- return retval;
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/csharp/multiple2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/csharp/multiple2.cs
deleted file mode 100644
index 981dd1b35e936..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/csharp/multiple2.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-
-//
-[assembly:InternalsVisibleTo("Friend2a"),
- InternalsVisibleTo("Friend2b")]
-//
-
-namespace Utilities
-{
- public class StringUtilities
- {
- internal static string ToTitleCase(string value)
- {
- string retval = null;
- for (int ctr = 0; ctr <= value.Length - 1; ctr++)
- if (ctr == 0)
- retval += Char.ToUpper(value[ctr]);
- else if (ctr > 0 && Char.IsWhiteSpace(value[ctr - 1]))
- retval += Char.ToUpper(value[ctr]);
- else
- retval += value[ctr];
- return retval;
- }
- }
-}
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/vb/multiple1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/vb/multiple1.vb
deleted file mode 100644
index 24e7e90f23773..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/vb/multiple1.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-Imports System.Runtime.CompilerServices
-
-'
-
-
-'
-Public Class StringUtilities
- Friend Function ToTitleCase(value As String) As String
- Dim retval As String = Nothing
- For ctr As Integer = 0 To value.Length - 1
- If ctr = 0 Then
- retval += Char.ToUpper(value(ctr))
- ElseIf ctr > 0 AndAlso Char.IsWhiteSpace(value(ctr - 1))
- retval += Char.ToUpper(value(ctr))
- Else
- retval += value(ctr)
- End If
- Next
- Return retval
- End Function
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/vb/multiple2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/vb/multiple2.vb
deleted file mode 100644
index 54c1b82611a18..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/vb/multiple2.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-Imports System.Runtime.CompilerServices
-
-'
-
-'
-Namespace Utilities
- Public Class StringUtilities
- Shared Friend Function ToTitleCase(value As String) As String
- Dim retval As String = Nothing
- For ctr As Integer = 0 To value.Length - 1
- If ctr = 0 Then
- retval += Char.ToUpper(value(ctr))
- ElseIf ctr > 0 AndAlso Char.IsWhiteSpace(value(ctr - 1))
- retval += Char.ToUpper(value(ctr))
- Else
- retval += value(ctr)
- End If
- Next
- Return retval
- End Function
- End Class
-End Namespace
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/csharp/gethashcodeex1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/csharp/gethashcodeex1.cs
deleted file mode 100644
index c58d72ac74c0d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/csharp/gethashcodeex1.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-using System;
-using System.Runtime.CompilerServices;
-
-public class Example
-{
- public static void Main()
- {
- Console.WriteLine("{0,-18} {1,6} {2,18:N0} {3,6} {4,18:N0}\n",
- "", "Var 1", "Hash Code", "Var 2", "Hash Code");
-
- // Get hash codes of two different strings.
- String sc1 = "String #1";
- String sc2 = "String #2";
- ShowHashCodes("sc1", sc1, "sc2", sc2);
-
- // Get hash codes of two identical non-interned strings.
- String s1 = "This string";
- String s2 = String.Format("{0} {1}", "This", "string");
- ShowHashCodes("s1", s1, "s2", s2);
-
- // Get hash codes of two (evidently concatenated) strings.
- String si1 = "This is a string!";
- String si2 = "This " + "is " + "a " + "string!";
- ShowHashCodes("si1", si1, "si2", si2);
- }
-
- private static void ShowHashCodes(String var1, Object value1,
- String var2, Object value2)
- {
- Console.WriteLine("{0,-18} {1,6} {2,18:X8} {3,6} {4,18:X8}",
- "Obj.GetHashCode", var1, value1.GetHashCode(),
- var2, value2.GetHashCode());
-
- Console.WriteLine("{0,-18} {1,6} {2,18:X8} {3,6} {4,18:X8}\n",
- "RTH.GetHashCode", var1, RuntimeHelpers.GetHashCode(value1),
- var2, RuntimeHelpers.GetHashCode(value2));
- }
-}
-// The example displays output similar to the following:
-// Var 1 Hash Code Var 2 Hash Code
-//
-// Obj.GetHashCode sc1 94EABD27 sc2 94EABD24
-// RTH.GetHashCode sc1 02BF8098 sc2 00BB8560
-//
-// Obj.GetHashCode s1 29C5A397 s2 29C5A397
-// RTH.GetHashCode s1 0297B065 s2 03553390
-//
-// Obj.GetHashCode si1 941BCEA5 si2 941BCEA5
-// RTH.GetHashCode si1 01FED012 si2 01FED012
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/vb/gethashcodeex1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/vb/gethashcodeex1.vb
deleted file mode 100644
index 23afc1bd6229e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.CompilerServices/RuntimeHelpers/GetHashCode/vb/gethashcodeex1.vb
+++ /dev/null
@@ -1,52 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Runtime.CompilerServices
-
-Module Example
- Public Sub Main()
- Console.WriteLine("{0,-18} {1,6} {2,18:N0} {3,6} {4,18:N0}",
- "", "Var 1", "Hash Code", "Var 2", "Hash Code")
- Console.WriteLine()
-
- ' Get hash codes of two different strings.
- Dim sc1 As String = "String #1"
- Dim sc2 As String = "String #2"
- ShowHashCodes("sc1", sc1, "sc2", sc2)
-
- ' Get hash codes of two identical non-interned strings.
- Dim s1 As String = "This string"
- Dim s2 As String = String.Format("{0} {1}", "This", "string")
- ShowHashCodes("s1", s1, "s2", s2)
-
- ' Get hash codes of two (evidently concatenated) strings.
- Dim si1 As String = "This is a string!"
- Dim si2 As String = "This " + "is " + "a " + "string!"
- ShowHashCodes("si1", si1, "si2", si2)
- End Sub
-
- Private Sub ShowHashCodes(var1 As String, value1 As Object,
- var2 As String, value2 As Object)
- Console.WriteLine("{0,-18} {1,6} {2,18:X8} {3,6} {4,18:X8}",
- "Obj.GetHashCode", var1, value1.GetHashCode,
- var2, value2.GetHashCode)
-
- Console.WriteLine("{0,-18} {1,6} {2,18:X8} {3,6} {4,18:X8}",
- "RTH.GetHashCode", var1, RuntimeHelpers.GetHashCode(value1),
- var2, RuntimeHelpers.GetHashCode(value2))
- Console.WriteLine()
- End Sub
-End Module
-' The example displays output similar to the following:
-' Var 1 Hash Code Var 2 Hash Code
-'
-' Obj.GetHashCode sc1 94EABD27 sc2 94EABD24
-' RTH.GetHashCode sc1 02BF8098 sc2 00BB8560
-'
-' Obj.GetHashCode s1 29C5A397 s2 29C5A397
-' RTH.GetHashCode s1 0297B065 s2 03553390
-'
-' Obj.GetHashCode si1 941BCEA5 si2 941BCEA5
-' RTH.GetHashCode si1 01FED012 si2 01FED012
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/csharp/source.cs
deleted file mode 100644
index a86d65aa13274..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/csharp/source.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-//
-using System.Runtime.InteropServices;
-//
-
-//
-public interface INew
-{
- void NewMethod();
-}
-//
-
-//
-public interface ICustomMarshaler
-{
- Object MarshalNativeToManaged(IntPtr pNativeData);
- IntPtr MarshalManagedToNative(Object ManagedObj);
- void CleanUpNativeData(IntPtr pNativeData);
- void CleanUpManagedData(Object ManagedObj);
- int GetNativeDataSize();
-}
-//
-
-namespace scope1
-{
- //
- interface IUserData
- {
- void DoSomeStuff(INew pINew);
- }
- //
-}
-
-namespace scope2
-{
- //
- interface IUserData
- {
- void DoSomeStuff(
- [MarshalAs(UnmanagedType.CustomMarshaler,
- MarshalType="NewOldMarshaler")]
- INew pINew
- );
- }
- //
-}
-
-//
-public class NewOldMarshaler : ICustomMarshaler
-{
- public static ICustomMarshaler GetInstance(string pstrCookie)
- => new NewOldMarshaler();
-
- public Object MarshalNativeToManaged(IntPtr pNativeData) => throw new NotImplementedException();
- public IntPtr MarshalManagedToNative(Object ManagedObj) => throw new NotImplementedException();
- public void CleanUpNativeData(IntPtr pNativeData) => throw new NotImplementedException();
- public void CleanUpManagedData(Object ManagedObj) => throw new NotImplementedException();
- public int GetNativeDataSize() => throw new NotImplementedException();
-}
-//
-
-class StubClass
-{
- public static void Main() { }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/vb/source.vb
deleted file mode 100644
index 0b0c06adb87b1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.InteropServices/ICustomMarshaler/Overview/vb/source.vb
+++ /dev/null
@@ -1,47 +0,0 @@
-'
-Imports System.Runtime.InteropServices
-
-'
-
-'
-Public Interface INew
- Sub NewMethod()
-End Interface
-'
-
-
-'
-Public Interface ICustomMarshaler
- Function MarshalNativeToManaged( pNativeData As IntPtr ) As Object
- Function MarshalManagedToNative( ManagedObj As Object ) As IntPtr
- Sub CleanUpNativeData( pNativeData As IntPtr )
- Sub CleanUpManagedData( ManagedObj As Object )
- Function GetNativeDataSize() As Integer
-End Interface
-'
-
-Namespace scope1
-
-'
-Public Interface IUserData
- Sub DoSomeStuff(pINew As INew)
-End Interface
-'
-
-End Namespace
-
-Namespace scope2
-
-'
-Public Interface IUserData
- Sub DoSomeStuff( _
- pINew As INew)
-End Interface
-'
-End Namespace
-
-Class StubClass
- Public Shared Sub Main
- End Sub
-End Class
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/csharp/apply1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/csharp/apply1.cs
deleted file mode 100644
index 5cbe00d402f66..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/csharp/apply1.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using System;
-using System.Reflection;
-using System.Runtime.Versioning;
-
-[assembly:ComponentGuaranteesAttribute(ComponentGuaranteesOptions.None)]
-namespace MyLibrary
-{
- [ComponentGuaranteesAttribute(ComponentGuaranteesOptions.Stable)] public class MyLibraryClass
- {
- public string GetName()
- {
- return "My Library";
- }
- }
-
- [ComponentGuaranteesAttribute(ComponentGuaranteesOptions.Exchange)] public class MyPrimitiveClass
- {}
-
- [ComponentGuaranteesAttribute(ComponentGuaranteesOptions.None)] public class MyChurningClass
- {}
-}
-
-public class Example
-{
- public static void Main()
- {
- Assembly assem = typeof(Example).Assembly;
- foreach (Type typ in assem.GetTypes())
- {
- object[] typeAttribs = typ.GetCustomAttributes(typeof(ComponentGuaranteesAttribute), true);
- if (typeAttribs.Length > 0)
- {
- ComponentGuaranteesAttribute guaranteeAttrib = (ComponentGuaranteesAttribute) typeAttribs[0];
- ComponentGuaranteesOptions guarantee = guaranteeAttrib.Guarantees;
- // Test whether guarantee is Exchange.
- if ((guarantee & ComponentGuaranteesOptions.Exchange) == ComponentGuaranteesOptions.Exchange)
- Console.WriteLine($"{typ.Name} is marked as {guarantee}.");
- //
- // Test whether guarantee is Stable.
- if ((guarantee & ComponentGuaranteesOptions.Stable) == ComponentGuaranteesOptions.Stable)
- Console.WriteLine($"{typ.Name} is marked as {guarantee}.");
- //
- //
- // Test whether guarantee is Stable or Exchange.
- if ((guarantee & (ComponentGuaranteesOptions.Stable | ComponentGuaranteesOptions.Exchange)) > 0)
- Console.WriteLine($"{typ.Name} is marked as Stable or Exchange.");
- //
- //
- // Test whether there is no guarantee (neither Stable nor Exchange).
- if ((guarantee & (ComponentGuaranteesOptions.Stable | ComponentGuaranteesOptions.Exchange)) == 0)
- Console.WriteLine($"{typ.Name} has no compatibility guarantee.");
- //
- }
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/vb/apply1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/vb/apply1.vb
deleted file mode 100644
index bd3f3de6b1826..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Runtime.Versioning/ComponentGuaranteesAttribute/Overview/vb/apply1.vb
+++ /dev/null
@@ -1,57 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Reflection
-Imports System.Runtime.Versioning
-
-
-Namespace MyLibrary
- Public Class MyLibraryClass
- Public Function GetName() As String
- Return "My Library"
- End Function
- End Class
-
- Public Class MyPrimitiveClass
-
- End Class
-
- Public Class MyChurningClass
-
- End Class
-End Namespace
-
-Public Module Example
- Public Sub Main()
- Dim assem As Assembly = GetType(Example).Assembly
- For Each typ As Type In assem.GetTypes()
- Dim typeAttribs() As Object = typ.GetCustomAttributes(GetType(ComponentGuaranteesAttribute), True)
- If typeAttribs.Length > 0 Then
- Dim guaranteeAttrib As ComponentGuaranteesAttribute = DirectCast(typeAttribs(0), ComponentGuaranteesAttribute)
- Dim guarantee = guaranteeAttrib.Guarantees
- ' Test whether guarantee is Exchange.
- If (guarantee And ComponentGuaranteesOptions.Exchange) = ComponentGuaranteesOptions.Exchange Then
- Console.WriteLine("{0} is marked as {1}.", typ.Name, guarantee)
- End If
- '
- ' Test whether guarantee is Stable.
- If (guarantee And ComponentGuaranteesOptions.Stable) = ComponentGuaranteesOptions.Stable Then
- Console.WriteLine("{0} is marked as {1}.", typ.Name, guarantee)
- End If
- '
- '
- ' Test whether guarantee is Stable or Exchange.
- If (guarantee And (ComponentGuaranteesOptions.Stable Or ComponentGuaranteesOptions.Exchange)) > 0 Then
- Console.WriteLine("{0} is marked as Stable or Exchange.", typ.Name, guarantee)
- End If
- '
- '
- ' Test whether there is no guarantee (neither Stable nor Exchange).
- If (guarantee And (ComponentGuaranteesOptions.Stable Or ComponentGuaranteesOptions.Exchange)) = 0 Then
- Console.WriteLine("{0} has no compatibility guarantee.", typ.Name, guarantee)
- End If
- '
- End If
- Next
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Match/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Match/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Match/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Match/csharp/startat.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Match/csharp/startat.cs
deleted file mode 100644
index f4ed0b262fab1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Match/csharp/startat.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Text.RegularExpressions;
-
-namespace Examples
-{
- public class Example3
- {
- public static void Main()
- {
- string input = "Zip code: 98052";
- var regex = new Regex(@"(?<=Zip code: )\d{5}");
- Match match = regex.Match(input, 5);
- if (match.Success)
- Console.WriteLine($"Match found: {match.Value}");
- }
- }
-}
-
-// This code prints the following output:
-// Match found: 98052
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/caching1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/caching1.cs
deleted file mode 100644
index f5389b0b8282d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/caching1.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.IO;
-using System.Text.RegularExpressions;
-
-public class CachingExample
-{
- public static void Main()
- {
- string filename = @".\Caching1.txt";
- //
- StreamReader sr = new StreamReader(filename);
- string input;
- string pattern = @"\b(\w+)\s\1\b";
- while (sr.Peek() >= 0)
- {
- input = sr.ReadLine();
- Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
- MatchCollection matches = rgx.Matches(input);
- if (matches.Count > 0)
- {
- Console.WriteLine($"{input} ({matches.Count} matches):");
- foreach (Match match in matches)
- Console.WriteLine(" " + match.Value);
- }
- }
- sr.Close();
- //
- Console.WriteLine();
- Main2();
- }
-
- public static void Main2()
- {
- string filename = @".\Caching1.txt";
- //
- StreamReader sr = new StreamReader(filename);
- string input;
- string pattern = @"\b(\w+)\s\1\b";
- Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
-
- while (sr.Peek() >= 0)
- {
- input = sr.ReadLine();
- MatchCollection matches = rgx.Matches(input);
- if (matches.Count > 0)
- {
- Console.WriteLine($"{input} ({matches.Count} matches):");
- foreach (Match match in matches)
- Console.WriteLine(" " + match.Value);
- }
- }
- sr.Close();
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/regex_example1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/regex_example1.cs
deleted file mode 100644
index f3b5a59cdb006..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/regex_example1.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Text.RegularExpressions;
-
-public class Example
-{
- public static void Main()
- {
- // Get the en-US NumberFormatInfo object to build the regular
- // expression pattern dynamically.
- NumberFormatInfo nfi = CultureInfo.GetCultureInfo("en-US").NumberFormat;
-
- // Define the regular expression pattern.
- string pattern;
- pattern = @"^\s*[";
- // Get the positive and negative sign symbols.
- pattern += Regex.Escape(nfi.PositiveSign + nfi.NegativeSign) + @"]?\s?";
- // Get the currency symbol.
- pattern += Regex.Escape(nfi.CurrencySymbol) + @"?\s?";
- // Add integral digits to the pattern.
- pattern += @"(\d*";
- // Add the decimal separator.
- pattern += Regex.Escape(nfi.CurrencyDecimalSeparator) + "?";
- // Add the fractional digits.
- pattern += @"(\d{";
- // Determine the number of fractional digits in currency values.
- pattern += nfi.CurrencyDecimalDigits.ToString() + "})?){1}$";
-
- Console.WriteLine($"Pattern is {pattern}\n");
-
- Regex rgx = new Regex(pattern);
-
- // Define some test strings.
- string[] tests = { "-42", "19.99", "0.001", "100 USD",
- ".34", "0.34", "1,052.21", "$10.62",
- "+1.43", "-$0.23" };
-
- // Check each test string against the regular expression.
- foreach (string test in tests)
- {
- if (rgx.IsMatch(test))
- Console.WriteLine($"{test} is a currency value.");
- else
- Console.WriteLine($"{test} is not a currency value.");
- }
- }
-}
-// The example displays the following output:
-// Pattern is ^\s*[\+-]?\s?\$?\s?(\d*\.?(\d{2})?){1}$
-//
-// -42 is a currency value.
-// 19.99 is a currency value.
-// 0.001 is not a currency value.
-// 100 USD is not a currency value.
-// .34 is a currency value.
-// 0.34 is a currency value.
-// 1,052.21 is not a currency value.
-// $10.62 is a currency value.
-// +1.43 is a currency value.
-// -$0.23 is a currency value.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/words.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/words.cs
deleted file mode 100644
index ad56a166dde42..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/csharp/words.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-using System;
-using System.Text.RegularExpressions;
-
-public class Test
-{
- public static void Main ()
- {
-//
- // Define a regular expression for repeated words.
- Regex rx = new Regex(@"\b(?\w+)\s+(\k)\b",
- RegexOptions.Compiled | RegexOptions.IgnoreCase);
-//
-
- // Define a test string.
- string text = "The the quick brown fox fox jumps over the lazy dog dog.";
-
-//
- // Find matches.
- MatchCollection matches = rx.Matches(text);
-//
-
-//
- // Report the number of matches found.
- Console.WriteLine($"{matches.Count} matches found in:\n {text}");
-//
-
-//
- // Report on each match.
- foreach (Match match in matches)
- {
- GroupCollection groups = match.Groups;
- Console.WriteLine($"'{groups["word"].Value}' repeated at positions {groups[0].Index} and {groups[1].Index}");
- }
-//
- }
-}
-
-// The example produces the following output to the console:
-// 3 matches found in:
-// The the quick brown fox fox jumps over the lazy dog dog.
-// 'The' repeated at positions 0 and 4
-// 'fox' repeated at positions 20 and 25
-// 'dog' repeated at positions 49 and 53
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/vb/regex_example1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/vb/regex_example1.vb
deleted file mode 100644
index 90511bb655ed5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/vb/regex_example1.vb
+++ /dev/null
@@ -1,63 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Text.RegularExpressions
-
-Public Module Example
- Public Sub Main()
- ' Get the current NumberFormatInfo object to build the regular
- ' expression pattern dynamically.
- Dim nfi As NumberFormatInfo = CultureInfo.GetCultureInfo("en-US").NumberFormat
-
- ' Define the regular expression pattern.
- Dim pattern As String
- pattern = "^\s*["
- ' Get the positive and negative sign symbols.
- pattern += Regex.Escape(nfi.PositiveSign + nfi.NegativeSign) + "]?\s?"
- ' Get the currency symbol.
- pattern += Regex.Escape(nfi.CurrencySymbol) + "?\s?"
- ' Add integral digits to the pattern.
- pattern += "(\d*"
- ' Add the decimal separator.
- pattern += Regex.Escape(nfi.CurrencyDecimalSeparator) + "?"
- ' Add the fractional digits.
- pattern += "(\d{"
- ' Determine the number of fractional digits in currency values.
- pattern += nfi.CurrencyDecimalDigits.ToString() + "})?){1}$"
-
- Console.WriteLine("Pattern is {0}", pattern)
- Console.WriteLine()
-
- Dim rgx As New Regex(pattern)
-
- ' Define some test strings.
- Dim tests() As String = {"-42", "19.99", "0.001", "100 USD", _
- ".34", "0.34", "1,052.21", "$10.62", _
- "+1.43", "-$0.23" }
-
- ' Check each test string against the regular expression.
- For Each test As String In tests
- If rgx.IsMatch(test) Then
- Console.WriteLine("{0} is a currency value.", test)
- Else
- Console.WriteLine("{0} is not a currency value.", test)
- End If
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Pattern is ^\s*[\+-]?\s?\$?\s?(\d*\.?(\d{2})?){1}$
-'
-' -42 is a currency value.
-' 19.99 is a currency value.
-' 0.001 is not a currency value.
-' 100 USD is not a currency value.
-' .34 is a currency value.
-' 0.34 is a currency value.
-' 1,052.21 is not a currency value.
-' $10.62 is a currency value.
-' +1.43 is a currency value.
-' -$0.23 is a currency value.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/vb/words.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/vb/words.vb
deleted file mode 100644
index 8c4afc19cb7ac..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text.RegularExpressions/Regex/Overview/vb/words.vb
+++ /dev/null
@@ -1,49 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text.RegularExpressions
-
-Public Module Test
-
- Public Sub Main()
-'
- ' Define a regular expression for repeated words.
- Dim rx As New Regex("\b(?\w+)\s+(\k)\b", _
- RegexOptions.Compiled Or RegexOptions.IgnoreCase)
-'
-
- ' Define a test string.
- Dim text As String = "The the quick brown fox fox jumps over the lazy dog dog."
-
-'
- ' Find matches.
- Dim matches As MatchCollection = rx.Matches(text)
-'
-
-'
- ' Report the number of matches found.
- Console.WriteLine("{0} matches found in:", matches.Count)
- Console.WriteLine(" {0}", text)
-'
-
-'
- ' Report on each match.
- For Each match As Match In matches
- Dim groups As GroupCollection = match.Groups
- Console.WriteLine("'{0}' repeated at positions {1} and {2}", _
- groups.Item("word").Value, _
- groups.Item(0).Index, _
- groups.Item(1).Index)
- Next
-'
- End Sub
-End Module
-' The example produces the following output to the console:
-' 3 matches found in:
-' The the quick brown fox fox jumps over the lazy dog dog.
-' 'The' repeated at positions 0 and 4
-' 'fox' repeated at positions 20 and 25
-' 'dog' repeated at positions 49 and 53
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/csharp/getencoding1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/csharp/getencoding1.cs
deleted file mode 100644
index 3456efe6bf14e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/csharp/getencoding1.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-using System;
-using System.Text;
-
-public class Example
-{
- public static void Main()
- {
- Encoding enc = Encoding.GetEncoding(1253);
- Encoding altEnc = Encoding.GetEncoding("windows-1253");
- Console.WriteLine($"{enc.EncodingName} = Code Page {altEnc.CodePage}: {enc.Equals(altEnc)}");
- string greekAlphabet = "Α α Β β Γ γ Δ δ Ε ε Ζ ζ Η η " +
- "Θ θ Ι ι Κ κ Λ λ Μ μ Ν ν Ξ ξ " +
- "Ο ο Π π Ρ ρ Σ σ ς Τ τ Υ υ " +
- "Φ φ Χ χ Ψ ψ Ω ω";
- Console.OutputEncoding = Encoding.UTF8;
- byte[] bytes = enc.GetBytes(greekAlphabet);
- Console.WriteLine("{0,-12} {1,20} {2,20:X2}", "Character",
- "Unicode Code Point", "Code Page 1253");
- for (int ctr = 0; ctr < bytes.Length; ctr++) {
- if (greekAlphabet[ctr].Equals(' '))
- continue;
-
- Console.WriteLine("{0,-12} {1,20} {2,20:X2}", greekAlphabet[ctr],
- GetCodePoint(greekAlphabet[ctr]), bytes[ctr]);
- }
- }
-
- private static string GetCodePoint(char ch)
- {
- string retVal = "u+";
- byte[] bytes = Encoding.Unicode.GetBytes(ch.ToString());
- for (int ctr = bytes.Length - 1; ctr >= 0; ctr--)
- retVal += bytes[ctr].ToString("X2");
-
- return retVal;
- }
-}
-// The example displays the following output:
-// Character Unicode Code Point Code Page 1253
-// Α u+0391 C1
-// α u+03B1 E1
-// Β u+0392 C2
-// β u+03B2 E2
-// Γ u+0393 C3
-// γ u+03B3 E3
-// Δ u+0394 C4
-// δ u+03B4 E4
-// Ε u+0395 C5
-// ε u+03B5 E5
-// Ζ u+0396 C6
-// ζ u+03B6 E6
-// Η u+0397 C7
-// η u+03B7 E7
-// Θ u+0398 C8
-// θ u+03B8 E8
-// Ι u+0399 C9
-// ι u+03B9 E9
-// Κ u+039A CA
-// κ u+03BA EA
-// Λ u+039B CB
-// λ u+03BB EB
-// Μ u+039C CC
-// μ u+03BC EC
-// Ν u+039D CD
-// ν u+03BD ED
-// Ξ u+039E CE
-// ξ u+03BE EE
-// Ο u+039F CF
-// ο u+03BF EF
-// Π u+03A0 D0
-// π u+03C0 F0
-// Ρ u+03A1 D1
-// ρ u+03C1 F1
-// Σ u+03A3 D3
-// σ u+03C3 F3
-// ς u+03C2 F2
-// Τ u+03A4 D4
-// τ u+03C4 F4
-// Υ u+03A5 D5
-// υ u+03C5 F5
-// Φ u+03A6 D6
-// φ u+03C6 F6
-// Χ u+03A7 D7
-// χ u+03C7 F7
-// Ψ u+03A8 D8
-// ψ u+03C8 F8
-// Ω u+03A9 D9
-// ω u+03C9 F9
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/vb/getencoding1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/vb/getencoding1.vb
deleted file mode 100644
index 864777764d9a0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Encoding/Overview/vb/getencoding1.vb
+++ /dev/null
@@ -1,90 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-
-Module Example
- Public Sub Main()
- Dim enc As Encoding = Encoding.GetEncoding(1253)
- Dim altEnc As Encoding = Encoding.GetEncoding("windows-1253")
- Console.WriteLine("{0} = Code Page {1}: {2}", enc.EncodingName,
- altEnc.CodePage, enc.Equals(altEnc))
- Dim greekAlphabet As String = "Α α Β β Γ γ Δ δ Ε ε Ζ ζ Η η " +
- "Θ θ Ι ι Κ κ Λ λ Μ μ Ν ν Ξ ξ " +
- "Ο ο Π π Ρ ρ Σ σ ς Τ τ Υ υ " +
- "Φ φ Χ χ Ψ ψ Ω ω"
- Console.OutputEncoding = Encoding.UTF8
- Dim bytes() As Byte = enc.GetBytes(greekAlphabet)
- Console.WriteLine("{0,-12} {1,20} {2,20:X2}", "Character",
- "Unicode Code Point", "Code Page 1253")
- For ctr As Integer = 0 To bytes.Length - 1
- If greekAlphabet(ctr).Equals(" "c) Then Continue For
-
- Console.WriteLine("{0,-12} {1,20} {2,20:X2}", greekAlphabet(ctr),
- GetCodePoint(greekAlphabet(ctr)), bytes(ctr))
- Next
-
- End Sub
-
- Private Function GetCodePoint(ch As String) As String
- Dim retVal As String = "u+"
- Dim bytes() As Byte = Encoding.Unicode.GetBytes(ch)
- For ctr As Integer = bytes.Length - 1 To 0 Step -1
- retVal += bytes(ctr).ToString("X2")
- Next
- Return retVal
- End Function
-End Module
-' The example displays the following output:
-' Character Unicode Code Point Code Page 1253
-' Α u+0391 C1
-' α u+03B1 E1
-' Β u+0392 C2
-' β u+03B2 E2
-' Γ u+0393 C3
-' γ u+03B3 E3
-' Δ u+0394 C4
-' δ u+03B4 E4
-' Ε u+0395 C5
-' ε u+03B5 E5
-' Ζ u+0396 C6
-' ζ u+03B6 E6
-' Η u+0397 C7
-' η u+03B7 E7
-' Θ u+0398 C8
-' θ u+03B8 E8
-' Ι u+0399 C9
-' ι u+03B9 E9
-' Κ u+039A CA
-' κ u+03BA EA
-' Λ u+039B CB
-' λ u+03BB EB
-' Μ u+039C CC
-' μ u+03BC EC
-' Ν u+039D CD
-' ν u+03BD ED
-' Ξ u+039E CE
-' ξ u+03BE EE
-' Ο u+039F CF
-' ο u+03BF EF
-' Π u+03A0 D0
-' π u+03C0 F0
-' Ρ u+03A1 D1
-' ρ u+03C1 F1
-' Σ u+03A3 D3
-' σ u+03C3 F3
-' ς u+03C2 F2
-' Τ u+03A4 D4
-' τ u+03C4 F4
-' Υ u+03A5 D5
-' υ u+03C5 F5
-' Φ u+03A6 D6
-' φ u+03C6 F6
-' Χ u+03A7 D7
-' χ u+03C7 F7
-' Ψ u+03A8 D8
-' ψ u+03C8 F8
-' Ω u+03A9 D9
-' ω u+03C9 F9
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/RegularExpressions/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Text/RegularExpressions/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/RegularExpressions/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/RegularExpressions/Overview/vb/caching1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/RegularExpressions/Overview/vb/caching1.vb
deleted file mode 100644
index 27d2a3705b3e1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/RegularExpressions/Overview/vb/caching1.vb
+++ /dev/null
@@ -1,53 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.IO
-Imports System.Text.RegularExpressions
-
-Module Example
- Public Sub Main()
- Dim filename As String = ".\Caching1.txt"
- '
- Dim sr As New StreamReader(filename)
- Dim input As String
- Dim pattern As String = "\b(\w+)\s\1\b"
- Do While sr.Peek() >= 0
- input = sr.ReadLine()
- Dim rgx As New Regex(pattern, RegexOptions.IgnoreCase)
- Dim matches As MatchCollection = rgx.Matches(input)
- If matches.Count > 0 Then
- Console.WriteLine("{0} ({1} matches):", input, matches.Count)
- For Each match As Match In matches
- Console.WriteLine(" " + match.Value)
- Next
- End If
- Loop
- sr.Close()
- '
- Console.WriteLine()
- Main2()
- End Sub
-
- Public Sub Main2()
- Dim filename As String = ".\Caching1.txt"
- '
- Dim sr As New StreamReader(filename)
- Dim input As String
- Dim pattern As String = "\b(\w+)\s\1\b"
- Dim rgx As New Regex(pattern, RegexOptions.IgnoreCase)
- Do While sr.Peek() >= 0
- input = sr.ReadLine()
- Dim matches As MatchCollection = rgx.Matches(input)
- If matches.Count > 0 Then
- Console.WriteLine("{0} ({1} matches):", input, matches.Count)
- For Each match As Match In matches
- Console.WriteLine(" " + match.Value)
- Next
- End If
- Loop
- sr.Close()
- '
- Console.WriteLine()
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/CountLettersInSpan.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/CountLettersInSpan.cs
deleted file mode 100644
index ba8dc14459e3d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/CountLettersInSpan.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Security.Cryptography;
-using System.Text;
-
-namespace RuneSamples
-{
- public static class CountLettersInSpan
- {
- public static void Run()
- {
- Console.WriteLine($"Incorrect code: { CountLettersBadExample(new Span("𐓏𐓘𐓻𐓘𐓻𐓟 𐒻𐓟".ToCharArray()))} letters in 𐓏𐓘𐓻𐓘𐓻𐓟 𐒻𐓟");
- Console.WriteLine($" Correct code: { CountLetters(new Span("𐓏𐓘𐓻𐓘𐓻𐓟 𐒻𐓟".ToCharArray()))} letters in 𐓏𐓘𐓻𐓘𐓻𐓟 𐒻𐓟");
-
- //
- // THE FOLLOWING METHOD SHOWS INCORRECT CODE.
- // DO NOT DO THIS IN A PRODUCTION APPLICATION.
- static int CountLettersBadExample(ReadOnlySpan span)
- {
- int letterCount = 0;
-
- foreach (char ch in span)
- {
- if (char.IsLetter(ch))
- { letterCount++; }
- }
-
- return letterCount;
- }
- //
-
- //
- static int CountLetters(ReadOnlySpan span)
- {
- int letterCount = 0;
-
- foreach (Rune rune in span.EnumerateRunes())
- {
- if (Rune.IsLetter(rune))
- { letterCount++; }
- }
-
- return letterCount;
- }
- //
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/CountLettersInString.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/CountLettersInString.cs
deleted file mode 100644
index cf7c5af02da30..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/CountLettersInString.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace RuneSamples
-{
- public static class CountLettersInString
- {
- public static void Run()
- {
- Console.WriteLine($"Incorrect code: { CountLettersBadExample("𐓏𐓘𐓻𐓘𐓻𐓟 𐒻𐓟")} letters in 𐓏𐓘𐓻𐓘𐓻𐓟 𐒻𐓟");
- Console.WriteLine($" Correct code: { CountLetters("𐓏𐓘𐓻𐓘𐓻𐓟 𐒻𐓟")} letters in 𐓏𐓘𐓻𐓘𐓻𐓟 𐒻𐓟");
- //Console.WriteLine($"String '𐓏𐓘𐓻𐓘𐓻𐓟𐒻𐓟' consists entirely of letters: { StringConsistsEntirelyOfLetters("𐓏𐓘𐓻𐓘𐓻𐓟𐒻𐓟")}");
-
- //
- // THE FOLLOWING METHOD SHOWS INCORRECT CODE.
- // DO NOT DO THIS IN A PRODUCTION APPLICATION.
- int CountLettersBadExample(string s)
- {
- int letterCount = 0;
-
- foreach (char ch in s)
- {
- if (char.IsLetter(ch))
- { letterCount++; }
- }
-
- return letterCount;
- }
- //
-
- //
- int CountLetters(string s)
- {
- int letterCount = 0;
-
- foreach (Rune rune in s.EnumerateRunes())
- {
- if (Rune.IsLetter(rune))
- { letterCount++; }
- }
-
- return letterCount;
- }
- //
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/EncodeRune.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/EncodeRune.cs
deleted file mode 100644
index c39fe86f0837b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/EncodeRune.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace RuneSamples
-{
- public static class EncodeRune
- {
- public static void Run()
- {
- Console.WriteLine("Converting ox emoji to UTF-16 and UTF-8");
- Rune rune = Rune.GetRuneAt("🐂", 0);
- Console.WriteLine($"Rune value: {rune.Value}");
-
- //
- char[] chars = new char[rune.Utf16SequenceLength];
- int numCharsWritten = rune.EncodeToUtf16(chars);
- //
-
- Console.WriteLine($"Number of chars: {numCharsWritten}");
-
- //
- string theString = rune.ToString();
- //
-
- //
- byte[] bytes = new byte[rune.Utf8SequenceLength];
- int numBytesWritten = rune.EncodeToUtf8(bytes);
- //
-
- Console.WriteLine($"Number of UTF-8 bytes: {numBytesWritten}");
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/FindFirstLetter.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/FindFirstLetter.cs
deleted file mode 100644
index ec79966fb5b2f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/FindFirstLetter.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace RuneSamples
-{
- public static class FindFirstLetter
- {
- public static void Run()
- {
- Console.WriteLine($"Index of first capital letter of Latin alphabet in \"𐓏𐓘𐓻𐓘𐓻𐓟F𐒻𐓟\": { GetIndexOfFirstAToZ("𐓏𐓘𐓻𐓘𐓻𐓟F𐒻𐓟")}");
-
- //
- int GetIndexOfFirstAToZ(string s)
- {
- for (int i = 0; i < s.Length; i++)
- {
- char thisChar = s[i];
- if ('A' <= thisChar && thisChar <= 'Z')
- {
- return i; // found a match
- }
- }
-
- return -1; // didn't find 'A' - 'Z' in the input string
- }
- //
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/InstantiateRunes.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/InstantiateRunes.cs
deleted file mode 100644
index c48bfa1e4a8e4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/InstantiateRunes.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace RuneSamples
-{
- public class InstantiateRunes
- {
- public static void Run()
- {
- //
- Rune a = new Rune(0x0061); // LATIN SMALL LETTER A
- Rune b = new Rune(0x10421); // DESERET CAPITAL LETTER ER
- //
-
- //
- Rune c = new Rune('a');
- //
-
- //
- Rune d = new Rune('\ud83d', '\udd2e'); // U+1F52E CRYSTAL BALL
- //
-
- Console.WriteLine($"Rune a: {a}");
- Console.WriteLine($"Rune b: {b}");
- Console.WriteLine($"Rune c: {c}");
- Console.WriteLine($"Rune d: {d}");
- Console.WriteLine($"Rune d code point: {d.Value}");
-
- //
- Rune rune = new Rune('\ud83d', '\udd2e'); // U+1F52E CRYSTAL BALL
- int codePoint = rune.Value; // = 128302 decimal (= 0x1F52E)
- //
-
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/SplitStringOnChar.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/SplitStringOnChar.cs
deleted file mode 100644
index 896039be8f5bf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/SplitStringOnChar.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace RuneSamples
-{
- public static class SplitStringOnChar
- {
- public static void Run()
- {
- //
- string inputString = "🐂, 🐄, 🐆";
- string[] splitOnSpace = inputString.Split(' ');
- string[] splitOnComma = inputString.Split(',');
- //
-
- Console.WriteLine($"Splitting string {inputString} on space");
- Array.ForEach(splitOnSpace, s => Console.WriteLine(s));
-
- Console.WriteLine($"Splitting string {inputString} on comma");
- Array.ForEach(splitOnComma, s => Console.WriteLine(s));
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/TrimNonLettersAndNonDigits.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/TrimNonLettersAndNonDigits.cs
deleted file mode 100644
index fc339d6489403..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/TrimNonLettersAndNonDigits.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Buffers;
-using System.Collections.Generic;
-using System.Text;
-
-namespace RuneSamples
-{
- class TrimNonLettersAndNonDigits
- {
- public static void Run()
- {
- char[] s = "!Hello!".ToCharArray();
- ReadOnlySpan span = new ReadOnlySpan(s);
- Console.WriteLine(span.ToString());
- ReadOnlySpan newSpan = TrimNonLettersAndNonDigits(span);
- Console.WriteLine(newSpan.ToString());
-
- //
- static ReadOnlySpan TrimNonLettersAndNonDigits(ReadOnlySpan span)
- {
- // First, trim from the front.
- // If any Rune can't be decoded
- // (return value is anything other than "Done"),
- // or if the Rune is a letter or digit,
- // stop trimming from the front and
- // instead work from the end.
- while (Rune.DecodeFromUtf16(span, out Rune rune, out int charsConsumed) == OperationStatus.Done)
- {
- if (Rune.IsLetterOrDigit(rune))
- { break; }
- span = span[charsConsumed..];
- }
-
- // Next, trim from the end.
- // If any Rune can't be decoded,
- // or if the Rune is a letter or digit,
- // break from the loop, and we're finished.
- while (Rune.DecodeLastFromUtf16(span, out Rune rune, out int charsConsumed) == OperationStatus.Done)
- {
- if (Rune.IsLetterOrDigit(rune))
- { break; }
- span = span[..^charsConsumed];
- }
-
- return span;
- }
- //
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/WorkWithSurrogates.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/WorkWithSurrogates.cs
deleted file mode 100644
index e9a7c23c2e73f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/csharp/WorkWithSurrogates.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace RuneSamples
-{
- public static class WorkWithSurrogates
- {
- public static void Run()
- {
- ProcessStringUseChar("𐓏𐓘𐓻𐓘𐓻𐓟 𐒻𐓟");
- ProcessStringUseRune("𐓏𐓘𐓻𐓘𐓻𐓟 𐒻𐓟");
-
- //
- static void ProcessStringUseChar(string s)
- {
- Console.WriteLine("Using char");
-
- for (int i = 0; i < s.Length; i++)
- {
- if (!char.IsSurrogate(s[i]))
- {
- Console.WriteLine($"Code point: {(int)(s[i])}");
- }
- else if (i + 1 < s.Length && char.IsSurrogatePair(s[i], s[i + 1]))
- {
- int codePoint = char.ConvertToUtf32(s[i], s[i + 1]);
- Console.WriteLine($"Code point: {codePoint}");
- i++; // so that when the loop iterates it's actually +2
- }
- else
- {
- throw new Exception("String was not well-formed UTF-16.");
- }
- }
- }
- //
-
- //
- static void ProcessStringUseRune(string s)
- {
- Console.WriteLine("Using Rune");
-
- for (int i = 0; i < s.Length;)
- {
- if (!Rune.TryGetRuneAt(s, i, out Rune rune))
- {
- throw new Exception("String was not well-formed UTF-16.");
- }
-
- Console.WriteLine($"Code point: {rune.Value}");
- i += rune.Utf16SequenceLength; // increment the iterator by the number of chars in this Rune
- }
- }
- //
-
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/fsharp/CountLettersInString.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/fsharp/CountLettersInString.fs
deleted file mode 100644
index 73be5587bff0f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/Rune/Overview/fsharp/CountLettersInString.fs
+++ /dev/null
@@ -1,28 +0,0 @@
-open System
-open System.Text
-
-//
-// THE FOLLOWING METHOD SHOWS INCORRECT CODE.
-// DO NOT DO THIS IN A PRODUCTION APPLICATION.
-let countLettersBadExample (s: string) =
- let mutable letterCount = 0
-
- for ch in s do
- if Char.IsLetter ch then
- letterCount <- letterCount + 1
-
- letterCount
-
-//
-
-//
-let countLetters (s: string) =
- let mutable letterCount = 0
-
- for rune in s.EnumerateRunes() do
- if Rune.IsLetter rune then
- letterCount <- letterCount + 1
-
- letterCount
-
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/Project.csproj
deleted file mode 100644
index 22dd9034898ba..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- true
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/call1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/call1.cs
deleted file mode 100644
index ed96e1ca314d7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/call1.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-using System;
-using System.Text;
-
-public class Example
-{
- public static void Main()
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("This is the beginning of a sentence, ");
- sb.Replace("the beginning of ", "");
- sb.Insert(sb.ToString().IndexOf("a ") + 2, "complete ");
- sb.Replace(",", ".");
- Console.WriteLine(sb.ToString());
- }
-}
-// The example displays the following output:
-// This is a complete sentence.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/call2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/call2.cs
deleted file mode 100644
index 9fe17b881dfea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/call2.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-using System;
-using System.Text;
-
-public class Example2
-{
- public static void Main()
- {
- StringBuilder sb = new StringBuilder("This is the beginning of a sentence, ");
- sb.Replace("the beginning of ", "").Insert(sb.ToString().IndexOf("a ") + 2,
- "complete ").Replace(",", ".");
- Console.WriteLine(sb.ToString());
- }
-}
-// The example displays the following output:
-// This is a complete sentence.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/chars1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/chars1.cs
deleted file mode 100644
index 85b3c3c664502..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/chars1.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Text;
-
-public class Example3
-{
- public static void Main()
- {
- Random rnd = new Random();
- StringBuilder sb = new StringBuilder();
-
- // Generate 10 random numbers and store them in a StringBuilder.
- for (int ctr = 0; ctr <= 9; ctr++)
- sb.Append(rnd.Next().ToString("N5"));
-
- Console.WriteLine("The original string:");
- Console.WriteLine(sb.ToString());
-
- // Decrease each number by one.
- for (int ctr = 0; ctr < sb.Length; ctr++)
- {
- if (Char.GetUnicodeCategory(sb[ctr]) == UnicodeCategory.DecimalDigitNumber)
- {
- int number = (int)Char.GetNumericValue(sb[ctr]);
- number--;
- if (number < 0) number = 9;
-
- sb[ctr] = number.ToString()[0];
- }
- }
- Console.WriteLine("\nThe new string:");
- Console.WriteLine(sb.ToString());
- }
-}
-// The example displays the following output:
-// The original string:
-// 1,457,531,530.00000940,522,609.000001,668,113,564.000001,998,992,883.000001,792,660,834.00
-// 000101,203,251.000002,051,183,075.000002,066,000,067.000001,643,701,043.000001,702,382,508
-// .00000
-//
-// The new string:
-// 0,346,420,429.99999839,411,598.999990,557,002,453.999990,887,881,772.999990,681,559,723.99
-// 999090,192,140.999991,940,072,964.999991,955,999,956.999990,532,690,932.999990,691,271,497
-// .99999
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/default1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/default1.cs
deleted file mode 100644
index 76998f10013ce..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/default1.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-using System;
-using System.Reflection;
-using System.Text;
-
-public class Example4
-{
- public static void Main()
- {
- StringBuilder sb = new StringBuilder();
- ShowSBInfo(sb);
- sb.Append("This is a sentence.");
- ShowSBInfo(sb);
- for (int ctr = 0; ctr <= 10; ctr++)
- {
- sb.Append("This is an additional sentence.");
- ShowSBInfo(sb);
- }
- }
-
- private static void ShowSBInfo(StringBuilder sb)
- {
- foreach (var prop in sb.GetType().GetProperties())
- {
- if (prop.GetIndexParameters().Length == 0)
- Console.Write("{0}: {1:N0} ", prop.Name, prop.GetValue(sb));
- }
- Console.WriteLine();
- }
-}
-// The example displays the following output:
-// Capacity: 16 MaxCapacity: 2,147,483,647 Length: 0
-// Capacity: 32 MaxCapacity: 2,147,483,647 Length: 19
-// Capacity: 64 MaxCapacity: 2,147,483,647 Length: 50
-// Capacity: 128 MaxCapacity: 2,147,483,647 Length: 81
-// Capacity: 128 MaxCapacity: 2,147,483,647 Length: 112
-// Capacity: 256 MaxCapacity: 2,147,483,647 Length: 143
-// Capacity: 256 MaxCapacity: 2,147,483,647 Length: 174
-// Capacity: 256 MaxCapacity: 2,147,483,647 Length: 205
-// Capacity: 256 MaxCapacity: 2,147,483,647 Length: 236
-// Capacity: 512 MaxCapacity: 2,147,483,647 Length: 267
-// Capacity: 512 MaxCapacity: 2,147,483,647 Length: 298
-// Capacity: 512 MaxCapacity: 2,147,483,647 Length: 329
-// Capacity: 512 MaxCapacity: 2,147,483,647 Length: 360
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/delete1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/delete1.cs
deleted file mode 100644
index 4d12e85f086ee..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/delete1.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-using System;
-using System.Text;
-
-public class Example5
-{
- public static void Main()
- {
- StringBuilder sb = new StringBuilder("A StringBuilder object");
- ShowSBInfo(sb);
- // Remove "object" from the text.
- string textToRemove = "object";
- int pos = sb.ToString().IndexOf(textToRemove);
- if (pos >= 0)
- {
- sb.Remove(pos, textToRemove.Length);
- ShowSBInfo(sb);
- }
- // Clear the StringBuilder contents.
- sb.Clear();
- ShowSBInfo(sb);
- }
-
- public static void ShowSBInfo(StringBuilder sb)
- {
- Console.WriteLine($"\nValue: {sb.ToString()}");
- foreach (var prop in sb.GetType().GetProperties())
- {
- if (prop.GetIndexParameters().Length == 0)
- Console.Write("{0}: {1:N0} ", prop.Name, prop.GetValue(sb));
- }
- Console.WriteLine();
- }
-}
-// The example displays the following output:
-// Value: A StringBuilder object
-// Capacity: 22 MaxCapacity: 2,147,483,647 Length: 22
-//
-// Value: A StringBuilder
-// Capacity: 22 MaxCapacity: 2,147,483,647 Length: 16
-//
-// Value:
-// Capacity: 22 MaxCapacity: 2,147,483,647 Length: 0
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/expand1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/expand1.cs
deleted file mode 100644
index 251766cd3414d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/expand1.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-using System;
-using System.Text;
-
-public class Example6
-{
- public static void Main()
- {
- // Create a StringBuilder object with no text.
- StringBuilder sb = new StringBuilder();
- // Append some text.
- sb.Append('*', 10).Append(" Adding Text to a StringBuilder Object ").Append('*', 10);
- sb.AppendLine("\n");
- sb.AppendLine("Some code points and their corresponding characters:");
- // Append some formatted text.
- for (int ctr = 50; ctr <= 60; ctr++)
- {
- sb.AppendFormat("{0,12:X4} {1,12}", ctr, Convert.ToChar(ctr));
- sb.AppendLine();
- }
- // Find the end of the introduction to the column.
- int pos = sb.ToString().IndexOf("characters:") + 11 +
- Environment.NewLine.Length;
- // Insert a column header.
- sb.Insert(pos, String.Format("{2}{0,12:X4} {1,12}{2}", "Code Unit",
- "Character", "\n"));
-
- // Convert the StringBuilder to a string and display it.
- Console.WriteLine(sb.ToString());
- }
-}
-// The example displays the following output:
-// ********** Adding Text to a StringBuilder Object **********
-//
-// Some code points and their corresponding characters:
-//
-// Code Unit Character
-// 0032 2
-// 0033 3
-// 0034 4
-// 0035 5
-// 0036 6
-// 0037 7
-// 0038 8
-// 0039 9
-// 003A :
-// 003B ;
-// 003C <
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/immutability2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/immutability2.cs
deleted file mode 100644
index 1bdd80a7212c4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/immutability2.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-
-public class Example7
-{
- public unsafe static void Main()
- {
- string value = "This is the first sentence" + ".";
- fixed (char* start = value)
- {
- value = String.Concat(value, "This is the second sentence. ");
- fixed (char* current = value)
- {
- Console.WriteLine(start == current);
- }
- }
- }
-}
-// The example displays the following output:
-// False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/instantiate1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/instantiate1.cs
deleted file mode 100644
index 0d91bfb11e786..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/instantiate1.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-using System;
-using System.Text;
-
-public class Example8
-{
- public static void Main()
- {
- string value = "An ordinary string";
- int index = value.IndexOf("An ") + 3;
- int capacity = 0xFFFF;
-
- // Instantiate a StringBuilder from a string.
- StringBuilder sb1 = new StringBuilder(value);
- ShowSBInfo(sb1);
-
- // Instantiate a StringBuilder from string and define a capacity.
- StringBuilder sb2 = new StringBuilder(value, capacity);
- ShowSBInfo(sb2);
-
- // Instantiate a StringBuilder from substring and define a capacity.
- StringBuilder sb3 = new StringBuilder(value, index,
- value.Length - index,
- capacity);
- ShowSBInfo(sb3);
- }
-
- public static void ShowSBInfo(StringBuilder sb)
- {
- Console.WriteLine($"\nValue: {sb.ToString()}");
- foreach (var prop in sb.GetType().GetProperties())
- {
- if (prop.GetIndexParameters().Length == 0)
- Console.Write("{0}: {1:N0} ", prop.Name, prop.GetValue(sb));
- }
- Console.WriteLine();
- }
-}
-// The example displays the following output:
-// Value: An ordinary string
-// Capacity: 18 MaxCapacity: 2,147,483,647 Length: 18
-//
-// Value: An ordinary string
-// Capacity: 65,535 MaxCapacity: 2,147,483,647 Length: 18
-//
-// Value: ordinary string
-// Capacity: 65,535 MaxCapacity: 2,147,483,647 Length: 15
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern1.cs
deleted file mode 100644
index afb671908bd2b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern1.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-using System;
-using System.Text;
-
-public class Example9
-{
- public static void Main()
- {
- Random rnd = new Random();
- string[] tempF = { "47.6F", "51.3F", "49.5F", "62.3F" };
- string[] tempC = { "21.2C", "16.1C", "23.5C", "22.9C" };
- string[][] temps = { tempF, tempC };
-
- StringBuilder sb = new StringBuilder();
- var f = new StringBuilderFinder(sb, "F");
- var baseDate = new DateTime(2013, 5, 1);
- String[] temperatures = temps[rnd.Next(2)];
- bool isFahrenheit = false;
- foreach (var temperature in temperatures)
- {
- if (isFahrenheit)
- sb.AppendFormat("{0:d}: {1}\n", baseDate, temperature);
- else
- isFahrenheit = f.SearchAndAppend(String.Format("{0:d}: {1}\n",
- baseDate, temperature));
- baseDate = baseDate.AddDays(1);
- }
- if (isFahrenheit)
- {
- sb.Insert(0, "Average Daily Temperature in Degrees Fahrenheit");
- sb.Insert(47, "\n\n");
- }
- else
- {
- sb.Insert(0, "Average Daily Temperature in Degrees Celsius");
- sb.Insert(44, "\n\n");
- }
- Console.WriteLine(sb.ToString());
- }
-}
-
-public class StringBuilderFinder
-{
- private StringBuilder sb;
- private String text;
-
- public StringBuilderFinder(StringBuilder sb, String textToFind)
- {
- this.sb = sb;
- this.text = textToFind;
- }
-
- public bool SearchAndAppend(String stringToSearch)
- {
- sb.Append(stringToSearch);
- return stringToSearch.Contains(text);
- }
-}
-// The example displays output similar to the following:
-// Average Daily Temperature in Degrees Celsius
-//
-// 5/1/2013: 21.2C
-// 5/2/2013: 16.1C
-// 5/3/2013: 23.5C
-// 5/4/2013: 22.9C
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern2.cs
deleted file mode 100644
index baa5e9f78d891..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern2.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-using System;
-using System.Text;
-using System.Text.RegularExpressions;
-
-public class Example10
-{
- public static void Main()
- {
- // Create a StringBuilder object with 4 successive occurrences
- // of each character in the English alphabet.
- StringBuilder sb = new StringBuilder();
- for (ushort ctr = (ushort)'a'; ctr <= (ushort)'z'; ctr++)
- sb.Append(Convert.ToChar(ctr), 4);
-
- // Create a parallel string object.
- String sbString = sb.ToString();
- // Determine where each new character sequence begins.
- String pattern = @"(\w)\1+";
- MatchCollection matches = Regex.Matches(sbString, pattern);
-
- // Uppercase the first occurrence of the sequence, and separate it
- // from the previous sequence by an underscore character.
- for (int ctr = matches.Count - 1; ctr >= 0; ctr--)
- {
- Match m = matches[ctr];
- sb[m.Index] = Char.ToUpper(sb[m.Index]);
- if (m.Index > 0) sb.Insert(m.Index, "_");
- }
- // Display the resulting string.
- sbString = sb.ToString();
- int line = 0;
- do
- {
- int nChars = line * 80 + 79 <= sbString.Length ?
- 80 : sbString.Length - line * 80;
- Console.WriteLine(sbString.Substring(line * 80, nChars));
- line++;
- } while (line * 80 < sbString.Length);
- }
-}
-// The example displays the following output:
-// Aaaa_Bbbb_Cccc_Dddd_Eeee_Ffff_Gggg_Hhhh_Iiii_Jjjj_Kkkk_Llll_Mmmm_Nnnn_Oooo_Pppp_
-// Qqqq_Rrrr_Ssss_Tttt_Uuuu_Vvvv_Wwww_Xxxx_Yyyy_Zzzz
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern3.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern3.cs
deleted file mode 100644
index 4415ba820ca29..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern3.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-using System;
-using System.Text;
-
-public class Example11
-{
- public static void Main()
- {
- // Create a StringBuilder object with 4 successive occurrences
- // of each character in the English alphabet.
- StringBuilder sb = new StringBuilder();
- for (ushort ctr = (ushort)'a'; ctr <= (ushort)'z'; ctr++)
- sb.Append(Convert.ToChar(ctr), 4);
-
- // Iterate the text to determine when a new character sequence occurs.
- int position = 0;
- Char current = '\u0000';
- do
- {
- if (sb[position] != current)
- {
- current = sb[position];
- sb[position] = Char.ToUpper(sb[position]);
- if (position > 0)
- sb.Insert(position, "_");
- position += 2;
- }
- else
- {
- position++;
- }
- } while (position <= sb.Length - 1);
- // Display the resulting string.
- String sbString = sb.ToString();
- int line = 0;
- do
- {
- int nChars = line * 80 + 79 <= sbString.Length ?
- 80 : sbString.Length - line * 80;
- Console.WriteLine(sbString.Substring(line * 80, nChars));
- line++;
- } while (line * 80 < sbString.Length);
- }
-}
-// The example displays the following output:
-// Aaaa_Bbbb_Cccc_Dddd_Eeee_Ffff_Gggg_Hhhh_Iiii_Jjjj_Kkkk_Llll_Mmmm_Nnnn_Oooo_Pppp_
-// Qqqq_Rrrr_Ssss_Tttt_Uuuu_Vvvv_Wwww_Xxxx_Yyyy_Zzzz
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern4.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern4.cs
deleted file mode 100644
index c19bb283e947f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/pattern4.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-using System;
-using System.Text;
-using System.Text.RegularExpressions;
-
-public class Example12
-{
- public static void Main()
- {
- // Create a StringBuilder object with 4 successive occurrences
- // of each character in the English alphabet.
- StringBuilder sb = new StringBuilder();
- for (ushort ctr = (ushort)'a'; ctr <= (ushort)'z'; ctr++)
- sb.Append(Convert.ToChar(ctr), 4);
-
- // Convert it to a string.
- String sbString = sb.ToString();
-
- // Use a regex to uppercase the first occurrence of the sequence,
- // and separate it from the previous sequence by an underscore.
- string pattern = @"(\w)(\1+)";
- sbString = Regex.Replace(sbString, pattern,
- m => (m.Index > 0 ? "_" : "") +
- m.Groups[1].Value.ToUpper() +
- m.Groups[2].Value);
-
- // Display the resulting string.
- int line = 0;
- do
- {
- int nChars = line * 80 + 79 <= sbString.Length ?
- 80 : sbString.Length - line * 80;
- Console.WriteLine(sbString.Substring(line * 80, nChars));
- line++;
- } while (line * 80 < sbString.Length);
- }
-}
-// The example displays the following output:
-// Aaaa_Bbbb_Cccc_Dddd_Eeee_Ffff_Gggg_Hhhh_Iiii_Jjjj_Kkkk_Llll_Mmmm_Nnnn_Oooo_Pppp_
-// Qqqq_Rrrr_Ssss_Tttt_Uuuu_Vvvv_Wwww_Xxxx_Yyyy_Zzzz
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/replace1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/replace1.cs
deleted file mode 100644
index 10cbf95094824..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/csharp/replace1.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-using System;
-using System.Text;
-
-public class Example13
-{
- public static void Main()
- {
- StringBuilder MyStringBuilder = new StringBuilder("Hello World!");
- MyStringBuilder.Replace('!', '?');
- Console.WriteLine(MyStringBuilder);
- }
-}
-// The example displays the following output:
-// Hello World?
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/call1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/call1.fs
deleted file mode 100644
index d60dc11f6918b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/call1.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module call1
-//
-open System.Text
-
-let sb = StringBuilder()
-sb.Append "This is the beginning of a sentence, " |> ignore
-sb.Replace("the beginning of ", "") |> ignore
-sb.Insert((string sb).IndexOf "a " + 2, "complete ") |> ignore
-sb.Replace(",", ".") |> ignore
-printfn $"{sb}"
-// The example displays the following output:
-// This is a complete sentence.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/call2.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/call2.fs
deleted file mode 100644
index 5433db9d95fca..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/call2.fs
+++ /dev/null
@@ -1,16 +0,0 @@
-module call2
-//
-open System.Text
-
-let sb = StringBuilder "This is the beginning of a sentence, "
-
-sb
- .Replace("the beginning of ", "")
- .Insert((string sb).IndexOf "a " + 2, "complete ")
- .Replace(",", ".")
-|> ignore
-
-printfn $"{sb}"
-// The example displays the following output:
-// This is a complete sentence.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/chars1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/chars1.fs
deleted file mode 100644
index 4d6cd351d0c55..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/chars1.fs
+++ /dev/null
@@ -1,38 +0,0 @@
-module chars1
-//
-open System
-open System.Globalization
-open System.Text
-
-let rnd = Random()
-let sb = new StringBuilder()
-
-// Generate 10 random numbers and store them in a StringBuilder.
-for _ = 0 to 9 do
- rnd.Next().ToString "N5" |> sb.Append |> ignore
-
-printfn "The original string:"
-printfn $"{sb}"
-
-// Decrease each number by one.
-for i = 0 to sb.Length - 1 do
- if Char.GetUnicodeCategory(sb[i]) = UnicodeCategory.DecimalDigitNumber then
- let number = Char.GetNumericValue sb.[i] |> int
- let number = number - 1
- let number = if number < 0 then 9 else number
- sb.[i] <- number.ToString()[0]
-
-printfn "\nThe new string:"
-printfn $"{sb}"
-
-// The example displays the following output:
-// The original string:
-// 1,457,531,530.00000940,522,609.000001,668,113,564.000001,998,992,883.000001,792,660,834.00
-// 000101,203,251.000002,051,183,075.000002,066,000,067.000001,643,701,043.000001,702,382,508
-// .00000
-//
-// The new string:
-// 0,346,420,429.99999839,411,598.999990,557,002,453.999990,887,881,772.999990,681,559,723.99
-// 999090,192,140.999991,940,072,964.999991,955,999,956.999990,532,690,932.999990,691,271,497
-// .99999
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/default1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/default1.fs
deleted file mode 100644
index e5c8f67c8d3aa..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/default1.fs
+++ /dev/null
@@ -1,36 +0,0 @@
-module default1
-
-//
-open System.Text
-
-let showSBInfo (sb: StringBuilder) =
- for prop in sb.GetType().GetProperties() do
- if prop.GetIndexParameters().Length = 0 then
- printf $"{prop.Name}: {prop.GetValue sb:N0} "
-
- printfn ""
-
-let sb = StringBuilder()
-showSBInfo sb
-sb.Append "This is a sentence." |> ignore
-showSBInfo sb
-
-for i = 0 to 10 do
- sb.Append "This is an additional sentence." |> ignore
- showSBInfo sb
-
-// The example displays the following output:
-// Capacity: 16 MaxCapacity: 2,147,483,647 Length: 0
-// Capacity: 32 MaxCapacity: 2,147,483,647 Length: 19
-// Capacity: 64 MaxCapacity: 2,147,483,647 Length: 50
-// Capacity: 128 MaxCapacity: 2,147,483,647 Length: 81
-// Capacity: 128 MaxCapacity: 2,147,483,647 Length: 112
-// Capacity: 256 MaxCapacity: 2,147,483,647 Length: 143
-// Capacity: 256 MaxCapacity: 2,147,483,647 Length: 174
-// Capacity: 256 MaxCapacity: 2,147,483,647 Length: 205
-// Capacity: 256 MaxCapacity: 2,147,483,647 Length: 236
-// Capacity: 512 MaxCapacity: 2,147,483,647 Length: 267
-// Capacity: 512 MaxCapacity: 2,147,483,647 Length: 298
-// Capacity: 512 MaxCapacity: 2,147,483,647 Length: 329
-// Capacity: 512 MaxCapacity: 2,147,483,647 Length: 360
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/delete1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/delete1.fs
deleted file mode 100644
index 35b188a14ebc6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/delete1.fs
+++ /dev/null
@@ -1,35 +0,0 @@
-module delete1
-//
-open System.Text
-
-let showSBInfo (sb: StringBuilder) =
- for prop in sb.GetType().GetProperties() do
- if prop.GetIndexParameters().Length = 0 then
- printf $"{prop.Name}: {prop.GetValue sb:N0} "
-
- printfn ""
-
-let sb = StringBuilder "A StringBuilder object"
-showSBInfo sb
-// Remove "object" from the text.
-let textToRemove = "object"
-let pos = (string sb).IndexOf textToRemove
-
-if pos >= 0 then
- sb.Remove(pos, textToRemove.Length) |> ignore
- showSBInfo sb
-
-// Clear the StringBuilder contents.
-sb.Clear() |> ignore
-showSBInfo sb
-
-// The example displays the following output:
-// Value: A StringBuilder object
-// Capacity: 22 MaxCapacity: 2,147,483,647 Length: 22
-//
-// Value: A StringBuilder
-// Capacity: 22 MaxCapacity: 2,147,483,647 Length: 16
-//
-// Value:
-// Capacity: 22 MaxCapacity: 2,147,483,647 Length: 0
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/expand1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/expand1.fs
deleted file mode 100644
index f82c1e6c56f10..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/expand1.fs
+++ /dev/null
@@ -1,49 +0,0 @@
-module expand1
-//
-open System
-open System.Text
-
-// Create a StringBuilder object with no text.
-let sb = StringBuilder()
-// Append some text.
-sb
- .Append('*', 10)
- .Append(" Adding Text to a StringBuilder Object ")
- .Append('*', 10)
-|> ignore
-
-sb.AppendLine "\n" |> ignore
-sb.AppendLine "Some code points and their corresponding characters:" |> ignore
-// Append some formatted text.
-for i = 50 to 60 do
- sb.AppendFormat("{0,12:X4} {1,12}", i, Convert.ToChar i) |> ignore
- sb.AppendLine() |> ignore
-
-// Find the end of the introduction to the column.
-let pos = (string sb).IndexOf("characters:") + 11 + Environment.NewLine.Length
-// Insert a column header.
-sb.Insert(pos, String.Format("{2}{0,12:X4} {1,12}{2}", "Code Unit", "Character", "\n"))
-|> ignore
-
-// Convert the StringBuilder to a string and display it.
-printfn $"{sb}"
-
-
-// The example displays the following output:
-// ********** Adding Text to a StringBuilder Object **********
-//
-// Some code points and their corresponding characters:
-//
-// Code Unit Character
-// 0032 2
-// 0033 3
-// 0034 4
-// 0035 5
-// 0036 6
-// 0037 7
-// 0038 8
-// 0039 9
-// 003A :
-// 003B ;
-// 003C <
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/immutability2.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/immutability2.fs
deleted file mode 100644
index d4805eb10f8cf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/immutability2.fs
+++ /dev/null
@@ -1,14 +0,0 @@
-module immutability2
-
-#nowarn "9"
-
-do
- //
- let mutable value = "This is the first sentence" + "."
- use start = fixed value
- value <- System.String.Concat(value, "This is the second sentence. ")
- use current = fixed value
- printfn $"{start = current}"
-// The example displays the following output:
-// False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/instantiate1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/instantiate1.fs
deleted file mode 100644
index 9517a7fc9d63f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/instantiate1.fs
+++ /dev/null
@@ -1,37 +0,0 @@
-module instantiate1
-//
-open System.Text
-
-let showSBInfo (sb: StringBuilder) =
- for prop in sb.GetType().GetProperties() do
- if prop.GetIndexParameters().Length = 0 then
- printf $"{prop.Name}: {prop.GetValue sb:N0} "
-
- printfn ""
-
-let value = "An ordinary string"
-let index = value.IndexOf "An " + 3
-let capacity = 0xFFFF
-
-// Instantiate a StringBuilder from a string.
-let sb1 = StringBuilder value
-showSBInfo sb1
-
-// Instantiate a StringBuilder from string and define a capacity.
-let sb2 = StringBuilder(value, capacity)
-showSBInfo sb2
-
-// Instantiate a StringBuilder from substring and define a capacity.
-let sb3 = StringBuilder(value, index, value.Length - index, capacity)
-showSBInfo sb3
-
-// The example displays the following output:
-// Value: An ordinary string
-// Capacity: 18 MaxCapacity: 2,147,483,647 Length: 18
-//
-// Value: An ordinary string
-// Capacity: 65,535 MaxCapacity: 2,147,483,647 Length: 18
-//
-// Value: ordinary string
-// Capacity: 65,535 MaxCapacity: 2,147,483,647 Length: 15
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern1.fs
deleted file mode 100644
index f8db4f7397c29..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern1.fs
+++ /dev/null
@@ -1,46 +0,0 @@
-module pattern1
-//
-open System
-open System.Text
-
-type StringBuilderFinder(sb: StringBuilder, textToFind: string) =
- member _.SearchAndAppend(stringToSearch: string) =
- sb.Append stringToSearch |> ignore
- stringToSearch.Contains textToFind
-
-let tempF = [| "47.6F"; "51.3F"; "49.5F"; "62.3F" |]
-let tempC = [| "21.2C"; "16.1C"; "23.5C"; "22.9C" |]
-let temps = [| tempF; tempC |]
-
-let sb = StringBuilder()
-let f = StringBuilderFinder(sb, "F")
-let temperatures = temps[Random.Shared.Next(2)]
-let mutable baseDate = DateTime(2013, 5, 1)
-let mutable isFahrenheit = false
-
-for temperature in temperatures do
- if isFahrenheit then
- sb.AppendFormat("{0:d}: {1}\n", baseDate, temperature) |> ignore
- else
- isFahrenheit <- $"{baseDate:d}: {temperature}\n" |> f.SearchAndAppend
-
- baseDate <- baseDate.AddDays 1
-
-if isFahrenheit then
- sb.Insert(0, "Average Daily Temperature in Degrees Fahrenheit") |> ignore
- sb.Insert(47, "\n\n") |> ignore
-
-else
- sb.Insert(0, "Average Daily Temperature in Degrees Celsius") |> ignore
- sb.Insert(44, "\n\n") |> ignore
-
-printfn $"{sb}"
-
-// The example displays output similar to the following:
-// Average Daily Temperature in Degrees Celsius
-//
-// 5/1/2013: 21.2C
-// 5/2/2013: 16.1C
-// 5/3/2013: 23.5C
-// 5/4/2013: 22.9C
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern2.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern2.fs
deleted file mode 100644
index 56521da543216..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern2.fs
+++ /dev/null
@@ -1,45 +0,0 @@
-module pattern2
-//
-open System
-open System.Text
-open System.Text.RegularExpressions
-
-// Create a StringBuilder object with 4 successive occurrences
-// of each character in the English alphabet.
-let sb = StringBuilder()
-
-for char in 'a' .. 'z' do
- sb.Append(char, 4) |> ignore
-
-// Create a parallel string object.
-let sbString = string sb
-// Determine where each new character sequence begins.
-let pattern = @"(\w)\1+"
-let matches = Regex.Matches(sbString, pattern)
-
-// Uppercase the first occurrence of the sequence, and separate it
-// from the previous sequence by an underscore character.
-for i = matches.Count - 1 downto 0 do
- let m = matches[i]
- sb[m.Index] <- Char.ToUpper sb[m.Index]
-
- if m.Index > 0 then
- sb.Insert(m.Index, "_") |> ignore
-
-// Display the resulting string.
-let sbString2 = string sb
-
-for line = 0 to (sbString2.Length - 1) / 80 do
- let nChars =
- if line * 80 + 79 <= sbString2.Length then
- 80
- else
- sbString2.Length - line * 80
-
- printfn $"{sbString2.Substring(line * 80, nChars)}"
-
-
-// The example displays the following output:
-// Aaaa_Bbbb_Cccc_Dddd_Eeee_Ffff_Gggg_Hhhh_Iiii_Jjjj_Kkkk_Llll_Mmmm_Nnnn_Oooo_Pppp_
-// Qqqq_Rrrr_Ssss_Tttt_Uuuu_Vvvv_Wwww_Xxxx_Yyyy_Zzzz
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern3.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern3.fs
deleted file mode 100644
index c1d506a6b27ac..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern3.fs
+++ /dev/null
@@ -1,45 +0,0 @@
-module pattern3
-//
-open System
-open System.Text
-
-// Create a StringBuilder object with 4 successive occurrences
-// of each character in the English alphabet.
-let sb = StringBuilder()
-
-for char in 'a' .. 'z' do
- sb.Append(char, 4) |> ignore
-
-// Iterate the text to determine when a new character sequence occurs.
-let mutable position = 0
-let mutable current = '\u0000'
-
-while position <= sb.Length - 1 do
- if sb[position] <> current then
- current <- sb[position]
- sb[position] <- Char.ToUpper sb[position]
-
- if position > 0 then
- sb.Insert(position, "_") |> ignore
-
- position <- position + 2
-
- else
- position <- position + 1
-
-// Display the resulting string.
-let sbString = string sb
-
-for line = 0 to (sbString.Length - 1) / 80 do
- let nChars =
- if line * 80 + 79 <= sbString.Length then
- 80
- else
- sbString.Length - line * 80
-
- printfn $"{sbString.Substring(line * 80, nChars)}"
-
-// The example displays the following output:
-// Aaaa_Bbbb_Cccc_Dddd_Eeee_Ffff_Gggg_Hhhh_Iiii_Jjjj_Kkkk_Llll_Mmmm_Nnnn_Oooo_Pppp_
-// Qqqq_Rrrr_Ssss_Tttt_Uuuu_Vvvv_Wwww_Xxxx_Yyyy_Zzzz
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern4.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern4.fs
deleted file mode 100644
index 63f6caeab39fd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/pattern4.fs
+++ /dev/null
@@ -1,43 +0,0 @@
-module pattern4
-//
-open System.Text
-open System.Text.RegularExpressions
-
-// Create a StringBuilder object with 4 successive occurrences
-// of each character in the English alphabet.
-let sb = StringBuilder()
-
-for char in 'a' .. 'z' do
- sb.Append(char, 4) |> ignore
-
-// Convert it to a string.
-let sbString = string sb
-
-// Use a regex to uppercase the first occurrence of the sequence,
-// and separate it from the previous sequence by an underscore.
-let pattern = @"(\w)(\1+)"
-
-let sbStringReplaced =
- Regex.Replace(
- sbString,
- pattern,
- fun m ->
- (if m.Index > 0 then "_" else "")
- + m.Groups[ 1 ].Value.ToUpper()
- + m.Groups[2].Value
- )
-
-// Display the resulting string.
-for line = 0 to (sbStringReplaced.Length - 1) / 80 do
- let nChars =
- if line * 80 + 79 <= sbStringReplaced.Length then
- 80
- else
- sbStringReplaced.Length - line * 80
-
- printfn $"{sbStringReplaced.Substring(line * 80, nChars)}"
-
-// The example displays the following output:
-// Aaaa_Bbbb_Cccc_Dddd_Eeee_Ffff_Gggg_Hhhh_Iiii_Jjjj_Kkkk_Llll_Mmmm_Nnnn_Oooo_Pppp_
-// Qqqq_Rrrr_Ssss_Tttt_Uuuu_Vvvv_Wwww_Xxxx_Yyyy_Zzzz
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/replace1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/replace1.fs
deleted file mode 100644
index 02b30af283397..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/fsharp/replace1.fs
+++ /dev/null
@@ -1,11 +0,0 @@
-module replace1
-//
-open System.Text
-
-let myStringBuilder = StringBuilder "Hello World!"
-myStringBuilder.Replace('!', '?') |> ignore
-printfn $"{myStringBuilder}"
-
-// The example displays the following output:
-// Hello World?
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/call1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/call1.vb
deleted file mode 100644
index 71c9e10dac04f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/call1.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-
-Module Example2
- Public Sub Main()
- Dim sb As New StringBuilder()
- sb.Append("This is the beginning of a sentence, ")
- sb.Replace("the beginning of ", "")
- sb.Insert(sb.ToString().IndexOf("a ") + 2, "complete ")
- sb.Replace(",", ".")
- Console.WriteLine(sb.ToString())
- End Sub
-End Module
-' The example displays the following output:
-' This is a complete sentence.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/call2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/call2.vb
deleted file mode 100644
index 358d0a456b471..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/call2.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-
-Module Example3
- Public Sub Main()
- Dim sb As New StringBuilder("This is the beginning of a sentence, ")
- sb.Replace("the beginning of ", "").Insert(sb.ToString().IndexOf("a ") + 2,
- "complete ").Replace(", ", ".")
- Console.WriteLine(sb.ToString())
- End Sub
-End Module
-' The example displays the following output:
-' This is a complete sentence.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/chars1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/chars1.vb
deleted file mode 100644
index 68f7824256a84..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/chars1.vb
+++ /dev/null
@@ -1,46 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Text
-
-Module Example4
- Public Sub Main()
- Dim rnd As New Random()
- Dim sb As New StringBuilder()
-
- ' Generate 10 random numbers and store them in a StringBuilder.
- For ctr As Integer = 0 To 9
- sb.Append(rnd.Next().ToString("N5"))
- Next
- Console.WriteLine("The original string:")
- Console.WriteLine(sb.ToString())
- Console.WriteLine()
-
- ' Decrease each number by one.
- For ctr As Integer = 0 To sb.Length - 1
- If Char.GetUnicodeCategory(sb(ctr)) = UnicodeCategory.DecimalDigitNumber Then
- Dim number As Integer = CType(Char.GetNumericValue(sb(ctr)), Integer)
- number -= 1
- If number < 0 Then number = 9
-
- sb(ctr) = number.ToString()(0)
- End If
- Next
- Console.WriteLine("The new string:")
- Console.WriteLine(sb.ToString())
- End Sub
-End Module
-' The example displays the following output:
-' The original string:
-' 1,457,531,530.00000940,522,609.000001,668,113,564.000001,998,992,883.000001,792,660,834.00
-' 000101,203,251.000002,051,183,075.000002,066,000,067.000001,643,701,043.000001,702,382,508
-' .00000
-'
-' The new string:
-' 0,346,420,429.99999839,411,598.999990,557,002,453.999990,887,881,772.999990,681,559,723.99
-' 999090,192,140.999991,940,072,964.999991,955,999,956.999990,532,690,932.999990,691,271,497
-' .99999
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/default1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/default1.vb
deleted file mode 100644
index 60388e491b39a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/default1.vb
+++ /dev/null
@@ -1,43 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Reflection
-Imports System.Text
-
-Module Example5
- Public Sub Main()
- Dim sb As New StringBuilder()
- ShowSBInfo(sb)
- sb.Append("This is a sentence.")
- ShowSBInfo(sb)
- For ctr As Integer = 0 To 10
- sb.Append("This is an additional sentence.")
- ShowSBInfo(sb)
- Next
- End Sub
-
- Public Sub ShowSBInfo(sb As StringBuilder)
- For Each prop In sb.GetType().GetProperties
- If prop.GetIndexParameters().Length = 0 Then
- Console.Write("{0}: {1:N0} ", prop.Name, prop.GetValue(sb))
- End If
- Next
- Console.WriteLine()
- End Sub
-End Module
-' The example displays the following output:
-' Capacity: 16 MaxCapacity: 2,147,483,647 Length: 0
-' Capacity: 32 MaxCapacity: 2,147,483,647 Length: 19
-' Capacity: 64 MaxCapacity: 2,147,483,647 Length: 50
-' Capacity: 128 MaxCapacity: 2,147,483,647 Length: 81
-' Capacity: 128 MaxCapacity: 2,147,483,647 Length: 112
-' Capacity: 256 MaxCapacity: 2,147,483,647 Length: 143
-' Capacity: 256 MaxCapacity: 2,147,483,647 Length: 174
-' Capacity: 256 MaxCapacity: 2,147,483,647 Length: 205
-' Capacity: 256 MaxCapacity: 2,147,483,647 Length: 236
-' Capacity: 512 MaxCapacity: 2,147,483,647 Length: 267
-' Capacity: 512 MaxCapacity: 2,147,483,647 Length: 298
-' Capacity: 512 MaxCapacity: 2,147,483,647 Length: 329
-' Capacity: 512 MaxCapacity: 2,147,483,647 Length: 360
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/delete1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/delete1.vb
deleted file mode 100644
index 905d4bd6f641d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/delete1.vb
+++ /dev/null
@@ -1,44 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-
-Module Example6
- Public Sub Main()
- Dim sb As New StringBuilder("A StringBuilder object")
- ShowSBInfo(sb)
- ' Remove "object" from the text.
- Dim textToRemove As String = "object"
- Dim pos As Integer = sb.ToString().IndexOf(textToRemove)
- If pos >= 0 Then
- sb.Remove(pos, textToRemove.Length)
- ShowSBInfo(sb)
- End If
- ' Clear the StringBuilder contents.
- sb.Clear()
- ShowSBInfo(sb)
- End Sub
-
- Public Sub ShowSBInfo(sb As StringBuilder)
- Console.WriteLine()
- Console.WriteLine("Value: {0}", sb.ToString())
- For Each prop In sb.GetType().GetProperties
- If prop.GetIndexParameters().Length = 0 Then
- Console.Write("{0}: {1:N0} ", prop.Name, prop.GetValue(sb))
- End If
- Next
- Console.WriteLine()
- End Sub
-End Module
-' The example displays the following output:
-' Value: A StringBuilder object
-' Capacity: 22 MaxCapacity: 2,147,483,647 Length: 22
-'
-' Value: A StringBuilder
-' Capacity: 22 MaxCapacity: 2,147,483,647 Length: 16
-'
-' Value:
-' Capacity: 22 MaxCapacity: 2,147,483,647 Length: 0
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/expand1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/expand1.vb
deleted file mode 100644
index 21b2eee5489ad..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/expand1.vb
+++ /dev/null
@@ -1,49 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-
-Module Example7
- Public Sub Main()
- ' Create a StringBuilder object with no text.
- Dim sb As New StringBuilder()
- ' Append some text.
- sb.Append("*"c, 10).Append(" Adding Text to a StringBuilder Object ").Append("*"c, 10)
- sb.AppendLine()
- sb.AppendLine()
- sb.AppendLine("Some code points and their corresponding characters:")
- ' Append some formatted text.
- For ctr = 50 To 60
- sb.AppendFormat("{0,12:X4} {1,12}", ctr, Convert.ToChar(ctr))
- sb.AppendLine()
- Next
- ' Find the end of the introduction to the column.
- Dim pos As Integer = sb.ToString().IndexOf("characters:") + 11 +
- Environment.NewLine.Length
- ' Insert a column header.
- sb.Insert(pos, String.Format("{2}{0,12:X4} {1,12}{2}", "Code Unit",
- "Character", vbCrLf))
-
- ' Convert the StringBuilder to a string and display it.
- Console.WriteLine(sb.ToString())
- End Sub
-End Module
-' The example displays the following output:
-' ********** Adding Text to a StringBuilder Object **********
-'
-' Some code points and their corresponding characters:
-'
-' Code Unit Character
-' 0032 2
-' 0033 3
-' 0034 4
-' 0035 5
-' 0036 6
-' 0037 7
-' 0038 8
-' 0039 9
-' 003A :
-' 003B ;
-' 003C <
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/instantiate1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/instantiate1.vb
deleted file mode 100644
index a2ecb1f9a8c73..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/instantiate1.vb
+++ /dev/null
@@ -1,49 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-
-Module Example8
- Public Sub Main()
- Dim value As String = "An ordinary string"
- Dim index As Integer = value.IndexOf("An ") + 3
- Dim capacity As Integer = &HFFFF
-
- ' Instantiate a StringBuilder from a string.
- Dim sb1 As New StringBuilder(value)
- ShowSBInfo(sb1)
-
- ' Instantiate a StringBuilder from string and define a capacity.
- Dim sb2 As New StringBuilder(value, capacity)
- ShowSBInfo(sb2)
-
- ' Instantiate a StringBuilder from substring and define a capacity.
- Dim sb3 As New StringBuilder(value, index,
- value.Length - index,
- capacity)
- ShowSBInfo(sb3)
- End Sub
-
- Public Sub ShowSBInfo(sb As StringBuilder)
- Console.WriteLine()
- Console.WriteLine("Value: {0}", sb.ToString())
- For Each prop In sb.GetType().GetProperties
- If prop.GetIndexParameters().Length = 0 Then
- Console.Write("{0}: {1:N0} ", prop.Name, prop.GetValue(sb))
- End If
- Next
- Console.WriteLine()
- End Sub
-End Module
-' The example displays the following output:
-' Value: An ordinary string
-' Capacity: 18 MaxCapacity: 2,147,483,647 Length: 18
-'
-' Value: An ordinary string
-' Capacity: 65,535 MaxCapacity: 2,147,483,647 Length: 18
-'
-' Value: ordinary string
-' Capacity: 65,535 MaxCapacity: 2,147,483,647 Length: 15
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern1.vb
deleted file mode 100644
index bfef80bcabcdb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern1.vb
+++ /dev/null
@@ -1,60 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-
-Module Example9
- Public Sub Main()
- Dim rnd As New Random()
- Dim tempF() As String = {"47.6F", "51.3F", "49.5F", "62.3F"}
- Dim tempC() As String = {"21.2C", "16.1C", "23.5C", "22.9C"}
- Dim temps()() As String = {tempF, tempC}
-
- Dim sb As StringBuilder = New StringBuilder()
- Dim f As New StringBuilderFinder(sb, "F")
- Dim baseDate As New DateTime(2013, 5, 1)
- Dim temperatures() As String = temps(rnd.Next(2))
- Dim isFahrenheit As Boolean = False
- For Each temperature In temperatures
- If isFahrenheit Then
- sb.AppendFormat("{0:d}: {1}{2}", baseDate, temperature, vbCrLf)
- Else
- isFahrenheit = f.SearchAndAppend(String.Format("{0:d}: {1}{2}",
- baseDate, temperature, vbCrLf))
- End If
- baseDate = baseDate.AddDays(1)
- Next
- If isFahrenheit Then
- sb.Insert(0, "Average Daily Temperature in Degrees Fahrenheit")
- sb.Insert(47, vbCrLf + vbCrLf)
- Else
- sb.Insert(0, "Average Daily Temperature in Degrees Celsius")
- sb.Insert(44, vbCrLf + vbCrLf)
- End If
- Console.WriteLine(sb.ToString())
- End Sub
-End Module
-
-Public Class StringBuilderFinder
- Private sb As StringBuilder
- Private text As String
-
- Public Sub New(sb As StringBuilder, textToFind As String)
- Me.sb = sb
- text = textToFind
- End Sub
-
- Public Function SearchAndAppend(stringToSearch As String) As Boolean
- sb.Append(stringToSearch)
- Return stringToSearch.Contains(text)
- End Function
-End Class
-' The example displays output similar to the following:
-' Average Daily Temperature in Degrees Celsius
-'
-' 5/1/2013: 21.2C
-' 5/2/2013: 16.1C
-' 5/3/2013: 23.5C
-' 5/4/2013: 22.9C
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern2.vb
deleted file mode 100644
index 0fa2ece1e7b2a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern2.vb
+++ /dev/null
@@ -1,43 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-Imports System.Text.RegularExpressions
-
-Module Example10
- Public Sub Main()
- ' Create a StringBuilder object with 4 successive occurrences
- ' of each character in the English alphabet.
- Dim sb As New StringBuilder()
- For ctr As UShort = AscW("a") To AscW("z")
- sb.Append(ChrW(ctr), 4)
- Next
- ' Create a parallel string object.
- Dim sbString As String = sb.ToString()
- ' Determine where each new character sequence begins.
- Dim pattern As String = "(\w)\1+"
- Dim matches As MatchCollection = Regex.Matches(sbString, pattern)
-
- ' Uppercase the first occurrence of the sequence, and separate it
- ' from the previous sequence by an underscore character.
- For ctr As Integer = matches.Count - 1 To 0 Step -1
- Dim m As Match = matches(ctr)
- sb.Chars(m.Index) = Char.ToUpper(sb.Chars(m.Index))
- If m.Index > 0 Then sb.Insert(m.Index, "_")
- Next
- ' Display the resulting string.
- sbString = sb.ToString()
- Dim line As Integer = 0
- Do
- Dim nChars As Integer = If(line * 80 + 79 <= sbString.Length,
- 80, sbString.Length - line * 80)
- Console.WriteLine(sbString.Substring(line * 80, nChars))
- line += 1
- Loop While line * 80 < sbString.Length
- End Sub
-End Module
-' The example displays the following output:
-' Aaaa_Bbbb_Cccc_Dddd_Eeee_Ffff_Gggg_Hhhh_Iiii_Jjjj_Kkkk_Llll_Mmmm_Nnnn_Oooo_Pppp_
-' Qqqq_Rrrr_Ssss_Tttt_Uuuu_Vvvv_Wwww_Xxxx_Yyyy_Zzzz
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern3.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern3.vb
deleted file mode 100644
index 7ecbaa54107ab..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern3.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-
-Module Example11
- Public Sub Main()
- ' Create a StringBuilder object with 4 successive occurrences
- ' of each character in the English alphabet.
- Dim sb As New StringBuilder()
- For ctr As UShort = AscW("a") To AscW("z")
- sb.Append(ChrW(ctr), 4)
- Next
- ' Iterate the text to determine when a new character sequence occurs.
- Dim position As Integer = 0
- Dim current As Char = ChrW(0)
- Do
- If sb(position) <> current Then
- current = sb(position)
- sb(position) = Char.ToUpper(sb(position))
- If position > 0 Then sb.Insert(position, "_")
- position += 2
- Else
- position += 1
- End If
- Loop While position <= sb.Length - 1
- ' Display the resulting string.
- Dim sbString As String = sb.ToString()
- Dim line As Integer = 0
- Do
- Dim nChars As Integer = If(line * 80 + 79 <= sbString.Length,
- 80, sbString.Length - line * 80)
- Console.WriteLine(sbString.Substring(line * 80, nChars))
- line += 1
- Loop While line * 80 < sbString.Length
- End Sub
-End Module
-' The example displays the following output:
-' Aaaa_Bbbb_Cccc_Dddd_Eeee_Ffff_Gggg_Hhhh_Iiii_Jjjj_Kkkk_Llll_Mmmm_Nnnn_Oooo_Pppp_
-' Qqqq_Rrrr_Ssss_Tttt_Uuuu_Vvvv_Wwww_Xxxx_Yyyy_Zzzz
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern4.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern4.vb
deleted file mode 100644
index 9fb52dbd59600..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/pattern4.vb
+++ /dev/null
@@ -1,40 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-Imports System.Text.RegularExpressions
-
-Module Example12
- Public Sub Main()
- ' Create a StringBuilder object with 4 successive occurrences
- ' of each character in the English alphabet.
- Dim sb As New StringBuilder()
- For ctr As UShort = AscW("a") To AscW("z")
- sb.Append(ChrW(ctr), 4)
- Next
- ' Convert it to a string.
- Dim sbString As String = sb.ToString()
-
- ' Use a regex to uppercase the first occurrence of the sequence,
- ' and separate it from the previous sequence by an underscore.
- Dim pattern As String = "(\w)(\1+)"
- sbString = Regex.Replace(sbString, pattern,
- Function(m) If(m.Index > 0, "_", "") +
- m.Groups(1).Value.ToUpper +
- m.Groups(2).Value)
-
- ' Display the resulting string.
- Dim line As Integer = 0
- Do
- Dim nChars As Integer = If(line * 80 + 79 <= sbString.Length,
- 80, sbString.Length - line * 80)
- Console.WriteLine(sbString.Substring(line * 80, nChars))
- line += 1
- Loop While line * 80 < sbString.Length
- End Sub
-End Module
-' The example displays the following output:
-' Aaaa_Bbbb_Cccc_Dddd_Eeee_Ffff_Gggg_Hhhh_Iiii_Jjjj_Kkkk_Llll_Mmmm_Nnnn_Oooo_Pppp_
-' Qqqq_Rrrr_Ssss_Tttt_Uuuu_Vvvv_Wwww_Xxxx_Yyyy_Zzzz
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/replace1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/replace1.vb
deleted file mode 100644
index 7da78f82ca437..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Text/StringBuilder/Overview/vb/replace1.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-
-Module Example
- Public Sub Main()
- Dim MyStringBuilder As New StringBuilder("Hello World!")
- MyStringBuilder.Replace("!"c, "?"c)
- Console.WriteLine(MyStringBuilder)
- End Sub
-End Module
-' The example displays the following output:
-' Hello World?
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/Wait1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/Wait1.cs
deleted file mode 100644
index 7f27f381cf28f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/Wait1.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-class Program
-{
- static Random rand = new Random();
-
- static void Main()
- {
- // Wait on a single task with no timeout specified.
- Task taskA = Task.Run( () => Thread.Sleep(2000));
- Console.WriteLine($"taskA Status: {taskA.Status}");
- try {
- taskA.Wait();
- Console.WriteLine($"taskA Status: {taskA.Status}");
- }
- catch (AggregateException) {
- Console.WriteLine("Exception in taskA.");
- }
- }
-}
-// The example displays output like the following:
-// taskA Status: WaitingToRun
-// taskA Status: RanToCompletion
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/Wait2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/Wait2.cs
deleted file mode 100644
index 436768f8b6314..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/Wait2.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class Example5
-{
- public static void Main()
- {
- // Wait on a single task with a timeout specified.
- Task taskA = Task.Run(() => Thread.Sleep(2000));
- try
- {
- taskA.Wait(1000); // Wait for 1 second.
- bool completed = taskA.IsCompleted;
- Console.WriteLine("Task A completed: {0}, Status: {1}",
- completed, taskA.Status);
- if (!completed)
- Console.WriteLine("Timed out before task A completed.");
- }
- catch (AggregateException)
- {
- Console.WriteLine("Exception in taskA.");
- }
- }
-}
-// The example displays output like the following:
-// Task A completed: False, Status: Running
-// Timed out before task A completed.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/WaitAll1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/WaitAll1.cs
deleted file mode 100644
index d23bd899ded0c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/WaitAll1.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class Example3
-{
- public static void Main()
- {
- // Wait for all tasks to complete.
- Task[] tasks = new Task[10];
- for (int i = 0; i < 10; i++)
- {
- tasks[i] = Task.Run(() => Thread.Sleep(2000));
- }
- try
- {
- Task.WaitAll(tasks);
- }
- catch (AggregateException ae)
- {
- Console.WriteLine("One or more exceptions occurred: ");
- foreach (var ex in ae.Flatten().InnerExceptions)
- Console.WriteLine($" {ex.Message}");
- }
-
- Console.WriteLine("Status of completed tasks:");
- foreach (var t in tasks)
- Console.WriteLine($" Task #{t.Id}: {t.Status}");
- }
-}
-// The example displays the following output:
-// Status of completed tasks:
-// Task #2: RanToCompletion
-// Task #1: RanToCompletion
-// Task #3: RanToCompletion
-// Task #4: RanToCompletion
-// Task #6: RanToCompletion
-// Task #5: RanToCompletion
-// Task #7: RanToCompletion
-// Task #8: RanToCompletion
-// Task #9: RanToCompletion
-// Task #10: RanToCompletion
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/WaitAll2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/WaitAll2.cs
deleted file mode 100644
index be60e6442c03d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/WaitAll2.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class Example6
-{
- public static void Main()
- {
- // Create a cancellation token and cancel it.
- var source1 = new CancellationTokenSource();
- var token1 = source1.Token;
- source1.Cancel();
- // Create a cancellation token for later cancellation.
- var source2 = new CancellationTokenSource();
- var token2 = source2.Token;
-
- // Create a series of tasks that will complete, be cancelled,
- // timeout, or throw an exception.
- Task[] tasks = new Task[12];
- for (int i = 0; i < 12; i++)
- {
- switch (i % 4)
- {
- // Task should run to completion.
- case 0:
- tasks[i] = Task.Run(() => Thread.Sleep(2000));
- break;
- // Task should be set to canceled state.
- case 1:
- tasks[i] = Task.Run(() => Thread.Sleep(2000),
- token1);
- break;
- case 2:
- // Task should throw an exception.
- tasks[i] = Task.Run(() => { throw new NotSupportedException(); });
- break;
- case 3:
- // Task should examine cancellation token.
- tasks[i] = Task.Run(() =>
- {
- Thread.Sleep(2000);
- if (token2.IsCancellationRequested)
- token2.ThrowIfCancellationRequested();
- Thread.Sleep(500);
- }, token2);
- break;
- }
- }
- Thread.Sleep(250);
- source2.Cancel();
-
- try
- {
- Task.WaitAll(tasks);
- }
- catch (AggregateException ae)
- {
- Console.WriteLine("One or more exceptions occurred:");
- foreach (var ex in ae.InnerExceptions)
- Console.WriteLine($" {ex.GetType().Name}: {ex.Message}");
- }
-
- Console.WriteLine("\nStatus of tasks:");
- foreach (var t in tasks)
- {
- Console.WriteLine($" Task #{t.Id}: {t.Status}");
- if (t.Exception != null)
- {
- foreach (var ex in t.Exception.InnerExceptions)
- Console.WriteLine($" {ex.GetType().Name}: {ex.Message}");
- }
- }
- }
-}
-// The example displays output like the following:
-// One or more exceptions occurred:
-// TaskCanceledException: A task was canceled.
-// NotSupportedException: Specified method is not supported.
-// TaskCanceledException: A task was canceled.
-// TaskCanceledException: A task was canceled.
-// NotSupportedException: Specified method is not supported.
-// TaskCanceledException: A task was canceled.
-// TaskCanceledException: A task was canceled.
-// NotSupportedException: Specified method is not supported.
-// TaskCanceledException: A task was canceled.
-//
-// Status of tasks:
-// Task #13: RanToCompletion
-// Task #1: Canceled
-// Task #3: Faulted
-// NotSupportedException: Specified method is not supported.
-// Task #8: Canceled
-// Task #14: RanToCompletion
-// Task #4: Canceled
-// Task #6: Faulted
-// NotSupportedException: Specified method is not supported.
-// Task #7: Canceled
-// Task #15: RanToCompletion
-// Task #9: Canceled
-// Task #11: Faulted
-// NotSupportedException: Specified method is not supported.
-// Task #12: Canceled
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/WhenAny1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/WhenAny1.cs
deleted file mode 100644
index 18756dc00096f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/WhenAny1.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class Example4
-{
- public static void Main()
- {
- var tasks = new Task[3];
- var rnd = new Random();
- for (int ctr = 0; ctr <= 2; ctr++)
- tasks[ctr] = Task.Run(() => Thread.Sleep(rnd.Next(500, 3000)));
-
- try
- {
- int index = Task.WaitAny(tasks);
- Console.WriteLine($"Task #{tasks[index].Id} completed first.\n");
- Console.WriteLine("Status of all tasks:");
- foreach (var t in tasks)
- Console.WriteLine($" Task #{t.Id}: {t.Status}");
- }
- catch (AggregateException)
- {
- Console.WriteLine("An exception occurred.");
- }
- }
-}
-// The example displays output like the following:
-// Task #1 completed first.
-//
-// Status of all tasks:
-// Task #3: Running
-// Task #1: RanToCompletion
-// Task #4: Running
-//
-
-
-
-
-// // Wait for first task to complete.
-// Task[] tasks2 = new Task[3];
-//
-// // Try three different approaches to the problem. Take the first one.
-// tasks2[0] = Task.Factory.StartNew(() => TrySolution1());
-// tasks2[1] = Task.Factory.StartNew(() => TrySolution2());
-// tasks2[2] = Task.Factory.StartNew(() => TrySolution3());
-//
-//
-// int index = Task.WaitAny(tasks2);
-// double d = tasks2[index].Result;
-// Console.WriteLine($"task[{index}] completed first with result of {d}.");
-//
-// Console.ReadKey();
-// }
-//
-//
-// static void DoSomeWork(int val)
-// {
-// // Pretend to do something.
-// Thread.SpinWait(val);
-// }
-//
-// static double TrySolution1()
-// {
-// int i = rand.Next(1000000);
-// // Simulate work by spinning
-// Thread.SpinWait(i);
-// return DateTime.Now.Millisecond;
-// }
-// static double TrySolution2()
-// {
-// int i = rand.Next(1000000);
-// // Simulate work by spinning
-// Thread.SpinWait(i);
-// return DateTime.Now.Millisecond;
-// }
-// static double TrySolution3()
-// {
-// int i = rand.Next(1000000);
-// // Simulate work by spinning
-// Thread.SpinWait(i);
-// Thread.SpinWait(1000000);
-// return DateTime.Now.Millisecond;
-// }
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/run1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/run1.cs
deleted file mode 100644
index 80d36c6e2ea3f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/run1.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-using System;
-using System.Threading.Tasks;
-
-public class Example
-{
- public static async Task Main()
- {
- await Task.Run( () => {
- // Just loop.
- int ctr = 0;
- for (ctr = 0; ctr <= 1000000; ctr++)
- {}
- Console.WriteLine($"Finished {ctr} loop iterations");
- } );
- }
-}
-// The example displays the following output:
-// Finished 1000001 loop iterations
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/startnew.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/startnew.cs
deleted file mode 100644
index f1d4917273135..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/startnew.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-class Example1
-{
- static void Main()
- {
- Action
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/startnew1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/startnew1.cs
deleted file mode 100644
index 2c39595bad6b1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/startnew1.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-using System;
-using System.Threading.Tasks;
-
-public class Example2
-{
- public static void Main()
- {
- Task t = Task.Factory.StartNew(() =>
- {
- // Just loop.
- int ctr = 0;
- for (ctr = 0; ctr <= 1000000; ctr++)
- { }
- Console.WriteLine($"Finished {ctr} loop iterations");
- });
- t.Wait();
- }
-}
-// The example displays the following output:
-// Finished 1000001 loop iterations
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/Wait1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/Wait1.fs
deleted file mode 100644
index 82303ddd26464..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/Wait1.fs
+++ /dev/null
@@ -1,22 +0,0 @@
-module Wait1
-//
-open System
-open System.Threading
-open System.Threading.Tasks
-
-let rand = Random()
-
-// Wait on a single task with no timeout specified.
-let taskA = Task.Run(fun () -> Thread.Sleep 2000)
-printfn $"taskA Status: {taskA.Status}"
-try
- taskA.Wait()
- printfn $"taskA Status: {taskA.Status}"
-
-with :? AggregateException ->
- printfn "Exception in taskA."
-
-// The example displays output like the following:
-// taskA Status: WaitingToRun
-// taskA Status: RanToCompletion
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/Wait2.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/Wait2.fs
deleted file mode 100644
index 72bbb825d56ee..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/Wait2.fs
+++ /dev/null
@@ -1,25 +0,0 @@
-module Wait2
-//
-open System
-open System.Threading
-open System.Threading.Tasks
-
-// Wait on a single task with a timeout specified.
-let taskA = Task.Run(fun () -> Thread.Sleep 2000)
-
-try
- taskA.Wait 1000 |> ignore // Wait for 1 second.
- let completed = taskA.IsCompleted
- printfn $"Task A completed: {completed}, Status: {taskA.Status}"
-
- if not completed then
- printfn "Timed out before task A completed."
-
-with :? AggregateException ->
- printfn "Exception in taskA."
-
-
-// The example displays output like the following:
-// Task A completed: False, Status: Running
-// Timed out before task A completed.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/WaitAll1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/WaitAll1.fs
deleted file mode 100644
index 3f0e0c0c05681..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/WaitAll1.fs
+++ /dev/null
@@ -1,38 +0,0 @@
-module WaitAll1
-//
-open System
-open System.Threading
-open System.Threading.Tasks
-
-// Wait for all tasks to complete.
-let tasks =
- [| for _ = 0 to 9 do
- Task.Run(fun () -> Thread.Sleep 2000) |]
-
-try
- Task.WaitAll tasks
-
-with :? AggregateException as ae ->
- printfn "One or more exceptions occurred: "
-
- for ex in ae.Flatten().InnerExceptions do
- printfn $" {ex.Message}"
-
-printfn "Status of completed tasks:"
-
-for t in tasks do
- printfn $" Task #{t.Id}: {t.Status}"
-
-// The example displays the following output:
-// Status of completed tasks:
-// Task #2: RanToCompletion
-// Task #1: RanToCompletion
-// Task #3: RanToCompletion
-// Task #4: RanToCompletion
-// Task #6: RanToCompletion
-// Task #5: RanToCompletion
-// Task #7: RanToCompletion
-// Task #8: RanToCompletion
-// Task #9: RanToCompletion
-// Task #10: RanToCompletion
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/WaitAll2.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/WaitAll2.fs
deleted file mode 100644
index 9d466754397e1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/WaitAll2.fs
+++ /dev/null
@@ -1,86 +0,0 @@
-module WaitAll2
-//
-open System
-open System.Threading
-open System.Threading.Tasks
-
-// Create a cancellation token and cancel it.
-let source1 = new CancellationTokenSource()
-let token1 = source1.Token
-source1.Cancel()
-// Create a cancellation token for later cancellation.
-let source2 = new CancellationTokenSource()
-let token2 = source2.Token
-
-// Create a series of tasks that will complete, be cancelled,
-// timeout, or throw an exception.
-let tasks =
- [| for i in 0..11 do
- match i % 4 with
- // Task should run to completion.
- | 0 -> Task.Run(fun () -> Thread.Sleep 2000)
- // Task should be set to canceled state.
- | 1 -> Task.Run(fun () -> Thread.Sleep 2000, token1)
- // Task should throw an exception.
- | 2 -> Task.Run(fun () -> NotSupportedException())
- // Task should examine cancellation token.
- | _ ->
- Task.Run(fun () ->
- Thread.Sleep 2000
-
- if token2.IsCancellationRequested then
- token2.ThrowIfCancellationRequested()
-
- Thread.Sleep 500, token2) |]
-
-
-Thread.Sleep 250
-source2.Cancel()
-
-try
- Task.WaitAll tasks
-
-with :? AggregateException as ae ->
- printfn "One or more exceptions occurred:"
-
- for ex in ae.InnerExceptions do
- printfn $" {ex.GetType().Name}: {ex.Message}"
-
-printfn "\nStatus of tasks:"
-
-for t in tasks do
- printfn $" Task #{t.Id}: {t.Status}"
-
- if isNull t.Exception |> not then
- for ex in t.Exception.InnerExceptions do
- printfn $" {ex.GetType().Name}: {ex.Message}"
-
-// The example displays output like the following:
-// One or more exceptions occurred:
-// TaskCanceledException: A task was canceled.
-// NotSupportedException: Specified method is not supported.
-// TaskCanceledException: A task was canceled.
-// TaskCanceledException: A task was canceled.
-// NotSupportedException: Specified method is not supported.
-// TaskCanceledException: A task was canceled.
-// TaskCanceledException: A task was canceled.
-// NotSupportedException: Specified method is not supported.
-// TaskCanceledException: A task was canceled.
-//
-// Status of tasks:
-// Task #13: RanToCompletion
-// Task #1: Canceled
-// Task #3: Faulted
-// NotSupportedException: Specified method is not supported.
-// Task #8: Canceled
-// Task #14: RanToCompletion
-// Task #4: Canceled
-// Task #6: Faulted
-// NotSupportedException: Specified method is not supported.
-// Task #7: Canceled
-// Task #15: RanToCompletion
-// Task #9: Canceled
-// Task #11: Faulted
-// NotSupportedException: Specified method is not supported.
-// Task #12: Canceled
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/WhenAny1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/WhenAny1.fs
deleted file mode 100644
index 0909a2ca968e0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/WhenAny1.fs
+++ /dev/null
@@ -1,81 +0,0 @@
-module WhenAny1
-//
-open System
-open System.Threading
-open System.Threading.Tasks
-
-let rnd = new Random()
-
-let tasks =
- [| for _ = 0 to 2 do
- Task.Run(fun () -> rnd.Next(500, 3000) |> Thread.Sleep) |]
-
-try
- let index = Task.WaitAny tasks
- printfn $"Task #{tasks[index].Id} completed first.\n"
- printfn "Status of all tasks:"
-
- for t in tasks do
- printfn $" Task #{t.Id}: {t.Status}"
-
-with :? AggregateException ->
- printfn "An exception occurred."
-
-// The example displays output like the following:
-// Task #1 completed first.
-//
-// Status of all tasks:
-// Task #3: Running
-// Task #1: RanToCompletion
-// Task #4: Running
-//
-
-
-
-
-// // Wait for first task to complete.
-// Task[] tasks2 = new Task[3];
-//
-// // Try three different approaches to the problem. Take the first one.
-// tasks2[0] = Task.Factory.StartNew(() => TrySolution1());
-// tasks2[1] = Task.Factory.StartNew(() => TrySolution2());
-// tasks2[2] = Task.Factory.StartNew(() => TrySolution3());
-//
-//
-// int index = Task.WaitAny(tasks2);
-// double d = tasks2[index].Result;
-// Console.WriteLine("task[{0}] completed first with result of {1}.", index, d);
-//
-// Console.ReadKey();
-//
-//
-//
-// static void DoSomeWork(int val)
-//
-// // Pretend to do something.
-// Thread.SpinWait(val);
-//
-//
-// static double TrySolution1()
-//
-// int i = rand.Next(1000000);
-// // Simulate work by spinning
-// Thread.SpinWait(i);
-// return DateTime.Now.Millisecond;
-//
-// static double TrySolution2()
-//
-// int i = rand.Next(1000000);
-// // Simulate work by spinning
-// Thread.SpinWait(i);
-// return DateTime.Now.Millisecond;
-//
-// static double TrySolution3()
-//
-// int i = rand.Next(1000000);
-// // Simulate work by spinning
-// Thread.SpinWait(i);
-// Thread.SpinWait(1000000);
-// return DateTime.Now.Millisecond;
-//
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/run1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/run1.fs
deleted file mode 100644
index 1e986c10583f5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/run1.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module run1
-//
-open System.Threading.Tasks
-
-let main =
- task {
- do!
- Task.Run(fun () ->
- for i = 0 to 1000000 do
- printfn $"Finished {i} loop iterations")
- }
-
-main.Wait()
-
-// The example displays the following output:
-// Finished 1000001 loop iterations
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/startnew.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/startnew.fs
deleted file mode 100644
index 3c6d07303c0cf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/startnew.fs
+++ /dev/null
@@ -1,46 +0,0 @@
-module startnew
-//
-open System.Threading
-open System.Threading.Tasks
-
-let action =
- fun (obj: obj) -> printfn $"Task={Task.CurrentId}, obj={obj}, Thread={Thread.CurrentThread.ManagedThreadId}"
-
-// Create a task but do not start it.
-let t1 = new Task(action, "alpha")
-
-// Construct a started task
-let t2 = Task.Factory.StartNew(action, "beta")
-// Block the main thread to demonstrate that t2 is executing
-t2.Wait()
-
-// Launch t1
-t1.Start()
-printfn $"t1 has been launched. (Main Thread={Thread.CurrentThread.ManagedThreadId})"
-// Wait for the task to finish.
-t1.Wait()
-
-// Construct a started task using Task.Run.
-let taskData = "delta"
-
-let t3 =
- Task.Run(fun () -> printfn $"Task={Task.CurrentId}, obj={taskData}, Thread={Thread.CurrentThread.ManagedThreadId}")
-// Wait for the task to finish.
-t3.Wait()
-
-// Construct an unstarted task
-let t4 = new Task(action, "gamma")
-// Run it synchronously
-t4.RunSynchronously()
-// Although the task was run synchronously, it is a good practice
-// to wait for it in the event exceptions were thrown by the task.
-t4.Wait()
-
-
-// The example displays output like the following:
-// Task=1, obj=beta, Thread=3
-// t1 has been launched. (Main Thread=1)
-// Task=2, obj=alpha, Thread=4
-// Task=3, obj=delta, Thread=3
-// Task=4, obj=gamma, Thread=1
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/startnew1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/startnew1.fs
deleted file mode 100644
index a66aff79a9db8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/fsharp/startnew1.fs
+++ /dev/null
@@ -1,16 +0,0 @@
-module startnew1
-//
-open System.Threading.Tasks
-
-let t =
- Task.Factory.StartNew(fun () ->
- // Just loop.
- for i = 0 to 1000000 do
- printfn $"Finished {i} loop iterations")
-
-t.Wait()
-
-
-// The example displays the following output:
-// Finished 1000001 loop iterations
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/Wait1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/Wait1.vb
deleted file mode 100644
index 914b7bce249cf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/Wait1.vb
+++ /dev/null
@@ -1,24 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Threading
-Imports System.Threading.Tasks
-
-Module Example4
- Public Sub Main()
- ' Wait on a single task with no timeout specified.
- Dim taskA = Task.Run(Sub() Thread.Sleep(2000))
- Console.WriteLine("taskA Status: {0}", taskA.Status)
- Try
- taskA.Wait()
- Console.WriteLine("taskA Status: {0}", taskA.Status)
- Catch e As AggregateException
- Console.WriteLine("Exception in taskA.")
- End Try
- End Sub
-End Module
-' The example displays output like the following:
-' taskA Status: WaitingToRun
-' taskA Status: RanToCompletion
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/Wait2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/Wait2.vb
deleted file mode 100644
index 5831bede59b52..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/Wait2.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Threading
-Imports System.Threading.Tasks
-
-Module Example5
- Public Sub Main()
- ' Wait on a single task with a timeout specified.
- Dim taskA As Task = Task.Run(Sub() Thread.Sleep(2000))
- Try
- taskA.Wait(1000) ' Wait for 1 second.
- Dim completed As Boolean = taskA.IsCompleted
- Console.WriteLine("Task.Completed: {0}, Status: {1}",
- completed, taskA.Status)
- If Not completed Then
- Console.WriteLine("Timed out before task A completed.")
- End If
- Catch e As AggregateException
- Console.WriteLine("Exception in taskA.")
- End Try
- End Sub
-End Module
-' The example displays the following output:
-' Task A completed: False, Status: Running
-' Timed out before task A completed.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/WaitAll1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/WaitAll1.vb
deleted file mode 100644
index fc512ca31a2ae..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/WaitAll1.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Threading
-Imports System.Threading.Tasks
-
-Module Example6
- Public Sub Main()
- ' Wait for all tasks to complete.
- Dim tasks(9) As Task
- For i As Integer = 0 To 9
- tasks(i) = Task.Run(Sub() Thread.Sleep(2000))
- Next
- Try
- Task.WaitAll(tasks)
- Catch ae As AggregateException
- Console.WriteLine("One or more exceptions occurred: ")
- For Each ex In ae.Flatten().InnerExceptions
- Console.WriteLine(" {0}", ex.Message)
- Next
- End Try
-
- Console.WriteLine("Status of completed tasks:")
- For Each t In tasks
- Console.WriteLine(" Task #{0}: {1}", t.Id, t.Status)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Status of completed tasks:
-' Task #2: RanToCompletion
-' Task #1: RanToCompletion
-' Task #3: RanToCompletion
-' Task #4: RanToCompletion
-' Task #6: RanToCompletion
-' Task #5: RanToCompletion
-' Task #7: RanToCompletion
-' Task #8: RanToCompletion
-' Task #9: RanToCompletion
-' Task #10: RanToCompletion
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/WaitAll2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/WaitAll2.vb
deleted file mode 100644
index 91cea251e4b3d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/WaitAll2.vb
+++ /dev/null
@@ -1,98 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Threading
-Imports System.Threading.Tasks
-
-Module Example7
- Public Sub Main()
- ' Create a cancellation token and cancel it.
- Dim source1 As New CancellationTokenSource()
- Dim token1 As CancellationToken = source1.Token
- source1.Cancel()
- ' Create a cancellation token for later cancellation.
- Dim source2 As New CancellationTokenSource()
- Dim token2 As CancellationToken = source2.Token
-
- ' Create a series of tasks that will complete, be cancelled,
- ' timeout, or throw an exception.
- Dim tasks(11) As Task
- For i As Integer = 0 To 11
- Select Case i Mod 4
- ' Task should run to completion.
- Case 0
- tasks(i) = Task.Run(Sub() Thread.Sleep(2000))
- ' Task should be set to canceled state.
- Case 1
- tasks(i) = Task.Run(Sub() Thread.Sleep(2000), token1)
- Case 2
- ' Task should throw an exception.
- tasks(i) = Task.Run(Sub()
- Throw New NotSupportedException()
- End Sub)
- Case 3
- ' Task should examine cancellation token.
- tasks(i) = Task.Run(Sub()
- Thread.Sleep(2000)
- If token2.IsCancellationRequested Then
- token2.ThrowIfCancellationRequested()
- End If
- Thread.Sleep(500)
- End Sub, token2)
- End Select
- Next
- Thread.Sleep(250)
- source2.Cancel()
-
- Try
- Task.WaitAll(tasks)
- Catch ae As AggregateException
- Console.WriteLine("One or more exceptions occurred:")
- For Each ex In ae.InnerExceptions
- Console.WriteLine(" {0}: {1}", ex.GetType().Name, ex.Message)
- Next
- End Try
- Console.WriteLine()
-
- Console.WriteLine("Status of tasks:")
- For Each t In tasks
- Console.WriteLine(" Task #{0}: {1}", t.Id, t.Status)
- If t.Exception IsNot Nothing Then
- For Each ex In t.Exception.InnerExceptions
- Console.WriteLine(" {0}: {1}", ex.GetType().Name,
- ex.Message)
- Next
- End If
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' One or more exceptions occurred:
-' TaskCanceledException: A task was canceled.
-' NotSupportedException: Specified method is not supported.
-' TaskCanceledException: A task was canceled.
-' TaskCanceledException: A task was canceled.
-' NotSupportedException: Specified method is not supported.
-' TaskCanceledException: A task was canceled.
-' TaskCanceledException: A task was canceled.
-' NotSupportedException: Specified method is not supported.
-' TaskCanceledException: A task was canceled.
-'
-' Status of tasks:
-' Task #13: RanToCompletion
-' Task #1: Canceled
-' Task #3: Faulted
-' NotSupportedException: Specified method is not supported.
-' Task #8: Canceled
-' Task #14: RanToCompletion
-' Task #4: Canceled
-' Task #6: Faulted
-' NotSupportedException: Specified method is not supported.
-' Task #7: Canceled
-' Task #15: RanToCompletion
-' Task #9: Canceled
-' Task #11: Faulted
-' NotSupportedException: Specified method is not supported.
-' Task #12: Canceled
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/WaitAny1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/WaitAny1.vb
deleted file mode 100644
index 6efb896788c6c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/WaitAny1.vb
+++ /dev/null
@@ -1,35 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Threading
-
-Module Example8
- Public Sub Main()
- Dim tasks(2) As Task
- Dim rnd As New Random()
- For ctr As Integer = 0 To 2
- tasks(ctr) = Task.Run(Sub() Thread.Sleep(rnd.Next(500, 3000)))
- Next
-
- Try
- Dim index As Integer = Task.WaitAny(tasks)
- Console.WriteLine("Task #{0} completed first.", tasks(index).Id)
- Console.WriteLine()
- Console.WriteLine("Status of all tasks:")
- For Each t In tasks
- Console.WriteLine(" Task #{0}: {1}", t.Id, t.Status)
- Next
- Catch e As AggregateException
- Console.WriteLine("An exception occurred.")
- End Try
- End Sub
-End Module
-' The example displays output like the following:
-' Task #1 completed first.
-'
-' Status of all tasks:
-' Task #3: Running
-' Task #1: RanToCompletion
-' Task #4: Running
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/run1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/run1.vb
deleted file mode 100644
index 1c5ed25f06296..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/run1.vb
+++ /dev/null
@@ -1,22 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Threading.Tasks
-
-Module Example1
- Public Sub Main()
- Dim t As Task = Task.Run(Sub()
- ' Just loop.
- Dim ctr As Integer = 0
- For ctr = 0 To 1000000
- Next
- Console.WriteLine("Finished {0} loop iterations",
- ctr)
- End Sub)
- t.Wait()
- End Sub
-End Module
-' The example displays the following output:
-' Finished 1000001 loop iterations
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/startnew.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/startnew.vb
deleted file mode 100644
index 855e0f8297b08..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/startnew.vb
+++ /dev/null
@@ -1,54 +0,0 @@
-'
-Imports System.Threading
-Imports System.Threading.Tasks
-
-Module Example2
- Public Sub Main()
- Dim action As Action(Of Object) =
- Sub(obj As Object)
- Console.WriteLine("Task={0}, obj={1}, Thread={2}",
- Task.CurrentId, obj,
- Thread.CurrentThread.ManagedThreadId)
- End Sub
-
- ' Construct an unstarted task
- Dim t1 As New Task(action, "alpha")
-
- ' Construct a started task
- Dim t2 As Task = Task.Factory.StartNew(action, "beta")
- ' Block the main thread to demonstrate that t2 is executing
- t2.Wait()
-
- ' Launch t1
- t1.Start()
- Console.WriteLine("t1 has been launched. (Main Thread={0})",
- Thread.CurrentThread.ManagedThreadId)
- ' Wait for the task to finish.
- t1.Wait()
-
- ' Construct a started task using Task.Run.
- Dim taskData As String = "delta"
- Dim t3 As Task = Task.Run(Sub()
- Console.WriteLine("Task={0}, obj={1}, Thread={2}",
- Task.CurrentId, taskData,
- Thread.CurrentThread.ManagedThreadId)
- End Sub)
- ' Wait for the task to finish.
- t3.Wait()
-
- ' Construct an unstarted task
- Dim t4 As New Task(action, "gamma")
- ' Run it synchronously
- t4.RunSynchronously()
- ' Although the task was run synchronously, it is a good practice
- ' to wait for it in the event exceptions were thrown by the task.
- t4.Wait()
- End Sub
-End Module
-' The example displays output like the following:
-' Task=1, obj=beta, Thread=3
-' t1 has been launched. (Main Thread=1)
-' Task=2, obj=alpha, Thread=3
-' Task=3, obj=delta, Thread=3
-' Task=4, obj=gamma, Thread=1
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/startnew1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/startnew1.vb
deleted file mode 100644
index c8653513f1faf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/vb/startnew1.vb
+++ /dev/null
@@ -1,22 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Threading.Tasks
-
-Module Example3
- Public Sub Main()
- Dim t As Task = Task.Factory.StartNew(Sub()
- ' Just loop.
- Dim ctr As Integer = 0
- For ctr = 0 To 1000000
- Next
- Console.WriteLine("Finished {0} loop iterations",
- ctr)
- End Sub)
- t.Wait()
- End Sub
-End Module
-' The example displays the following output:
-' Finished 1000001 loop iterations
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/Project.csproj
deleted file mode 100644
index 2732086bb1e6e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Exe
- net10.0-windows
- true
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/app.config b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/app.config
deleted file mode 100644
index 3e0e37cfc8c7a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/app.config
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/app.xaml b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/app.xaml
deleted file mode 100644
index 4160208d4a04f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/app.xaml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/app.xaml.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/app.xaml.cs
deleted file mode 100644
index d4bf55202f127..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/app.xaml.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace WPF_CS1
-{
- ///
- /// Interaction logic for App.xaml
- ///
- public partial class App : Application
- {
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/mainwindow.xaml b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/mainwindow.xaml
deleted file mode 100644
index 299b19375b548..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/mainwindow.xaml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/mainwindow.xaml.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/mainwindow.xaml.cs
deleted file mode 100644
index 55e8002773b30..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/FromCurrentSynchronizationContext/csharp/mainwindow.xaml.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-using System;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-
-namespace WPF_CS1
-{
- ///
- /// Interaction logic for MainWindow.xaml
- ///
- public partial class MainWindow : Window
- {
- private int fileCount;
- int colCount;
- int rowCount;
- private int tilePixelHeight;
- private int tilePixelWidth;
- private int largeImagePixelHeight;
- private int largeImagePixelWidth;
- private int largeImageStride;
- PixelFormat format;
- BitmapPalette palette = null;
-
- public MainWindow()
- {
- InitializeComponent();
-
- // For this example, values are hard-coded to a mosaic of 8x8 tiles.
- // Each tile is 50 pixels high and 66 pixels wide and 32 bits per pixel.
- colCount = 12;
- rowCount = 8;
- tilePixelHeight = 50;
- tilePixelWidth = 66;
- largeImagePixelHeight = tilePixelHeight * rowCount;
- largeImagePixelWidth = tilePixelWidth * colCount;
- largeImageStride = largeImagePixelWidth * (32 / 8);
- this.Width = largeImagePixelWidth + 40;
- image.Width = largeImagePixelWidth;
- image.Height = largeImagePixelHeight;
- }
-
- private void button_Click(object sender, RoutedEventArgs e)
- {
-
- // For best results use 1024 x 768 jpg files at 32bpp.
- string[] files = System.IO.Directory.GetFiles(@"C:\Users\Public\Pictures\Sample Pictures\", "*.jpg");
-
- fileCount = files.Length;
- Task[] images = new Task[fileCount];
- for (int i = 0; i < fileCount; i++)
- {
- int x = i;
- images[x] = Task.Factory.StartNew(() => LoadImage(files[x]));
- }
-
- // When they've all been loaded, tile them into a single byte array.
- var tiledImage = Task.Factory.ContinueWhenAll(
- images, (i) => TileImages(i));
-
- // We are currently on the UI thread. Save the sync context and pass it to
- // the next task so that it can access the UI control "image".
- var UISyncContext = TaskScheduler.FromCurrentSynchronizationContext();
-
- // On the UI thread, put the bytes into a bitmap and
- // display it in the Image control.
- var t3 = tiledImage.ContinueWith((antecedent) =>
- {
- // Get System DPI.
- Matrix m = PresentationSource.FromVisual(Application.Current.MainWindow)
- .CompositionTarget.TransformToDevice;
- double dpiX = m.M11;
- double dpiY = m.M22;
-
- BitmapSource bms = BitmapSource.Create(largeImagePixelWidth,
- largeImagePixelHeight,
- dpiX,
- dpiY,
- format,
- palette, //use default palette
- antecedent.Result,
- largeImageStride);
- image.Source = bms;
- }, UISyncContext);
- }
-
- byte[] LoadImage(string filename)
- {
- // Use the WPF BitmapImage class to load and
- // resize the bitmap. NOTE: Only 32bpp formats are supported correctly.
- // Support for additional color formats is left as an exercise
- // for the reader. For more information, see documentation for ColorConvertedBitmap.
-
- BitmapImage bitmapImage = new BitmapImage();
- bitmapImage.BeginInit();
- bitmapImage.UriSource = new Uri(filename);
- bitmapImage.DecodePixelHeight = tilePixelHeight;
- bitmapImage.DecodePixelWidth = tilePixelWidth;
- bitmapImage.EndInit();
-
- format = bitmapImage.Format;
- int size = (int)(bitmapImage.Height * bitmapImage.Width);
- int stride = (int)bitmapImage.Width * 4;
- byte[] dest = new byte[stride * tilePixelHeight];
-
- bitmapImage.CopyPixels(dest, stride, 0);
-
- return dest;
- }
-
- int Stride(int pixelWidth, int bitsPerPixel)
- {
- return (((pixelWidth * bitsPerPixel + 31) / 32) * 4);
- }
-
- // Map the individual image tiles to the large image
- // in parallel. Any kind of raw image manipulation can be
- // done here because we are not attempting to access any
- // WPF controls from multiple threads.
- byte[] TileImages(Task[] sourceImages)
- {
- byte[] largeImage = new byte[largeImagePixelHeight * largeImageStride];
- int tileImageStride = tilePixelWidth * 4; // hard coded to 32bpp
-
- Random rand = new Random();
- Parallel.For(0, rowCount * colCount, (i) =>
- {
- // Pick one of the images at random for this tile.
- int cur = rand.Next(0, sourceImages.Length);
- byte[] pixels = sourceImages[cur].Result;
-
- // Get the starting index for this tile.
- int row = i / colCount;
- int col = (int)(i % colCount);
- int idx = ((row * (largeImageStride * tilePixelHeight)) + (col * tileImageStride));
-
- // Write the pixels for the current tile. The pixels are not contiguous
- // in the array, therefore we have to advance the index by the image stride
- // (minus the stride of the tile) for each scanline of the tile.
- int tileImageIndex = 0;
- for (int j = 0; j < tilePixelHeight; j++)
- {
- // Write the next scanline for this tile.
- for (int k = 0; k < tileImageStride; k++)
- {
- largeImage[idx++] = pixels[tileImageIndex++];
- }
- // Advance to the beginning of the next scanline.
- idx += largeImageStride - tileImageStride;
- }
- });
- return largeImage;
- }
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/Application.xaml b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/Application.xaml
deleted file mode 100644
index a51b6ba73e2e5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/Application.xaml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/Application.xaml.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/Application.xaml.vb
deleted file mode 100644
index 084cbe917ecd3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/Application.xaml.vb
+++ /dev/null
@@ -1,6 +0,0 @@
-Class Application
-
- ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
- ' can be handled in this file.
-
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/AssemblyInfo.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/AssemblyInfo.vb
deleted file mode 100644
index 025ee7271e722..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/AssemblyInfo.vb
+++ /dev/null
@@ -1,11 +0,0 @@
-Imports System.Windows
-
-'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
-'1st parameter: where theme specific resource dictionaries are located
-'(used if a resource is not found in the page,
-' or application resource dictionaries)
-
-'2nd parameter: where the generic resource dictionary is located
-'(used if a resource is not found in the page,
-'app, and any theme specific resource dictionaries)
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/MainWindow.xaml b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/MainWindow.xaml
deleted file mode 100644
index e9509dc18f447..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/MainWindow.xaml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/MainWindow.xaml.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/MainWindow.xaml.vb
deleted file mode 100644
index d90011dabecc1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/MainWindow.xaml.vb
+++ /dev/null
@@ -1,143 +0,0 @@
-Option Infer On
-
-'
-
-Partial Public Class MainWindow : Inherits Window
- Dim fileCount As Integer
- Dim colCount As Integer
- Dim rowCount As Integer
- Dim tilePixelHeight As Integer
- Dim tilePixelWidth As Integer
- Dim largeImagePixelHeight As Integer
- Dim largeImagePixelWidth As Integer
- Dim largeImageStride As Integer
- Dim format As PixelFormat
- Dim palette As BitmapPalette = Nothing
-
- Public Sub New()
- InitializeComponent()
-
- ' For this example, values are hard-coded to a mosaic of 8x8 tiles.
- ' Each tile Is 50 pixels high and 66 pixels wide and 32 bits per pixel.
- colCount = 12
- rowCount = 8
- tilePixelHeight = 50
- tilePixelWidth = 66
- largeImagePixelHeight = tilePixelHeight * rowCount
- largeImagePixelWidth = tilePixelWidth * colCount
- largeImageStride = largeImagePixelWidth * (32 / 8)
- Me.Width = largeImagePixelWidth + 40
- image.Width = largeImagePixelWidth
- image.Height = largeImagePixelHeight
- End Sub
-
- Private Sub button_Click(sender As Object, e As RoutedEventArgs) _
- Handles button.Click
-
- ' For best results use 1024 x 768 jpg files at 32bpp.
- Dim files() As String = System.IO.Directory.GetFiles("C:\Users\Public\Pictures\Sample Pictures\", "*.jpg")
-
- fileCount = files.Length
- Dim images(fileCount - 1) As Task(Of Byte())
- For i As Integer = 0 To fileCount - 1
- Dim x As Integer = i
- images(x) = Task.Factory.StartNew(Function() LoadImage(files(x)))
- Next
-
- ' When they have all been loaded, tile them into a single byte array.
- 'var tiledImage = Task.Factory.ContinueWhenAll(
- ' images, (i) >= TileImages(i));
-
- ' Dim tiledImage As Task(Of Byte()) = Task.Factory.ContinueWhenAll(images, Function(i As Task(Of Byte())) TileImages(i))
- Dim tiledImage = Task.Factory.ContinueWhenAll(images, Function(i As Task(Of Byte())()) TileImages(i))
- ' We are currently on the UI thread. Save the sync context and pass it to
- ' the next task so that it can access the UI control "image1".
- Dim UISyncContext = TaskScheduler.FromCurrentSynchronizationContext()
-
- ' On the UI thread, put the bytes into a bitmap and
- ' display it in the Image control.
- Dim t3 = tiledImage.ContinueWith(Sub(antecedent)
- ' Get System DPI.
- Dim m As Matrix = PresentationSource.FromVisual(Application.Current.MainWindow).CompositionTarget.TransformToDevice
- Dim dpiX As Double = m.M11
- Dim dpiY As Double = m.M22
-
- ' Use the default palette in creating the bitmap.
- Dim bms As BitmapSource = BitmapSource.Create(largeImagePixelWidth,
- largeImagePixelHeight,
- dpiX,
- dpiY,
- format,
- palette,
- antecedent.Result,
- largeImageStride)
- image.Source = bms
- End Sub, UISyncContext)
- End Sub
-
- Public Function LoadImage(filename As String) As Byte()
- ' Use the WPF BitmapImage class to load and
- ' resize the bitmap. NOTE: Only 32bpp formats are supported correctly.
- ' Support for additional color formats Is left as an exercise
- ' for the reader. For more information, see documentation for ColorConvertedBitmap.
- Dim bitmapImage As New BitmapImage()
- bitmapImage.BeginInit()
- bitmapImage.UriSource = New Uri(filename)
- bitmapImage.DecodePixelHeight = tilePixelHeight
- bitmapImage.DecodePixelWidth = tilePixelWidth
- bitmapImage.EndInit()
-
- format = bitmapImage.Format
- Dim size As Integer = CInt(bitmapImage.Height * bitmapImage.Width)
- Dim stride As Integer = CInt(bitmapImage.Width * 4)
- Dim dest(stride * tilePixelHeight - 1) As Byte
-
- bitmapImage.CopyPixels(dest, stride, 0)
-
- Return dest
- End Function
-
- Function Stride(pixelWidth As Integer, bitsPerPixel As Integer) As Integer
- Return (((pixelWidth * bitsPerPixel + 31) / 32) * 4)
- End Function
-
- ' Map the individual image tiles to the large image
- ' in parallel. Any kind of raw image manipulation can be
- ' done here because we are Not attempting to access any
- ' WPF controls from multiple threads.
- Function TileImages(sourceImages As Task(Of Byte())()) As Byte()
- Dim largeImage(largeImagePixelHeight * largeImageStride - 1) As Byte
- Dim tileImageStride As Integer = tilePixelWidth * 4 ' hard coded To 32bpp
-
- Dim rand As New Random()
- Parallel.For(0, rowCount * colCount, Sub(i)
- ' Pick one of the images at random for this tile.
- Dim cur As Integer = rand.Next(0, sourceImages.Length)
- Dim pixels() As Byte = sourceImages(cur).Result
-
- ' Get the starting index for this tile.
- Dim row As Integer = i \ colCount
- Dim col As Integer = i Mod colCount
- Dim idx As Integer = ((row * (largeImageStride * tilePixelHeight)) + (col * tileImageStride))
-
- ' Write the pixels for the current tile. The pixels are Not contiguous
- ' in the array, therefore we have to advance the index by the image stride
- ' (minus the stride of the tile) for each scanline of the tile.
- Dim tileImageIndex As Integer = 0
- For j As Integer = 0 To tilePixelHeight - 1
- ' Write the next scanline for this tile.
- For k As Integer = 0 To tileImageStride - 1
- largeImage(idx) = pixels(tileImageIndex)
- idx += 1
- tileImageIndex += 1
- Next
- ' Advance to the beginning of the next scanline.
- idx += largeImageStride - tileImageStride
- Next
- End Sub)
- Return largeImage
- End Function
-End Class
-'
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/WpfApp.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/WpfApp.vbproj
deleted file mode 100644
index 6edaac4562a2a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/TaskScheduler/Overview/vb/WpfApp.vbproj
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
- WinExe
- net10.0-windows
- WpfApp
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/Pattern2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/Pattern2.cs
deleted file mode 100644
index 2fca16b193137..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/Pattern2.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-using System.Threading;
-
-public class Example3
-{
- public static void Main()
- {
- //
- // Define the lock object.
- var obj = new Object();
-
- // Define the critical section.
- Monitor.Enter(obj);
- try
- {
- // Code to execute one thread at a time.
- }
- // catch blocks go here.
- finally
- {
- Monitor.Exit(obj);
- }
- //
- }
-
- //
- [MethodImplAttribute(MethodImplOptions.Synchronized)]
- void MethodToLock()
- {
- // Method implementation.
- }
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/badbox1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/badbox1.cs
deleted file mode 100644
index 4ebbc0dbc7d9d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/badbox1.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class Example
-{
- public static void Main()
- {
-
- int nTasks = 0;
- object o = nTasks;
- List tasks = new List();
-
- try {
- for (int ctr = 0; ctr < 10; ctr++)
- tasks.Add(Task.Run( () => { // Instead of doing some work, just sleep.
- Thread.Sleep(250);
- // Increment the number of tasks.
- Monitor.Enter(o);
- try {
- nTasks++;
- }
- finally {
- Monitor.Exit(o);
- }
- } ));
- Task.WaitAll(tasks.ToArray());
- Console.WriteLine($"{nTasks} tasks started and executed.");
- }
- catch (AggregateException e) {
- String msg = String.Empty;
- foreach (var ie in e.InnerExceptions) {
- Console.WriteLine($"{ie.GetType().Name}");
- if (! msg.Contains(ie.Message))
- msg += ie.Message + Environment.NewLine;
- }
- Console.WriteLine("\nException Message(s):");
- Console.WriteLine(msg);
- }
- }
-}
-// The example displays the following output:
-// 10 tasks started and executed.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/badlock1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/badlock1.cs
deleted file mode 100644
index 9119dc1387204..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/badlock1.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class Example1
-{
- public static void Main()
- {
- int nTasks = 0;
- List tasks = new List();
-
- try
- {
- for (int ctr = 0; ctr < 10; ctr++)
- tasks.Add(Task.Run(() =>
- { // Instead of doing some work, just sleep.
- Thread.Sleep(250);
- // Increment the number of tasks.
- Monitor.Enter(nTasks);
- try
- {
- nTasks += 1;
- }
- finally
- {
- Monitor.Exit(nTasks);
- }
- }));
- Task.WaitAll(tasks.ToArray());
- Console.WriteLine($"{nTasks} tasks started and executed.");
- }
- catch (AggregateException e)
- {
- String msg = String.Empty;
- foreach (var ie in e.InnerExceptions)
- {
- Console.WriteLine($"{ie.GetType().Name}");
- if (!msg.Contains(ie.Message))
- msg += ie.Message + Environment.NewLine;
- }
- Console.WriteLine("\nException Message(s):");
- Console.WriteLine(msg);
- }
- }
-}
-// The example displays the following output:
-// SynchronizationLockException
-// SynchronizationLockException
-// SynchronizationLockException
-// SynchronizationLockException
-// SynchronizationLockException
-// SynchronizationLockException
-// SynchronizationLockException
-// SynchronizationLockException
-// SynchronizationLockException
-// SynchronizationLockException
-//
-// Exception Message(s):
-// Object synchronization method was called from an unsynchronized block of code.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/example1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/example1.cs
deleted file mode 100644
index c0af1f3674e54..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/example1.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class Example2
-{
- public static void Main()
- {
- List tasks = new List();
- Random rnd = new Random();
- long total = 0;
- int n = 0;
-
- for (int taskCtr = 0; taskCtr < 10; taskCtr++)
- tasks.Add(Task.Run(() =>
- {
- int[] values = new int[10000];
- int taskTotal = 0;
- int taskN = 0;
- int ctr = 0;
- Monitor.Enter(rnd);
- // Generate 10,000 random integers
- for (ctr = 0; ctr < 10000; ctr++)
- values[ctr] = rnd.Next(0, 1001);
- Monitor.Exit(rnd);
- taskN = ctr;
- foreach (var value in values)
- taskTotal += value;
-
- Console.WriteLine("Mean for task {0,2}: {1:N2} (N={2:N0})",
- Task.CurrentId, (taskTotal * 1.0) / taskN,
- taskN);
- Interlocked.Add(ref n, taskN);
- Interlocked.Add(ref total, taskTotal);
- }));
- try
- {
- Task.WaitAll(tasks.ToArray());
- Console.WriteLine($"\nMean for all tasks: {(total * 1.0) / n:N2} (N={n:N0})");
- }
- catch (AggregateException e)
- {
- foreach (var ie in e.InnerExceptions)
- Console.WriteLine($"{ie.GetType().Name}: {ie.Message}");
- }
- }
-}
-// The example displays output like the following:
-// Mean for task 1: 499.04 (N=10,000)
-// Mean for task 2: 500.42 (N=10,000)
-// Mean for task 3: 499.65 (N=10,000)
-// Mean for task 8: 502.59 (N=10,000)
-// Mean for task 5: 502.75 (N=10,000)
-// Mean for task 4: 494.88 (N=10,000)
-// Mean for task 7: 499.22 (N=10,000)
-// Mean for task 10: 496.45 (N=10,000)
-// Mean for task 6: 499.75 (N=10,000)
-// Mean for task 9: 502.79 (N=10,000)
-//
-// Mean for all tasks: 499.75 (N=100,000)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/source.cs
deleted file mode 100644
index 83ad819941262..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/csharp/source.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-using System;
-using System.Threading;
-
-internal class SyncResource
-{
- // Use a monitor to enforce synchronization.
- public void Access()
- {
- lock(this) {
- Console.WriteLine($"Starting synchronized resource access on thread #{Thread.CurrentThread.ManagedThreadId}");
- if (Thread.CurrentThread.ManagedThreadId % 2 == 0)
- Thread.Sleep(2000);
-
- Thread.Sleep(200);
- Console.WriteLine($"Stopping synchronized resource access on thread #{Thread.CurrentThread.ManagedThreadId}");
- }
- }
-}
-
-internal class UnSyncResource
-{
- // Do not enforce synchronization.
- public void Access()
- {
- Console.WriteLine($"Starting unsynchronized resource access on Thread #{Thread.CurrentThread.ManagedThreadId}");
- if (Thread.CurrentThread.ManagedThreadId % 2 == 0)
- Thread.Sleep(2000);
-
- Thread.Sleep(200);
- Console.WriteLine($"Stopping unsynchronized resource access on thread #{Thread.CurrentThread.ManagedThreadId}");
- }
-}
-
-public class App
-{
- private static int numOps;
- private static AutoResetEvent opsAreDone = new AutoResetEvent(false);
- private static SyncResource SyncRes = new SyncResource();
- private static UnSyncResource UnSyncRes = new UnSyncResource();
-
- public static void Main()
- {
- // Set the number of synchronized calls.
- numOps = 5;
- for (int ctr = 0; ctr <= 4; ctr++)
- ThreadPool.QueueUserWorkItem(new WaitCallback(SyncUpdateResource));
-
- // Wait until this WaitHandle is signaled.
- opsAreDone.WaitOne();
- Console.WriteLine("\t\nAll synchronized operations have completed.\n");
-
- // Reset the count for unsynchronized calls.
- numOps = 5;
- for (int ctr = 0; ctr <= 4; ctr++)
- ThreadPool.QueueUserWorkItem(new WaitCallback(UnSyncUpdateResource));
-
- // Wait until this WaitHandle is signaled.
- opsAreDone.WaitOne();
- Console.WriteLine("\t\nAll unsynchronized thread operations have completed.\n");
- }
-
- static void SyncUpdateResource(Object state)
- {
- // Call the internal synchronized method.
- SyncRes.Access();
-
- // Ensure that only one thread can decrement the counter at a time.
- if (Interlocked.Decrement(ref numOps) == 0)
- // Announce to Main that in fact all thread calls are done.
- opsAreDone.Set();
- }
-
- static void UnSyncUpdateResource(Object state)
- {
- // Call the unsynchronized method.
- UnSyncRes.Access();
-
- // Ensure that only one thread can decrement the counter at a time.
- if (Interlocked.Decrement(ref numOps) == 0)
- // Announce to Main that in fact all thread calls are done.
- opsAreDone.Set();
- }
-}
-// The example displays output like the following:
-// Starting synchronized resource access on thread #6
-// Stopping synchronized resource access on thread #6
-// Starting synchronized resource access on thread #7
-// Stopping synchronized resource access on thread #7
-// Starting synchronized resource access on thread #3
-// Stopping synchronized resource access on thread #3
-// Starting synchronized resource access on thread #4
-// Stopping synchronized resource access on thread #4
-// Starting synchronized resource access on thread #5
-// Stopping synchronized resource access on thread #5
-//
-// All synchronized operations have completed.
-//
-// Starting unsynchronized resource access on Thread #7
-// Starting unsynchronized resource access on Thread #9
-// Starting unsynchronized resource access on Thread #10
-// Starting unsynchronized resource access on Thread #6
-// Starting unsynchronized resource access on Thread #3
-// Stopping unsynchronized resource access on thread #7
-// Stopping unsynchronized resource access on thread #9
-// Stopping unsynchronized resource access on thread #3
-// Stopping unsynchronized resource access on thread #10
-// Stopping unsynchronized resource access on thread #6
-//
-// All unsynchronized thread operations have completed.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/Pattern2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/Pattern2.vb
deleted file mode 100644
index 1bb579c6cbc1a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/Pattern2.vb
+++ /dev/null
@@ -1,32 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Runtime.CompilerServices
-Imports System.Threading
-
-Module Example5
- Public Sub Main()
- '
- ' Define the lock object.
- Dim obj As New Object()
-
- ' Define the critical section.
- Monitor.Enter(obj)
- Try
- ' Code to execute one thread at a time.
-
- ' catch blocks go here.
- Finally
- Monitor.Exit(obj)
- End Try
- '
- End Sub
-
- '
-
- Sub MethodToLock()
- ' Method implementation.
- End Sub
- '
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/badbox1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/badbox1.vb
deleted file mode 100644
index d044f7b82bb1f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/badbox1.vb
+++ /dev/null
@@ -1,47 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-Imports System.Threading
-Imports System.Threading.Tasks
-
-Module Example2
- Public Sub Main()
- Dim nTasks As Integer = 0
- Dim o As Object = nTasks
- Dim tasks As New List(Of Task)()
-
- Try
- For ctr As Integer = 0 To 9
- tasks.Add(Task.Run(Sub()
- ' Instead of doing some work, just sleep.
- Thread.Sleep(250)
- ' Increment the number of tasks.
- Monitor.Enter(o)
- Try
- nTasks += 1
- Finally
- Monitor.Exit(o)
- End Try
- End Sub))
- Next
- Task.WaitAll(tasks.ToArray())
- Console.WriteLine("{0} tasks started and executed.", nTasks)
- Catch e As AggregateException
- Dim msg As String = String.Empty
- For Each ie In e.InnerExceptions
- Console.WriteLine("{0}", ie.GetType().Name)
- If Not msg.Contains(ie.Message) Then
- msg += ie.Message + Environment.NewLine
- End If
- Next
- Console.WriteLine(vbCrLf + "Exception Message(s):")
- Console.WriteLine(msg)
- End Try
- End Sub
-End Module
-' The example displays the following output:
-' 10 tasks started and executed.
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/badlock1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/badlock1.vb
deleted file mode 100644
index 423f706a8c453..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/badlock1.vb
+++ /dev/null
@@ -1,60 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-Imports System.Threading
-Imports System.Threading.Tasks
-
-Module Example3
- Public Sub Main()
- Dim nTasks As Integer = 0
- Dim tasks As New List(Of Task)()
-
- Try
- For ctr As Integer = 0 To 9
- tasks.Add(Task.Run(Sub()
- ' Instead of doing some work, just sleep.
- Thread.Sleep(250)
- ' Increment the number of tasks.
- Monitor.Enter(nTasks)
- Try
- nTasks += 1
- Finally
- Monitor.Exit(nTasks)
- End Try
- End Sub))
- Next
- Task.WaitAll(tasks.ToArray())
- Console.WriteLine("{0} tasks started and executed.", nTasks)
- Catch e As AggregateException
- Dim msg As String = String.Empty
- For Each ie In e.InnerExceptions
- Console.WriteLine("{0}", ie.GetType().Name)
- If Not msg.Contains(ie.Message) Then
- msg += ie.Message + Environment.NewLine
- End If
- Next
- Console.WriteLine(vbCrLf + "Exception Message(s):")
- Console.WriteLine(msg)
- End Try
- End Sub
-End Module
-' The example displays the following output:
-' SynchronizationLockException
-' SynchronizationLockException
-' SynchronizationLockException
-' SynchronizationLockException
-' SynchronizationLockException
-' SynchronizationLockException
-' SynchronizationLockException
-' SynchronizationLockException
-' SynchronizationLockException
-' SynchronizationLockException
-'
-' Exception Message(s):
-' Object synchronization method was called from an unsynchronized block of code.
-'
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/example1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/example1.vb
deleted file mode 100644
index 265086425246c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/example1.vb
+++ /dev/null
@@ -1,66 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-Imports System.Threading
-Imports System.Threading.Tasks
-
-Module Example4
- Public Sub Main()
- Dim tasks As New List(Of Task)()
- Dim rnd As New Random()
- Dim total As Long = 0
- Dim n As Integer = 0
-
- For taskCtr As Integer = 0 To 9
- tasks.Add(Task.Run(Sub()
- Dim values(9999) As Integer
- Dim taskTotal As Integer = 0
- Dim taskN As Integer = 0
- Dim ctr As Integer = 0
- Monitor.Enter(rnd)
- ' Generate 10,000 random integers.
- For ctr = 0 To 9999
- values(ctr) = rnd.Next(0, 1001)
- Next
- Monitor.Exit(rnd)
- taskN = ctr
- For Each value In values
- taskTotal += value
- Next
-
- Console.WriteLine("Mean for task {0,2}: {1:N2} (N={2:N0})",
- Task.CurrentId, taskTotal / taskN,
- taskN)
- Interlocked.Add(n, taskN)
- Interlocked.Add(total, taskTotal)
- End Sub))
- Next
-
- Try
- Task.WaitAll(tasks.ToArray())
- Console.WriteLine()
- Console.WriteLine("Mean for all tasks: {0:N2} (N={1:N0})",
- (total * 1.0) / n, n)
- Catch e As AggregateException
- For Each ie In e.InnerExceptions
- Console.WriteLine("{0}: {1}", ie.GetType().Name, ie.Message)
- Next
- End Try
- End Sub
-End Module
-' The example displays output like the following:
-' Mean for task 1: 499.04 (N=10,000)
-' Mean for task 2: 500.42 (N=10,000)
-' Mean for task 3: 499.65 (N=10,000)
-' Mean for task 8: 502.59 (N=10,000)
-' Mean for task 5: 502.75 (N=10,000)
-' Mean for task 4: 494.88 (N=10,000)
-' Mean for task 7: 499.22 (N=10,000)
-' Mean for task 10: 496.45 (N=10,000)
-' Mean for task 6: 499.75 (N=10,000)
-' Mean for task 9: 502.79 (N=10,000)
-'
-' Mean for all tasks: 499.75 (N=100,000)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/source.vb
deleted file mode 100644
index 9c55354023910..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Monitor/Overview/vb/source.vb
+++ /dev/null
@@ -1,110 +0,0 @@
-'
-Imports System.Threading
-
-Friend Class SyncResource
- ' Use a monitor to enforce synchronization.
- Public Sub Access()
- SyncLock Me
- Console.WriteLine("Starting synchronized resource access on thread #{0}",
- Thread.CurrentThread.ManagedThreadId)
- If Thread.CurrentThread.ManagedThreadId Mod 2 = 0 Then
- Thread.Sleep(2000)
- End If
- Thread.Sleep(200)
- Console.WriteLine("Stopping synchronized resource access on thread #{0}",
- Thread.CurrentThread.ManagedThreadId)
- End SyncLock
- End Sub
-End Class
-
-Friend Class UnSyncResource
- ' Do not enforce synchronization.
- Public Sub Access()
- Console.WriteLine("Starting unsynchronized resource access on Thread #{0}",
- Thread.CurrentThread.ManagedThreadId)
- If Thread.CurrentThread.ManagedThreadId Mod 2 = 0 Then
- Thread.Sleep(2000)
- End If
- Thread.Sleep(200)
- Console.WriteLine("Stopping unsynchronized resource access on thread #{0}",
- Thread.CurrentThread.ManagedThreadId)
- End Sub
-End Class
-
-Public Module App
- Private numOps As Integer
- Private opsAreDone As New AutoResetEvent(False)
- Private SyncRes As New SyncResource()
- Private UnSyncRes As New UnSyncResource()
-
- Public Sub Main()
- ' Set the number of synchronized calls.
- numOps = 5
- For ctr As Integer = 0 To 4
- ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf SyncUpdateResource))
- Next
- ' Wait until this WaitHandle is signaled.
- opsAreDone.WaitOne()
- Console.WriteLine(vbTab + Environment.NewLine + "All synchronized operations have completed.")
- Console.WriteLine()
-
- numOps = 5
- ' Reset the count for unsynchronized calls.
- For ctr As Integer = 0 To 4
- ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf UnSyncUpdateResource))
- Next
-
- ' Wait until this WaitHandle is signaled.
- opsAreDone.WaitOne()
- Console.WriteLine(vbTab + Environment.NewLine + "All unsynchronized thread operations have completed.")
- End Sub
-
- Sub SyncUpdateResource()
- ' Call the internal synchronized method.
- SyncRes.Access()
-
- ' Ensure that only one thread can decrement the counter at a time.
- If Interlocked.Decrement(numOps) = 0 Then
- ' Announce to Main that in fact all thread calls are done.
- opsAreDone.Set()
- End If
- End Sub
-
- Sub UnSyncUpdateResource()
- ' Call the unsynchronized method.
- UnSyncRes.Access()
-
- ' Ensure that only one thread can decrement the counter at a time.
- If Interlocked.Decrement(numOps) = 0 Then
- ' Announce to Main that in fact all thread calls are done.
- opsAreDone.Set()
- End If
- End Sub
-End Module
-' The example displays output like the following:
-' Starting synchronized resource access on thread #6
-' Stopping synchronized resource access on thread #6
-' Starting synchronized resource access on thread #7
-' Stopping synchronized resource access on thread #7
-' Starting synchronized resource access on thread #3
-' Stopping synchronized resource access on thread #3
-' Starting synchronized resource access on thread #4
-' Stopping synchronized resource access on thread #4
-' Starting synchronized resource access on thread #5
-' Stopping synchronized resource access on thread #5
-'
-' All synchronized operations have completed.
-'
-' Starting unsynchronized resource access on Thread #7
-' Starting unsynchronized resource access on Thread #9
-' Starting unsynchronized resource access on Thread #10
-' Starting unsynchronized resource access on Thread #6
-' Starting unsynchronized resource access on Thread #3
-' Stopping unsynchronized resource access on thread #7
-' Stopping unsynchronized resource access on thread #9
-' Stopping unsynchronized resource access on thread #3
-' Stopping unsynchronized resource access on thread #10
-' Stopping unsynchronized resource access on thread #6
-'
-' All unsynchronized thread operations have completed.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/csharp/classexample1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/csharp/classexample1.cs
deleted file mode 100644
index e8f8a0a3b3f26..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/csharp/classexample1.cs
+++ /dev/null
@@ -1,242 +0,0 @@
-//
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-//
-
-//
-public class SynchronizedCache
-{
- private ReaderWriterLockSlim cacheLock = new ReaderWriterLockSlim();
- private Dictionary innerCache = new Dictionary();
-
- public int Count
- { get { return innerCache.Count; } }
-
- public string Read(int key)
- {
- cacheLock.EnterReadLock();
- try
- {
- return innerCache[key];
- }
- finally
- {
- cacheLock.ExitReadLock();
- }
- }
-
- public void Add(int key, string value)
- {
- cacheLock.EnterWriteLock();
- try
- {
- innerCache.Add(key, value);
- }
- finally
- {
- cacheLock.ExitWriteLock();
- }
- }
-
- public bool AddWithTimeout(int key, string value, int timeout)
- {
- if (cacheLock.TryEnterWriteLock(timeout))
- {
- try
- {
- innerCache.Add(key, value);
- }
- finally
- {
- cacheLock.ExitWriteLock();
- }
- return true;
- }
- else
- {
- return false;
- }
- }
-
- public AddOrUpdateStatus AddOrUpdate(int key, string value)
- {
- cacheLock.EnterUpgradeableReadLock();
- try
- {
- string result = null;
- if (innerCache.TryGetValue(key, out result))
- {
- if (result == value)
- {
- return AddOrUpdateStatus.Unchanged;
- }
- else
- {
- cacheLock.EnterWriteLock();
- try
- {
- innerCache[key] = value;
- }
- finally
- {
- cacheLock.ExitWriteLock();
- }
- return AddOrUpdateStatus.Updated;
- }
- }
- else
- {
- cacheLock.EnterWriteLock();
- try
- {
- innerCache.Add(key, value);
- }
- finally
- {
- cacheLock.ExitWriteLock();
- }
- return AddOrUpdateStatus.Added;
- }
- }
- finally
- {
- cacheLock.ExitUpgradeableReadLock();
- }
- }
-
- public void Delete(int key)
- {
- cacheLock.EnterWriteLock();
- try
- {
- innerCache.Remove(key);
- }
- finally
- {
- cacheLock.ExitWriteLock();
- }
- }
-
- public enum AddOrUpdateStatus
- {
- Added,
- Updated,
- Unchanged
- };
-
- ~SynchronizedCache()
- {
- if (cacheLock != null) cacheLock.Dispose();
- }
-}
-//
-
-//
-public class Example
-{
- public static void Main()
- {
- var sc = new SynchronizedCache();
- var tasks = new List();
- int itemsWritten = 0;
-
- // Execute a writer.
- tasks.Add(Task.Run( () => { String[] vegetables = { "broccoli", "cauliflower",
- "carrot", "sorrel", "baby turnip",
- "beet", "brussel sprout",
- "cabbage", "plantain",
- "spinach", "grape leaves",
- "lime leaves", "corn",
- "radish", "cucumber",
- "raddichio", "lima beans" };
- for (int ctr = 1; ctr <= vegetables.Length; ctr++)
- sc.Add(ctr, vegetables[ctr - 1]);
-
- itemsWritten = vegetables.Length;
- Console.WriteLine($"Task {Task.CurrentId} wrote {itemsWritten} items\n");
- } ));
- // Execute two readers, one to read from first to last and the second from last to first.
- for (int ctr = 0; ctr <= 1; ctr++) {
- bool desc = ctr == 1;
- tasks.Add(Task.Run( () => { int start, last, step;
- int items;
- do {
- String output = String.Empty;
- items = sc.Count;
- if (! desc) {
- start = 1;
- step = 1;
- last = items;
- }
- else {
- start = items;
- step = -1;
- last = 1;
- }
-
- for (int index = start; desc ? index >= last : index <= last; index += step)
- output += String.Format("[{0}] ", sc.Read(index));
-
- Console.WriteLine($"Task {Task.CurrentId} read {items} items: {output}\n");
- } while (items < itemsWritten | itemsWritten == 0);
- } ));
- }
- // Execute a red/update task.
- tasks.Add(Task.Run( () => { Thread.Sleep(100);
- for (int ctr = 1; ctr <= sc.Count; ctr++) {
- String value = sc.Read(ctr);
- if (value == "cucumber")
- if (sc.AddOrUpdate(ctr, "green bean") != SynchronizedCache.AddOrUpdateStatus.Unchanged)
- Console.WriteLine("Changed 'cucumber' to 'green bean'");
- }
- } ));
-
- // Wait for all three tasks to complete.
- Task.WaitAll(tasks.ToArray());
-
- // Display the final contents of the cache.
- Console.WriteLine();
- Console.WriteLine("Values in synchronized cache: ");
- for (int ctr = 1; ctr <= sc.Count; ctr++)
- Console.WriteLine($" {ctr}: {sc.Read(ctr)}");
- }
-}
-// The example displays the following output:
-// Task 1 read 0 items:
-//
-// Task 3 wrote 17 items
-//
-//
-// Task 1 read 17 items: [broccoli] [cauliflower] [carrot] [sorrel] [baby turnip] [
-// beet] [brussel sprout] [cabbage] [plantain] [spinach] [grape leaves] [lime leave
-// s] [corn] [radish] [cucumber] [raddichio] [lima beans]
-//
-// Task 2 read 0 items:
-//
-// Task 2 read 17 items: [lima beans] [raddichio] [cucumber] [radish] [corn] [lime
-// leaves] [grape leaves] [spinach] [plantain] [cabbage] [brussel sprout] [beet] [b
-// aby turnip] [sorrel] [carrot] [cauliflower] [broccoli]
-//
-// Changed 'cucumber' to 'green bean'
-//
-// Values in synchronized cache:
-// 1: broccoli
-// 2: cauliflower
-// 3: carrot
-// 4: sorrel
-// 5: baby turnip
-// 6: beet
-// 7: brussel sprout
-// 8: cabbage
-// 9: plantain
-// 10: spinach
-// 11: grape leaves
-// 12: lime leaves
-// 13: corn
-// 14: radish
-// 15: green bean
-// 16: raddichio
-// 17: lima beans
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/vb/classexample1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/vb/classexample1.vb
deleted file mode 100644
index 71a514c564d71..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/ReaderWriterLockSlim/Overview/vb/classexample1.vb
+++ /dev/null
@@ -1,211 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-Imports System.Threading
-Imports System.Threading.Tasks
-
-'
-
-'
-Public Class SynchronizedCache
- Private cacheLock As New ReaderWriterLockSlim()
- Private innerCache As New Dictionary(Of Integer, String)
-
- Public ReadOnly Property Count As Integer
- Get
- Return innerCache.Count
- End Get
- End Property
-
- Public Function Read(ByVal key As Integer) As String
- cacheLock.EnterReadLock()
- Try
- Return innerCache(key)
- Finally
- cacheLock.ExitReadLock()
- End Try
- End Function
-
- Public Sub Add(ByVal key As Integer, ByVal value As String)
- cacheLock.EnterWriteLock()
- Try
- innerCache.Add(key, value)
- Finally
- cacheLock.ExitWriteLock()
- End Try
- End Sub
-
- Public Function AddWithTimeout(ByVal key As Integer, ByVal value As String, _
- ByVal timeout As Integer) As Boolean
- If cacheLock.TryEnterWriteLock(timeout) Then
- Try
- innerCache.Add(key, value)
- Finally
- cacheLock.ExitWriteLock()
- End Try
- Return True
- Else
- Return False
- End If
- End Function
-
- Public Function AddOrUpdate(ByVal key As Integer, _
- ByVal value As String) As AddOrUpdateStatus
- cacheLock.EnterUpgradeableReadLock()
- Try
- Dim result As String = Nothing
- If innerCache.TryGetValue(key, result) Then
- If result = value Then
- Return AddOrUpdateStatus.Unchanged
- Else
- cacheLock.EnterWriteLock()
- Try
- innerCache.Item(key) = value
- Finally
- cacheLock.ExitWriteLock()
- End Try
- Return AddOrUpdateStatus.Updated
- End If
- Else
- cacheLock.EnterWriteLock()
- Try
- innerCache.Add(key, value)
- Finally
- cacheLock.ExitWriteLock()
- End Try
- Return AddOrUpdateStatus.Added
- End If
- Finally
- cacheLock.ExitUpgradeableReadLock()
- End Try
- End Function
-
- Public Sub Delete(ByVal key As Integer)
- cacheLock.EnterWriteLock()
- Try
- innerCache.Remove(key)
- Finally
- cacheLock.ExitWriteLock()
- End Try
- End Sub
-
- Public Enum AddOrUpdateStatus
- Added
- Updated
- Unchanged
- End Enum
-
- Protected Overrides Sub Finalize()
- If cacheLock IsNot Nothing Then cacheLock.Dispose()
- End Sub
-End Class
-'
-
-'
-Public Module Example
- Public Sub Main()
- Dim sc As New SynchronizedCache()
- Dim tasks As New List(Of Task)
- Dim itemsWritten As Integer
-
- ' Execute a writer.
- tasks.Add(Task.Run( Sub()
- Dim vegetables() As String = { "broccoli", "cauliflower",
- "carrot", "sorrel", "baby turnip",
- "beet", "brussel sprout",
- "cabbage", "plantain",
- "spinach", "grape leaves",
- "lime leaves", "corn",
- "radish", "cucumber",
- "raddichio", "lima beans" }
- For ctr As Integer = 1 to vegetables.Length
- sc.Add(ctr, vegetables(ctr - 1))
- Next
- itemsWritten = vegetables.Length
- Console.WriteLine("Task {0} wrote {1} items{2}",
- Task.CurrentId, itemsWritten, vbCrLf)
- End Sub))
- ' Execute two readers, one to read from first to last and the second from last to first.
- For ctr As Integer = 0 To 1
- Dim flag As Integer = ctr
- tasks.Add(Task.Run( Sub()
- Dim start, last, stp As Integer
- Dim items As Integer
- Do
- Dim output As String = String.Empty
- items = sc.Count
- If flag = 0 Then
- start = 1 : stp = 1 : last = items
- Else
- start = items : stp = -1 : last = 1
- End If
- For index As Integer = start To last Step stp
- output += String.Format("[{0}] ", sc.Read(index))
- Next
- Console.WriteLine("Task {0} read {1} items: {2}{3}",
- Task.CurrentId, items, output,
- vbCrLf)
- Loop While items < itemsWritten Or itemsWritten = 0
- End Sub))
- Next
- ' Execute a red/update task.
- tasks.Add(Task.Run( Sub()
- For ctr As Integer = 1 To sc.Count
- Dim value As String = sc.Read(ctr)
- If value = "cucumber" Then
- If sc.AddOrUpdate(ctr, "green bean") <> SynchronizedCache.AddOrUpdateStatus.Unchanged Then
- Console.WriteLine("Changed 'cucumber' to 'green bean'")
- End If
- End If
- Next
- End Sub ))
-
- ' Wait for all three tasks to complete.
- Task.WaitAll(tasks.ToArray())
-
- ' Display the final contents of the cache.
- Console.WriteLine()
- Console.WriteLine("Values in synchronized cache: ")
- For ctr As Integer = 1 To sc.Count
- Console.WriteLine(" {0}: {1}", ctr, sc.Read(ctr))
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' Task 1 read 0 items:
-'
-' Task 3 wrote 17 items
-'
-' Task 1 read 17 items: [broccoli] [cauliflower] [carrot] [sorrel] [baby turnip] [
-' beet] [brussel sprout] [cabbage] [plantain] [spinach] [grape leaves] [lime leave
-' s] [corn] [radish] [cucumber] [raddichio] [lima beans]
-'
-' Task 2 read 0 items:
-'
-' Task 2 read 17 items: [lima beans] [raddichio] [cucumber] [radish] [corn] [lime
-' leaves] [grape leaves] [spinach] [plantain] [cabbage] [brussel sprout] [beet] [b
-' aby turnip] [sorrel] [carrot] [cauliflower] [broccoli]
-'
-' Changed 'cucumber' to 'green bean'
-'
-' Values in synchronized cache:
-' 1: broccoli
-' 2: cauliflower
-' 3: carrot
-' 4: sorrel
-' 5: baby turnip
-' 6: beet
-' 7: brussel sprout
-' 8: cabbage
-' 9: plantain
-' 10: spinach
-' 11: grape leaves
-' 12: lime leaves
-' 13: corn
-' 14: radish
-' 15: green bean
-' 16: raddichio
-' 17: lima beans
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/BackgroundEx1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/BackgroundEx1.cs
deleted file mode 100644
index 8ea507bf21c1d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/BackgroundEx1.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-using System;
-using System.Diagnostics;
-using System.Threading;
-
-public class Example
-{
- public static void Main()
- {
- var th = new Thread(ExecuteInForeground);
- th.IsBackground = true;
- th.Start();
- Thread.Sleep(1000);
- Console.WriteLine($"Main thread ({Thread.CurrentThread.ManagedThreadId}) exiting...");
- }
-
- private static void ExecuteInForeground()
- {
- var sw = Stopwatch.StartNew();
- Console.WriteLine("Thread {0}: {1}, Priority {2}",
- Thread.CurrentThread.ManagedThreadId,
- Thread.CurrentThread.ThreadState,
- Thread.CurrentThread.Priority);
- do {
- Console.WriteLine($"Thread {Thread.CurrentThread.ManagedThreadId}: Elapsed {sw.ElapsedMilliseconds / 1000.0:N2} seconds");
- Thread.Sleep(500);
- } while (sw.ElapsedMilliseconds <= 5000);
- sw.Stop();
- }
-}
-// The example displays output like the following:
-// Thread 3: Background, Priority Normal
-// Thread 3: Elapsed 0.00 seconds
-// Thread 3: Elapsed 0.51 seconds
-// Main thread (1) exiting...
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/Instance1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/Instance1.cs
deleted file mode 100644
index ee70bbd366d3f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/Instance1.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-using System;
-using System.Threading;
-
-public class Example1
-{
- static Object obj = new Object();
-
- public static void Main()
- {
- ThreadPool.QueueUserWorkItem(ShowThreadInformation);
- var th1 = new Thread(ShowThreadInformation);
- th1.Start();
- var th2 = new Thread(ShowThreadInformation);
- th2.IsBackground = true;
- th2.Start();
- Thread.Sleep(500);
- ShowThreadInformation(null);
- }
-
- private static void ShowThreadInformation(Object state)
- {
- lock (obj) {
- var th = Thread.CurrentThread;
- Console.WriteLine($"Managed thread #{th.ManagedThreadId}: ");
- Console.WriteLine($" Background thread: {th.IsBackground}");
- Console.WriteLine($" Thread pool thread: {th.IsThreadPoolThread}");
- Console.WriteLine($" Priority: {th.Priority}");
- Console.WriteLine($" Culture: {th.CurrentCulture.Name}");
- Console.WriteLine($" UI culture: {th.CurrentUICulture.Name}");
- Console.WriteLine();
- }
- }
-}
-// The example displays output like the following:
-// Managed thread #6:
-// Background thread: True
-// Thread pool thread: False
-// Priority: Normal
-// Culture: en-US
-// UI culture: en-US
-//
-// Managed thread #3:
-// Background thread: True
-// Thread pool thread: True
-// Priority: Normal
-// Culture: en-US
-// UI culture: en-US
-//
-// Managed thread #4:
-// Background thread: False
-// Thread pool thread: False
-// Priority: Normal
-// Culture: en-US
-// UI culture: en-US
-//
-// Managed thread #1:
-// Background thread: False
-// Thread pool thread: False
-// Priority: Normal
-// Culture: en-US
-// UI culture: en-US
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/ThreadStart1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/ThreadStart1.cs
deleted file mode 100644
index 9da0d912d3a66..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/ThreadStart1.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-using System;
-using System.Diagnostics;
-using System.Threading;
-
-public class Example2
-{
- public static void Main()
- {
- var th = new Thread(ExecuteInForeground);
- th.Start();
- Thread.Sleep(1000);
- Console.WriteLine($"Main thread ({Thread.CurrentThread.ManagedThreadId}) exiting...");
- }
-
- private static void ExecuteInForeground()
- {
- var sw = Stopwatch.StartNew();
- Console.WriteLine("Thread {0}: {1}, Priority {2}",
- Thread.CurrentThread.ManagedThreadId,
- Thread.CurrentThread.ThreadState,
- Thread.CurrentThread.Priority);
- do {
- Console.WriteLine($"Thread {Thread.CurrentThread.ManagedThreadId}: Elapsed {sw.ElapsedMilliseconds / 1000.0:N2} seconds");
- Thread.Sleep(500);
- } while (sw.ElapsedMilliseconds <= 5000);
- sw.Stop();
- }
-}
-// The example displays output like the following:
-// Thread 3: Running, Priority Normal
-// Thread 3: Elapsed 0.00 seconds
-// Thread 3: Elapsed 0.51 seconds
-// Main thread (1) exiting...
-// Thread 3: Elapsed 1.02 seconds
-// Thread 3: Elapsed 1.53 seconds
-// Thread 3: Elapsed 2.05 seconds
-// Thread 3: Elapsed 2.55 seconds
-// Thread 3: Elapsed 3.07 seconds
-// Thread 3: Elapsed 3.57 seconds
-// Thread 3: Elapsed 4.07 seconds
-// Thread 3: Elapsed 4.58 seconds
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/ThreadStart2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/ThreadStart2.cs
deleted file mode 100644
index b506662797dd9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/ThreadStart2.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-using System;
-using System.Diagnostics;
-using System.Threading;
-
-public class Example3
-{
- public static void Main()
- {
- var th = new Thread(ExecuteInForeground);
- th.Start(4500);
- Thread.Sleep(1000);
- Console.WriteLine($"Main thread ({Thread.CurrentThread.ManagedThreadId}) exiting...");
- }
-
- private static void ExecuteInForeground(Object obj)
- {
- int interval;
- try {
- interval = (int) obj;
- }
- catch (InvalidCastException) {
- interval = 5000;
- }
- var sw = Stopwatch.StartNew();
- Console.WriteLine("Thread {0}: {1}, Priority {2}",
- Thread.CurrentThread.ManagedThreadId,
- Thread.CurrentThread.ThreadState,
- Thread.CurrentThread.Priority);
- do {
- Console.WriteLine($"Thread {Thread.CurrentThread.ManagedThreadId}: Elapsed {sw.ElapsedMilliseconds / 1000.0:N2} seconds");
- Thread.Sleep(500);
- } while (sw.ElapsedMilliseconds <= interval);
- sw.Stop();
- }
-}
-// The example displays output like the following:
-// Thread 3: Running, Priority Normal
-// Thread 3: Elapsed 0.00 seconds
-// Thread 3: Elapsed 0.52 seconds
-// Main thread (1) exiting...
-// Thread 3: Elapsed 1.03 seconds
-// Thread 3: Elapsed 1.55 seconds
-// Thread 3: Elapsed 2.06 seconds
-// Thread 3: Elapsed 2.58 seconds
-// Thread 3: Elapsed 3.09 seconds
-// Thread 3: Elapsed 3.61 seconds
-// Thread 3: Elapsed 4.12 seconds
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/source.cs
deleted file mode 100644
index 81f0b0abfc2a7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/csharp/source.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-using System;
-using System.Threading;
-
-// Simple threading scenario: Start a static method running
-// on a second thread.
-public class ThreadExample {
- // The ThreadProc method is called when the thread starts.
- // It loops ten times, writing to the console and yielding
- // the rest of its time slice each time, and then ends.
- public static void ThreadProc() {
- for (int i = 0; i < 10; i++) {
- Console.WriteLine($"ThreadProc: {i}");
- // Yield the rest of the time slice.
- Thread.Sleep(0);
- }
- }
-
- public static void Main() {
- Console.WriteLine("Main thread: Start a second thread.");
- // The constructor for the Thread class requires a ThreadStart
- // delegate that represents the method to be executed on the
- // thread. C# simplifies the creation of this delegate.
- Thread t = new Thread(new ThreadStart(ThreadProc));
-
- // Start ThreadProc. Note that on a uniprocessor, the new
- // thread does not get any processor time until the main thread
- // is preempted or yields. Uncomment the Thread.Sleep that
- // follows t.Start() to see the difference.
- t.Start();
- //Thread.Sleep(0);
-
- for (int i = 0; i < 4; i++) {
- Console.WriteLine("Main thread: Do some work.");
- Thread.Sleep(0);
- }
-
- Console.WriteLine("Main thread: Call Join(), to wait until ThreadProc ends.");
- t.Join();
- Console.WriteLine("Main thread: ThreadProc.Join has returned. Press Enter to end program.");
- Console.ReadLine();
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/BackgroundEx1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/BackgroundEx1.fs
deleted file mode 100644
index 1292ad0fc3f43..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/BackgroundEx1.fs
+++ /dev/null
@@ -1,25 +0,0 @@
-module BackgroundEx1
-//
-open System.Diagnostics
-open System.Threading
-
-let executeInForeground () =
- let sw = Stopwatch.StartNew()
- printfn $"Thread {Thread.CurrentThread.ManagedThreadId}: {Thread.CurrentThread.ThreadState}, Priority {Thread.CurrentThread.Priority}"
- while sw.ElapsedMilliseconds <= 5000 do
- printfn $"Thread {Thread.CurrentThread.ManagedThreadId}: Elapsed {sw.ElapsedMilliseconds / 1000L:N2} seconds"
- Thread.Sleep 500
- sw.Stop()
-
-let th = Thread executeInForeground
-th.IsBackground <- true
-th.Start()
-Thread.Sleep 1000
-printfn $"Main thread ({Thread.CurrentThread.ManagedThreadId}) exiting..."
-
-// The example displays output like the following:
-// Thread 3: Background, Priority Normal
-// Thread 3: Elapsed 0.00 seconds
-// Thread 3: Elapsed 0.51 seconds
-// Main thread (1) exiting...
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/Instance1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/Instance1.fs
deleted file mode 100644
index bb741981363ff..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/Instance1.fs
+++ /dev/null
@@ -1,55 +0,0 @@
-module Instance1
-//
-open System.Threading
-
-let obj = obj ()
-
-let showThreadInformation (state: obj) =
- lock obj (fun () ->
- let th = Thread.CurrentThread
- printfn $"Managed thread #{th.ManagedThreadId}: "
- printfn $" Background thread: {th.IsBackground}"
- printfn $" Thread pool thread: {th.IsThreadPoolThread}"
- printfn $" Priority: {th.Priority}"
- printfn $" Culture: {th.CurrentCulture.Name}"
- printfn $" UI culture: {th.CurrentUICulture.Name}"
- printfn "")
-
-ThreadPool.QueueUserWorkItem showThreadInformation |> ignore
-let th1 = Thread(ParameterizedThreadStart showThreadInformation)
-th1.Start()
-let th2 = Thread(ParameterizedThreadStart showThreadInformation)
-th2.IsBackground <- true
-th2.Start()
-Thread.Sleep 500
-showThreadInformation ()
-
-// The example displays output like the following:
-// Managed thread #6:
-// Background thread: True
-// Thread pool thread: False
-// Priority: Normal
-// Culture: en-US
-// UI culture: en-US
-//
-// Managed thread #3:
-// Background thread: True
-// Thread pool thread: True
-// Priority: Normal
-// Culture: en-US
-// UI culture: en-US
-//
-// Managed thread #4:
-// Background thread: False
-// Thread pool thread: False
-// Priority: Normal
-// Culture: en-US
-// UI culture: en-US
-//
-// Managed thread #1:
-// Background thread: False
-// Thread pool thread: False
-// Priority: Normal
-// Culture: en-US
-// UI culture: en-US
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/ThreadStart1.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/ThreadStart1.fs
deleted file mode 100644
index c6ba2b152a3bd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/ThreadStart1.fs
+++ /dev/null
@@ -1,35 +0,0 @@
-module ThreadStart1
-//
-open System.Diagnostics
-open System.Threading
-
-let executeInForeground () =
- let sw = Stopwatch.StartNew()
-
- printfn $"Thread {Thread.CurrentThread.ManagedThreadId}: {Thread.CurrentThread.ThreadState}, Priority {Thread.CurrentThread.Priority}"
-
- while sw.ElapsedMilliseconds <= 5000 do
- printfn $"Thread {Thread.CurrentThread.ManagedThreadId}: Elapsed {sw.ElapsedMilliseconds / 1000L:N2} seconds"
- Thread.Sleep 500
-
- sw.Stop()
-
-let th = Thread executeInForeground
-th.Start()
-Thread.Sleep 1000
-printfn $"Main thread ({Thread.CurrentThread.ManagedThreadId}) exiting..."
-
-// The example displays output like the following:
-// Thread 3: Running, Priority Normal
-// Thread 3: Elapsed 0.00 seconds
-// Thread 3: Elapsed 0.51 seconds
-// Main thread (1) exiting...
-// Thread 3: Elapsed 1.02 seconds
-// Thread 3: Elapsed 1.53 seconds
-// Thread 3: Elapsed 2.05 seconds
-// Thread 3: Elapsed 2.55 seconds
-// Thread 3: Elapsed 3.07 seconds
-// Thread 3: Elapsed 3.57 seconds
-// Thread 3: Elapsed 4.07 seconds
-// Thread 3: Elapsed 4.58 seconds
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/ThreadStart2.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/ThreadStart2.fs
deleted file mode 100644
index 2ea72a450753b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/ThreadStart2.fs
+++ /dev/null
@@ -1,41 +0,0 @@
-module ThreadStart2
-//
-open System
-open System.Diagnostics
-open System.Threading
-
-let executeInForeground obj =
- let interval =
- try
- unbox obj
- with :? InvalidCastException ->
- 5000
-
- let sw = Stopwatch.StartNew()
-
- printfn $"Thread {Thread.CurrentThread.ManagedThreadId}: {Thread.CurrentThread.ThreadState}, Priority {Thread.CurrentThread.Priority}"
-
- while sw.ElapsedMilliseconds <= interval do
- printfn $"Thread {Thread.CurrentThread.ManagedThreadId}: Elapsed {sw.ElapsedMilliseconds / 1000L:N2} seconds"
- Thread.Sleep 500
-
- sw.Stop()
-
-let th = Thread(ParameterizedThreadStart executeInForeground)
-th.Start 4500
-Thread.Sleep 1000
-printfn $"Main thread ({Thread.CurrentThread.ManagedThreadId}) exiting..."
-
-// The example displays output like the following:
-// Thread 3: Running, Priority Normal
-// Thread 3: Elapsed 0.00 seconds
-// Thread 3: Elapsed 0.52 seconds
-// Main thread (1) exiting...
-// Thread 3: Elapsed 1.03 seconds
-// Thread 3: Elapsed 1.55 seconds
-// Thread 3: Elapsed 2.06 seconds
-// Thread 3: Elapsed 2.58 seconds
-// Thread 3: Elapsed 3.09 seconds
-// Thread 3: Elapsed 3.61 seconds
-// Thread 3: Elapsed 4.12 seconds
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/source.fs b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/source.fs
deleted file mode 100644
index e7f68faf4439e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/fsharp/source.fs
+++ /dev/null
@@ -1,38 +0,0 @@
-module source
-//
-open System.Threading
-
-// Simple threading scenario: Start a static method running
-// on a second thread.
-
-// The ThreadProc method is called when the thread starts.
-// It loops ten times, writing to the console and yielding
-// the rest of its time slice each time, and then ends.
-let threadProc () =
- for i = 0 to 9 do
- printfn $"ThreadProc: {i}"
- // Yield the rest of the time slice.
- Thread.Sleep 0
-
-printfn "Main thread: Start a second thread."
-// The constructor for the Thread class requires a ThreadStart
-// delegate that represents the method to be executed on the
-// thread. F# simplifies the creation of this delegate.
-let t = Thread threadProc
-
-// Start ThreadProc. Note that on a uniprocessor, the new
-// thread does not get any processor time until the main thread
-// is preempted or yields. Uncomment the Thread.Sleep that
-// follows t.Start() to see the difference.
-t.Start()
-//Thread.Sleep 0
-
-for _ = 0 to 3 do
- printfn "Main thread: Do some work."
- Thread.Sleep 0
-
-printfn "Main thread: Call Join(), to wait until ThreadProc ends."
-t.Join()
-printfn "Main thread: ThreadProc.Join has returned. Press Enter to end program."
-stdin.ReadLine() |> ignore
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/BackgroundEx1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/BackgroundEx1.vb
deleted file mode 100644
index f3020b9ae83e3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/BackgroundEx1.vb
+++ /dev/null
@@ -1,39 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Diagnostics
-Imports System.Threading
-
-Module Example1
- Public Sub Main()
- Dim th As New Thread(AddressOf ExecuteInForeground)
- th.IsBackground = True
- th.Start()
- Thread.Sleep(1000)
- Console.WriteLine("Main thread ({0}) exiting...", Thread.CurrentThread.ManagedThreadId)
- End Sub
-
- Private Sub ExecuteInForeground()
- Dim start As DateTime = DateTime.Now
- Dim sw As Stopwatch = Stopwatch.StartNew()
- Console.WriteLine("Thread {0}: {1}, Priority {2}",
- Thread.CurrentThread.ManagedThreadId,
- Thread.CurrentThread.ThreadState,
- Thread.CurrentThread.Priority)
- Do
- Console.WriteLine("Thread {0}: Elapsed {1:N2} seconds",
- Thread.CurrentThread.ManagedThreadId,
- sw.ElapsedMilliseconds / 1000)
- Thread.Sleep(500)
- Loop While sw.ElapsedMilliseconds <= 5000
- sw.Stop()
- End Sub
-End Module
-' The example displays output like the following:
-' Thread 3: Background, Priority Normal
-' Thread 3: Elapsed 0.00 seconds
-' Thread 3: Elapsed 0.51 seconds
-' Main thread (1) exiting...
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/Instance1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/Instance1.vb
deleted file mode 100644
index 8f6d5ae3a6e83..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/Instance1.vb
+++ /dev/null
@@ -1,63 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Threading
-
-Module Example2
- Private lock As New Object()
-
- Public Sub Main()
- ThreadPool.QueueUserWorkItem(AddressOf ShowThreadInformation)
- Dim th1 As New Thread(AddressOf ShowThreadInformation)
- th1.Start()
- Dim th2 As New Thread(AddressOf ShowThreadInformation)
- th2.IsBackground = True
- th2.Start()
- Thread.Sleep(500)
- ShowThreadInformation(Nothing)
- End Sub
-
- Private Sub ShowThreadInformation(state As Object)
- SyncLock lock
- Dim th As Thread = Thread.CurrentThread
- Console.WriteLine("Managed thread #{0}: ", th.ManagedThreadId)
- Console.WriteLine(" Background thread: {0}", th.IsBackground)
- Console.WriteLine(" Thread pool thread: {0}", th.IsThreadPoolThread)
- Console.WriteLine(" Priority: {0}", th.Priority)
- Console.WriteLine(" Culture: {0}", th.CurrentCulture.Name)
- Console.WriteLine(" UI culture: {0}", th.CurrentUICulture.Name)
- Console.WriteLine()
- End SyncLock
- End Sub
-End Module
-' The example displays output like the following:
-' ' Managed thread #6:
-' Background thread: True
-' Thread pool thread: False
-' Priority: Normal
-' Culture: en-US
-' UI culture: en-US
-'
-' Managed thread #3:
-' Background thread: True
-' Thread pool thread: True
-' Priority: Normal
-' Culture: en-US
-' UI culture: en-US
-'
-' Managed thread #4:
-' Background thread: False
-' Thread pool thread: False
-' Priority: Normal
-' Culture: en-US
-' UI culture: en-US
-'
-' Managed thread #1:
-' Background thread: False
-' Thread pool thread: False
-' Priority: Normal
-' Culture: en-US
-' UI culture: en-US
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/ThreadStart1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/ThreadStart1.vb
deleted file mode 100644
index 4ddc5ac250afb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/ThreadStart1.vb
+++ /dev/null
@@ -1,46 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Diagnostics
-Imports System.Threading
-
-Module Example3
- Public Sub Main()
- Dim th As New Thread(AddressOf ExecuteInForeground)
- th.Start()
- Thread.Sleep(1000)
- Console.WriteLine("Main thread ({0}) exiting...", Thread.CurrentThread.ManagedThreadId)
- End Sub
-
- Private Sub ExecuteInForeground()
- Dim start As DateTime = DateTime.Now
- Dim sw As Stopwatch = Stopwatch.StartNew()
- Console.WriteLine("Thread {0}: {1}, Priority {2}",
- Thread.CurrentThread.ManagedThreadId,
- Thread.CurrentThread.ThreadState,
- Thread.CurrentThread.Priority)
- Do
- Console.WriteLine("Thread {0}: Elapsed {1:N2} seconds",
- Thread.CurrentThread.ManagedThreadId,
- sw.ElapsedMilliseconds / 1000)
- Thread.Sleep(500)
- Loop While sw.ElapsedMilliseconds <= 5000
- sw.Stop()
- End Sub
-End Module
-' The example displays output like the following:
-' Thread 3: Running, Priority Normal
-' Thread 3: Elapsed 0.00 seconds
-' Thread 3: Elapsed 0.51 seconds
-' Main thread (1) exiting...
-' Thread 3: Elapsed 1.02 seconds
-' Thread 3: Elapsed 1.53 seconds
-' Thread 3: Elapsed 2.05 seconds
-' Thread 3: Elapsed 2.55 seconds
-' Thread 3: Elapsed 3.07 seconds
-' Thread 3: Elapsed 3.57 seconds
-' Thread 3: Elapsed 4.07 seconds
-' Thread 3: Elapsed 4.58 seconds
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/ThreadStart2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/ThreadStart2.vb
deleted file mode 100644
index 8bad0fa35124c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/ThreadStart2.vb
+++ /dev/null
@@ -1,51 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Diagnostics
-Imports System.Threading
-
-Module Example4
- Public Sub Main()
- Dim th As New Thread(AddressOf ExecuteInForeground)
- th.Start(4500)
- Thread.Sleep(1000)
- Console.WriteLine("Main thread ({0}) exiting...", Thread.CurrentThread.ManagedThreadId)
- End Sub
-
- Private Sub ExecuteInForeground(obj As Object)
- Dim interval As Integer
- If IsNumeric(obj) Then
- interval = CInt(obj)
- Else
- interval = 5000
- End If
- Dim start As DateTime = DateTime.Now
- Dim sw As Stopwatch = Stopwatch.StartNew()
- Console.WriteLine("Thread {0}: {1}, Priority {2}",
- Thread.CurrentThread.ManagedThreadId,
- Thread.CurrentThread.ThreadState,
- Thread.CurrentThread.Priority)
- Do
- Console.WriteLine("Thread {0}: Elapsed {1:N2} seconds",
- Thread.CurrentThread.ManagedThreadId,
- sw.ElapsedMilliseconds / 1000)
- Thread.Sleep(500)
- Loop While sw.ElapsedMilliseconds <= interval
- sw.Stop()
- End Sub
-End Module
-' The example displays output like the following:
-' Thread 3: Running, Priority Normal
-' Thread 3: Elapsed 0.00 seconds
-' Thread 3: Elapsed 0.52 seconds
-' Main thread (1) exiting...
-' Thread 3: Elapsed 1.03 seconds
-' Thread 3: Elapsed 1.55 seconds
-' Thread 3: Elapsed 2.06 seconds
-' Thread 3: Elapsed 2.58 seconds
-' Thread 3: Elapsed 3.09 seconds
-' Thread 3: Elapsed 3.61 seconds
-' Thread 3: Elapsed 4.12 seconds
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/source.vb
deleted file mode 100644
index 7f9837184ec10..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Threading/Thread/Overview/vb/source.vb
+++ /dev/null
@@ -1,45 +0,0 @@
-'
-Imports System.Threading
-
-' Simple threading scenario: Start a Shared method running
-' on a second thread.
-Public Class ThreadExample
- ' The ThreadProc method is called when the thread starts.
- ' It loops ten times, writing to the console and yielding
- ' the rest of its time slice each time, and then ends.
- Public Shared Sub ThreadProc()
- Dim i As Integer
- For i = 0 To 9
- Console.WriteLine("ThreadProc: {0}", i)
- ' Yield the rest of the time slice.
- Thread.Sleep(0)
- Next
- End Sub
-
- Public Shared Sub Main()
- Console.WriteLine("Main thread: Start a second thread.")
- ' The constructor for the Thread class requires a ThreadStart
- ' delegate. The Visual Basic AddressOf operator creates this
- ' delegate for you.
- Dim t As New Thread(AddressOf ThreadProc)
-
- ' Start ThreadProc. Note that on a uniprocessor, the new
- ' thread does not get any processor time until the main thread
- ' is preempted or yields. Uncomment the Thread.Sleep that
- ' follows t.Start() to see the difference.
- t.Start()
- 'Thread.Sleep(0)
-
- Dim i As Integer
- For i = 1 To 4
- Console.WriteLine("Main thread: Do some work.")
- Thread.Sleep(0)
- Next
-
- Console.WriteLine("Main thread: Call Join(), to wait until ThreadProc ends.")
- t.Join()
- Console.WriteLine("Main thread: ThreadProc.Join has returned. Press Enter to end program.")
- Console.ReadLine()
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/vb/project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/vb/project.vbproj
deleted file mode 100644
index fab5eea626429..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/vb/project.vbproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- vb
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/vb/validschemaset.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/vb/validschemaset.vb
deleted file mode 100644
index e6ffade64b2a9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/vb/validschemaset.vb
+++ /dev/null
@@ -1,46 +0,0 @@
-'
-Imports System.Xml
-Imports System.Xml.Schema
-Imports System.IO
-
-Public Module Sample
- Public Sub Main()
-
- ' Create the XmlSchemaSet class.
- Dim sc as XmlSchemaSet = new XmlSchemaSet()
-
- ' Add the schema to the collection.
- sc.Add("urn:bookstore-schema", "books.xsd")
-
- ' Set the validation settings.
- Dim settings as XmlReaderSettings = new XmlReaderSettings()
- settings.ValidationType = ValidationType.Schema
- settings.Schemas = sc
- AddHandler settings.ValidationEventHandler, AddressOf ValidationCallBack
-
- ' Create the XmlReader object.
- Dim reader as XmlReader = XmlReader.Create("booksSchemaFail.xml", settings)
-
- ' Parse the file.
- While reader.Read()
- End While
-
- End Sub
-
- ' Display any validation errors.
- Private Sub ValidationCallBack(sender as object, e as ValidationEventArgs)
- Console.WriteLine($"Validation Error:{vbCrLf} {e.Message}")
- Console.WriteLine()
- End Sub
-End Module
-' The example displays output like the following:
-' Validation Error:
-' The element 'book' in namespace 'urn:bookstore-schema' has invalid child element 'author'
-' in namespace 'urn:bookstore-schema'. List of possible elements expected: 'title' in
-' namespace 'urn:bookstore-schema'.
-'
-' Validation Error:
-' The element 'author' in namespace 'urn:bookstore-schema' has invalid child element 'name'
-' in namespace 'urn:bookstore-schema'. List of possible elements expected: 'first-name' in
-' namespace 'urn:bookstore-schema'.
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/xml/books.xsd b/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/xml/books.xsd
deleted file mode 100644
index 2a96b028ca9ab..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/xml/books.xsd
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/xml/booksschemafail.xml b/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/xml/booksschemafail.xml
deleted file mode 100644
index eca0efa8327c2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml.Schema/XmlSchemaSet/Overview/xml/booksschemafail.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
- Benjamin
- Franklin
-
-
-
- The Confidence Man
-
- Herman
- Melville
-
- 11.99
-
-
- The Gorgias
-
- Plato
-
- 9.99
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/app.config b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/app.config
deleted file mode 100644
index 3e0e37cfc8c7a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/app.config
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/booksdata.xml b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/booksdata.xml
deleted file mode 100644
index 77260e30dea17..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/booksdata.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
- Pride And Prejudice
- 24.95
-
-
- The Handmaid's Tale
- 29.95
-
-
- Sense and Sensibility
- 19.95
-
-
- To Kill a Mockingbird
- 4.98
-
-
- The Catcher in the Rye
- 4.86
-
-
- Of Mice and Men
- 5.92
-
-
- Mysterious Island
- 5.39
-
-
- War and Peace
- 12.84
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/booksdata.xsd b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/booksdata.xsd
deleted file mode 100644
index 3274ce58fbf6a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/booksdata.xsd
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/constants.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/constants.cs
deleted file mode 100644
index 5886dbee90cba..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/constants.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace XMLProcessingApp
-{
- public static class Constants
- {
- public const string positionTop = "Top";
- public const string positionBottom = "Bottom";
- public const string positionAbove = "Above selected item";
- public const string positionBelow = "Below selected item";
- public const int lengthOfNamespaceDeclaration = 37;
- public const string booksFileName = "booksData.xml";
- public const string Title = "Title";
- public const string Genre = "Genre";
- public const string PubDate = "Publish Year";
- public const string Price = "Price";
- public const string ISBN = "ISBN";
- public const string Condition = "Condition";
- public const string Excludes = "Excludes";
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/deleteicon.png b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/deleteicon.png
deleted file mode 100644
index b251fc3fac7d0..0000000000000
Binary files a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/deleteicon.png and /dev/null differ
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/downarrow.png b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/downarrow.png
deleted file mode 100644
index 9b3fc1076ddf0..0000000000000
Binary files a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/downarrow.png and /dev/null differ
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/form1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/form1.cs
deleted file mode 100644
index ba6a9214a3ada..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/form1.cs
+++ /dev/null
@@ -1,820 +0,0 @@
-using System;
-using System.Collections;
-using System.Drawing;
-using System.Windows.Forms;
-using System.Xml;
-
-namespace XMLProcessingApp
-{
- public partial class Form1 : Form
- {
- private string _globalTag = "";
- private XMLHelperMethods _xmlHelperMethods;
- private string _ISBNOfSelectedBookNode = "";
- private XmlDocument _doc = null;
- private int _selectionStart;
- private int _selectionLength;
- private XmlNode _currentlySelectedNode = null;
- public Form1()
- {
- InitializeComponent();
- _xmlHelperMethods = new XMLHelperMethods();
- }
-
- //************************************************************************************
- //
- // Load Xml from file. Keep white spaces and newlines.
- // Then, call a method to populate a tree view control with the elements of the XML.
- //
- //************************************************************************************
- private void loadXML(bool generateXML, bool validateXML, bool generateSchema)
- {
- if (validateXML)
- {
- _doc = _xmlHelperMethods.LoadDocumentWithSchemaValidation(generateXML, generateSchema);
- }
- else
- {
- _doc = _xmlHelperMethods.LoadDocument(generateXML);
- }
-
- if (_doc == null)
- {
- MessageBox.Show("Unable to load XML file or schema. The XML file or schema validation file does not exist. Consider generating the XML file and/or schema file");
- }
- else
- {
- XmlTextBox.Text = _doc.InnerXml;
- populateTreeView(_doc);
- }
- }
-
- //************************************************************************************
- //
- // Populate the TreeView control with the elements of the XML file.
- //
- //************************************************************************************
- private void populateTreeView(XmlDocument doc)
- {
- xmlTreeView.Nodes.Clear();
- addTreeNodes(doc.DocumentElement.ChildNodes, xmlTreeView);
- xmlTreeView.ExpandAll();
- }
-
- //************************************************************************************
- //
- // Helper method for populating the TreeView control with the elements of the XML file.
- //
- //************************************************************************************
- private void addTreeNode_Recursive(XmlNode xmlNode, TreeNode treeNode)
- {
- XmlNodeList xNodeList;
- if (xmlNode.HasChildNodes)
- {
- xNodeList = xmlNode.ChildNodes;
- foreach (XmlNode node in xmlNode.ChildNodes)
- {
- if (node.NodeType != XmlNodeType.Whitespace)
- {
- TreeNode tempTreeNode = new TreeNode(node.Name);
- if (node.Attributes != null)
- {
- XmlNode tempXMLNode = node.Attributes.GetNamedItem("ISBN");
- if (tempXMLNode != null)
- {
- _globalTag = tempXMLNode.Value;
- }
- }
- tempTreeNode.Tag = _globalTag;
- treeNode.Nodes.Add(tempTreeNode);
- addTreeNode_Recursive(node, tempTreeNode);
- }
- }
- }
- else
- {
- treeNode.Text = xmlNode.OuterXml.Trim();
- }
- }
-
- private void addTreeNodes(XmlNodeList books, TreeView treeView)
- {
-
- foreach (XmlNode book in books)
- {
- if (book.NodeType == XmlNodeType.Element)
- {
- XmlElement bookElement = (XmlElement)book;
- TreeNode tempTreeNode = new TreeNode(bookElement["title"].InnerText);
- XmlNode tempXMLNode = bookElement.Attributes.GetNamedItem("ISBN");
- _globalTag = tempXMLNode.Value;
- tempTreeNode.Tag = _globalTag;
- treeView.Nodes.Add(tempTreeNode);
- }
- }
- }
-
- //************************************************************************************
- //
- // When an item is selected in the TreeView, highlight the related XMLNode in the RichTextBox.
- //
- //************************************************************************************
- private void xmlTreeView_AfterSelect(object sender, TreeViewEventArgs e)
- {
- filterTreeView.SelectedNode = null;
- unHighlightXML();
- _ISBNOfSelectedBookNode = (string)e.Node.Tag;
- if (_ISBNOfSelectedBookNode != null)
- {
- highlightXML();
- }
- }
- //************************************************************************************
- //
- // Remove the highlighted XML in the XML pane.
- //
- //************************************************************************************
- private void unHighlightXML()
- {
- // Set any previously selected text back to black.
- XmlTextBox.Select(_selectionStart, _selectionLength);
- Font tempFont = new Font(FontFamily.GenericSansSerif, 10F, FontStyle.Regular);
- XmlTextBox.SelectionFont = tempFont;
- XmlTextBox.SelectionColor = Color.White;
- }
- //************************************************************************************
- //
- // Highlight XML in the XML pane. Use the current selection in the TreeView node to
- // choose which element to highlight.
- //
- //************************************************************************************
- private bool highlightXML()
- {
- XmlNode selectedBookNode = _xmlHelperMethods.GetBook(_ISBNOfSelectedBookNode, _doc);
-
- if (selectedBookNode != null)
- {
- _currentlySelectedNode = selectedBookNode;
-
- // Use node to get search string.
- string stringToHighlight = selectedBookNode.OuterXml;
-
- // Cannot search RichTextBox with newlines so do some magic to get the highlight string.
- int numberOfCharactersBefore = stringToHighlight.Substring(0, stringToHighlight.IndexOf(_ISBNOfSelectedBookNode)).Length;
- int lengthOfSelection = stringToHighlight.Length - Constants.lengthOfNamespaceDeclaration;
-
- // Highlight the new selected text.
- XmlTextBox.SelectionLength = _ISBNOfSelectedBookNode.Length;
- int tempSelectionIndex = XmlTextBox.Find(_ISBNOfSelectedBookNode);
-
- // Select the entire node in the RichTextBox. Not just the attribute value.
- XmlTextBox.SelectionStart = tempSelectionIndex - numberOfCharactersBefore;
- XmlTextBox.SelectionLength = lengthOfSelection;
-
- // Store globally because user can manually select XML Text box and we need to know highlighted area later.
- _selectionStart = XmlTextBox.SelectionStart;
- _selectionLength = XmlTextBox.SelectionLength;
-
- Font tempFont = new Font(FontFamily.GenericSansSerif, 9F, FontStyle.Bold);
- XmlTextBox.SelectionFont = tempFont;
- XmlTextBox.SelectionColor = Color.Yellow;
- XmlTextBox.ScrollToCaret();
-
- populateEditBoxes();
-
- return true;
- }
- else
- {
- return false;
- }
- }
- //************************************************************************************
- //
- // As the user selects nodes in the treeview control, populate edit boxes in the edit pane
- // with information from the selected element.
- //
- //************************************************************************************
- private void populateEditBoxes()
- {
- // Get attribute and element values of a node.
- string title = "";
- string ISBN = "";
- string publicationDate = "";
- string genre = "";
- string price = "";
-
- // get book values.
- _xmlHelperMethods.GetBookInformation(ref title, ref ISBN, ref publicationDate,
- ref price, ref genre, _currentlySelectedNode);
-
- // populate edit boxes.
- editTitleTextBox.Text = title;
- editISBNTextBox.Text = ISBN;
- editPubDateTextBox.Text = publicationDate;
- editPriceTextBox.Text = price;
- editGenreTextBox.Text = genre;
- }
-
- //************************************************************************************
- //
- // Add an XML Element to the XMLDocument object.
- //
- //************************************************************************************
- private void addNewBookButton_Click(object sender, EventArgs e)
- {
- if (_doc != null)
- {
- if (newISBNTextBox.Text != "")
- {
- // Create a book element.
- XmlElement bookElement = _xmlHelperMethods.AddNewBook(newGenreTextBox.Text,
- newISBNTextBox.Text, newPubDateTextBox.Text, newTitleTextBox.Text, newPriceTextBox.Text, _doc);
-
- if (bookElement != null)
- {
- XmlNode selectedBookNode = null;
-
- if (positionComboBox.Text == Constants.positionAbove)
- {
- selectedBookNode = _xmlHelperMethods.GetBook(_ISBNOfSelectedBookNode, _doc);
- }
- else if (positionComboBox.Text == Constants.positionBelow)
- {
- selectedBookNode = _xmlHelperMethods.GetBook(_ISBNOfSelectedBookNode, _doc);
- }
-
- //Insert book element at the beginning, end, before a specific element
- // or after one depending on what option the user selects.
- _xmlHelperMethods.InsertBookElement(bookElement, positionComboBox.Text, selectedBookNode, validateCheckBox.Checked, generateSchemaCheckBox.Checked);
-
- // Populate the RichTextBox again.
-
- XmlTextBox.Text = _doc.InnerXml;
- populateTreeView(_doc);
-
- // Highlight the newly added item.
- _ISBNOfSelectedBookNode = newISBNTextBox.Text;
- if (highlightXML())
- {
- // Clear the text box controls.
- newGenreTextBox.Text = "";
- newISBNTextBox.Text = "";
- newPubDateTextBox.Text = "";
- newTitleTextBox.Text = "";
- newPriceTextBox.Text = "";
- }
- }
- }
- else
- {
- MessageBox.Show("Please provide an ISBN number");
- }
- }
- else
- {
- MessageBox.Show("Please load the XML first by using the Load XML tab");
- }
- }
-
- //************************************************************************************
- //
- // Helper method to create custom color tabs. In this case, call black.
- //
- //************************************************************************************
- private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
- {
- SolidBrush fillbrush = new SolidBrush(Color.Black);
- //draw rectangle behind the tabs
- Rectangle lasttabrect = tabControl1.GetTabRect(tabControl1.TabPages.Count - 1);
- Rectangle background = new Rectangle();
- background.Location = new Point(lasttabrect.Right, 0);
-
- //pad the rectangle to cover the 1 pixel line between the top of the tabpage and the start of the tabs
- background.Size = new Size(tabControl1.Right - background.Left, lasttabrect.Height + 1);
- e.Graphics.FillRectangle(fillbrush, background);
-
- TabPage page = tabControl1.TabPages[e.Index];
- e.Graphics.FillRectangle(new SolidBrush(page.BackColor), e.Bounds);
-
- Rectangle paddedBounds = e.Bounds;
- int yOffset = (e.State == DrawItemState.Selected) ? -2 : 1;
- paddedBounds.Offset(1, yOffset);
- TextRenderer.DrawText(e.Graphics, page.Text, this.Font, paddedBounds, page.ForeColor);
- }
- //************************************************************************************
- //
- // Load XML into the DOM when the user chooses the Load XML button.
- //
- //************************************************************************************
- private void loadButton_Click(object sender, EventArgs e)
- {
- loadXML(generateCheckBox.Checked,
- validateCheckBox.Checked, generateSchemaCheckBox.Checked);
-
- // Clear the text box controls.
- newGenreTextBox.Text = "";
- newISBNTextBox.Text = "";
- newPubDateTextBox.Text = "";
- newTitleTextBox.Text = "";
- newPriceTextBox.Text = "";
- }
- //************************************************************************************
- //
- // To show and hide the generate XML Schema checkboxes.
- //
- //************************************************************************************
- private void validateCheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (validateCheckBox.Checked == true)
- {
- generateSchemaCheckBox.Enabled = true;
- generateSchemaCheckBox.Visible = true;
- }
- else
- {
- generateSchemaCheckBox.Enabled = false;
- generateSchemaCheckBox.Visible = false;
- }
- }
- //************************************************************************************
- //
- // Update XML element when user submits changes that they've made to edit boxes.
- //
- //************************************************************************************
- private void submitButton_Click(object sender, EventArgs e)
- {
- if (_currentlySelectedNode != null)
- {
- _xmlHelperMethods.editBook(editTitleTextBox.Text, editISBNTextBox.Text,
- editPubDateTextBox.Text, editGenreTextBox.Text, editPriceTextBox.Text,
- _currentlySelectedNode, validateCheckBox.Checked, generateCheckBox.Checked);
-
- // Populate the RichTextBox again.
- XmlTextBox.Text = _doc.InnerXml;
- populateTreeView(_doc);
-
- highlightXML();
- }
- }
- //************************************************************************************
- //
- // Delete an element from the DOM.
- //
- //************************************************************************************
- private void deleteButton_Click(object sender, EventArgs e)
- {
- if (_currentlySelectedNode != null)
- {
- _xmlHelperMethods.deleteBook(_currentlySelectedNode);
- _currentlySelectedNode = null;
- XmlTextBox.Text = _doc.InnerXml;
- populateTreeView(_doc);
-
- // populate edit boxes.
- editTitleTextBox.Text = "";
- editISBNTextBox.Text = "";
- editPubDateTextBox.Text = "";
- editPriceTextBox.Text = "";
- editGenreTextBox.Text = "";
- }
- }
- //************************************************************************************
- //
- // Position an element up one level in the list of XML elements.
- //
- //************************************************************************************
- private void positionUpButton_Click(object sender, EventArgs e)
- {
- if (_currentlySelectedNode != null && xmlTreeView.SelectedNode != null)
- {
- _xmlHelperMethods.MoveElementUp(_currentlySelectedNode);
- XmlTextBox.Text = _doc.InnerXml;
-
- unHighlightXML();
- if (_ISBNOfSelectedBookNode != null)
- {
- highlightXML();
- }
-
- // Move items up the tree.
-
- TreeNode selectedNode = xmlTreeView.SelectedNode;
- TreeNode previousNode = xmlTreeView.SelectedNode.PrevNode;
-
- if (previousNode != null)
- {
- xmlTreeView.Nodes.Remove(selectedNode);
- TreeNode insertedNode = xmlTreeView.Nodes.Insert(previousNode.Index, selectedNode.Text);
- insertedNode.Tag = selectedNode.Tag;
- xmlTreeView.SelectedNode = insertedNode;
- }
- xmlTreeView.Focus();
- }
- else
- {
- MessageBox.Show("Select the node that you want to reposition in the list");
- }
- }
- //************************************************************************************
- //
- // Position an element one level down in the list of XML elements.
- //
- //************************************************************************************
- private void positionDownButton_Click(object sender, EventArgs e)
- {
- if (_currentlySelectedNode != null && xmlTreeView.SelectedNode != null)
- {
- _xmlHelperMethods.MoveElementDown(_currentlySelectedNode);
- XmlTextBox.Text = _doc.InnerXml;
-
- unHighlightXML();
- if (_ISBNOfSelectedBookNode != null)
- {
- highlightXML();
- }
-
- // Move items down in the tree.
-
- TreeNode selectedNode = xmlTreeView.SelectedNode;
- TreeNode nextNode = xmlTreeView.SelectedNode.NextNode;
-
- if (nextNode != null)
- {
- int insertionIndex = nextNode.Index;
- TreeNode insertedNode = null;
- xmlTreeView.Nodes.Remove(selectedNode);
- if (insertionIndex < xmlTreeView.Nodes.Count)
- {
- insertedNode = xmlTreeView.Nodes.Insert(insertionIndex, selectedNode.Text);
- }
- else
- {
- insertedNode = xmlTreeView.Nodes.Add(selectedNode.Text);
- }
-
- insertedNode.Tag = selectedNode.Tag;
- xmlTreeView.SelectedNode = insertedNode;
- xmlTreeView.Focus();
- }
- xmlTreeView.Focus();
- }
- else
- {
- MessageBox.Show("Select the node that you want to reposition in the list");
- }
- }
- //************************************************************************************
- //
- // Save XML.
- //
- //************************************************************************************
- private void saveButton_Click(object sender, EventArgs e)
- {
- _xmlHelperMethods.SaveXML(_doc);
- MessageBox.Show("XML saved.");
- }
-
- //************************************************************************************
- //
- // Add a filter condition to the list of filter conditions in the UI.
- //
- //************************************************************************************
- private void addFilterButton_Click(object sender, EventArgs e)
- {
- if (condition1Panel.Visible != true)
- {
- condition1Panel.Visible = true;
- applyLabel.Visible = true;
- matchesLabel.Visible = true;
- matchesComboBox.Visible = true;
- }
- else if (condition2Panel.Visible != true)
- {
- condition2Panel.Visible = true;
- }
- else if (condition3Panel.Visible != true)
- {
- condition3Panel.Visible = true;
- }
- else
- {
- condition4Panel.Visible = true;
- }
- }
- //************************************************************************************
- //
- // Clear conditions from the list of conditions.
- //
- //************************************************************************************
- private void clearButton_Click(object sender, EventArgs e)
- {
- if (condition4Panel.Visible != false)
- {
- condition4Panel.Visible = false;
- condition4CheckBox.Checked = false;
- }
- else if (condition3Panel.Visible != false)
- {
- condition3Panel.Visible = false;
- condition3CheckBox.Checked = false;
- }
- else if (condition2Panel.Visible != false)
- {
- condition2Panel.Visible = false;
- condition2CheckBox.Checked = false;
- }
- else
- {
- condition1Panel.Visible = false;
- applyLabel.Visible = false;
- matchesComboBox.Visible = false;
- matchesLabel.Visible = false;
- condition1CheckBox.Checked = false;
- }
- }
- //************************************************************************************
- //
- // Handle condition 1 combobox
- //
- //************************************************************************************
- private void condition1ComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- populateOperatorComboBox(condition1ComboBox, operator1ComboBox);
- }
- //************************************************************************************
- //
- // Handle condition 2 combobox
- //
- //************************************************************************************
- private void condition2ComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- populateOperatorComboBox(condition2ComboBox, operator2ComboBox);
- }
- //************************************************************************************
- //
- // Handle condition 3 combobox
- //
- //************************************************************************************
- private void condition3ComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- populateOperatorComboBox(condition3ComboBox, operator3ComboBox);
- }
- //************************************************************************************
- //
- // Handle condition 4 combobox
- //
- //************************************************************************************
- private void condition4ComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- populateOperatorComboBox(condition4ComboBox, operator4ComboBox);
- }
-
- //************************************************************************************
- //
- // Based on which type of filter condition, the user selects, choose the relevant operators
- // and populate the operator combo box with those values.
- //
- //************************************************************************************
- public void populateOperatorComboBox(ComboBox conditionComboBox,
- ComboBox operatorComboBox)
- {
- operatorComboBox.Items.Clear();
-
- switch (conditionComboBox.Text)
- {
- case Constants.Title:
- operatorComboBox.Items.Add("=");
- operatorComboBox.Items.Add("Contains");
- operatorComboBox.Items.Add("Excludes");
- break;
- case Constants.Genre:
- operatorComboBox.Items.Add("=");
- break;
- case Constants.PubDate:
- operatorComboBox.Items.Add("=");
- break;
- case Constants.Price:
- operatorComboBox.Items.Add("=");
- operatorComboBox.Items.Add(">");
- operatorComboBox.Items.Add("<");
- operatorComboBox.Items.Add(">=");
- operatorComboBox.Items.Add("<=");
- operatorComboBox.Items.Add("<>");
- break;
- case Constants.ISBN:
- operatorComboBox.Items.Add("=");
- operatorComboBox.Items.Add("Contains");
- operatorComboBox.Items.Add("Excludes");
- break;
- default:
- break;
- }
- }
- //************************************************************************************
- //
- // Handle condition 1 checkbox.
- //
- //************************************************************************************
- private void condition1CheckBox_CheckedChanged(object sender, EventArgs e)
- {
- ConditionCheckChanged((CheckBox)sender);
- }
- //************************************************************************************
- //
- // Handle condition 2 checkbox.
- //
- //************************************************************************************
- private void condition2CheckBox_CheckedChanged(object sender, EventArgs e)
- {
- ConditionCheckChanged((CheckBox)sender);
- }
- //************************************************************************************
- //
- // Handle condition 3 checkbox.
- //
- //************************************************************************************
- private void condition3CheckBox_CheckedChanged(object sender, EventArgs e)
- {
- ConditionCheckChanged((CheckBox)sender);
- }
- //************************************************************************************
- //
- // Handle condition 4 checkbox.
- //
- //************************************************************************************
- private void condition4CheckBox_CheckedChanged(object sender, EventArgs e)
- {
- ConditionCheckChanged((CheckBox)sender);
- }
- //************************************************************************************
- //
- // Handle when any checkbox is checked or cleared. Queue up the conditions, operators
- // and values for each selected condition and pass them to a method for processing.
- //
- //************************************************************************************
- private void ConditionCheckChanged(CheckBox conditionCheckBox)
- {
- ArrayList Conditions = new ArrayList();
- ArrayList Operators = new ArrayList();
- ArrayList Values =new ArrayList();
-
- if (condition1CheckBox.Checked == true)
- {
- Conditions.Add(condition1ComboBox.Text);
- Operators.Add(operator1ComboBox.Text);
- Values.Add(condition1TextBox.Text);
- }
- if (condition2CheckBox.Checked == true)
- {
- Conditions.Add(condition2ComboBox.Text);
- Operators.Add(operator2ComboBox.Text);
- Values.Add(condition2TextBox.Text);
- }
- if (condition3CheckBox.Checked == true)
- {
- Conditions.Add(condition3ComboBox.Text);
- Operators.Add(operator3ComboBox.Text);
- Values.Add(condition3TextBox.Text);
- }
- if (condition4CheckBox.Checked == true)
- {
- Conditions.Add(condition4ComboBox.Text);
- Operators.Add(operator4ComboBox.Text);
- Values.Add(condition4TextBox.Text);
- }
-
- FilterChecked(Conditions, Operators, Values, conditionCheckBox);
- }
- //************************************************************************************
- //
- // Clear filter treeview and requery for filter conditions.
- //
- //************************************************************************************
- private void RemoveFilter()
- {
- filterTreeView.Nodes.Clear();
-
- if (condition1CheckBox.Checked == true)
- {
- ConditionCheckChanged(condition1CheckBox);
- }
- else if (condition2CheckBox.Checked == true)
- {
- ConditionCheckChanged(condition2CheckBox);
- }
- else if (condition3CheckBox.Checked == true)
- {
- ConditionCheckChanged(condition3CheckBox);
- }
- else if (condition4CheckBox.Checked == true)
- {
- ConditionCheckChanged(condition4CheckBox);
- }
- }
- //************************************************************************************
- //
- // Show or hide the filtered results box based on whether filter conditions are selected.
- //
- //************************************************************************************
- private void ShowOrHideFilterBox()
- {
- if (condition1CheckBox.Checked == false &&
- condition2CheckBox.Checked == false &&
- condition3CheckBox.Checked == false &&
- condition4CheckBox.Checked == false)
- {
- filterBox.Visible = false;
- }
- else
- {
- filterBox.Visible = true;
- }
- }
- //************************************************************************************
- //
- // Query XML Document based on filter conditions.
- //
- //************************************************************************************
- private void FilterChecked(ArrayList conditions, ArrayList operatorSymbols, ArrayList values, CheckBox conditionCheckBox)
- {
- if (conditionCheckBox.Checked == true)
- {
- XmlNodeList nodes = null;
-
- bool failure = false;
- foreach (string _condition in conditions)
- {
- if (_condition == Constants.Condition)
- {
- MessageBox.Show("Missing a condition");
- conditionCheckBox.Checked = false;
- failure = true;
- break;
- }
- }
- foreach (string _value in values)
- {
- if (_value == "")
- {
- MessageBox.Show("Missing a value");
- conditionCheckBox.Checked = false;
- failure = true;
- break;
- }
- }
- if (failure != true)
- {
- nodes = _xmlHelperMethods.ApplyFilters
- (conditions, operatorSymbols, values, _doc, matchesComboBox.Text);
- filterTreeView.Nodes.Clear();
- if (nodes == null)
- {
- MessageBox.Show("No results found");
- conditionCheckBox.Checked = false;
- }
- else if (nodes.Count == 0)
- {
- MessageBox.Show("No results found");
- conditionCheckBox.Checked = false;
- }
- else
- {
- addTreeNodes(nodes, filterTreeView);
- }
- }
- }
- else
- {
- RemoveFilter();
- }
- ShowOrHideFilterBox();
- }
-
- //************************************************************************************
- //
- // Handle when items in the filtered results viewed are selected by the user.
- //
- //************************************************************************************
- private void filterTreeView_AfterSelect(object sender, TreeViewEventArgs e)
- {
- xmlTreeView.SelectedNode = null;
- unHighlightXML();
- _ISBNOfSelectedBookNode = (string)e.Node.Tag;
- if (_ISBNOfSelectedBookNode != null)
- {
- highlightXML();
- }
- }
-
- //************************************************************************************
- //
- // Handle when the user chooses to "All" or "Any" in the "Matches" combo box.
- //
- //************************************************************************************
- private void matchesComboBox_SelectedValueChanged(object sender, EventArgs e)
- {
- RemoveFilter();
- }
- }
- }
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/form1.designer.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/form1.designer.cs
deleted file mode 100644
index d846810359032..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/form1.designer.cs
+++ /dev/null
@@ -1,1121 +0,0 @@
-namespace XMLProcessingApp
-{
- partial class Form1
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
- this.TreeViewGroupBox = new System.Windows.Forms.GroupBox();
- this.xmlTreeView = new System.Windows.Forms.TreeView();
- this.TextGroupBox = new System.Windows.Forms.GroupBox();
- this.saveButton = new System.Windows.Forms.Button();
- this.refreshTreeButton = new System.Windows.Forms.Button();
- this.positionDownButton = new System.Windows.Forms.Button();
- this.positionUpButton = new System.Windows.Forms.Button();
- this.XmlTextBox = new System.Windows.Forms.RichTextBox();
- this.tabControl1 = new System.Windows.Forms.TabControl();
- this.loadTab = new System.Windows.Forms.TabPage();
- this.optionsGroupBox = new System.Windows.Forms.GroupBox();
- this.generateSchemaCheckBox = new System.Windows.Forms.CheckBox();
- this.generateCheckBox = new System.Windows.Forms.CheckBox();
- this.validateCheckBox = new System.Windows.Forms.CheckBox();
- this.loadButton = new System.Windows.Forms.Button();
- this.addTab = new System.Windows.Forms.TabPage();
- this.addElementGroupBox = new System.Windows.Forms.GroupBox();
- this.newPositionLabel = new System.Windows.Forms.Label();
- this.positionComboBox = new System.Windows.Forms.ComboBox();
- this.newTitleTextBox = new System.Windows.Forms.TextBox();
- this.newTitleLabel = new System.Windows.Forms.Label();
- this.newISBNLabel = new System.Windows.Forms.Label();
- this.newPriceLabel = new System.Windows.Forms.Label();
- this.newISBNTextBox = new System.Windows.Forms.TextBox();
- this.newPriceTextBox = new System.Windows.Forms.TextBox();
- this.newPubDateLabel = new System.Windows.Forms.Label();
- this.newGenreLabel = new System.Windows.Forms.Label();
- this.newPubDateTextBox = new System.Windows.Forms.TextBox();
- this.addNewBookButton = new System.Windows.Forms.Button();
- this.newGenreTextBox = new System.Windows.Forms.TextBox();
- this.editTab = new System.Windows.Forms.TabPage();
- this.EditElementGroupBox = new System.Windows.Forms.GroupBox();
- this.deleteButton = new System.Windows.Forms.Button();
- this.editTitleTextBox = new System.Windows.Forms.TextBox();
- this.editTitleLabel = new System.Windows.Forms.Label();
- this.editISBNLabel = new System.Windows.Forms.Label();
- this.editPriceLabel = new System.Windows.Forms.Label();
- this.editISBNTextBox = new System.Windows.Forms.TextBox();
- this.editPriceTextBox = new System.Windows.Forms.TextBox();
- this.editPubDateLabel = new System.Windows.Forms.Label();
- this.editGenreLabel = new System.Windows.Forms.Label();
- this.editPubDateTextBox = new System.Windows.Forms.TextBox();
- this.submitButton = new System.Windows.Forms.Button();
- this.editGenreTextBox = new System.Windows.Forms.TextBox();
- this.filterTab = new System.Windows.Forms.TabPage();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.matchesComboBox = new System.Windows.Forms.ComboBox();
- this.matchesLabel = new System.Windows.Forms.Label();
- this.applyLabel = new System.Windows.Forms.Label();
- this.condition4Panel = new System.Windows.Forms.Panel();
- this.condition4CheckBox = new System.Windows.Forms.CheckBox();
- this.operator4ComboBox = new System.Windows.Forms.ComboBox();
- this.condition4ComboBox = new System.Windows.Forms.ComboBox();
- this.condition4TextBox = new System.Windows.Forms.TextBox();
- this.condition3Panel = new System.Windows.Forms.Panel();
- this.condition3CheckBox = new System.Windows.Forms.CheckBox();
- this.operator3ComboBox = new System.Windows.Forms.ComboBox();
- this.condition3ComboBox = new System.Windows.Forms.ComboBox();
- this.condition3TextBox = new System.Windows.Forms.TextBox();
- this.condition2Panel = new System.Windows.Forms.Panel();
- this.condition2CheckBox = new System.Windows.Forms.CheckBox();
- this.operator2ComboBox = new System.Windows.Forms.ComboBox();
- this.condition2ComboBox = new System.Windows.Forms.ComboBox();
- this.condition2TextBox = new System.Windows.Forms.TextBox();
- this.condition1Panel = new System.Windows.Forms.Panel();
- this.condition1CheckBox = new System.Windows.Forms.CheckBox();
- this.operator1ComboBox = new System.Windows.Forms.ComboBox();
- this.condition1ComboBox = new System.Windows.Forms.ComboBox();
- this.condition1TextBox = new System.Windows.Forms.TextBox();
- this.clearButton = new System.Windows.Forms.Button();
- this.addFilterButton = new System.Windows.Forms.Button();
- this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
- this.filterBox = new System.Windows.Forms.GroupBox();
- this.filterTreeView = new System.Windows.Forms.TreeView();
- this.TreeViewGroupBox.SuspendLayout();
- this.TextGroupBox.SuspendLayout();
- this.tabControl1.SuspendLayout();
- this.loadTab.SuspendLayout();
- this.optionsGroupBox.SuspendLayout();
- this.addTab.SuspendLayout();
- this.addElementGroupBox.SuspendLayout();
- this.editTab.SuspendLayout();
- this.EditElementGroupBox.SuspendLayout();
- this.filterTab.SuspendLayout();
- this.groupBox1.SuspendLayout();
- this.condition4Panel.SuspendLayout();
- this.condition3Panel.SuspendLayout();
- this.condition2Panel.SuspendLayout();
- this.condition1Panel.SuspendLayout();
- this.filterBox.SuspendLayout();
- this.SuspendLayout();
- //
- // TreeViewGroupBox
- //
- this.TreeViewGroupBox.Controls.Add(this.xmlTreeView);
- this.TreeViewGroupBox.ForeColor = System.Drawing.Color.White;
- this.TreeViewGroupBox.Location = new System.Drawing.Point(373, 12);
- this.TreeViewGroupBox.Name = "TreeViewGroupBox";
- this.TreeViewGroupBox.Size = new System.Drawing.Size(286, 688);
- this.TreeViewGroupBox.TabIndex = 4;
- this.TreeViewGroupBox.TabStop = false;
- this.TreeViewGroupBox.Text = "Book List";
- //
- // xmlTreeView
- //
- this.xmlTreeView.BackColor = System.Drawing.Color.Black;
- this.xmlTreeView.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.xmlTreeView.ForeColor = System.Drawing.Color.White;
- this.xmlTreeView.Location = new System.Drawing.Point(16, 19);
- this.xmlTreeView.Name = "xmlTreeView";
- this.xmlTreeView.Size = new System.Drawing.Size(258, 656);
- this.xmlTreeView.TabIndex = 3;
- this.xmlTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.xmlTreeView_AfterSelect);
- //
- // TextGroupBox
- //
- this.TextGroupBox.Controls.Add(this.saveButton);
- this.TextGroupBox.Controls.Add(this.refreshTreeButton);
- this.TextGroupBox.Controls.Add(this.positionDownButton);
- this.TextGroupBox.Controls.Add(this.positionUpButton);
- this.TextGroupBox.Controls.Add(this.XmlTextBox);
- this.TextGroupBox.ForeColor = System.Drawing.Color.White;
- this.TextGroupBox.Location = new System.Drawing.Point(665, 12);
- this.TextGroupBox.Name = "TextGroupBox";
- this.TextGroupBox.Size = new System.Drawing.Size(526, 688);
- this.TextGroupBox.TabIndex = 5;
- this.TextGroupBox.TabStop = false;
- this.TextGroupBox.Text = "Xml View";
- //
- // saveButton
- //
- this.saveButton.FlatAppearance.BorderColor = System.Drawing.Color.Black;
- this.saveButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.saveButton.Image = ((System.Drawing.Image)(resources.GetObject("saveButton.Image")));
- this.saveButton.Location = new System.Drawing.Point(6, 196);
- this.saveButton.Name = "saveButton";
- this.saveButton.Size = new System.Drawing.Size(31, 34);
- this.saveButton.TabIndex = 38;
- this.toolTip1.SetToolTip(this.saveButton, "Save XML with new element positions");
- this.saveButton.UseVisualStyleBackColor = true;
- this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
- //
- // refreshTreeButton
- //
- this.refreshTreeButton.FlatAppearance.BorderColor = System.Drawing.Color.Black;
- this.refreshTreeButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.refreshTreeButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshTreeButton.Image")));
- this.refreshTreeButton.Location = new System.Drawing.Point(6, 150);
- this.refreshTreeButton.Name = "refreshTreeButton";
- this.refreshTreeButton.Size = new System.Drawing.Size(31, 34);
- this.refreshTreeButton.TabIndex = 37;
- this.toolTip1.SetToolTip(this.refreshTreeButton, "Refresh tree view to reflect new order of elements");
- this.refreshTreeButton.UseVisualStyleBackColor = true;
- //
- // positionDownButton
- //
- this.positionDownButton.FlatAppearance.BorderColor = System.Drawing.Color.Black;
- this.positionDownButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.positionDownButton.Image = ((System.Drawing.Image)(resources.GetObject("positionDownButton.Image")));
- this.positionDownButton.Location = new System.Drawing.Point(6, 105);
- this.positionDownButton.Name = "positionDownButton";
- this.positionDownButton.Size = new System.Drawing.Size(31, 34);
- this.positionDownButton.TabIndex = 36;
- this.toolTip1.SetToolTip(this.positionDownButton, "Move selected item down in the list");
- this.positionDownButton.UseVisualStyleBackColor = true;
- this.positionDownButton.Click += new System.EventHandler(this.positionDownButton_Click);
- //
- // positionUpButton
- //
- this.positionUpButton.FlatAppearance.BorderColor = System.Drawing.Color.Black;
- this.positionUpButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.positionUpButton.Image = ((System.Drawing.Image)(resources.GetObject("positionUpButton.Image")));
- this.positionUpButton.Location = new System.Drawing.Point(6, 59);
- this.positionUpButton.Name = "positionUpButton";
- this.positionUpButton.Size = new System.Drawing.Size(31, 34);
- this.positionUpButton.TabIndex = 35;
- this.toolTip1.SetToolTip(this.positionUpButton, "Move selected item up in the list");
- this.positionUpButton.UseVisualStyleBackColor = true;
- this.positionUpButton.Click += new System.EventHandler(this.positionUpButton_Click);
- //
- // XmlTextBox
- //
- this.XmlTextBox.BackColor = System.Drawing.Color.Black;
- this.XmlTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.XmlTextBox.ForeColor = System.Drawing.Color.White;
- this.XmlTextBox.Location = new System.Drawing.Point(43, 19);
- this.XmlTextBox.Name = "XmlTextBox";
- this.XmlTextBox.Size = new System.Drawing.Size(477, 656);
- this.XmlTextBox.TabIndex = 6;
- this.XmlTextBox.Text = "";
- //
- // tabControl1
- //
- this.tabControl1.Controls.Add(this.loadTab);
- this.tabControl1.Controls.Add(this.addTab);
- this.tabControl1.Controls.Add(this.editTab);
- this.tabControl1.Controls.Add(this.filterTab);
- this.tabControl1.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
- this.tabControl1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.tabControl1.Location = new System.Drawing.Point(12, 12);
- this.tabControl1.Name = "tabControl1";
- this.tabControl1.SelectedIndex = 0;
- this.tabControl1.Size = new System.Drawing.Size(354, 247);
- this.tabControl1.TabIndex = 7;
- this.tabControl1.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.tabControl1_DrawItem);
- //
- // loadTab
- //
- this.loadTab.BackColor = System.Drawing.Color.Black;
- this.loadTab.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
- this.loadTab.Controls.Add(this.optionsGroupBox);
- this.loadTab.Controls.Add(this.loadButton);
- this.loadTab.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.loadTab.ForeColor = System.Drawing.Color.White;
- this.loadTab.Location = new System.Drawing.Point(4, 25);
- this.loadTab.Name = "loadTab";
- this.loadTab.Padding = new System.Windows.Forms.Padding(3);
- this.loadTab.Size = new System.Drawing.Size(346, 218);
- this.loadTab.TabIndex = 1;
- this.loadTab.Text = "Load XML";
- //
- // optionsGroupBox
- //
- this.optionsGroupBox.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
- this.optionsGroupBox.Controls.Add(this.generateSchemaCheckBox);
- this.optionsGroupBox.Controls.Add(this.generateCheckBox);
- this.optionsGroupBox.Controls.Add(this.validateCheckBox);
- this.optionsGroupBox.ForeColor = System.Drawing.Color.White;
- this.optionsGroupBox.Location = new System.Drawing.Point(16, 56);
- this.optionsGroupBox.Name = "optionsGroupBox";
- this.optionsGroupBox.Size = new System.Drawing.Size(324, 104);
- this.optionsGroupBox.TabIndex = 8;
- this.optionsGroupBox.TabStop = false;
- this.optionsGroupBox.Text = "Options";
- //
- // generateSchemaCheckBox
- //
- this.generateSchemaCheckBox.AutoSize = true;
- this.generateSchemaCheckBox.Enabled = false;
- this.generateSchemaCheckBox.Location = new System.Drawing.Point(14, 77);
- this.generateSchemaCheckBox.Name = "generateSchemaCheckBox";
- this.generateSchemaCheckBox.Size = new System.Drawing.Size(295, 20);
- this.generateSchemaCheckBox.TabIndex = 10;
- this.generateSchemaCheckBox.Text = "If the schema file is not found, then generate it.";
- this.generateSchemaCheckBox.UseVisualStyleBackColor = true;
- this.generateSchemaCheckBox.Visible = false;
- //
- // generateCheckBox
- //
- this.generateCheckBox.AutoSize = true;
- this.generateCheckBox.ForeColor = System.Drawing.Color.White;
- this.generateCheckBox.Location = new System.Drawing.Point(13, 24);
- this.generateCheckBox.Name = "generateCheckBox";
- this.generateCheckBox.Size = new System.Drawing.Size(257, 20);
- this.generateCheckBox.TabIndex = 9;
- this.generateCheckBox.Text = "If the file is not found, generate the XML.";
- this.generateCheckBox.UseVisualStyleBackColor = true;
- //
- // validateCheckBox
- //
- this.validateCheckBox.AutoSize = true;
- this.validateCheckBox.ForeColor = System.Drawing.Color.White;
- this.validateCheckBox.Location = new System.Drawing.Point(13, 51);
- this.validateCheckBox.Name = "validateCheckBox";
- this.validateCheckBox.Size = new System.Drawing.Size(239, 20);
- this.validateCheckBox.TabIndex = 8;
- this.validateCheckBox.Text = "Validate the XML against a schema.";
- this.validateCheckBox.UseVisualStyleBackColor = true;
- this.validateCheckBox.CheckedChanged += new System.EventHandler(this.validateCheckBox_CheckedChanged);
- //
- // loadButton
- //
- this.loadButton.BackColor = System.Drawing.Color.Black;
- this.loadButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.loadButton.Location = new System.Drawing.Point(16, 16);
- this.loadButton.Name = "loadButton";
- this.loadButton.Size = new System.Drawing.Size(136, 27);
- this.loadButton.TabIndex = 0;
- this.loadButton.Text = "Load XML from file";
- this.loadButton.UseVisualStyleBackColor = false;
- this.loadButton.Click += new System.EventHandler(this.loadButton_Click);
- //
- // addTab
- //
- this.addTab.BackColor = System.Drawing.Color.Black;
- this.addTab.Controls.Add(this.addElementGroupBox);
- this.addTab.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.addTab.ForeColor = System.Drawing.Color.White;
- this.addTab.Location = new System.Drawing.Point(4, 25);
- this.addTab.Name = "addTab";
- this.addTab.Padding = new System.Windows.Forms.Padding(3);
- this.addTab.Size = new System.Drawing.Size(346, 218);
- this.addTab.TabIndex = 0;
- this.addTab.Text = "Add Book";
- //
- // addElementGroupBox
- //
- this.addElementGroupBox.Controls.Add(this.newPositionLabel);
- this.addElementGroupBox.Controls.Add(this.positionComboBox);
- this.addElementGroupBox.Controls.Add(this.newTitleTextBox);
- this.addElementGroupBox.Controls.Add(this.newTitleLabel);
- this.addElementGroupBox.Controls.Add(this.newISBNLabel);
- this.addElementGroupBox.Controls.Add(this.newPriceLabel);
- this.addElementGroupBox.Controls.Add(this.newISBNTextBox);
- this.addElementGroupBox.Controls.Add(this.newPriceTextBox);
- this.addElementGroupBox.Controls.Add(this.newPubDateLabel);
- this.addElementGroupBox.Controls.Add(this.newGenreLabel);
- this.addElementGroupBox.Controls.Add(this.newPubDateTextBox);
- this.addElementGroupBox.Controls.Add(this.addNewBookButton);
- this.addElementGroupBox.Controls.Add(this.newGenreTextBox);
- this.addElementGroupBox.Location = new System.Drawing.Point(6, 6);
- this.addElementGroupBox.Name = "addElementGroupBox";
- this.addElementGroupBox.Size = new System.Drawing.Size(334, 201);
- this.addElementGroupBox.TabIndex = 0;
- this.addElementGroupBox.TabStop = false;
- //
- // newPositionLabel
- //
- this.newPositionLabel.AutoSize = true;
- this.newPositionLabel.Location = new System.Drawing.Point(18, 164);
- this.newPositionLabel.Name = "newPositionLabel";
- this.newPositionLabel.Size = new System.Drawing.Size(59, 16);
- this.newPositionLabel.TabIndex = 28;
- this.newPositionLabel.Text = "Position:";
- //
- // positionComboBox
- //
- this.positionComboBox.BackColor = System.Drawing.Color.Black;
- this.positionComboBox.ForeColor = System.Drawing.Color.White;
- this.positionComboBox.FormattingEnabled = true;
- this.positionComboBox.Items.AddRange(new object[] {
- "Top",
- "Bottom",
- "Above selected item",
- "Below selected item"});
- this.positionComboBox.Location = new System.Drawing.Point(111, 157);
- this.positionComboBox.Name = "positionComboBox";
- this.positionComboBox.Size = new System.Drawing.Size(128, 24);
- this.positionComboBox.TabIndex = 27;
- this.positionComboBox.Text = "Top";
- //
- // newTitleTextBox
- //
- this.newTitleTextBox.BackColor = System.Drawing.Color.Black;
- this.newTitleTextBox.ForeColor = System.Drawing.Color.White;
- this.newTitleTextBox.Location = new System.Drawing.Point(111, 21);
- this.newTitleTextBox.Name = "newTitleTextBox";
- this.newTitleTextBox.Size = new System.Drawing.Size(192, 22);
- this.newTitleTextBox.TabIndex = 16;
- //
- // newTitleLabel
- //
- this.newTitleLabel.AutoSize = true;
- this.newTitleLabel.Location = new System.Drawing.Point(18, 21);
- this.newTitleLabel.Name = "newTitleLabel";
- this.newTitleLabel.Size = new System.Drawing.Size(37, 16);
- this.newTitleLabel.TabIndex = 18;
- this.newTitleLabel.Text = "Title:";
- //
- // newISBNLabel
- //
- this.newISBNLabel.AutoSize = true;
- this.newISBNLabel.Location = new System.Drawing.Point(18, 48);
- this.newISBNLabel.Name = "newISBNLabel";
- this.newISBNLabel.Size = new System.Drawing.Size(42, 16);
- this.newISBNLabel.TabIndex = 19;
- this.newISBNLabel.Text = "ISBN:";
- //
- // newPriceLabel
- //
- this.newPriceLabel.AutoSize = true;
- this.newPriceLabel.Location = new System.Drawing.Point(18, 107);
- this.newPriceLabel.Name = "newPriceLabel";
- this.newPriceLabel.Size = new System.Drawing.Size(42, 16);
- this.newPriceLabel.TabIndex = 26;
- this.newPriceLabel.Text = "Price:";
- //
- // newISBNTextBox
- //
- this.newISBNTextBox.BackColor = System.Drawing.Color.Black;
- this.newISBNTextBox.ForeColor = System.Drawing.Color.White;
- this.newISBNTextBox.Location = new System.Drawing.Point(111, 48);
- this.newISBNTextBox.Name = "newISBNTextBox";
- this.newISBNTextBox.Size = new System.Drawing.Size(192, 22);
- this.newISBNTextBox.TabIndex = 20;
- //
- // newPriceTextBox
- //
- this.newPriceTextBox.BackColor = System.Drawing.Color.Black;
- this.newPriceTextBox.ForeColor = System.Drawing.Color.White;
- this.newPriceTextBox.Location = new System.Drawing.Point(111, 100);
- this.newPriceTextBox.Name = "newPriceTextBox";
- this.newPriceTextBox.Size = new System.Drawing.Size(75, 22);
- this.newPriceTextBox.TabIndex = 25;
- //
- // newPubDateLabel
- //
- this.newPubDateLabel.AutoSize = true;
- this.newPubDateLabel.Location = new System.Drawing.Point(18, 74);
- this.newPubDateLabel.Name = "newPubDateLabel";
- this.newPubDateLabel.Size = new System.Drawing.Size(87, 16);
- this.newPubDateLabel.TabIndex = 21;
- this.newPubDateLabel.Text = "Publish Date:";
- //
- // newGenreLabel
- //
- this.newGenreLabel.AutoSize = true;
- this.newGenreLabel.Location = new System.Drawing.Point(18, 135);
- this.newGenreLabel.Name = "newGenreLabel";
- this.newGenreLabel.Size = new System.Drawing.Size(48, 16);
- this.newGenreLabel.TabIndex = 24;
- this.newGenreLabel.Text = "Genre:";
- //
- // newPubDateTextBox
- //
- this.newPubDateTextBox.BackColor = System.Drawing.Color.Black;
- this.newPubDateTextBox.ForeColor = System.Drawing.Color.White;
- this.newPubDateTextBox.Location = new System.Drawing.Point(111, 74);
- this.newPubDateTextBox.Name = "newPubDateTextBox";
- this.newPubDateTextBox.Size = new System.Drawing.Size(125, 22);
- this.newPubDateTextBox.TabIndex = 22;
- //
- // addNewBookButton
- //
- this.addNewBookButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.addNewBookButton.Location = new System.Drawing.Point(245, 157);
- this.addNewBookButton.Name = "addNewBookButton";
- this.addNewBookButton.Size = new System.Drawing.Size(70, 24);
- this.addNewBookButton.TabIndex = 17;
- this.addNewBookButton.Text = "Add";
- this.addNewBookButton.UseVisualStyleBackColor = true;
- this.addNewBookButton.Click += new System.EventHandler(this.addNewBookButton_Click);
- //
- // newGenreTextBox
- //
- this.newGenreTextBox.BackColor = System.Drawing.Color.Black;
- this.newGenreTextBox.ForeColor = System.Drawing.Color.White;
- this.newGenreTextBox.Location = new System.Drawing.Point(111, 128);
- this.newGenreTextBox.Name = "newGenreTextBox";
- this.newGenreTextBox.Size = new System.Drawing.Size(125, 22);
- this.newGenreTextBox.TabIndex = 23;
- //
- // editTab
- //
- this.editTab.BackColor = System.Drawing.Color.Black;
- this.editTab.Controls.Add(this.EditElementGroupBox);
- this.editTab.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.editTab.ForeColor = System.Drawing.Color.White;
- this.editTab.Location = new System.Drawing.Point(4, 25);
- this.editTab.Name = "editTab";
- this.editTab.Padding = new System.Windows.Forms.Padding(3);
- this.editTab.Size = new System.Drawing.Size(346, 218);
- this.editTab.TabIndex = 2;
- this.editTab.Text = "Edit Books";
- //
- // EditElementGroupBox
- //
- this.EditElementGroupBox.Controls.Add(this.deleteButton);
- this.EditElementGroupBox.Controls.Add(this.editTitleTextBox);
- this.EditElementGroupBox.Controls.Add(this.editTitleLabel);
- this.EditElementGroupBox.Controls.Add(this.editISBNLabel);
- this.EditElementGroupBox.Controls.Add(this.editPriceLabel);
- this.EditElementGroupBox.Controls.Add(this.editISBNTextBox);
- this.EditElementGroupBox.Controls.Add(this.editPriceTextBox);
- this.EditElementGroupBox.Controls.Add(this.editPubDateLabel);
- this.EditElementGroupBox.Controls.Add(this.editGenreLabel);
- this.EditElementGroupBox.Controls.Add(this.editPubDateTextBox);
- this.EditElementGroupBox.Controls.Add(this.submitButton);
- this.EditElementGroupBox.Controls.Add(this.editGenreTextBox);
- this.EditElementGroupBox.Location = new System.Drawing.Point(6, 6);
- this.EditElementGroupBox.Name = "EditElementGroupBox";
- this.EditElementGroupBox.Size = new System.Drawing.Size(334, 201);
- this.EditElementGroupBox.TabIndex = 1;
- this.EditElementGroupBox.TabStop = false;
- //
- // deleteButton
- //
- this.deleteButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.deleteButton.Location = new System.Drawing.Point(21, 163);
- this.deleteButton.Name = "deleteButton";
- this.deleteButton.Size = new System.Drawing.Size(119, 25);
- this.deleteButton.TabIndex = 27;
- this.deleteButton.Text = "Delete Book";
- this.deleteButton.UseVisualStyleBackColor = true;
- this.deleteButton.Click += new System.EventHandler(this.deleteButton_Click);
- //
- // editTitleTextBox
- //
- this.editTitleTextBox.BackColor = System.Drawing.Color.Black;
- this.editTitleTextBox.ForeColor = System.Drawing.Color.White;
- this.editTitleTextBox.Location = new System.Drawing.Point(111, 21);
- this.editTitleTextBox.Name = "editTitleTextBox";
- this.editTitleTextBox.Size = new System.Drawing.Size(192, 22);
- this.editTitleTextBox.TabIndex = 16;
- //
- // editTitleLabel
- //
- this.editTitleLabel.AutoSize = true;
- this.editTitleLabel.Location = new System.Drawing.Point(18, 21);
- this.editTitleLabel.Name = "editTitleLabel";
- this.editTitleLabel.Size = new System.Drawing.Size(37, 16);
- this.editTitleLabel.TabIndex = 18;
- this.editTitleLabel.Text = "Title:";
- //
- // editISBNLabel
- //
- this.editISBNLabel.AutoSize = true;
- this.editISBNLabel.Location = new System.Drawing.Point(18, 48);
- this.editISBNLabel.Name = "editISBNLabel";
- this.editISBNLabel.Size = new System.Drawing.Size(42, 16);
- this.editISBNLabel.TabIndex = 19;
- this.editISBNLabel.Text = "ISBN:";
- //
- // editPriceLabel
- //
- this.editPriceLabel.AutoSize = true;
- this.editPriceLabel.Location = new System.Drawing.Point(18, 107);
- this.editPriceLabel.Name = "editPriceLabel";
- this.editPriceLabel.Size = new System.Drawing.Size(42, 16);
- this.editPriceLabel.TabIndex = 26;
- this.editPriceLabel.Text = "Price:";
- //
- // editISBNTextBox
- //
- this.editISBNTextBox.BackColor = System.Drawing.Color.Black;
- this.editISBNTextBox.ForeColor = System.Drawing.Color.White;
- this.editISBNTextBox.Location = new System.Drawing.Point(111, 48);
- this.editISBNTextBox.Name = "editISBNTextBox";
- this.editISBNTextBox.Size = new System.Drawing.Size(192, 22);
- this.editISBNTextBox.TabIndex = 20;
- //
- // editPriceTextBox
- //
- this.editPriceTextBox.BackColor = System.Drawing.Color.Black;
- this.editPriceTextBox.ForeColor = System.Drawing.Color.White;
- this.editPriceTextBox.Location = new System.Drawing.Point(111, 100);
- this.editPriceTextBox.Name = "editPriceTextBox";
- this.editPriceTextBox.Size = new System.Drawing.Size(75, 22);
- this.editPriceTextBox.TabIndex = 25;
- //
- // editPubDateLabel
- //
- this.editPubDateLabel.AutoSize = true;
- this.editPubDateLabel.Location = new System.Drawing.Point(18, 74);
- this.editPubDateLabel.Name = "editPubDateLabel";
- this.editPubDateLabel.Size = new System.Drawing.Size(87, 16);
- this.editPubDateLabel.TabIndex = 21;
- this.editPubDateLabel.Text = "Publish Date:";
- //
- // editGenreLabel
- //
- this.editGenreLabel.AutoSize = true;
- this.editGenreLabel.Location = new System.Drawing.Point(18, 135);
- this.editGenreLabel.Name = "editGenreLabel";
- this.editGenreLabel.Size = new System.Drawing.Size(48, 16);
- this.editGenreLabel.TabIndex = 24;
- this.editGenreLabel.Text = "Genre:";
- //
- // editPubDateTextBox
- //
- this.editPubDateTextBox.BackColor = System.Drawing.Color.Black;
- this.editPubDateTextBox.ForeColor = System.Drawing.Color.White;
- this.editPubDateTextBox.Location = new System.Drawing.Point(111, 74);
- this.editPubDateTextBox.Name = "editPubDateTextBox";
- this.editPubDateTextBox.Size = new System.Drawing.Size(125, 22);
- this.editPubDateTextBox.TabIndex = 22;
- //
- // submitButton
- //
- this.submitButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.submitButton.Location = new System.Drawing.Point(184, 163);
- this.submitButton.Name = "submitButton";
- this.submitButton.Size = new System.Drawing.Size(119, 25);
- this.submitButton.TabIndex = 17;
- this.submitButton.Text = "Submit Updates";
- this.submitButton.UseVisualStyleBackColor = true;
- this.submitButton.Click += new System.EventHandler(this.submitButton_Click);
- //
- // editGenreTextBox
- //
- this.editGenreTextBox.BackColor = System.Drawing.Color.Black;
- this.editGenreTextBox.ForeColor = System.Drawing.Color.White;
- this.editGenreTextBox.Location = new System.Drawing.Point(111, 128);
- this.editGenreTextBox.Name = "editGenreTextBox";
- this.editGenreTextBox.Size = new System.Drawing.Size(125, 22);
- this.editGenreTextBox.TabIndex = 23;
- //
- // filterTab
- //
- this.filterTab.BackColor = System.Drawing.Color.Black;
- this.filterTab.Controls.Add(this.groupBox1);
- this.filterTab.ForeColor = System.Drawing.Color.White;
- this.filterTab.Location = new System.Drawing.Point(4, 25);
- this.filterTab.Name = "filterTab";
- this.filterTab.Size = new System.Drawing.Size(346, 218);
- this.filterTab.TabIndex = 3;
- this.filterTab.Text = "Filter";
- //
- // groupBox1
- //
- this.groupBox1.Controls.Add(this.matchesComboBox);
- this.groupBox1.Controls.Add(this.matchesLabel);
- this.groupBox1.Controls.Add(this.applyLabel);
- this.groupBox1.Controls.Add(this.condition4Panel);
- this.groupBox1.Controls.Add(this.condition3Panel);
- this.groupBox1.Controls.Add(this.condition2Panel);
- this.groupBox1.Controls.Add(this.condition1Panel);
- this.groupBox1.Controls.Add(this.clearButton);
- this.groupBox1.Controls.Add(this.addFilterButton);
- this.groupBox1.Location = new System.Drawing.Point(6, 6);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(334, 201);
- this.groupBox1.TabIndex = 2;
- this.groupBox1.TabStop = false;
- //
- // matchesComboBox
- //
- this.matchesComboBox.BackColor = System.Drawing.Color.Black;
- this.matchesComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.matchesComboBox.ForeColor = System.Drawing.Color.White;
- this.matchesComboBox.FormattingEnabled = true;
- this.matchesComboBox.Items.AddRange(new object[] {
- "Any",
- "All"});
- this.matchesComboBox.Location = new System.Drawing.Point(255, 28);
- this.matchesComboBox.Name = "matchesComboBox";
- this.matchesComboBox.Size = new System.Drawing.Size(67, 24);
- this.matchesComboBox.TabIndex = 59;
- this.matchesComboBox.Text = "Any";
- this.matchesComboBox.Visible = false;
- this.matchesComboBox.SelectedValueChanged += new System.EventHandler(this.matchesComboBox_SelectedValueChanged);
- //
- // matchesLabel
- //
- this.matchesLabel.AutoSize = true;
- this.matchesLabel.Location = new System.Drawing.Point(187, 33);
- this.matchesLabel.Name = "matchesLabel";
- this.matchesLabel.Size = new System.Drawing.Size(62, 16);
- this.matchesLabel.TabIndex = 58;
- this.matchesLabel.Text = "Matches:";
- this.matchesLabel.Visible = false;
- //
- // applyLabel
- //
- this.applyLabel.AutoSize = true;
- this.applyLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.applyLabel.Location = new System.Drawing.Point(7, 53);
- this.applyLabel.Name = "applyLabel";
- this.applyLabel.Size = new System.Drawing.Size(33, 13);
- this.applyLabel.TabIndex = 57;
- this.applyLabel.Text = "Apply";
- this.applyLabel.Visible = false;
- //
- // condition4Panel
- //
- this.condition4Panel.Controls.Add(this.condition4CheckBox);
- this.condition4Panel.Controls.Add(this.operator4ComboBox);
- this.condition4Panel.Controls.Add(this.condition4ComboBox);
- this.condition4Panel.Controls.Add(this.condition4TextBox);
- this.condition4Panel.Location = new System.Drawing.Point(5, 163);
- this.condition4Panel.Name = "condition4Panel";
- this.condition4Panel.Size = new System.Drawing.Size(324, 36);
- this.condition4Panel.TabIndex = 56;
- this.condition4Panel.Visible = false;
- //
- // condition4CheckBox
- //
- this.condition4CheckBox.AutoSize = true;
- this.condition4CheckBox.Location = new System.Drawing.Point(7, 11);
- this.condition4CheckBox.Name = "condition4CheckBox";
- this.condition4CheckBox.Size = new System.Drawing.Size(15, 14);
- this.condition4CheckBox.TabIndex = 54;
- this.condition4CheckBox.UseVisualStyleBackColor = true;
- this.condition4CheckBox.CheckedChanged += new System.EventHandler(this.condition4CheckBox_CheckedChanged);
- //
- // operator4ComboBox
- //
- this.operator4ComboBox.BackColor = System.Drawing.Color.Black;
- this.operator4ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.operator4ComboBox.ForeColor = System.Drawing.Color.White;
- this.operator4ComboBox.FormattingEnabled = true;
- this.operator4ComboBox.Items.AddRange(new object[] {
- "=",
- ">",
- "<",
- ">=",
- "<>"});
- this.operator4ComboBox.Location = new System.Drawing.Point(131, 6);
- this.operator4ComboBox.Name = "operator4ComboBox";
- this.operator4ComboBox.Size = new System.Drawing.Size(78, 24);
- this.operator4ComboBox.TabIndex = 53;
- this.operator4ComboBox.Text = "=";
- //
- // condition4ComboBox
- //
- this.condition4ComboBox.BackColor = System.Drawing.Color.Black;
- this.condition4ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.condition4ComboBox.ForeColor = System.Drawing.Color.White;
- this.condition4ComboBox.FormattingEnabled = true;
- this.condition4ComboBox.Items.AddRange(new object[] {
- "Title",
- "ISBN",
- "Publish Year",
- "Price",
- "Genre"});
- this.condition4ComboBox.Location = new System.Drawing.Point(29, 6);
- this.condition4ComboBox.Name = "condition4ComboBox";
- this.condition4ComboBox.Size = new System.Drawing.Size(96, 24);
- this.condition4ComboBox.TabIndex = 52;
- this.condition4ComboBox.Text = "Condition";
- this.condition4ComboBox.SelectedIndexChanged += new System.EventHandler(this.condition4ComboBox_SelectedIndexChanged);
- //
- // condition4TextBox
- //
- this.condition4TextBox.BackColor = System.Drawing.Color.Black;
- this.condition4TextBox.ForeColor = System.Drawing.Color.White;
- this.condition4TextBox.Location = new System.Drawing.Point(215, 6);
- this.condition4TextBox.Name = "condition4TextBox";
- this.condition4TextBox.Size = new System.Drawing.Size(102, 22);
- this.condition4TextBox.TabIndex = 51;
- //
- // condition3Panel
- //
- this.condition3Panel.Controls.Add(this.condition3CheckBox);
- this.condition3Panel.Controls.Add(this.operator3ComboBox);
- this.condition3Panel.Controls.Add(this.condition3ComboBox);
- this.condition3Panel.Controls.Add(this.condition3TextBox);
- this.condition3Panel.Location = new System.Drawing.Point(5, 130);
- this.condition3Panel.Name = "condition3Panel";
- this.condition3Panel.Size = new System.Drawing.Size(324, 36);
- this.condition3Panel.TabIndex = 55;
- this.condition3Panel.Visible = false;
- //
- // condition3CheckBox
- //
- this.condition3CheckBox.AutoSize = true;
- this.condition3CheckBox.Location = new System.Drawing.Point(7, 11);
- this.condition3CheckBox.Name = "condition3CheckBox";
- this.condition3CheckBox.Size = new System.Drawing.Size(15, 14);
- this.condition3CheckBox.TabIndex = 54;
- this.condition3CheckBox.UseVisualStyleBackColor = true;
- this.condition3CheckBox.CheckedChanged += new System.EventHandler(this.condition3CheckBox_CheckedChanged);
- //
- // operator3ComboBox
- //
- this.operator3ComboBox.BackColor = System.Drawing.Color.Black;
- this.operator3ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.operator3ComboBox.ForeColor = System.Drawing.Color.White;
- this.operator3ComboBox.FormattingEnabled = true;
- this.operator3ComboBox.Items.AddRange(new object[] {
- "=",
- ">",
- "<",
- ">=",
- "<>"});
- this.operator3ComboBox.Location = new System.Drawing.Point(131, 6);
- this.operator3ComboBox.Name = "operator3ComboBox";
- this.operator3ComboBox.Size = new System.Drawing.Size(78, 24);
- this.operator3ComboBox.TabIndex = 53;
- this.operator3ComboBox.Text = "=";
- //
- // condition3ComboBox
- //
- this.condition3ComboBox.BackColor = System.Drawing.Color.Black;
- this.condition3ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.condition3ComboBox.ForeColor = System.Drawing.Color.White;
- this.condition3ComboBox.FormattingEnabled = true;
- this.condition3ComboBox.Items.AddRange(new object[] {
- "Title",
- "ISBN",
- "Publish Year",
- "Price",
- "Genre"});
- this.condition3ComboBox.Location = new System.Drawing.Point(29, 6);
- this.condition3ComboBox.Name = "condition3ComboBox";
- this.condition3ComboBox.Size = new System.Drawing.Size(96, 24);
- this.condition3ComboBox.TabIndex = 52;
- this.condition3ComboBox.Text = "Condition";
- this.condition3ComboBox.SelectedIndexChanged += new System.EventHandler(this.condition3ComboBox_SelectedIndexChanged);
- //
- // condition3TextBox
- //
- this.condition3TextBox.BackColor = System.Drawing.Color.Black;
- this.condition3TextBox.ForeColor = System.Drawing.Color.White;
- this.condition3TextBox.Location = new System.Drawing.Point(215, 6);
- this.condition3TextBox.Name = "condition3TextBox";
- this.condition3TextBox.Size = new System.Drawing.Size(102, 22);
- this.condition3TextBox.TabIndex = 51;
- //
- // condition2Panel
- //
- this.condition2Panel.Controls.Add(this.condition2CheckBox);
- this.condition2Panel.Controls.Add(this.operator2ComboBox);
- this.condition2Panel.Controls.Add(this.condition2ComboBox);
- this.condition2Panel.Controls.Add(this.condition2TextBox);
- this.condition2Panel.Location = new System.Drawing.Point(5, 97);
- this.condition2Panel.Name = "condition2Panel";
- this.condition2Panel.Size = new System.Drawing.Size(324, 36);
- this.condition2Panel.TabIndex = 50;
- this.condition2Panel.Visible = false;
- //
- // condition2CheckBox
- //
- this.condition2CheckBox.AutoSize = true;
- this.condition2CheckBox.Location = new System.Drawing.Point(7, 11);
- this.condition2CheckBox.Name = "condition2CheckBox";
- this.condition2CheckBox.Size = new System.Drawing.Size(15, 14);
- this.condition2CheckBox.TabIndex = 54;
- this.condition2CheckBox.UseVisualStyleBackColor = true;
- this.condition2CheckBox.CheckedChanged += new System.EventHandler(this.condition2CheckBox_CheckedChanged);
- //
- // operator2ComboBox
- //
- this.operator2ComboBox.BackColor = System.Drawing.Color.Black;
- this.operator2ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.operator2ComboBox.ForeColor = System.Drawing.Color.White;
- this.operator2ComboBox.FormattingEnabled = true;
- this.operator2ComboBox.Items.AddRange(new object[] {
- "=",
- ">",
- "<",
- ">=",
- "<>"});
- this.operator2ComboBox.Location = new System.Drawing.Point(131, 6);
- this.operator2ComboBox.Name = "operator2ComboBox";
- this.operator2ComboBox.Size = new System.Drawing.Size(78, 24);
- this.operator2ComboBox.TabIndex = 53;
- this.operator2ComboBox.Text = "=";
- //
- // condition2ComboBox
- //
- this.condition2ComboBox.BackColor = System.Drawing.Color.Black;
- this.condition2ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.condition2ComboBox.ForeColor = System.Drawing.Color.White;
- this.condition2ComboBox.FormattingEnabled = true;
- this.condition2ComboBox.Items.AddRange(new object[] {
- "Title",
- "ISBN",
- "Publish Year",
- "Price",
- "Genre"});
- this.condition2ComboBox.Location = new System.Drawing.Point(29, 6);
- this.condition2ComboBox.Name = "condition2ComboBox";
- this.condition2ComboBox.Size = new System.Drawing.Size(96, 24);
- this.condition2ComboBox.TabIndex = 52;
- this.condition2ComboBox.Text = "Condition";
- this.condition2ComboBox.SelectedIndexChanged += new System.EventHandler(this.condition2ComboBox_SelectedIndexChanged);
- //
- // condition2TextBox
- //
- this.condition2TextBox.BackColor = System.Drawing.Color.Black;
- this.condition2TextBox.ForeColor = System.Drawing.Color.White;
- this.condition2TextBox.Location = new System.Drawing.Point(215, 6);
- this.condition2TextBox.Name = "condition2TextBox";
- this.condition2TextBox.Size = new System.Drawing.Size(102, 22);
- this.condition2TextBox.TabIndex = 51;
- //
- // condition1Panel
- //
- this.condition1Panel.Controls.Add(this.condition1CheckBox);
- this.condition1Panel.Controls.Add(this.operator1ComboBox);
- this.condition1Panel.Controls.Add(this.condition1ComboBox);
- this.condition1Panel.Controls.Add(this.condition1TextBox);
- this.condition1Panel.Location = new System.Drawing.Point(5, 65);
- this.condition1Panel.Name = "condition1Panel";
- this.condition1Panel.Size = new System.Drawing.Size(324, 36);
- this.condition1Panel.TabIndex = 49;
- this.condition1Panel.Visible = false;
- //
- // condition1CheckBox
- //
- this.condition1CheckBox.AutoSize = true;
- this.condition1CheckBox.Location = new System.Drawing.Point(7, 11);
- this.condition1CheckBox.Name = "condition1CheckBox";
- this.condition1CheckBox.Size = new System.Drawing.Size(15, 14);
- this.condition1CheckBox.TabIndex = 54;
- this.condition1CheckBox.UseVisualStyleBackColor = true;
- this.condition1CheckBox.CheckedChanged += new System.EventHandler(this.condition1CheckBox_CheckedChanged);
- //
- // operator1ComboBox
- //
- this.operator1ComboBox.BackColor = System.Drawing.Color.Black;
- this.operator1ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.operator1ComboBox.ForeColor = System.Drawing.Color.White;
- this.operator1ComboBox.FormattingEnabled = true;
- this.operator1ComboBox.Items.AddRange(new object[] {
- "=",
- ">",
- "<",
- ">=",
- "<>"});
- this.operator1ComboBox.Location = new System.Drawing.Point(131, 6);
- this.operator1ComboBox.Name = "operator1ComboBox";
- this.operator1ComboBox.Size = new System.Drawing.Size(78, 24);
- this.operator1ComboBox.TabIndex = 53;
- this.operator1ComboBox.Text = "=";
- //
- // condition1ComboBox
- //
- this.condition1ComboBox.BackColor = System.Drawing.Color.Black;
- this.condition1ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.condition1ComboBox.ForeColor = System.Drawing.Color.White;
- this.condition1ComboBox.FormattingEnabled = true;
- this.condition1ComboBox.Items.AddRange(new object[] {
- "Title",
- "ISBN",
- "Publish Year",
- "Price",
- "Genre"});
- this.condition1ComboBox.Location = new System.Drawing.Point(29, 6);
- this.condition1ComboBox.Name = "condition1ComboBox";
- this.condition1ComboBox.Size = new System.Drawing.Size(96, 24);
- this.condition1ComboBox.TabIndex = 52;
- this.condition1ComboBox.Text = "Condition";
- this.condition1ComboBox.SelectedIndexChanged += new System.EventHandler(this.condition1ComboBox_SelectedIndexChanged);
- //
- // condition1TextBox
- //
- this.condition1TextBox.BackColor = System.Drawing.Color.Black;
- this.condition1TextBox.ForeColor = System.Drawing.Color.White;
- this.condition1TextBox.Location = new System.Drawing.Point(215, 6);
- this.condition1TextBox.Name = "condition1TextBox";
- this.condition1TextBox.Size = new System.Drawing.Size(102, 22);
- this.condition1TextBox.TabIndex = 51;
- //
- // clearButton
- //
- this.clearButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.clearButton.Location = new System.Drawing.Point(94, 19);
- this.clearButton.Name = "clearButton";
- this.clearButton.Size = new System.Drawing.Size(87, 25);
- this.clearButton.TabIndex = 27;
- this.clearButton.Text = "Clear last";
- this.clearButton.UseVisualStyleBackColor = true;
- this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
- //
- // addFilterButton
- //
- this.addFilterButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.addFilterButton.Location = new System.Drawing.Point(11, 19);
- this.addFilterButton.Name = "addFilterButton";
- this.addFilterButton.Size = new System.Drawing.Size(77, 25);
- this.addFilterButton.TabIndex = 17;
- this.addFilterButton.Text = "Add Filter";
- this.addFilterButton.UseVisualStyleBackColor = true;
- this.addFilterButton.Click += new System.EventHandler(this.addFilterButton_Click);
- //
- // filterBox
- //
- this.filterBox.Controls.Add(this.filterTreeView);
- this.filterBox.ForeColor = System.Drawing.Color.White;
- this.filterBox.Location = new System.Drawing.Point(34, 278);
- this.filterBox.Name = "filterBox";
- this.filterBox.Size = new System.Drawing.Size(284, 391);
- this.filterBox.TabIndex = 8;
- this.filterBox.TabStop = false;
- this.filterBox.Text = "Filtered Book List";
- this.filterBox.Visible = false;
- //
- // filterTreeView
- //
- this.filterTreeView.BackColor = System.Drawing.Color.Black;
- this.filterTreeView.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.filterTreeView.ForeColor = System.Drawing.Color.White;
- this.filterTreeView.Location = new System.Drawing.Point(10, 19);
- this.filterTreeView.Name = "filterTreeView";
- this.filterTreeView.Size = new System.Drawing.Size(258, 366);
- this.filterTreeView.TabIndex = 3;
- this.filterTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.filterTreeView_AfterSelect);
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
- this.ClientSize = new System.Drawing.Size(1203, 727);
- this.Controls.Add(this.filterBox);
- this.Controls.Add(this.tabControl1);
- this.Controls.Add(this.TextGroupBox);
- this.Controls.Add(this.TreeViewGroupBox);
- this.Name = "Form1";
- this.Text = "In Memory XML Processing App";
- this.TreeViewGroupBox.ResumeLayout(false);
- this.TextGroupBox.ResumeLayout(false);
- this.tabControl1.ResumeLayout(false);
- this.loadTab.ResumeLayout(false);
- this.optionsGroupBox.ResumeLayout(false);
- this.optionsGroupBox.PerformLayout();
- this.addTab.ResumeLayout(false);
- this.addElementGroupBox.ResumeLayout(false);
- this.addElementGroupBox.PerformLayout();
- this.editTab.ResumeLayout(false);
- this.EditElementGroupBox.ResumeLayout(false);
- this.EditElementGroupBox.PerformLayout();
- this.filterTab.ResumeLayout(false);
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.condition4Panel.ResumeLayout(false);
- this.condition4Panel.PerformLayout();
- this.condition3Panel.ResumeLayout(false);
- this.condition3Panel.PerformLayout();
- this.condition2Panel.ResumeLayout(false);
- this.condition2Panel.PerformLayout();
- this.condition1Panel.ResumeLayout(false);
- this.condition1Panel.PerformLayout();
- this.filterBox.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.GroupBox TreeViewGroupBox;
- private System.Windows.Forms.TreeView xmlTreeView;
- private System.Windows.Forms.GroupBox TextGroupBox;
- private System.Windows.Forms.RichTextBox XmlTextBox;
- private System.Windows.Forms.TabControl tabControl1;
- private System.Windows.Forms.TabPage addTab;
- private System.Windows.Forms.TabPage loadTab;
- private System.Windows.Forms.TabPage editTab;
- private System.Windows.Forms.Button loadButton;
- private System.Windows.Forms.GroupBox optionsGroupBox;
- private System.Windows.Forms.CheckBox generateCheckBox;
- private System.Windows.Forms.CheckBox validateCheckBox;
- private System.Windows.Forms.GroupBox addElementGroupBox;
- private System.Windows.Forms.Label newPositionLabel;
- private System.Windows.Forms.ComboBox positionComboBox;
- private System.Windows.Forms.TextBox newTitleTextBox;
- private System.Windows.Forms.Label newTitleLabel;
- private System.Windows.Forms.Label newISBNLabel;
- private System.Windows.Forms.Label newPriceLabel;
- private System.Windows.Forms.TextBox newISBNTextBox;
- private System.Windows.Forms.TextBox newPriceTextBox;
- private System.Windows.Forms.Label newPubDateLabel;
- private System.Windows.Forms.Label newGenreLabel;
- private System.Windows.Forms.TextBox newPubDateTextBox;
- private System.Windows.Forms.Button addNewBookButton;
- private System.Windows.Forms.TextBox newGenreTextBox;
- private System.Windows.Forms.CheckBox generateSchemaCheckBox;
- private System.Windows.Forms.GroupBox EditElementGroupBox;
- private System.Windows.Forms.TextBox editTitleTextBox;
- private System.Windows.Forms.Label editTitleLabel;
- private System.Windows.Forms.Label editISBNLabel;
- private System.Windows.Forms.Label editPriceLabel;
- private System.Windows.Forms.TextBox editISBNTextBox;
- private System.Windows.Forms.TextBox editPriceTextBox;
- private System.Windows.Forms.Label editPubDateLabel;
- private System.Windows.Forms.Label editGenreLabel;
- private System.Windows.Forms.TextBox editPubDateTextBox;
- private System.Windows.Forms.Button submitButton;
- private System.Windows.Forms.TextBox editGenreTextBox;
- private System.Windows.Forms.Button deleteButton;
- private System.Windows.Forms.ToolTip toolTip1;
- private System.Windows.Forms.Button positionDownButton;
- private System.Windows.Forms.Button positionUpButton;
- private System.Windows.Forms.Button saveButton;
- private System.Windows.Forms.Button refreshTreeButton;
- private System.Windows.Forms.TabPage filterTab;
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.Button clearButton;
- private System.Windows.Forms.Panel condition1Panel;
- private System.Windows.Forms.Button addFilterButton;
- private System.Windows.Forms.Panel condition4Panel;
- private System.Windows.Forms.CheckBox condition4CheckBox;
- private System.Windows.Forms.ComboBox operator4ComboBox;
- private System.Windows.Forms.ComboBox condition4ComboBox;
- private System.Windows.Forms.TextBox condition4TextBox;
- private System.Windows.Forms.Panel condition3Panel;
- private System.Windows.Forms.CheckBox condition3CheckBox;
- private System.Windows.Forms.ComboBox operator3ComboBox;
- private System.Windows.Forms.ComboBox condition3ComboBox;
- private System.Windows.Forms.TextBox condition3TextBox;
- private System.Windows.Forms.Panel condition2Panel;
- private System.Windows.Forms.CheckBox condition2CheckBox;
- private System.Windows.Forms.ComboBox operator2ComboBox;
- private System.Windows.Forms.ComboBox condition2ComboBox;
- private System.Windows.Forms.TextBox condition2TextBox;
- private System.Windows.Forms.CheckBox condition1CheckBox;
- private System.Windows.Forms.ComboBox operator1ComboBox;
- private System.Windows.Forms.ComboBox condition1ComboBox;
- private System.Windows.Forms.TextBox condition1TextBox;
- private System.Windows.Forms.Label applyLabel;
- private System.Windows.Forms.GroupBox filterBox;
- private System.Windows.Forms.TreeView filterTreeView;
- private System.Windows.Forms.ComboBox matchesComboBox;
- private System.Windows.Forms.Label matchesLabel;
- }
-}
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/form1.resx b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/form1.resx
deleted file mode 100644
index f02a07c46d1dd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/form1.resx
+++ /dev/null
@@ -1,279 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAAB4AAAAfCAIAAAB/DupQAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- wwAADsMBx2+oZAAAB7ZJREFUSEvFln081Nkex79jk4eolVZh4taSDCJEHqO0KuVaepCEWFxJXaVErhAp
- eW4ozwyGkZrMSi4zxjBImBnjWfOAQsraora7r73r7vlpXtvdfe2re3f/2c/rO6/XOd9zznvO73u+3/P7
- wf8lBSVYrSqjqYs3sQGldaiLkwz8YSmrg6Ed2B2Cvd7gEgiuJ8Hlb/DXQNjjhTnREJrwu/WpCpjtAydf
- 8L4IIUm4mIKNWVSTwofmxfX6ObQ110rhTDIcD4e9PmC2F1Z9Jln1v6VtAo6ecOISXLxlQmoMax1M6R1L
- 5IoTuOJ4rvgaT5wz+KxkZDKIzlW5XgZeEbD7GGgbS9Z+TAa24BKANqWaVRP7+MlVnvgyRxTdI4jpEcZx
- hLE9gmu94vtjLx6/fN0286puYjawoRvOpsGBr8DARkL4belZgWsQhN20rmSl9k1Ec0SxHGEiV5TME6f1
- ijN6xem94tv9E8zJb4Sv34rmv+ufe8Ocmsvmj8lE52FnQLCUcH6t9ZvhgB+EZdpUtSYPTcf1TaQNPssd
- nS4VzJQPPyMPPSUPjJP6xMV8Ub1wemRu4e0PP/64uPj87b9ap18VDz1dFnUbOxu8joT2QcvlYOcRCLmO
- z6m7KXiZXNf89+gEuyO+G2ydFPUtDf3CrIMvHYxJiyik5D9glDHYDe1dUzMv/rOk2Xffo+CkcoRw6hrY
- HwZpWQlTIn0rOBYGcaTMwWd+jd0rNpmCuj5sNAaNLfiDAWc6hMF0/hlmvwe5UXqb4/6QiPapuZbOnm/n
- F5bgi+ML79jPX395twWOhv4yLDJy4OAB59L3UDs2U7vgSjGoE0DXArONxtruJ//RMXKpiXulbcAntwrW
- bgKlDUFUVlJOUVff4Mzs3A+Liy/ffd839+bB+EvpiCzY6Q7Lf964hi4cPg0JpdJ5dKkiJj6lAtbr/4wm
- eASjh73Rxif2jJwmUUFND9QIoV+zYd3mxJySdm7fkFA89uqNcP677tmFA1VMcDuFHZtEpl9AYCyk3oM8
- +pqyls1plR/QG7Zu8TxVMDCW3zNIHhBGVdIQF1lsYydCw+cmiXmkOlYbZ0QgWHjXPTsf82gY/KLB2EFC
- xqo2LF3mVh3k0zXIrcYZVf+NNvcNpY3P1IyKGU+nUmsbQB4PK/BZnf2gqgubzEDHPJNEKalj1E99SxE+
- J/aPw+kbsOPgEhflhqOndHSedE6DdAFdu5K9PbMK8EtoHXPQMJTeYpvR0JxV15jXwChqak6kUBOqaw/G
- JMNaHdAyRf9t6uqdRqFlD0/Fowrgj+OicrD6xMItvwr2+cjGFS3Pa5QpZBAq2VbEO4DXw7hapmZ+oeY+
- IUaHfU3d/Sw8vrI85m9+LMD4qL/h0QAz31DV3YcQGkU/mXwva2gKq1XemGJCCezzBjlFhF6J0PLxxTL5
- DNkiuh6Fbf0ejdf3L7xbKpimiSfZz2eG5udm/z2PDDVQt0Y8WTgwfls4K2vigNLU9XxsvuAFugmu88dW
- JJDA6cQSGv32eMnHFSoUMJYXMHQr2ZY3l9BqhFMVD4ndwyTeMG3kScuYmDM1wZmeQA3a8BPkTO/oS+oR
- fuZwCOW+tot30dg36FZAAQEUEHTryq4A+GQZ7HKHcKJmGQuX3/h5BdvsfazVCAFltamdQ3ndg1X9ow9G
- BXSRiC4UoQalfxQ5UTrGdwmUd7qBpqH8rsNF43MxHNHlLgGEpmFAnNTSSVo6Q/DVLWQW5Daol7cYZlCw
- DFEn+JR8ndDWj3ZXgDKPP1I9MIqsgj+CusgZx+JFdYwqIfRfDGGHW7Zo9gpPdKSuG4LiwfLAEhdJxww8
- z+vl18kUMVeSWFrv81pdz72gJpLFj2/pTW3vy348gHaKDDVQN76Fd5HOCW0d+tTeFUPbut548iKpb0Lz
- Fg08wwDdExIprcUCH5W7r44D+Yx1yUvVqK7nnHsvpJEbTu+JaeZebe29zuYnsfmocbkZcwY/7PJv6l9p
- h9BGYOOaLJiN7ByF8GwMhV5SH7R9P/hf3lbG0KZ2SaHsQWi8nkMezaeeE1TfHdrICWfwIpm9yMKbeKiL
- nF61nUeahhTsUUCMYIdr/uS82u1aBAFzJwlTIhUN2O8LF4iBrIHVJCYob0CPqex8Ym9lswuZ7k5hHL/D
- 9F6y41VM1EVOR3KTcRoZNAzQqej4nvNtG4XzNzHImvUS5gdttQePsxBXEsGbwCfkg57N+0LHNvWbtsEI
- tExA3xp2e+yq50NMMbbc0F5C+4WkloH1l3AiEhLKwjnju5lDuGKWKpltUN1hca/TjvrY4T5mqIG6BtWP
- NCntCuVsKGWrVj5CS8A3EqxdQOoTCe3XQpWJbhZED8twqqBfaOYRSA2Qelcuk7qaeH9ddo3qLZpKds0q
- 4n3pTCqkUxWJNOUUCpxLA+9wbCFWgR8RGrZyBreTcDpJLuWO2z+5lzhiZ3rfpupHiiSWVCFDqrBJqbxV
- s7JdvaRJOrUazqZgky32g5yChPBR4XB6llixou+bc+koiCrZtK3lTNtqttUdtkFpkxKxBh0JXMjEJuzx
- whEsft93Gk5hNRjZg8NRbFNeFyEgFk5eRUWLvTQQ0S0IG9q6E4c+B/+g0C2jpgWE7bDNEStfZKihux1z
- YhfQnyKAnwDLOZxsk1HGXQAAAABJRU5ErkJggg==
-
-
-
- 17, 17
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAAB4AAAAfCAIAAAB/DupQAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- wwAADsMBx2+oZAAAB4xJREFUSEvFlnlUk1caxt8AVSnMSFkiCkkAQdbIooiIigpSpR4XFBRR3MAWQQWR
- oq1sLuy7IwIiYSkgIAEELUsSFlkMkBASlhASghGoMiBQ0HGqHeZ+zndmTj3OtJ0z58xz7h85J9/95eZ9
- nvf9LvwOEQhAkMM//w+kqEwgGRGstsEmF9jiClvdYPN+sHEGAytQIeLP/F4RlijBantwOgIHz4NXGPjF
- QGAyfJ0K5+PBOwLcA8H5OKzfBRpkfMNvFEHHDJw84NglCEzVT686/KgzhC2K40nRiu0eDmkXHnnIJicV
- g1c4fHESVm/Gt/26qJtg31dwPoF8uwoRo3tGIrqHQzkStEI44qvc4QLxDw3j0/WjU5GdItWoPDgUABt2
- wyeL8e3/VqgIrmchOG135ZMEgQzhIjiSSK4kpns4njcc1yO9JfyB9Xx2aPZ1//R824vZByMTdnm1cDQY
- Nu4D+U9wyEe00gJcfBDXo4YTzX8awZMm9o+mi57nSia+E7/IGxyPzCn5Nia5rKldNDkz9/bd3E9vBS/n
- akentt9jgUcQrHXCOR9K+TNwOgoXkuxLHycOTSSL/xzP7j9DK3O9lrrTP9QtLD5NIKNLJ/Lbe+Izchqf
- dP04/2phYeHtzz8PTM/Xjb40TiuHvT5AMcVpv9AaRzgV8mky/e7Tl8duJKuttgN1A1hhCiQqkM1BVc/v
- sdCzsj24UXCnXZBbUt4jHPrrT28R/c27d7ypuWLxc7iYDFsPgrwCDsT1B1VwPgGX032b+yj0DjnfG6Cm
- B0brwdgWX8sMv2FyrzTyguo5fgze8Zt5JdW1/RLp6zdv/rawIJt73Tk5d6SqHQ76A0rXL2RoDccvKyTc
- V6Q1LLnLsCjv3JZbC2Tqv+jLTYJKa5M7BqJb+FebeFfahCprHcrqGrr7hWMzcyNzfxHOvEKWQkAC2O3B
- mbg27YMLCXCzCrIY2nkNDtXcVd6XQdcCg65ah/2Alplven5B33BmZ3/Kk95EjtjcO0jZwr60htXa0yeZ
- fzM0+6rlxazRLTrsOAZKS3EsLP4UdhyVD8siZNQtzmYYFzVvL2QB0QAjGlgvtd0BmsagTXUPj62TjZX0
- imjcgTSu6NSdEmSGkfOh7JJy5vg0c2yqWDqxvbgBDpyF5Xo4GZsGe79Uii2CzPo/0pjryjsongGga4mh
- iYbFw8+vFNBhkebewBDO5EStWHK/T0TjiUK/bwVNI+Sz16WIbJ44tfdpVM/IoeoOLOMoxLg0SHDATyWx
- FO4wVGmszY96FpnbY3XQszI8cKpEMl4z8uyxTDY4M9E7MdomG6keFBf2Dt2ob8fQBtYqVlsKBFg3oaY9
- Wc+Dk6FgYouTMbSrn1oKHTIZarks++pu0DLBjkyiukWnFQ5IHwjFbc+eDk6OSafHBmYnm8bGS4XSi4VV
- WDTRY6orMziiJD42DzA0mmWmG3AyqGuDyxnNlDLs1Dksu/IOWGH03jpT39zyXIGY3j/UIJVyxmWSVy+3
- eZ1zD4tmTs07X4oCijkY2oC2WTjvWTJfeo037PqwE05cAeN1OBnrw12nVOMKFWksZRrTppoHlPex0zL1
- ya3I7BYV8gerBsUMyTD/xxnMA03jxeb2StaOsMoGFY3o4n2iaSCZP3KdN7KxqAHreIoJTgY5eXBwJ3xz
- W7+oRS6r3qyCo7xxNxisRQXZH5eV0iXK6Oov6BGW9olqZONbfYJAxwJzAnHRz5OpuyrYTlVdifyRGIFM
- PakU9vmA2gqcjMn6c/jq2obSFsio0y5u0wmIwvpF19L0mH9Mlziulf8ndm9mVz8qjn9OGVbif/QRQuuv
- WbrjsGUBK77vWWinGC6mwnYPUFiEYzFpG4LrOe2b5fol7Sja5hUc0DHHjkYxD2FLQhp415t7UB/GtgqS
- uyWw7L0T/6RrmRBN1t2UzdoUNWIeWjniTFxyCrDtIPgnHK7rhqz6ZYUtq2LygKgP5NVrL1wPahEG1nGC
- GdxLDG44W6zhcACVGPQsgWSGlpzjIYvE/Oi+Mfj2Duw5jYXiQ6Gcu51TiCrwaxuEjFpyWSclOBE0VoKG
- vst3dafred7VbO+H7C/ruu1CU5ANJI/z1Ng8o0qufGHbiXaxZtoD8AoFm5047UOhyeIVpnW7KrBDTMiq
- 1yx5YpBSKofyv5S09Vbp/kq2S1nrnrLW3Q86nWv46ys6dYtaFLOZhLtMaj4TLiTC50ewCfpxoS8cD8OZ
- SK306nCulHKvRSGbtbKSR4mkqR0NsKOzbYuarYuaqAWNevkN6jksFKcltAaV9EcQfAv2eIMOFed8XEQy
- ZrHPNfnYYt/H/d5tg8uy6yDxvnLG96ibNHKYn9GYStlM+bsMyGIS85sUU8ohKAUrsZENTvhPUtfCrjKe
- weglqZlU4kZvPtvc+wVDYEZnk+61kO616he3amfXE9Fhr+agyMJOT9C3xPf+uhYpgpUDmrTg+TWKDYTn
- KCeVkTIfkjMfqaRWQDgNOykyDRXBdheoLsd3/XYRVIgE8y2oUWHvaXAPwP4HuvR4XMTe+sgxG2fCcj0C
- /ux/J3R3QVFFY8FgDbZ0qQQiGbu2/d8E8HfFSE6iQQnYUAAAAABJRU5ErkJggg==
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAAB4AAAAfCAIAAAB/DupQAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- wwAADsMBx2+oZAAAB7ZJREFUSEullnlUU9cWh3dQqlAVrcjgwBMhVKhiBURQBCwCWlB5ClJF0KqtVXCo
- U3EJgoKEIchQRcYwBmRQEAUhCUlIgpEhE4mADAmDVgYRgvIebUV7brx9PrtcrV39rfPHvXfd85199t5n
- 7wMfKrUpMFUdpkzFX/+ppn4EC4xhhQPYeYCjF3zhDet3gP02WOUChubw8Wz8t7+nKeqw1BoD/fs72HMW
- DkXA8ctw5kc4nQj+UbAvGDyPgLMPWG6AWdr4lA+S3mJw8ATvYxAQrRmZ71rC+Z4jixLJyeJuslgRJZSf
- 4sjcitkaIangG4gt8Kk1PvEvZGwBG/3gYBhcyttHF8U294SJFCFC+XlBV7CgM7ipk9zcXd4zxHz87HbP
- 0LfVTXAmETy+AysXIBBwwvtFtIDN++F4rGFaZYy4+4III4YJu0iirmiRPFbWS5b2UtoeCYaUHcpxyfBz
- 9k8jOW2P9GLywesorNqIQ94jfSPYtBe+v7wsm35Z2ougESJ5nERxTdqdLuvJaX8SU0aLLKqgtvY1DIz2
- jv1n/NeXg//9+f6gskwxYJhQDNsDwNwBR70j9elY0PwjdJJux8v6SGLFFVlPZFNHUF1LEFdGauryj00O
- jIqPTM6MziyofaLsGn3x6+Tk69evX/zysmlorFQ+oBWWCW77MPv+qGV24HMKLuaQJT3ID64VjaZ5LOs8
- lmshZ9sN3gGmTO3z9aC7dPoK+w1+h7iDzwX9I4PjE69evUL00Ylf6geViWI5HI6AddsA/t/pGjOwQJ9M
- 2H6n0a1arJZaTcxhOhVyt9+s21vOP1zZEHy/Q2uNGxBXgYk1zDUK5HfcaO1rHVYOjU+8fPXq5eRkp3Kc
- P6D8Io8G2w7DoqU4FtMSc9h5AiKohgU8SKlekstywIyt+/r2/aNVTWdrhHFixSd2KvRSG5hvFi1S+Fc2
- UMRdbcNjfWPj/eMTirFx2cgLSksvcinYuuNYTGs2QwAJ4ssgla6dxbTMr3Uv4fmW849UNZ5jikhcSVbb
- I207dxytb5rW+iiELQq425Ai7BANjLQNP5crx9uV49z+Uf3oPHDxBU0tFRedZmcfwrlratfuTslgLM5l
- ORZyvErrDlY0BDKEEVzJlfoHt7qf6Ni7gzGOLpb3x9Q1BzFF+2/fz2mWM7oHuY+Hef0jpd1DdrnIJ/6/
- B3PmJ7DlwLRLOWqpdA1KjWke27WI53Pr3tGqxhCWKI4vzRS2svuH9DC0lQptVvV4CK0XzpGcoAl8b927
- 8fBR1oPepAdY1nuU1sHuM2BiqULPnY98r0UuRN6YmclcQa11K+Gi6KFpaPLVellB88PGZ8/mO2zG0Xqm
- nMHhtKaWaF5zYI1wTzk/lCujoEwVdV0Qyn2rBFiFWb5OhdYxAE9/7bgSSGPMzmKupLI3l6AA8s9xW2Ib
- 2pIbW4pk7ZLRkQWOb9H3nj6jCFvJddIQ7oMAhgQlUn5rX7S466JYvocmhAMhYOGkQs9dgKzWjitG6FmZ
- zM9VMTzElNoeu7A1LDG/86dC6UPByDtW84aeZQhak5q7vRNzVp8I33pHEC/sJIvlF0XyHRWNmNXm9ir0
- rLnI17OjqZoUpgaF8Rmy+laDbVA8yl+Ya+x0/HzF46e8waf6b9FmjCdPqR2Pt0dchTlLYJ4x8Vj4aX47
- WaIIFyvWF7LB9wcwsVKh1aeBiw8hKNkwn6OWTkdJ7XyD755RDtpGGGieievJ0PqJSd23GWLGVP68MzoZ
- Wxu9ahtZRmX5MCQxEgWpuWfRlVLwOgILiCo00tqtKK9XF3EhhaaXzbQpqPWqFG5JKgId4hu6d3iCodtO
- HL1kZQClBOfqEG1CrziVC1zK66Mk3SSRAgKvwZd7YMYcnIzV0l0njVNu61K5GhkMlH8birh+NIlHUiHM
- U9ENVsBSW+wBG7ZgYP6Guzb0R0+a1DyPva7sfqysZ1MZHw5fwrrdW32sBRt9UX/aRRejg66bzbQsqN1U
- zNtLl2y9UoDT0TC1xcabZ8Q9n7iTLrW7zpmfVeNwpzHhQR+E5cKOI2C4DMfiWuEIfmfmJd78iiWD5KpF
- OSxrFd2XJtmUQMU98z+0DnF1UJw3XWpfyDHJY09Jox3gtVpRWRAQiXXnP3b96TPAaScERK29XuvFRPTq
- hdlMi/xaVP8874odY3NxOhq6xJVnYz2qpbYFtca5bK3MGhQhP7TdH5LA4yAYmOHAd2RgCu77UWndcLPO
- n9+OskWLwkBGWeXXOt8RWpAooI1SzejT09GOFZJlVPbCHJYmhQHpjAXZTAihwK4TYOmMo94jM1ts5ZMJ
- pln0MFG3RVk9cv0sCgPtwPRGw7/I1IXhGSZlQv1s5kxKDaTTp2ex5qXTIJQCvmdgzRbsGvRnQnT3fZjX
- SPnb7wqChYr1lcI5ubWQSiOQcgmXsiDhJmTUzM7l6GezNOJLIfAqeB8FG3fsfPy1kGecvoLdp+FkPITn
- Lc+p2VYp8C7lbLzOtMmlLU8pJ6ZVTrtcAkEp8G0ofLn392P9gUJRRfcx1NXQRefgRfAnoU4PpxLhVAIc
- J8M3IVgjdfsaM1Z7ET7l70lzJixeRljlijV7l92wyQ9cfbENrdlCQFViji7+2z8RatEE9WmEaZqEjzQI
- BDX8658L4Df7IJnYzd+2ZQAAAABJRU5ErkJggg==
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAAB4AAAAfCAIAAAB/DupQAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- wwAADsMBx2+oZAAAB6VJREFUSEutlnlcU1cWx89DLLI4tshWQVRQFo2ioCgqVWGogAiyVHHBiHXDBSii
- dVBkVSgIaJ0KCgRMArJvAhqSkJ1VkrAWBJKA4FLFCoLWKdTeh8+ZOh+nH9vO7/M+74/3efd7f/fcc869
- 8IHCAMOmKGNKyhjx4a8JUTDduRhpDazdAhu2gr032G2DdV7YSifMeCk2XZP47w8Jhxpb4Dj3Q0AOgcMx
- cPwShCRjIckQmAD7I8A7CBzJgObQ1CPGfJBmzgJbd/jiGBz9Ri0227FQGCzoiJPI46WKeKk8QSoPq+/a
- UV6rF5cFvmfAaQ8s+QwwJWLs72nOItjoAwciIJpGrhIntPRFSeRh4t6zTT3oCW3qiWtWlCh+4D34kXFv
- KLSmQyOSAl/4wxpXUFElCO/XnIWwaQ/4x+sn34yTyiMkMoSLEvfGSmTxEllia39i+73Ujnv1j571DI+1
- PR0VPXxWLH9kmV4BO0/gC1X+iOD8tzQ/xf0GxBul3UKUsKbeGKnsUos8pU1Bae/Llj+5zKyJvp5P7xwQ
- 3X+qGBl78fP48KufpUPPbw8MraMzYUcwWDsRqHeFga0HHIpUv1iU1NYf2yz/tlURWtcZxG0NrG4Ol/Tt
- TUwlB50+n0y5kJnDuf+s6+nzn8YnXr9+/a/xCWSfMTBk+l0RuPvB/GUE7z9Cn7YFwNmMc02yM009tiX1
- RtfZq7K4Tnl8X27H4qNhMNMYDC3QY+609VwqtXX41cDoy/GJXxAd2Rc/eZ7b8wBOfosnqIoawcSlNAU2
- bIPAC/YFwo23JXCVMZ/Ksc8VeBaJAkR3rQMjQNcUzFaBuQ3+NraCTxd6BITIXr1+MPrTq/GJiYlfFCMv
- Gh6PkCvqYHsQmK4gsLhmGYPXEYiial3nwDXGPBrnsxy+eyHOXRkYSXBNrHH0G/r85WC4xNLLt+flhHz4
- xeDoS8XzF9//OFre9xg7cQnVFIHFtWwDHAiHhEJIZWlmVi/L5m3KFx4Rdq0MQH5NwHQVAmmuccbpZjaw
- YIWW7WaYtwzmLiW5+XSMjbc+Gel+Nto9PCZ8NGxxtRQ2fQmf/LuO1nvB8aSPkiuxNJYBlWObw99V1Wzl
- H05wNY2TWELLHQfByAp3rWt6c3BIzcoeocFgscO+AO7DEWb/Y9bAUJ7sB5dCAXh/BfNIk9ypKvD5LuWz
- qVOvVk1NZy2gcT8vqPGgM2CGIZiuRNywgsr6kTGSx24CrWVSoRjM7h5UfUPXNonMyKV1P7jUoohpVpBv
- N+ElSlo7iVb7GzjvUY3KVE5lTqOwF6KsyBfuq5IqobXPmHMyp7xENlD3+LGFJ/ktegGzb4DacjelrQ+n
- q+q5xKTc6HkYJ+kNl/Qe5rTgHcbK4S16k6/GeerUNJYahbWIznMuEJDL6k/X3E24050q7c5p7WwcGlr6
- GzS7f5Aq7UqqbYtp7ParbHArbbje3ndBKovA0a1wMAqsHSfR09TBiawenalOYatQ2OZ0rmOe0Ke0NpBx
- J4rffLmuLaulq/Zd11V9AxmSzgui1tPVEr9bjS75grOijqRmeaREtpshhn3hYGk3iZ6iDPbbsZAr+jSu
- UhrTmMaxzxNsL6k5eqsxlCNJqGmliL9nDT4iub+NtbZJaU9/SmPHeUHzSWbTvvJ653yBL0Oc1KKIlsr/
- ns+H3afAbOUkGmmNGxyLXZzNg2tMfSpnbQ7fo0i0v7wejTw3abxIdt9siw9eLJNoeoc8sbYtjCPxv33H
- p6zWIVfgXFqX0KKIbekzuFyMd2P9BQQZzKzB52uLDIZSOntGBtticid3ltYi4yFsMXJH6eif77qLQOuY
- fCfpjuQ3B1c1oem9ikVrb/BsCmviWhRRYhl8fQUcd4P6DIIMn+iCy5cQlu5Q0YSqfA4NN76lULSnrPbY
- 7cZTbHGCWDbX5S1a1/RcXecJlvhQRQOKGzJBonMsC2qS2u/Z5vLhYCTYuBBYQjabUfu3zeEa5AinpTPN
- 6Fy7XIF7kYhcVotyAGWLgfNOAq1nGsxtOzDJ3VQgXHWDr5PJtilr+KZZAaFp4OH3m2i8kY4hbvzUlcO8
- do1MjkY6CyX4+ly+a4HIu6TGj9Om6+gN8wn0XobYq7jGMR9xeXNpqO1UHRJ1zUouxy2jbXuPltrBzmB0
- boU09Ohk8VXSmKgy0WCHPIHnLam243a8b6D61DbeUiFZnytYms2bTeVMS2cpUapXZHEg6CJKYpipT9De
- kZIyrHWHvachJusf9d0bKsUo7loZbFM6d3mu0OraTdy1nolh4HnLwnojGlcrsxpLY6pmcj5OqUTLBfeD
- YLKcQL1HqtPxlugbAmcpruUNIU0yUmEdWq9qGlObxp9N48zOZOlm8TUo7ClpLEhj6VB5qpeK8RMA3SlI
- tgTkfwoV5+rNsM0fjl9USShwq2g81djjyWkj3eBpJ5ep/bNkxpWyuXm1s+k8nau3ICIT/KJRC3q3/f++
- zFfBxl3gcxK+SoTQ9OkXixZkMCzo1YuorFkp5RCTDWeuwZFz4HkYP8i1DYlRHyqNj/HeaLcV3A7AzuOw
- 9wx+OdkfhocLnaJox1a7gqE58fOfEdpbLX0wWowtWo1ZrMOW2GJorwxM4M9d+P4/AvgVfdiJ1gRIRIEA
- AAAASUVORK5CYII=
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/output-build.txt b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/output-build.txt
deleted file mode 100644
index dcfb2c1ca19d8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/output-build.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-1>------ Build started: Project: XMLProcessingApp, Configuration: Debug Any CPU ------
-1> XMLProcessingApp -> C:\Users\normesta\Desktop\XMLProcessingApp\CS\bin\Debug\XMLProcessingApp.exe
-========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/packages.config b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/packages.config
deleted file mode 100644
index b711f7386e5a5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/packages.config
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/program.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/program.cs
deleted file mode 100644
index 756ea3f1b5ea3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/program.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Windows.Forms;
-
-namespace XMLProcessingApp
-{
- static class Program
- {
- ///
- /// The main entry point for the application.
- ///
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form1());
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/refreshtree.png b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/refreshtree.png
deleted file mode 100644
index ced06520cdead..0000000000000
Binary files a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/refreshtree.png and /dev/null differ
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/save.png b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/save.png
deleted file mode 100644
index 5389f58d8e382..0000000000000
Binary files a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/save.png and /dev/null differ
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source.cs
deleted file mode 100644
index 4f37e03e80de4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Xml;
-
-public class Sample
-{
- public static void Main()
- {
- //Create the XmlDocument.
- XmlDocument doc = new XmlDocument();
- doc.LoadXml("" +
- "" +
- "Pride And Prejudice" +
- "");
-
- //Display the document element.
- Console.WriteLine(doc.DocumentElement.OuterXml);
- }
-}
- //
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source1.cs
deleted file mode 100644
index de0ebd477daed..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source1.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-using System.Xml;
-
-public class Sample1
-{
- public static void Main()
- {
- //Create the XmlDocument.
- XmlDocument doc = new XmlDocument();
- doc.Load("books.xml");
-
- //Display all the book titles.
- XmlNodeList elemList = doc.GetElementsByTagName("title");
- for (int i = 0; i < elemList.Count; i++)
- {
- Console.WriteLine(elemList[i].InnerXml);
- }
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source2.cs
deleted file mode 100644
index 636f86b373a3d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source2.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-using System;
-using System.Xml;
-
-public class Sample2
-{
- public static void Main()
- {
- XmlDocument doc = new XmlDocument();
- doc.LoadXml("" +
- "Pride And Prejudice" +
- "19.95" +
- "");
-
- XmlNode root = doc.FirstChild;
-
- //Display the contents of the child nodes.
- if (root.HasChildNodes)
- {
- for (int i = 0; i < root.ChildNodes.Count; i++)
- {
- Console.WriteLine(root.ChildNodes[i].InnerText);
- }
- }
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source3.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source3.cs
deleted file mode 100644
index f819d58f68eca..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source3.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-using System.Xml;
-
-public class Sample3
-{
- public static void Main()
- {
- XmlDocument doc = new XmlDocument();
- doc.LoadXml("" +
- "Pride And Prejudice" +
- "19.95" +
- "");
-
- XmlNode root = doc.FirstChild;
-
- Console.WriteLine("Display the price element...");
- Console.WriteLine(root.LastChild.OuterXml);
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source4.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source4.cs
deleted file mode 100644
index 7a3bff19bb850..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source4.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-using System.Xml;
-
-public class Sample4
-{
- public static void Main()
- {
- XmlDocument doc = new XmlDocument();
- doc.Load("books.xml");
-
- XmlNode currNode = doc.DocumentElement.FirstChild;
- Console.WriteLine("First book...");
- Console.WriteLine(currNode.OuterXml);
-
- XmlNode nextNode = currNode.NextSibling;
- Console.WriteLine("\r\nSecond book...");
- Console.WriteLine(nextNode.OuterXml);
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source5.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source5.cs
deleted file mode 100644
index 3f19b7b5e91cd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source5.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-using System.Xml;
-
-public class Sample5
-{
- public static void Main()
- {
- XmlDocument doc = new XmlDocument();
- doc.Load("books.xml");
-
- XmlNode lastNode = doc.DocumentElement.LastChild;
- Console.WriteLine("Last book...");
- Console.WriteLine(lastNode.OuterXml);
-
- XmlNode prevNode = lastNode.PreviousSibling;
- Console.WriteLine("\r\nPrevious book...");
- Console.WriteLine(prevNode.OuterXml);
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source6.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source6.cs
deleted file mode 100644
index 62eefdca4bfb5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source6.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-using System;
-using System.Xml;
-
-public class Sample6
-{
- public static void Main()
- {
- XmlDocument doc = new XmlDocument();
- doc.Load("booksort.xml");
-
- XmlNodeList nodeList;
- XmlNode root = doc.DocumentElement;
-
- nodeList = root.SelectNodes("descendant::book[author/last-name='Austen']");
-
- //Change the price on the books.
- foreach (XmlNode book in nodeList)
- {
- book.LastChild.InnerText = "15.95";
- }
-
- Console.WriteLine("Display the modified XML document....");
- doc.Save(Console.Out);
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/uparrow.png b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/uparrow.png
deleted file mode 100644
index 435a984775157..0000000000000
Binary files a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/uparrow.png and /dev/null differ
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/xmlhelpermethods.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/xmlhelpermethods.cs
deleted file mode 100644
index b9b8b2e63c956..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/xmlhelpermethods.cs
+++ /dev/null
@@ -1,635 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Xml;
-using System.Xml.Schema;
-using System.IO;
-using System.Collections;
-
-namespace XMLProcessingApp
-{
- public class XMLHelperMethods
- {
- #region Load and save XML
- //************************************************************************************
- //
- // Loads XML from a file. If the file is not found, load XML from a string.
- //
- //************************************************************************************
-
- public XmlDocument LoadDocument(bool generateXML)
- {
- //
- XmlDocument doc = new XmlDocument();
- doc.PreserveWhitespace = true;
- try { doc.Load("booksData.xml"); }
- catch (System.IO.FileNotFoundException)
- {
- doc.LoadXml(" \n" +
- " \n" +
- " \n" +
- " Pride And Prejudice \n" +
- " 24.95 \n" +
- " \n" +
- " \n" +
- " The Handmaid's Tale \n" +
- " 29.95 \n" +
- " \n" +
- "");
- }
- //
-
- return doc;
- }
-
- //************************************************************************************
- //
- // Loads XML from a file. If the file is not found, load XML from a string.
- //
- //************************************************************************************
- public void SaveXML(XmlDocument doc)
- {
- doc.Save(Constants.booksFileName);
- }
- #endregion
-
- #region Validate XML against a Schema
-
- //
- //************************************************************************************
- //
- // Helper method that generates an XML string.
- //
- //************************************************************************************
- private string generateXMLString()
- {
- string xml = " \n" +
- " \n" +
- " \n" +
- " Pride And Prejudice \n" +
- " 24.95 \n" +
- " \n" +
- " \n" +
- " The Handmaid's Tale \n" +
- " 29.95 \n" +
- " \n" +
- " \n" +
- " Sense and Sensibility \n" +
- " 19.95 \n" +
- " \n" +
- "";
- return xml;
- }
-
- //************************************************************************************
- //
- // Associate the schema with XML. Then, load the XML and validate it against
- // the schema.
- //
- //************************************************************************************
- public XmlDocument LoadDocumentWithSchemaValidation(bool generateXML, bool generateSchema)
- {
- XmlReader reader = null;
- XmlReaderSettings settings = new XmlReaderSettings();
- // Helper method to retrieve schema.
- XmlSchema schema = getSchema(generateSchema);
-
- settings.Schemas.Add(schema);
- settings.ValidationEventHandler += ValidationCallback;
- settings.ValidationFlags =
- settings.ValidationFlags | XmlSchemaValidationFlags.ReportValidationWarnings;
- settings.ValidationType = ValidationType.Schema;
- if (!generateXML)
- {
- try
- {
- reader = XmlReader.Create("booksData.xml", settings);
- }
- catch (FileNotFoundException ex)
- {
- Console.WriteLine(
- $"XML file not found so generating: {ex.Message}");
- generateXML = true;
- }
- }
-
- if (generateXML)
- {
- string xml = generateXMLString();
- StringReader stringReader = new StringReader(xml);
-
- reader = XmlReader.Create(stringReader, settings);
- }
-
- XmlDocument doc = new XmlDocument();
-
- doc.PreserveWhitespace = true;
- doc.Load(reader);
- reader.Close();
-
- return doc;
- }
-
- //************************************************************************************
- //
- // Helper method that generates an XML Schema.
- //
- //************************************************************************************
- private string generateXMLSchema()
- {
- string xmlSchema =
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " ";
- return xmlSchema;
- }
-
- //************************************************************************************
- //
- // Helper method that gets a schema
- //
- //************************************************************************************
- private XmlSchema getSchema(bool generateSchema)
- {
- XmlSchemaSet xs = new XmlSchemaSet();
- XmlSchema schema = null;
-
- if (!generateSchema)
- {
- try
- {
- schema = xs.Add("http://www.contoso.com/books", "booksData.xsd");
- }
- catch (FileNotFoundException ex)
- {
- Console.WriteLine(
- $"XSD file not found so generating: {ex.Message}");
- generateSchema = true;
- }
- }
-
- if (generateSchema)
- {
- string xmlSchemaString = generateXMLSchema();
- StringReader stringReader = new StringReader(xmlSchemaString);
- XmlReader reader = XmlReader.Create(stringReader);
-
- schema = xs.Add("http://www.contoso.com/books", reader);
- }
-
- return schema;
- }
-
- //************************************************************************************
- //
- // Helper method to validate the XML against the schema.
- //
- //************************************************************************************
- private void validateXML(bool generateSchema, XmlDocument doc)
- {
- if (doc.Schemas.Count == 0)
- {
- // Helper method to retrieve schema.
- XmlSchema schema = getSchema(generateSchema);
- doc.Schemas.Add(schema);
- }
-
- // Use a callback to validate the XML node against the schema.
- doc.Validate(ValidationCallback);
- }
-
- //************************************************************************************
- //
- // Event handler that is raised when XML doesn't validate against the schema.
- //
- //************************************************************************************
- void ValidationCallback(object sender,
- System.Xml.Schema.ValidationEventArgs e)
- {
- if (e.Severity == XmlSeverityType.Warning)
- {
- Console.WriteLine
- ("The following validation warning occurred: " + e.Message);
- }
- else if (e.Severity == XmlSeverityType.Error)
- {
- Console.WriteLine
- ("The following critical validation errors occurred: " + e.Message);
- }
- }
- //
- #endregion
-
- #region Find XML elements and attributes
-
- //************************************************************************************
- //
- // Search the XML tree for a specific XMLNode element by using an attribute value.
- // Description: Must identify the namespace of the nodes and define a prefix. Also include the
- // prefix in the XPath string.
- //
- //************************************************************************************
- //
- public XmlNode GetBook(string uniqueAttribute, XmlDocument doc)
- {
- XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
- nsmgr.AddNamespace("bk", "http://www.contoso.com/books");
- string xPathString = "//bk:books/bk:book[@ISBN='" + uniqueAttribute + "']";
- XmlNode xmlNode = doc.DocumentElement.SelectSingleNode(xPathString, nsmgr);
- return xmlNode;
- }
- //
- //************************************************************************************
- //
- // Get information about a specific book. Pass in an XMLNode that
- // represents the book and populate strings passed in by reference.
- //
- // **********************************************************************************
- //
- public void GetBookInformation(ref string title, ref string ISBN, ref string publicationDate,
- ref string price, ref string genre, XmlNode book)
- {
- XmlElement bookElement = (XmlElement)book;
-
- // Get the attributes of a book.
- XmlAttribute attr = bookElement.GetAttributeNode("ISBN");
- ISBN = attr.InnerXml;
-
- attr = bookElement.GetAttributeNode("genre");
- genre = attr.InnerXml;
-
- attr = bookElement.GetAttributeNode("publicationdate");
- publicationDate = attr.InnerXml;
-
- // Get the values of child elements of a book.
- title = bookElement["title"].InnerText;
- price = bookElement["price"].InnerText;
- }
- //
- //************************************************************************************
- //
- // Uses filter criteria collection in the UI to retrieve specific elements and attributes.
- //
- //************************************************************************************
- public XmlNodeList ApplyFilters(ArrayList conditions, ArrayList operatorSymbols,
- ArrayList values, XmlDocument doc, string matchString)
- {
- XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
- nsmgr.AddNamespace("bk", "http://www.contoso.com/books");
-
- string xPathQueryString = "//bk:books/bk:book[";
- string xPathQueryEnding = "]";
- ArrayList xPathQueryStrings = new ArrayList();
- string booleanOperator;
- if (matchString == "Any")
- {
- booleanOperator = "or ";
- }
- else
- {
- booleanOperator = "and ";
- }
- int counter = 0;
- string[] operatorArray = (string[])operatorSymbols.ToArray(typeof(string));
- string[] valueArray = (string[])values.ToArray(typeof(string));
-
- foreach (string condition in conditions)
- {
- string xPathQueryPart = "";
- string operatorSymbol = operatorArray[counter];
- string value = valueArray[counter];
- if (counter > 0)
- {
- xPathQueryString = xPathQueryString + booleanOperator;
- }
- counter++;
-
- switch (condition)
- {
- case Constants.Title:
- switch (operatorSymbol)
- {
- case "Contains":
- xPathQueryPart = "contains(bk:title,'" + value + "')";
- break;
- case "Excludes":
- xPathQueryPart = "not(contains(bk:title,'" + value + "'))";
- break;
- case "=":
- xPathQueryPart = "bk:title='" + value + "'";
- break;
- }
- break;
- case Constants.ISBN:
- switch (operatorSymbol)
- {
- case "Contains":
- xPathQueryPart = "contains(@ISBN, '" + value + "')";
- break;
- case "Excludes":
- xPathQueryPart = "not(contains(@ISBN, '" + value + "'))";
- break;
- case "=":
- xPathQueryPart = "@ISBN='" + value + "'";
- break;
- }
- break;
- case Constants.PubDate:
- xPathQueryPart = "contains(@publicationdate, '" + value + "')";
- break;
- case Constants.Price:
- switch (operatorSymbol)
- {
- case "=":
- xPathQueryPart = "bk:price='" + value + "'";
- break;
- case ">":
- xPathQueryPart = "bk:price>'" + value + "'";
- break;
- case "<":
- xPathQueryPart = "bk:price<'" + value + "'";
- break;
- case ">=":
- xPathQueryPart = "bk:price>='" + value + "'";
- break;
- case "<=":
- xPathQueryPart = "bk:price<='" + value + "'";
- break;
- case "<>":
- xPathQueryPart = "bk:price!='" + value + "'";
- break;
- }
- break;
- case Constants.Genre:
- xPathQueryPart = "@genre='" + value + "'";
- break;
- }
-
- xPathQueryString = xPathQueryString + xPathQueryPart;
- }
-
- xPathQueryString = xPathQueryString + xPathQueryEnding;
-
- XmlNodeList nodeList = doc.DocumentElement.SelectNodes(xPathQueryString, nsmgr);
-
- return nodeList;
- }
-
- #endregion
-
- #region Add XML elements and attributes
- //************************************************************************************
- //
- // Add an element to the XML document.
- // This method creates a new book element and saves that element to the
- // XMLDocument object. It addes attributes for the new element and introduces
- // newline characters between elements fora nice readable format.
- //
- //
- //************************************************************************************
-
- //
- public XmlElement AddNewBook(string genre, string ISBN, string misc,
- string title, string price, XmlDocument doc)
- {
- // Create a new book element.
- XmlElement bookElement = doc.CreateElement("book", "http://www.contoso.com/books");
-
- // Create attributes for book and append them to the book element.
- XmlAttribute attribute = doc.CreateAttribute("genre");
- attribute.Value = genre;
- bookElement.Attributes.Append(attribute);
-
- attribute = doc.CreateAttribute("ISBN");
- attribute.Value = ISBN;
- bookElement.Attributes.Append(attribute);
-
- attribute = doc.CreateAttribute("publicationdate");
- attribute.Value = misc;
- bookElement.Attributes.Append(attribute);
-
- // Create and append a child element for the title of the book.
- XmlElement titleElement = doc.CreateElement("title");
- titleElement.InnerText = title;
- bookElement.AppendChild(titleElement);
-
- // Introduce a newline character so that XML is nicely formatted.
- bookElement.InnerXml =
- bookElement.InnerXml.Replace(titleElement.OuterXml,
- "\n " + titleElement.OuterXml + " \n ");
-
- // Create and append a child element for the price of the book.
- XmlElement priceElement = doc.CreateElement("price");
- priceElement.InnerText= price;
- bookElement.AppendChild(priceElement);
-
- // Introduce a newline character so that XML is nicely formatted.
- bookElement.InnerXml =
- bookElement.InnerXml.Replace(priceElement.OuterXml, priceElement.OuterXml + " \n ");
-
- return bookElement;
- }
- //
-
- //************************************************************************************
- //
- // Add an element to the XML document at a specific location
- // Takes a string that describes where the user wants the new node
- // to be positioned. The string comes from a series of radio buttons in a UI.
- // this method also accepts the XMLDocument in context. You have to use the
- // this instance because it is the object that was used to generate the
- // selectedBook XMLNode.
- //
- //************************************************************************************
- //
- public void InsertBookElement(XmlElement bookElement, string position, XmlNode selectedBook, bool validateNode, bool generateSchema)
- {
- XmlDocument doc = bookElement.OwnerDocument;
-
- string stringThatContainsNewline = bookElement.OuterXml;
-
- switch (position)
- {
- case Constants.positionTop:
- // Add newline characters and spaces to make XML more readable.
- XmlSignificantWhitespace sigWhiteSpace = doc.CreateSignificantWhitespace("\n ");
- doc.DocumentElement.InsertBefore(sigWhiteSpace, doc.DocumentElement.FirstChild);
- doc.DocumentElement.InsertAfter(bookElement, doc.DocumentElement.FirstChild);
- break;
-
- case Constants.positionBottom:
- // Add newline characters to make XML more readable.
- XmlWhitespace whitespace = doc.CreateWhitespace(" ");
- XmlNode appendedNode = doc.DocumentElement.AppendChild(bookElement);
- doc.DocumentElement.InsertBefore(whitespace, appendedNode);
- sigWhiteSpace = doc.CreateSignificantWhitespace("\n");
- doc.DocumentElement.InsertAfter(sigWhiteSpace, appendedNode);
- break;
-
- case Constants.positionAbove:
- // Add newline characters to make XML more readable.
- XmlNode currNode = doc.DocumentElement.InsertBefore(bookElement, selectedBook);
- sigWhiteSpace = doc.CreateSignificantWhitespace("\n ");
- doc.DocumentElement.InsertAfter(sigWhiteSpace, currNode);
- break;
-
- case Constants.positionBelow:
- // Add newline characters to make XML more readable.
- sigWhiteSpace = doc.CreateSignificantWhitespace("\n ");
- XmlNode whiteSpaceNode = doc.DocumentElement.InsertAfter(sigWhiteSpace, selectedBook);
- doc.DocumentElement.InsertAfter(bookElement, whiteSpaceNode);
- break;
-
- default:
- doc.DocumentElement.AppendChild(bookElement);
- break;
- }
-
- if (validateNode)
- {
- validateXML(generateSchema, doc);
- }
- }
- //
-
- #endregion
-
- #region Edit XML elements and attributes
-
- //************************************************************************************
- //
- // Edit an XML element
- //
- //************************************************************************************
- //
- public void editBook(string title, string ISBN, string publicationDate,
- string genre, string price, XmlNode book, bool validateNode, bool generateSchema)
- {
-
- XmlElement bookElement = (XmlElement)book;
-
- // Get the attributes of a book.
- bookElement.SetAttribute("ISBN", ISBN);
- bookElement.SetAttribute("genre", genre);
- bookElement.SetAttribute("publicationdate", publicationDate);
-
- // Get the values of child elements of a book.
- bookElement["title"].InnerText = title;
- bookElement["price"].InnerText = price;
-
- if (validateNode)
- {
- validateXML(generateSchema, bookElement.OwnerDocument);
- }
- }
- //
-
- #endregion
-
- #region Remove elements
-
- //************************************************************************************
- //
- // Summary: Delete a book node from the XMLDocument.
- //
- //
- //************************************************************************************
- //
- public void deleteBook(XmlNode book)
- {
- XmlNode prevNode = book.PreviousSibling;
-
- book.OwnerDocument.DocumentElement.RemoveChild(book);
-
- if (prevNode.NodeType == XmlNodeType.Whitespace ||
- prevNode.NodeType == XmlNodeType.SignificantWhitespace)
- {
- prevNode.OwnerDocument.DocumentElement.RemoveChild(prevNode);
- }
- }
- //
- #endregion
-
- #region Position elements
- //
- //************************************************************************************
- //
- // Summary: Move elements up in the XML.
- //
- //
- //************************************************************************************
-
- public void MoveElementUp(XmlNode book)
- {
- XmlNode previousNode = book.PreviousSibling;
- while (previousNode != null && (previousNode.NodeType != XmlNodeType.Element))
- {
- previousNode = previousNode.PreviousSibling;
- }
- if (previousNode != null)
- {
- XmlNode newLineNode = book.NextSibling;
- book.OwnerDocument.DocumentElement.RemoveChild(book);
- if (newLineNode.NodeType == XmlNodeType.Whitespace |
- newLineNode.NodeType == XmlNodeType.SignificantWhitespace)
- {
- newLineNode.OwnerDocument.DocumentElement.RemoveChild(newLineNode);
- }
- InsertBookElement((XmlElement)book, Constants.positionAbove,
- previousNode, false, false);
- }
- }
-
- //************************************************************************************
- //
- // Summary: Move elements down in the XML.
- //
- //
- //************************************************************************************
- public void MoveElementDown(XmlNode book)
- {
- // Walk backwards until we find an element - ignore text nodes
- XmlNode NextNode = book.NextSibling;
- while (NextNode != null && (NextNode.NodeType != XmlNodeType.Element))
- {
- NextNode = NextNode.NextSibling;
- }
- if (NextNode != null)
- {
- XmlNode newLineNode = book.PreviousSibling;
- book.OwnerDocument.DocumentElement.RemoveChild(book);
- if (newLineNode.NodeType == XmlNodeType.Whitespace |
- newLineNode.NodeType == XmlNodeType.SignificantWhitespace)
- {
- newLineNode.OwnerDocument.DocumentElement.RemoveChild(newLineNode);
- }
-
- InsertBookElement((XmlElement)book, Constants.positionBelow,
- NextNode, false, false);
- }
- }
-//
- #endregion
-
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/xmlprocessingapp.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/xmlprocessingapp.csproj
deleted file mode 100644
index 0a33ef8580090..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/xmlprocessingapp.csproj
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
- Exe
- net10.0-windows
- true
- XMLProcessingApp.Program
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/project.vbproj
deleted file mode 100644
index fab5eea626429..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/project.vbproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- vb
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-element.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-element.vb
deleted file mode 100644
index 2f771e57b52ef..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-element.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-'
-Option Strict On
-Option Explicit On
-Imports System.Xml
-
-Public Class ElementSample
- Public Shared Sub Main()
- 'Create the XmlDocument.
- Dim doc As New XmlDocument()
- doc.LoadXml("" &
- "" &
- "Pride And Prejudice" &
- "")
-
- 'Display the document element.
- Console.WriteLine(doc.DocumentElement.OuterXml)
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-lastchild.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-lastchild.vb
deleted file mode 100644
index b3f0bb3c517a6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-lastchild.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-'
-Option Explicit On
-Option Strict On
-Imports System.Xml
-
-Public Class LastChildSample
- Public Shared Sub Main()
-
- Dim doc As New XmlDocument()
- doc.LoadXml("" &
- "Pride And Prejudice" &
- "19.95" &
- "")
-
- Dim root As XmlNode = doc.FirstChild
-
- Console.WriteLine("Display the price element...")
- Console.WriteLine(root.LastChild.OuterXml)
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-nextsibling.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-nextsibling.vb
deleted file mode 100644
index 61b6219e4f52d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-nextsibling.vb
+++ /dev/null
@@ -1,20 +0,0 @@
-'
-Imports System.Xml
-
-Public Class NextSiblingSample
- Public Shared Sub Main()
-
- Dim doc As XmlDocument = New XmlDocument()
- doc.Load("books.xml")
-
- Dim currNode As XmlNode = doc.DocumentElement.FirstChild
- Console.WriteLine("First book...")
- Console.WriteLine(currNode.OuterXml)
-
- Dim nextNode As XmlNode = currNode.NextSibling
- Console.WriteLine(ControlChars.Lf + "Second book...")
- Console.WriteLine(nextNode.OuterXml)
-
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-tag.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-tag.vb
deleted file mode 100644
index 4effbf95b2dd0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source-tag.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-'
-Option Explicit On
-Option Strict On
-Imports System.Xml
-
-Public Class TagSample
-
- Public Shared Sub Main()
- 'Create the XmlDocument.
- Dim doc As New XmlDocument()
- doc.Load("books.xml")
-
- 'Display all the book titles.
- Dim elemList As XmlNodeList = doc.GetElementsByTagName("title")
- Dim i As Integer
- For i = 0 To elemList.Count - 1
- Console.WriteLine(elemList(i).InnerXml)
- Next i
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source2.vb
deleted file mode 100644
index febacdc3be368..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source2.vb
+++ /dev/null
@@ -1,29 +0,0 @@
-'
-Option Strict
-Option Explicit
-
-Imports System.IO
-Imports System.Xml
-
-Public Class Sample
-
- Public Shared Sub Main()
-
- Dim doc As New XmlDocument()
- doc.LoadXml("" & _
- "Pride And Prejudice" & _
- "19.95" & _
- "")
-
- Dim root As XmlNode = doc.FirstChild
-
- 'Display the contents of the child nodes.
- If root.HasChildNodes Then
- Dim i As Integer
- For i = 0 To root.ChildNodes.Count - 1
- Console.WriteLine(root.ChildNodes(i).InnerText)
- Next i
- End If
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source5.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source5.vb
deleted file mode 100644
index 7a202b11658ea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/Non-WinForms/source5.vb
+++ /dev/null
@@ -1,18 +0,0 @@
-'
-Imports System.Xml
-
-Public Class Sample5
- Public Shared Sub Main()
- Dim doc As XmlDocument = New XmlDocument()
- doc.Load("books.xml")
-
- Dim lastNode As XmlNode = doc.DocumentElement.LastChild
- Console.WriteLine("Last book...")
- Console.WriteLine(lastNode.OuterXml)
-
- Dim prevNode As XmlNode = lastNode.PreviousSibling
- Console.WriteLine(ControlChars.Lf + "Previous book...")
- Console.WriteLine(prevNode.OuterXml)
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/booksdata.xml b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/booksdata.xml
deleted file mode 100644
index 367166023d4d4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/booksdata.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
- Pride And Prejudice
- 24.95
-
-
- The Handmaid's Tale
- 29.95
-
-
- Sense and Sensibility
- 19.95
-
-
- To Kill a Mockingbird
- 4.98
-
-
- The Catcher in the Rye
- 4.86
-
-
- Of Mice and Men
- 5.92
-
-
- Mysterious Island
- 5.39
-
-
- War and Peace
- 12.84
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/booksdata.xsd b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/booksdata.xsd
deleted file mode 100644
index 5a3782f336237..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/booksdata.xsd
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/constants.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/constants.vb
deleted file mode 100644
index 34dc76072be72..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/constants.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-Public Class Constants
-
- Public Const positionTop As String = "Top"
- Public Const positionBottom As String = "Bottom"
- Public Const positionAbove As String = "Above selected item"
- Public Const positionBelow As String = "Below selected item"
- Public Const lengthOfNamespaceDeclaration As Integer = 37
- Public Const booksFileName As String = "booksData.xml"
- Public Const Title As String = "Title"
- Public Const Genre As String = "Genre"
- Public Const PubDate As String = "Publish Year"
- Public Const Price As String = "Price"
- Public Const ISBN As String = "ISBN"
- Public Const Condition As String = "Condition"
- Public Const Excludes As String = "Excludes"
-
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/downarrow.png b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/downarrow.png
deleted file mode 100644
index 9b3fc1076ddf0..0000000000000
Binary files a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/downarrow.png and /dev/null differ
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/form1.designer.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/form1.designer.vb
deleted file mode 100644
index ace985a5c473b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/form1.designer.vb
+++ /dev/null
@@ -1,1043 +0,0 @@
- _
-Partial Class Form1
- Inherits System.Windows.Forms.Form
-
- 'Form overrides dispose to clean up the component list.
- _
- Protected Overrides Sub Dispose(ByVal disposing As Boolean)
- Try
- If disposing AndAlso components IsNot Nothing Then
- components.Dispose()
- End If
- Finally
- MyBase.Dispose(disposing)
- End Try
- End Sub
-
- 'Required by the Windows Form Designer
- Private components As System.ComponentModel.IContainer
-
- 'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
- 'Do not modify it using the code editor.
- _
- Private Sub InitializeComponent()
- Me.components = New System.ComponentModel.Container()
- Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
- Me.TreeViewGroupBox = New System.Windows.Forms.GroupBox()
- Me.xmlTreeView = New System.Windows.Forms.TreeView()
- Me.TextGroupBox = New System.Windows.Forms.GroupBox()
- Me.saveButton = New System.Windows.Forms.Button()
- Me.refreshTreeButton = New System.Windows.Forms.Button()
- Me.positionDownButton = New System.Windows.Forms.Button()
- Me.positionUpButton = New System.Windows.Forms.Button()
- Me.XmlTextBox = New System.Windows.Forms.RichTextBox()
- Me.tabControl1 = New System.Windows.Forms.TabControl()
- Me.loadTab = New System.Windows.Forms.TabPage()
- Me.optionsGroupBox = New System.Windows.Forms.GroupBox()
- Me.generateSchemaCheckBox = New System.Windows.Forms.CheckBox()
- Me.generateCheckBox = New System.Windows.Forms.CheckBox()
- Me.validateCheckBox = New System.Windows.Forms.CheckBox()
- Me.loadButton = New System.Windows.Forms.Button()
- Me.addTab = New System.Windows.Forms.TabPage()
- Me.addElementGroupBox = New System.Windows.Forms.GroupBox()
- Me.newPositionLabel = New System.Windows.Forms.Label()
- Me.positionComboBox = New System.Windows.Forms.ComboBox()
- Me.newTitleTextBox = New System.Windows.Forms.TextBox()
- Me.newTitleLabel = New System.Windows.Forms.Label()
- Me.newISBNLabel = New System.Windows.Forms.Label()
- Me.newPriceLabel = New System.Windows.Forms.Label()
- Me.newISBNTextBox = New System.Windows.Forms.TextBox()
- Me.newPriceTextBox = New System.Windows.Forms.TextBox()
- Me.newPubDateLabel = New System.Windows.Forms.Label()
- Me.newGenreLabel = New System.Windows.Forms.Label()
- Me.newPubDateTextBox = New System.Windows.Forms.TextBox()
- Me.addNewBookButton = New System.Windows.Forms.Button()
- Me.newGenreTextBox = New System.Windows.Forms.TextBox()
- Me.editTab = New System.Windows.Forms.TabPage()
- Me.EditElementGroupBox = New System.Windows.Forms.GroupBox()
- Me.deleteButton = New System.Windows.Forms.Button()
- Me.editTitleTextBox = New System.Windows.Forms.TextBox()
- Me.editTitleLabel = New System.Windows.Forms.Label()
- Me.editISBNLabel = New System.Windows.Forms.Label()
- Me.editPriceLabel = New System.Windows.Forms.Label()
- Me.editISBNTextBox = New System.Windows.Forms.TextBox()
- Me.editPriceTextBox = New System.Windows.Forms.TextBox()
- Me.editPubDateLabel = New System.Windows.Forms.Label()
- Me.editGenreLabel = New System.Windows.Forms.Label()
- Me.editPubDateTextBox = New System.Windows.Forms.TextBox()
- Me.submitButton = New System.Windows.Forms.Button()
- Me.editGenreTextBox = New System.Windows.Forms.TextBox()
- Me.filterTab = New System.Windows.Forms.TabPage()
- Me.groupBox1 = New System.Windows.Forms.GroupBox()
- Me.matchesComboBox = New System.Windows.Forms.ComboBox()
- Me.matchesLabel = New System.Windows.Forms.Label()
- Me.applyLabel = New System.Windows.Forms.Label()
- Me.condition4Panel = New System.Windows.Forms.Panel()
- Me.condition4CheckBox = New System.Windows.Forms.CheckBox()
- Me.operator4ComboBox = New System.Windows.Forms.ComboBox()
- Me.condition4ComboBox = New System.Windows.Forms.ComboBox()
- Me.condition4TextBox = New System.Windows.Forms.TextBox()
- Me.condition3Panel = New System.Windows.Forms.Panel()
- Me.condition3CheckBox = New System.Windows.Forms.CheckBox()
- Me.operator3ComboBox = New System.Windows.Forms.ComboBox()
- Me.condition3ComboBox = New System.Windows.Forms.ComboBox()
- Me.condition3TextBox = New System.Windows.Forms.TextBox()
- Me.condition2Panel = New System.Windows.Forms.Panel()
- Me.condition2CheckBox = New System.Windows.Forms.CheckBox()
- Me.operator2ComboBox = New System.Windows.Forms.ComboBox()
- Me.condition2ComboBox = New System.Windows.Forms.ComboBox()
- Me.condition2TextBox = New System.Windows.Forms.TextBox()
- Me.condition1Panel = New System.Windows.Forms.Panel()
- Me.condition1CheckBox = New System.Windows.Forms.CheckBox()
- Me.operator1ComboBox = New System.Windows.Forms.ComboBox()
- Me.condition1ComboBox = New System.Windows.Forms.ComboBox()
- Me.condition1TextBox = New System.Windows.Forms.TextBox()
- Me.clearButton = New System.Windows.Forms.Button()
- Me.addFilterButton = New System.Windows.Forms.Button()
- Me.toolTip1 = New System.Windows.Forms.ToolTip(Me.components)
- Me.filterBox = New System.Windows.Forms.GroupBox()
- Me.filterTreeView = New System.Windows.Forms.TreeView()
- Me.TreeViewGroupBox.SuspendLayout()
- Me.TextGroupBox.SuspendLayout()
- Me.tabControl1.SuspendLayout()
- Me.loadTab.SuspendLayout()
- Me.optionsGroupBox.SuspendLayout()
- Me.addTab.SuspendLayout()
- Me.addElementGroupBox.SuspendLayout()
- Me.editTab.SuspendLayout()
- Me.EditElementGroupBox.SuspendLayout()
- Me.filterTab.SuspendLayout()
- Me.groupBox1.SuspendLayout()
- Me.condition4Panel.SuspendLayout()
- Me.condition3Panel.SuspendLayout()
- Me.condition2Panel.SuspendLayout()
- Me.condition1Panel.SuspendLayout()
- Me.filterBox.SuspendLayout()
- Me.SuspendLayout()
- '
- 'TreeViewGroupBox
- '
- Me.TreeViewGroupBox.Controls.Add(Me.xmlTreeView)
- Me.TreeViewGroupBox.ForeColor = System.Drawing.Color.White
- Me.TreeViewGroupBox.Location = New System.Drawing.Point(373, 12)
- Me.TreeViewGroupBox.Name = "TreeViewGroupBox"
- Me.TreeViewGroupBox.Size = New System.Drawing.Size(286, 688)
- Me.TreeViewGroupBox.TabIndex = 4
- Me.TreeViewGroupBox.TabStop = False
- Me.TreeViewGroupBox.Text = "Book List"
- '
- 'xmlTreeView
- '
- Me.xmlTreeView.BackColor = System.Drawing.Color.Black
- Me.xmlTreeView.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.xmlTreeView.ForeColor = System.Drawing.Color.White
- Me.xmlTreeView.Location = New System.Drawing.Point(16, 19)
- Me.xmlTreeView.Name = "xmlTreeView"
- Me.xmlTreeView.Size = New System.Drawing.Size(258, 656)
- Me.xmlTreeView.TabIndex = 3
- '
- 'TextGroupBox
- '
- Me.TextGroupBox.Controls.Add(Me.saveButton)
- Me.TextGroupBox.Controls.Add(Me.refreshTreeButton)
- Me.TextGroupBox.Controls.Add(Me.positionDownButton)
- Me.TextGroupBox.Controls.Add(Me.positionUpButton)
- Me.TextGroupBox.Controls.Add(Me.XmlTextBox)
- Me.TextGroupBox.ForeColor = System.Drawing.Color.White
- Me.TextGroupBox.Location = New System.Drawing.Point(665, 12)
- Me.TextGroupBox.Name = "TextGroupBox"
- Me.TextGroupBox.Size = New System.Drawing.Size(526, 688)
- Me.TextGroupBox.TabIndex = 5
- Me.TextGroupBox.TabStop = False
- Me.TextGroupBox.Text = "Xml View"
- '
- 'saveButton
- '
- Me.saveButton.FlatAppearance.BorderColor = System.Drawing.Color.Black
- Me.saveButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.saveButton.Image = CType(resources.GetObject("saveButton.Image"), System.Drawing.Image)
- Me.saveButton.Location = New System.Drawing.Point(6, 196)
- Me.saveButton.Name = "saveButton"
- Me.saveButton.Size = New System.Drawing.Size(31, 34)
- Me.saveButton.TabIndex = 38
- Me.toolTip1.SetToolTip(Me.saveButton, "Save XML with new element positions")
- Me.saveButton.UseVisualStyleBackColor = True
- '
- 'refreshTreeButton
- '
- Me.refreshTreeButton.FlatAppearance.BorderColor = System.Drawing.Color.Black
- Me.refreshTreeButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.refreshTreeButton.Image = CType(resources.GetObject("refreshTreeButton.Image"), System.Drawing.Image)
- Me.refreshTreeButton.Location = New System.Drawing.Point(6, 150)
- Me.refreshTreeButton.Name = "refreshTreeButton"
- Me.refreshTreeButton.Size = New System.Drawing.Size(31, 34)
- Me.refreshTreeButton.TabIndex = 37
- Me.toolTip1.SetToolTip(Me.refreshTreeButton, "Refresh tree view to reflect new order of elements")
- Me.refreshTreeButton.UseVisualStyleBackColor = True
- '
- 'positionDownButton
- '
- Me.positionDownButton.FlatAppearance.BorderColor = System.Drawing.Color.Black
- Me.positionDownButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.positionDownButton.Image = CType(resources.GetObject("positionDownButton.Image"), System.Drawing.Image)
- Me.positionDownButton.Location = New System.Drawing.Point(6, 105)
- Me.positionDownButton.Name = "positionDownButton"
- Me.positionDownButton.Size = New System.Drawing.Size(31, 34)
- Me.positionDownButton.TabIndex = 36
- Me.toolTip1.SetToolTip(Me.positionDownButton, "Move selected item down in the list")
- Me.positionDownButton.UseVisualStyleBackColor = True
- '
- 'positionUpButton
- '
- Me.positionUpButton.FlatAppearance.BorderColor = System.Drawing.Color.Black
- Me.positionUpButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.positionUpButton.Image = CType(resources.GetObject("positionUpButton.Image"), System.Drawing.Image)
- Me.positionUpButton.Location = New System.Drawing.Point(6, 59)
- Me.positionUpButton.Name = "positionUpButton"
- Me.positionUpButton.Size = New System.Drawing.Size(31, 34)
- Me.positionUpButton.TabIndex = 35
- Me.toolTip1.SetToolTip(Me.positionUpButton, "Move selected item up in the list")
- Me.positionUpButton.UseVisualStyleBackColor = True
- '
- 'XmlTextBox
- '
- Me.XmlTextBox.BackColor = System.Drawing.Color.Black
- Me.XmlTextBox.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.XmlTextBox.ForeColor = System.Drawing.Color.White
- Me.XmlTextBox.Location = New System.Drawing.Point(43, 19)
- Me.XmlTextBox.Name = "XmlTextBox"
- Me.XmlTextBox.Size = New System.Drawing.Size(477, 656)
- Me.XmlTextBox.TabIndex = 6
- Me.XmlTextBox.Text = ""
- '
- 'tabControl1
- '
- Me.tabControl1.Controls.Add(Me.loadTab)
- Me.tabControl1.Controls.Add(Me.addTab)
- Me.tabControl1.Controls.Add(Me.editTab)
- Me.tabControl1.Controls.Add(Me.filterTab)
- Me.tabControl1.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed
- Me.tabControl1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.tabControl1.Location = New System.Drawing.Point(12, 12)
- Me.tabControl1.Name = "tabControl1"
- Me.tabControl1.SelectedIndex = 0
- Me.tabControl1.Size = New System.Drawing.Size(354, 247)
- Me.tabControl1.TabIndex = 7
- '
- 'loadTab
- '
- Me.loadTab.BackColor = System.Drawing.Color.Black
- Me.loadTab.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None
- Me.loadTab.Controls.Add(Me.optionsGroupBox)
- Me.loadTab.Controls.Add(Me.loadButton)
- Me.loadTab.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.loadTab.ForeColor = System.Drawing.Color.White
- Me.loadTab.Location = New System.Drawing.Point(4, 25)
- Me.loadTab.Name = "loadTab"
- Me.loadTab.Padding = New System.Windows.Forms.Padding(3)
- Me.loadTab.Size = New System.Drawing.Size(346, 218)
- Me.loadTab.TabIndex = 1
- Me.loadTab.Text = "Load XML"
- '
- 'optionsGroupBox
- '
- Me.optionsGroupBox.BackColor = System.Drawing.SystemColors.ActiveCaptionText
- Me.optionsGroupBox.Controls.Add(Me.generateSchemaCheckBox)
- Me.optionsGroupBox.Controls.Add(Me.generateCheckBox)
- Me.optionsGroupBox.Controls.Add(Me.validateCheckBox)
- Me.optionsGroupBox.ForeColor = System.Drawing.Color.White
- Me.optionsGroupBox.Location = New System.Drawing.Point(16, 56)
- Me.optionsGroupBox.Name = "optionsGroupBox"
- Me.optionsGroupBox.Size = New System.Drawing.Size(324, 104)
- Me.optionsGroupBox.TabIndex = 8
- Me.optionsGroupBox.TabStop = False
- Me.optionsGroupBox.Text = "Options"
- '
- 'generateSchemaCheckBox
- '
- Me.generateSchemaCheckBox.AutoSize = True
- Me.generateSchemaCheckBox.Enabled = False
- Me.generateSchemaCheckBox.Location = New System.Drawing.Point(14, 77)
- Me.generateSchemaCheckBox.Name = "generateSchemaCheckBox"
- Me.generateSchemaCheckBox.Size = New System.Drawing.Size(295, 20)
- Me.generateSchemaCheckBox.TabIndex = 10
- Me.generateSchemaCheckBox.Text = "If the schema file is not found, then generate it."
- Me.generateSchemaCheckBox.UseVisualStyleBackColor = True
- Me.generateSchemaCheckBox.Visible = False
- '
- 'generateCheckBox
- '
- Me.generateCheckBox.AutoSize = True
- Me.generateCheckBox.ForeColor = System.Drawing.Color.White
- Me.generateCheckBox.Location = New System.Drawing.Point(13, 24)
- Me.generateCheckBox.Name = "generateCheckBox"
- Me.generateCheckBox.Size = New System.Drawing.Size(257, 20)
- Me.generateCheckBox.TabIndex = 9
- Me.generateCheckBox.Text = "If the file is not found, generate the XML."
- Me.generateCheckBox.UseVisualStyleBackColor = True
- '
- 'validateCheckBox
- '
- Me.validateCheckBox.AutoSize = True
- Me.validateCheckBox.ForeColor = System.Drawing.Color.White
- Me.validateCheckBox.Location = New System.Drawing.Point(13, 51)
- Me.validateCheckBox.Name = "validateCheckBox"
- Me.validateCheckBox.Size = New System.Drawing.Size(239, 20)
- Me.validateCheckBox.TabIndex = 8
- Me.validateCheckBox.Text = "Validate the XML against a schema."
- Me.validateCheckBox.UseVisualStyleBackColor = True
- '
- 'loadButton
- '
- Me.loadButton.BackColor = System.Drawing.Color.Black
- Me.loadButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.loadButton.Location = New System.Drawing.Point(16, 16)
- Me.loadButton.Name = "loadButton"
- Me.loadButton.Size = New System.Drawing.Size(136, 27)
- Me.loadButton.TabIndex = 0
- Me.loadButton.Text = "Load XML from file"
- Me.loadButton.UseVisualStyleBackColor = False
- '
- 'addTab
- '
- Me.addTab.BackColor = System.Drawing.Color.Black
- Me.addTab.Controls.Add(Me.addElementGroupBox)
- Me.addTab.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.addTab.ForeColor = System.Drawing.Color.White
- Me.addTab.Location = New System.Drawing.Point(4, 25)
- Me.addTab.Name = "addTab"
- Me.addTab.Padding = New System.Windows.Forms.Padding(3)
- Me.addTab.Size = New System.Drawing.Size(346, 218)
- Me.addTab.TabIndex = 0
- Me.addTab.Text = "Add Book"
- '
- 'addElementGroupBox
- '
- Me.addElementGroupBox.Controls.Add(Me.newPositionLabel)
- Me.addElementGroupBox.Controls.Add(Me.positionComboBox)
- Me.addElementGroupBox.Controls.Add(Me.newTitleTextBox)
- Me.addElementGroupBox.Controls.Add(Me.newTitleLabel)
- Me.addElementGroupBox.Controls.Add(Me.newISBNLabel)
- Me.addElementGroupBox.Controls.Add(Me.newPriceLabel)
- Me.addElementGroupBox.Controls.Add(Me.newISBNTextBox)
- Me.addElementGroupBox.Controls.Add(Me.newPriceTextBox)
- Me.addElementGroupBox.Controls.Add(Me.newPubDateLabel)
- Me.addElementGroupBox.Controls.Add(Me.newGenreLabel)
- Me.addElementGroupBox.Controls.Add(Me.newPubDateTextBox)
- Me.addElementGroupBox.Controls.Add(Me.addNewBookButton)
- Me.addElementGroupBox.Controls.Add(Me.newGenreTextBox)
- Me.addElementGroupBox.Location = New System.Drawing.Point(6, 6)
- Me.addElementGroupBox.Name = "addElementGroupBox"
- Me.addElementGroupBox.Size = New System.Drawing.Size(334, 201)
- Me.addElementGroupBox.TabIndex = 0
- Me.addElementGroupBox.TabStop = False
- '
- 'newPositionLabel
- '
- Me.newPositionLabel.AutoSize = True
- Me.newPositionLabel.Location = New System.Drawing.Point(18, 164)
- Me.newPositionLabel.Name = "newPositionLabel"
- Me.newPositionLabel.Size = New System.Drawing.Size(59, 16)
- Me.newPositionLabel.TabIndex = 28
- Me.newPositionLabel.Text = "Position:"
- '
- 'positionComboBox
- '
- Me.positionComboBox.BackColor = System.Drawing.Color.Black
- Me.positionComboBox.ForeColor = System.Drawing.Color.White
- Me.positionComboBox.FormattingEnabled = True
- Me.positionComboBox.Items.AddRange(New Object() {"Top", "Bottom", "Above selected item", "Below selected item"})
- Me.positionComboBox.Location = New System.Drawing.Point(111, 157)
- Me.positionComboBox.Name = "positionComboBox"
- Me.positionComboBox.Size = New System.Drawing.Size(128, 24)
- Me.positionComboBox.TabIndex = 27
- Me.positionComboBox.Text = "Top"
- '
- 'newTitleTextBox
- '
- Me.newTitleTextBox.BackColor = System.Drawing.Color.Black
- Me.newTitleTextBox.ForeColor = System.Drawing.Color.White
- Me.newTitleTextBox.Location = New System.Drawing.Point(111, 21)
- Me.newTitleTextBox.Name = "newTitleTextBox"
- Me.newTitleTextBox.Size = New System.Drawing.Size(192, 22)
- Me.newTitleTextBox.TabIndex = 16
- '
- 'newTitleLabel
- '
- Me.newTitleLabel.AutoSize = True
- Me.newTitleLabel.Location = New System.Drawing.Point(18, 21)
- Me.newTitleLabel.Name = "newTitleLabel"
- Me.newTitleLabel.Size = New System.Drawing.Size(37, 16)
- Me.newTitleLabel.TabIndex = 18
- Me.newTitleLabel.Text = "Title:"
- '
- 'newISBNLabel
- '
- Me.newISBNLabel.AutoSize = True
- Me.newISBNLabel.Location = New System.Drawing.Point(18, 48)
- Me.newISBNLabel.Name = "newISBNLabel"
- Me.newISBNLabel.Size = New System.Drawing.Size(42, 16)
- Me.newISBNLabel.TabIndex = 19
- Me.newISBNLabel.Text = "ISBN:"
- '
- 'newPriceLabel
- '
- Me.newPriceLabel.AutoSize = True
- Me.newPriceLabel.Location = New System.Drawing.Point(18, 107)
- Me.newPriceLabel.Name = "newPriceLabel"
- Me.newPriceLabel.Size = New System.Drawing.Size(42, 16)
- Me.newPriceLabel.TabIndex = 26
- Me.newPriceLabel.Text = "Price:"
- '
- 'newISBNTextBox
- '
- Me.newISBNTextBox.BackColor = System.Drawing.Color.Black
- Me.newISBNTextBox.ForeColor = System.Drawing.Color.White
- Me.newISBNTextBox.Location = New System.Drawing.Point(111, 48)
- Me.newISBNTextBox.Name = "newISBNTextBox"
- Me.newISBNTextBox.Size = New System.Drawing.Size(192, 22)
- Me.newISBNTextBox.TabIndex = 20
- '
- 'newPriceTextBox
- '
- Me.newPriceTextBox.BackColor = System.Drawing.Color.Black
- Me.newPriceTextBox.ForeColor = System.Drawing.Color.White
- Me.newPriceTextBox.Location = New System.Drawing.Point(111, 100)
- Me.newPriceTextBox.Name = "newPriceTextBox"
- Me.newPriceTextBox.Size = New System.Drawing.Size(75, 22)
- Me.newPriceTextBox.TabIndex = 25
- '
- 'newPubDateLabel
- '
- Me.newPubDateLabel.AutoSize = True
- Me.newPubDateLabel.Location = New System.Drawing.Point(18, 74)
- Me.newPubDateLabel.Name = "newPubDateLabel"
- Me.newPubDateLabel.Size = New System.Drawing.Size(87, 16)
- Me.newPubDateLabel.TabIndex = 21
- Me.newPubDateLabel.Text = "Publish Date:"
- '
- 'newGenreLabel
- '
- Me.newGenreLabel.AutoSize = True
- Me.newGenreLabel.Location = New System.Drawing.Point(18, 135)
- Me.newGenreLabel.Name = "newGenreLabel"
- Me.newGenreLabel.Size = New System.Drawing.Size(48, 16)
- Me.newGenreLabel.TabIndex = 24
- Me.newGenreLabel.Text = "Genre:"
- '
- 'newPubDateTextBox
- '
- Me.newPubDateTextBox.BackColor = System.Drawing.Color.Black
- Me.newPubDateTextBox.ForeColor = System.Drawing.Color.White
- Me.newPubDateTextBox.Location = New System.Drawing.Point(111, 74)
- Me.newPubDateTextBox.Name = "newPubDateTextBox"
- Me.newPubDateTextBox.Size = New System.Drawing.Size(125, 22)
- Me.newPubDateTextBox.TabIndex = 22
- '
- 'addNewBookButton
- '
- Me.addNewBookButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.addNewBookButton.Location = New System.Drawing.Point(245, 157)
- Me.addNewBookButton.Name = "addNewBookButton"
- Me.addNewBookButton.Size = New System.Drawing.Size(70, 24)
- Me.addNewBookButton.TabIndex = 17
- Me.addNewBookButton.Text = "Add"
- Me.addNewBookButton.UseVisualStyleBackColor = True
- '
- 'newGenreTextBox
- '
- Me.newGenreTextBox.BackColor = System.Drawing.Color.Black
- Me.newGenreTextBox.ForeColor = System.Drawing.Color.White
- Me.newGenreTextBox.Location = New System.Drawing.Point(111, 128)
- Me.newGenreTextBox.Name = "newGenreTextBox"
- Me.newGenreTextBox.Size = New System.Drawing.Size(125, 22)
- Me.newGenreTextBox.TabIndex = 23
- '
- 'editTab
- '
- Me.editTab.BackColor = System.Drawing.Color.Black
- Me.editTab.Controls.Add(Me.EditElementGroupBox)
- Me.editTab.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.editTab.ForeColor = System.Drawing.Color.White
- Me.editTab.Location = New System.Drawing.Point(4, 25)
- Me.editTab.Name = "editTab"
- Me.editTab.Padding = New System.Windows.Forms.Padding(3)
- Me.editTab.Size = New System.Drawing.Size(346, 218)
- Me.editTab.TabIndex = 2
- Me.editTab.Text = "Edit Books"
- '
- 'EditElementGroupBox
- '
- Me.EditElementGroupBox.Controls.Add(Me.deleteButton)
- Me.EditElementGroupBox.Controls.Add(Me.editTitleTextBox)
- Me.EditElementGroupBox.Controls.Add(Me.editTitleLabel)
- Me.EditElementGroupBox.Controls.Add(Me.editISBNLabel)
- Me.EditElementGroupBox.Controls.Add(Me.editPriceLabel)
- Me.EditElementGroupBox.Controls.Add(Me.editISBNTextBox)
- Me.EditElementGroupBox.Controls.Add(Me.editPriceTextBox)
- Me.EditElementGroupBox.Controls.Add(Me.editPubDateLabel)
- Me.EditElementGroupBox.Controls.Add(Me.editGenreLabel)
- Me.EditElementGroupBox.Controls.Add(Me.editPubDateTextBox)
- Me.EditElementGroupBox.Controls.Add(Me.submitButton)
- Me.EditElementGroupBox.Controls.Add(Me.editGenreTextBox)
- Me.EditElementGroupBox.Location = New System.Drawing.Point(6, 6)
- Me.EditElementGroupBox.Name = "EditElementGroupBox"
- Me.EditElementGroupBox.Size = New System.Drawing.Size(334, 201)
- Me.EditElementGroupBox.TabIndex = 1
- Me.EditElementGroupBox.TabStop = False
- '
- 'deleteButton
- '
- Me.deleteButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.deleteButton.Location = New System.Drawing.Point(21, 163)
- Me.deleteButton.Name = "deleteButton"
- Me.deleteButton.Size = New System.Drawing.Size(119, 25)
- Me.deleteButton.TabIndex = 27
- Me.deleteButton.Text = "Delete Book"
- Me.deleteButton.UseVisualStyleBackColor = True
- '
- 'editTitleTextBox
- '
- Me.editTitleTextBox.BackColor = System.Drawing.Color.Black
- Me.editTitleTextBox.ForeColor = System.Drawing.Color.White
- Me.editTitleTextBox.Location = New System.Drawing.Point(111, 21)
- Me.editTitleTextBox.Name = "editTitleTextBox"
- Me.editTitleTextBox.Size = New System.Drawing.Size(192, 22)
- Me.editTitleTextBox.TabIndex = 16
- '
- 'editTitleLabel
- '
- Me.editTitleLabel.AutoSize = True
- Me.editTitleLabel.Location = New System.Drawing.Point(18, 21)
- Me.editTitleLabel.Name = "editTitleLabel"
- Me.editTitleLabel.Size = New System.Drawing.Size(37, 16)
- Me.editTitleLabel.TabIndex = 18
- Me.editTitleLabel.Text = "Title:"
- '
- 'editISBNLabel
- '
- Me.editISBNLabel.AutoSize = True
- Me.editISBNLabel.Location = New System.Drawing.Point(18, 48)
- Me.editISBNLabel.Name = "editISBNLabel"
- Me.editISBNLabel.Size = New System.Drawing.Size(42, 16)
- Me.editISBNLabel.TabIndex = 19
- Me.editISBNLabel.Text = "ISBN:"
- '
- 'editPriceLabel
- '
- Me.editPriceLabel.AutoSize = True
- Me.editPriceLabel.Location = New System.Drawing.Point(18, 107)
- Me.editPriceLabel.Name = "editPriceLabel"
- Me.editPriceLabel.Size = New System.Drawing.Size(42, 16)
- Me.editPriceLabel.TabIndex = 26
- Me.editPriceLabel.Text = "Price:"
- '
- 'editISBNTextBox
- '
- Me.editISBNTextBox.BackColor = System.Drawing.Color.Black
- Me.editISBNTextBox.ForeColor = System.Drawing.Color.White
- Me.editISBNTextBox.Location = New System.Drawing.Point(111, 48)
- Me.editISBNTextBox.Name = "editISBNTextBox"
- Me.editISBNTextBox.Size = New System.Drawing.Size(192, 22)
- Me.editISBNTextBox.TabIndex = 20
- '
- 'editPriceTextBox
- '
- Me.editPriceTextBox.BackColor = System.Drawing.Color.Black
- Me.editPriceTextBox.ForeColor = System.Drawing.Color.White
- Me.editPriceTextBox.Location = New System.Drawing.Point(111, 100)
- Me.editPriceTextBox.Name = "editPriceTextBox"
- Me.editPriceTextBox.Size = New System.Drawing.Size(75, 22)
- Me.editPriceTextBox.TabIndex = 25
- '
- 'editPubDateLabel
- '
- Me.editPubDateLabel.AutoSize = True
- Me.editPubDateLabel.Location = New System.Drawing.Point(18, 74)
- Me.editPubDateLabel.Name = "editPubDateLabel"
- Me.editPubDateLabel.Size = New System.Drawing.Size(87, 16)
- Me.editPubDateLabel.TabIndex = 21
- Me.editPubDateLabel.Text = "Publish Date:"
- '
- 'editGenreLabel
- '
- Me.editGenreLabel.AutoSize = True
- Me.editGenreLabel.Location = New System.Drawing.Point(18, 135)
- Me.editGenreLabel.Name = "editGenreLabel"
- Me.editGenreLabel.Size = New System.Drawing.Size(48, 16)
- Me.editGenreLabel.TabIndex = 24
- Me.editGenreLabel.Text = "Genre:"
- '
- 'editPubDateTextBox
- '
- Me.editPubDateTextBox.BackColor = System.Drawing.Color.Black
- Me.editPubDateTextBox.ForeColor = System.Drawing.Color.White
- Me.editPubDateTextBox.Location = New System.Drawing.Point(111, 74)
- Me.editPubDateTextBox.Name = "editPubDateTextBox"
- Me.editPubDateTextBox.Size = New System.Drawing.Size(125, 22)
- Me.editPubDateTextBox.TabIndex = 22
- '
- 'submitButton
- '
- Me.submitButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.submitButton.Location = New System.Drawing.Point(184, 163)
- Me.submitButton.Name = "submitButton"
- Me.submitButton.Size = New System.Drawing.Size(119, 25)
- Me.submitButton.TabIndex = 17
- Me.submitButton.Text = "Submit Updates"
- Me.submitButton.UseVisualStyleBackColor = True
- '
- 'editGenreTextBox
- '
- Me.editGenreTextBox.BackColor = System.Drawing.Color.Black
- Me.editGenreTextBox.ForeColor = System.Drawing.Color.White
- Me.editGenreTextBox.Location = New System.Drawing.Point(111, 128)
- Me.editGenreTextBox.Name = "editGenreTextBox"
- Me.editGenreTextBox.Size = New System.Drawing.Size(125, 22)
- Me.editGenreTextBox.TabIndex = 23
- '
- 'filterTab
- '
- Me.filterTab.BackColor = System.Drawing.Color.Black
- Me.filterTab.Controls.Add(Me.groupBox1)
- Me.filterTab.ForeColor = System.Drawing.Color.White
- Me.filterTab.Location = New System.Drawing.Point(4, 25)
- Me.filterTab.Name = "filterTab"
- Me.filterTab.Size = New System.Drawing.Size(346, 218)
- Me.filterTab.TabIndex = 3
- Me.filterTab.Text = "Filter"
- '
- 'groupBox1
- '
- Me.groupBox1.Controls.Add(Me.matchesComboBox)
- Me.groupBox1.Controls.Add(Me.matchesLabel)
- Me.groupBox1.Controls.Add(Me.applyLabel)
- Me.groupBox1.Controls.Add(Me.condition4Panel)
- Me.groupBox1.Controls.Add(Me.condition3Panel)
- Me.groupBox1.Controls.Add(Me.condition2Panel)
- Me.groupBox1.Controls.Add(Me.condition1Panel)
- Me.groupBox1.Controls.Add(Me.clearButton)
- Me.groupBox1.Controls.Add(Me.addFilterButton)
- Me.groupBox1.Location = New System.Drawing.Point(6, 6)
- Me.groupBox1.Name = "groupBox1"
- Me.groupBox1.Size = New System.Drawing.Size(334, 201)
- Me.groupBox1.TabIndex = 2
- Me.groupBox1.TabStop = False
- '
- 'matchesComboBox
- '
- Me.matchesComboBox.BackColor = System.Drawing.Color.Black
- Me.matchesComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.matchesComboBox.ForeColor = System.Drawing.Color.White
- Me.matchesComboBox.FormattingEnabled = True
- Me.matchesComboBox.Items.AddRange(New Object() {"Any", "All"})
- Me.matchesComboBox.Location = New System.Drawing.Point(255, 28)
- Me.matchesComboBox.Name = "matchesComboBox"
- Me.matchesComboBox.Size = New System.Drawing.Size(67, 24)
- Me.matchesComboBox.TabIndex = 59
- Me.matchesComboBox.Text = "Any"
- Me.matchesComboBox.Visible = False
- '
- 'matchesLabel
- '
- Me.matchesLabel.AutoSize = True
- Me.matchesLabel.Location = New System.Drawing.Point(187, 33)
- Me.matchesLabel.Name = "matchesLabel"
- Me.matchesLabel.Size = New System.Drawing.Size(62, 16)
- Me.matchesLabel.TabIndex = 58
- Me.matchesLabel.Text = "Matches:"
- Me.matchesLabel.Visible = False
- '
- 'applyLabel
- '
- Me.applyLabel.AutoSize = True
- Me.applyLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.applyLabel.Location = New System.Drawing.Point(7, 53)
- Me.applyLabel.Name = "applyLabel"
- Me.applyLabel.Size = New System.Drawing.Size(33, 13)
- Me.applyLabel.TabIndex = 57
- Me.applyLabel.Text = "Apply"
- Me.applyLabel.Visible = False
- '
- 'condition4Panel
- '
- Me.condition4Panel.Controls.Add(Me.condition4CheckBox)
- Me.condition4Panel.Controls.Add(Me.operator4ComboBox)
- Me.condition4Panel.Controls.Add(Me.condition4ComboBox)
- Me.condition4Panel.Controls.Add(Me.condition4TextBox)
- Me.condition4Panel.Location = New System.Drawing.Point(5, 163)
- Me.condition4Panel.Name = "condition4Panel"
- Me.condition4Panel.Size = New System.Drawing.Size(324, 36)
- Me.condition4Panel.TabIndex = 56
- Me.condition4Panel.Visible = False
- '
- 'condition4CheckBox
- '
- Me.condition4CheckBox.AutoSize = True
- Me.condition4CheckBox.Location = New System.Drawing.Point(7, 11)
- Me.condition4CheckBox.Name = "condition4CheckBox"
- Me.condition4CheckBox.Size = New System.Drawing.Size(15, 14)
- Me.condition4CheckBox.TabIndex = 54
- Me.condition4CheckBox.UseVisualStyleBackColor = True
- '
- 'operator4ComboBox
- '
- Me.operator4ComboBox.BackColor = System.Drawing.Color.Black
- Me.operator4ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.operator4ComboBox.ForeColor = System.Drawing.Color.White
- Me.operator4ComboBox.FormattingEnabled = True
- Me.operator4ComboBox.Items.AddRange(New Object() {"=", ">", "<", ">=", "<>"})
- Me.operator4ComboBox.Location = New System.Drawing.Point(131, 6)
- Me.operator4ComboBox.Name = "operator4ComboBox"
- Me.operator4ComboBox.Size = New System.Drawing.Size(78, 24)
- Me.operator4ComboBox.TabIndex = 53
- Me.operator4ComboBox.Text = "="
- '
- 'condition4ComboBox
- '
- Me.condition4ComboBox.BackColor = System.Drawing.Color.Black
- Me.condition4ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.condition4ComboBox.ForeColor = System.Drawing.Color.White
- Me.condition4ComboBox.FormattingEnabled = True
- Me.condition4ComboBox.Items.AddRange(New Object() {"Title", "ISBN", "Publish Year", "Price", "Genre"})
- Me.condition4ComboBox.Location = New System.Drawing.Point(29, 6)
- Me.condition4ComboBox.Name = "condition4ComboBox"
- Me.condition4ComboBox.Size = New System.Drawing.Size(96, 24)
- Me.condition4ComboBox.TabIndex = 52
- Me.condition4ComboBox.Text = "Condition"
- '
- 'condition4TextBox
- '
- Me.condition4TextBox.BackColor = System.Drawing.Color.Black
- Me.condition4TextBox.ForeColor = System.Drawing.Color.White
- Me.condition4TextBox.Location = New System.Drawing.Point(215, 6)
- Me.condition4TextBox.Name = "condition4TextBox"
- Me.condition4TextBox.Size = New System.Drawing.Size(102, 22)
- Me.condition4TextBox.TabIndex = 51
- '
- 'condition3Panel
- '
- Me.condition3Panel.Controls.Add(Me.condition3CheckBox)
- Me.condition3Panel.Controls.Add(Me.operator3ComboBox)
- Me.condition3Panel.Controls.Add(Me.condition3ComboBox)
- Me.condition3Panel.Controls.Add(Me.condition3TextBox)
- Me.condition3Panel.Location = New System.Drawing.Point(5, 130)
- Me.condition3Panel.Name = "condition3Panel"
- Me.condition3Panel.Size = New System.Drawing.Size(324, 36)
- Me.condition3Panel.TabIndex = 55
- Me.condition3Panel.Visible = False
- '
- 'condition3CheckBox
- '
- Me.condition3CheckBox.AutoSize = True
- Me.condition3CheckBox.Location = New System.Drawing.Point(7, 11)
- Me.condition3CheckBox.Name = "condition3CheckBox"
- Me.condition3CheckBox.Size = New System.Drawing.Size(15, 14)
- Me.condition3CheckBox.TabIndex = 54
- Me.condition3CheckBox.UseVisualStyleBackColor = True
- '
- 'operator3ComboBox
- '
- Me.operator3ComboBox.BackColor = System.Drawing.Color.Black
- Me.operator3ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.operator3ComboBox.ForeColor = System.Drawing.Color.White
- Me.operator3ComboBox.FormattingEnabled = True
- Me.operator3ComboBox.Items.AddRange(New Object() {"=", ">", "<", ">=", "<>"})
- Me.operator3ComboBox.Location = New System.Drawing.Point(131, 6)
- Me.operator3ComboBox.Name = "operator3ComboBox"
- Me.operator3ComboBox.Size = New System.Drawing.Size(78, 24)
- Me.operator3ComboBox.TabIndex = 53
- Me.operator3ComboBox.Text = "="
- '
- 'condition3ComboBox
- '
- Me.condition3ComboBox.BackColor = System.Drawing.Color.Black
- Me.condition3ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.condition3ComboBox.ForeColor = System.Drawing.Color.White
- Me.condition3ComboBox.FormattingEnabled = True
- Me.condition3ComboBox.Items.AddRange(New Object() {"Title", "ISBN", "Publish Year", "Price", "Genre"})
- Me.condition3ComboBox.Location = New System.Drawing.Point(29, 6)
- Me.condition3ComboBox.Name = "condition3ComboBox"
- Me.condition3ComboBox.Size = New System.Drawing.Size(96, 24)
- Me.condition3ComboBox.TabIndex = 52
- Me.condition3ComboBox.Text = "Condition"
- '
- 'condition3TextBox
- '
- Me.condition3TextBox.BackColor = System.Drawing.Color.Black
- Me.condition3TextBox.ForeColor = System.Drawing.Color.White
- Me.condition3TextBox.Location = New System.Drawing.Point(215, 6)
- Me.condition3TextBox.Name = "condition3TextBox"
- Me.condition3TextBox.Size = New System.Drawing.Size(102, 22)
- Me.condition3TextBox.TabIndex = 51
- '
- 'condition2Panel
- '
- Me.condition2Panel.Controls.Add(Me.condition2CheckBox)
- Me.condition2Panel.Controls.Add(Me.operator2ComboBox)
- Me.condition2Panel.Controls.Add(Me.condition2ComboBox)
- Me.condition2Panel.Controls.Add(Me.condition2TextBox)
- Me.condition2Panel.Location = New System.Drawing.Point(5, 97)
- Me.condition2Panel.Name = "condition2Panel"
- Me.condition2Panel.Size = New System.Drawing.Size(324, 36)
- Me.condition2Panel.TabIndex = 50
- Me.condition2Panel.Visible = False
- '
- 'condition2CheckBox
- '
- Me.condition2CheckBox.AutoSize = True
- Me.condition2CheckBox.Location = New System.Drawing.Point(7, 11)
- Me.condition2CheckBox.Name = "condition2CheckBox"
- Me.condition2CheckBox.Size = New System.Drawing.Size(15, 14)
- Me.condition2CheckBox.TabIndex = 54
- Me.condition2CheckBox.UseVisualStyleBackColor = True
- '
- 'operator2ComboBox
- '
- Me.operator2ComboBox.BackColor = System.Drawing.Color.Black
- Me.operator2ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.operator2ComboBox.ForeColor = System.Drawing.Color.White
- Me.operator2ComboBox.FormattingEnabled = True
- Me.operator2ComboBox.Items.AddRange(New Object() {"=", ">", "<", ">=", "<>"})
- Me.operator2ComboBox.Location = New System.Drawing.Point(131, 6)
- Me.operator2ComboBox.Name = "operator2ComboBox"
- Me.operator2ComboBox.Size = New System.Drawing.Size(78, 24)
- Me.operator2ComboBox.TabIndex = 53
- Me.operator2ComboBox.Text = "="
- '
- 'condition2ComboBox
- '
- Me.condition2ComboBox.BackColor = System.Drawing.Color.Black
- Me.condition2ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.condition2ComboBox.ForeColor = System.Drawing.Color.White
- Me.condition2ComboBox.FormattingEnabled = True
- Me.condition2ComboBox.Items.AddRange(New Object() {"Title", "ISBN", "Publish Year", "Price", "Genre"})
- Me.condition2ComboBox.Location = New System.Drawing.Point(29, 6)
- Me.condition2ComboBox.Name = "condition2ComboBox"
- Me.condition2ComboBox.Size = New System.Drawing.Size(96, 24)
- Me.condition2ComboBox.TabIndex = 52
- Me.condition2ComboBox.Text = "Condition"
- '
- 'condition2TextBox
- '
- Me.condition2TextBox.BackColor = System.Drawing.Color.Black
- Me.condition2TextBox.ForeColor = System.Drawing.Color.White
- Me.condition2TextBox.Location = New System.Drawing.Point(215, 6)
- Me.condition2TextBox.Name = "condition2TextBox"
- Me.condition2TextBox.Size = New System.Drawing.Size(102, 22)
- Me.condition2TextBox.TabIndex = 51
- '
- 'condition1Panel
- '
- Me.condition1Panel.Controls.Add(Me.condition1CheckBox)
- Me.condition1Panel.Controls.Add(Me.operator1ComboBox)
- Me.condition1Panel.Controls.Add(Me.condition1ComboBox)
- Me.condition1Panel.Controls.Add(Me.condition1TextBox)
- Me.condition1Panel.Location = New System.Drawing.Point(5, 65)
- Me.condition1Panel.Name = "condition1Panel"
- Me.condition1Panel.Size = New System.Drawing.Size(324, 36)
- Me.condition1Panel.TabIndex = 49
- Me.condition1Panel.Visible = False
- '
- 'condition1CheckBox
- '
- Me.condition1CheckBox.AutoSize = True
- Me.condition1CheckBox.Location = New System.Drawing.Point(7, 11)
- Me.condition1CheckBox.Name = "condition1CheckBox"
- Me.condition1CheckBox.Size = New System.Drawing.Size(15, 14)
- Me.condition1CheckBox.TabIndex = 54
- Me.condition1CheckBox.UseVisualStyleBackColor = True
- '
- 'operator1ComboBox
- '
- Me.operator1ComboBox.BackColor = System.Drawing.Color.Black
- Me.operator1ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.operator1ComboBox.ForeColor = System.Drawing.Color.White
- Me.operator1ComboBox.FormattingEnabled = True
- Me.operator1ComboBox.Items.AddRange(New Object() {"=", ">", "<", ">=", "<>"})
- Me.operator1ComboBox.Location = New System.Drawing.Point(131, 6)
- Me.operator1ComboBox.Name = "operator1ComboBox"
- Me.operator1ComboBox.Size = New System.Drawing.Size(78, 24)
- Me.operator1ComboBox.TabIndex = 53
- Me.operator1ComboBox.Text = "="
- '
- 'condition1ComboBox
- '
- Me.condition1ComboBox.BackColor = System.Drawing.Color.Black
- Me.condition1ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.condition1ComboBox.ForeColor = System.Drawing.Color.White
- Me.condition1ComboBox.FormattingEnabled = True
- Me.condition1ComboBox.Items.AddRange(New Object() {"Title", "ISBN", "Publish Year", "Price", "Genre"})
- Me.condition1ComboBox.Location = New System.Drawing.Point(29, 6)
- Me.condition1ComboBox.Name = "condition1ComboBox"
- Me.condition1ComboBox.Size = New System.Drawing.Size(96, 24)
- Me.condition1ComboBox.TabIndex = 52
- Me.condition1ComboBox.Text = "Condition"
- '
- 'condition1TextBox
- '
- Me.condition1TextBox.BackColor = System.Drawing.Color.Black
- Me.condition1TextBox.ForeColor = System.Drawing.Color.White
- Me.condition1TextBox.Location = New System.Drawing.Point(215, 6)
- Me.condition1TextBox.Name = "condition1TextBox"
- Me.condition1TextBox.Size = New System.Drawing.Size(102, 22)
- Me.condition1TextBox.TabIndex = 51
- '
- 'clearButton
- '
- Me.clearButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.clearButton.Location = New System.Drawing.Point(94, 19)
- Me.clearButton.Name = "clearButton"
- Me.clearButton.Size = New System.Drawing.Size(87, 25)
- Me.clearButton.TabIndex = 27
- Me.clearButton.Text = "Clear last"
- Me.clearButton.UseVisualStyleBackColor = True
- '
- 'addFilterButton
- '
- Me.addFilterButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.addFilterButton.Location = New System.Drawing.Point(11, 19)
- Me.addFilterButton.Name = "addFilterButton"
- Me.addFilterButton.Size = New System.Drawing.Size(77, 25)
- Me.addFilterButton.TabIndex = 17
- Me.addFilterButton.Text = "Add Filter"
- Me.addFilterButton.UseVisualStyleBackColor = True
- '
- 'filterBox
- '
- Me.filterBox.Controls.Add(Me.filterTreeView)
- Me.filterBox.ForeColor = System.Drawing.Color.White
- Me.filterBox.Location = New System.Drawing.Point(34, 278)
- Me.filterBox.Name = "filterBox"
- Me.filterBox.Size = New System.Drawing.Size(284, 391)
- Me.filterBox.TabIndex = 8
- Me.filterBox.TabStop = False
- Me.filterBox.Text = "Filtered Book List"
- Me.filterBox.Visible = False
- '
- 'filterTreeView
- '
- Me.filterTreeView.BackColor = System.Drawing.Color.Black
- Me.filterTreeView.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.filterTreeView.ForeColor = System.Drawing.Color.White
- Me.filterTreeView.Location = New System.Drawing.Point(10, 19)
- Me.filterTreeView.Name = "filterTreeView"
- Me.filterTreeView.Size = New System.Drawing.Size(258, 366)
- Me.filterTreeView.TabIndex = 3
- '
- 'Form1
- '
- Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
- Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
- Me.BackColor = System.Drawing.SystemColors.ActiveCaptionText
- Me.ClientSize = New System.Drawing.Size(1203, 727)
- Me.Controls.Add(Me.filterBox)
- Me.Controls.Add(Me.tabControl1)
- Me.Controls.Add(Me.TextGroupBox)
- Me.Controls.Add(Me.TreeViewGroupBox)
- Me.Name = "Form1"
- Me.Text = "In Memory XML Processing App"
- Me.TreeViewGroupBox.ResumeLayout(False)
- Me.TextGroupBox.ResumeLayout(False)
- Me.tabControl1.ResumeLayout(False)
- Me.loadTab.ResumeLayout(False)
- Me.optionsGroupBox.ResumeLayout(False)
- Me.optionsGroupBox.PerformLayout()
- Me.addTab.ResumeLayout(False)
- Me.addElementGroupBox.ResumeLayout(False)
- Me.addElementGroupBox.PerformLayout()
- Me.editTab.ResumeLayout(False)
- Me.EditElementGroupBox.ResumeLayout(False)
- Me.EditElementGroupBox.PerformLayout()
- Me.filterTab.ResumeLayout(False)
- Me.groupBox1.ResumeLayout(False)
- Me.groupBox1.PerformLayout()
- Me.condition4Panel.ResumeLayout(False)
- Me.condition4Panel.PerformLayout()
- Me.condition3Panel.ResumeLayout(False)
- Me.condition3Panel.PerformLayout()
- Me.condition2Panel.ResumeLayout(False)
- Me.condition2Panel.PerformLayout()
- Me.condition1Panel.ResumeLayout(False)
- Me.condition1Panel.PerformLayout()
- Me.filterBox.ResumeLayout(False)
- Me.ResumeLayout(False)
-
- End Sub
- Dim TreeViewGroupBox As System.Windows.Forms.GroupBox
- Dim WithEvents xmlTreeView As System.Windows.Forms.TreeView
- Dim TextGroupBox As System.Windows.Forms.GroupBox
- Dim XmlTextBox As System.Windows.Forms.RichTextBox
- Dim WithEvents tabControl1 As System.Windows.Forms.TabControl
- Dim addTab As System.Windows.Forms.TabPage
- Dim loadTab As System.Windows.Forms.TabPage
- Dim editTab As System.Windows.Forms.TabPage
- Dim WithEvents loadButton As System.Windows.Forms.Button
- Dim optionsGroupBox As System.Windows.Forms.GroupBox
- Dim generateCheckBox As System.Windows.Forms.CheckBox
- Dim WithEvents validateCheckBox As System.Windows.Forms.CheckBox
- Dim addElementGroupBox As System.Windows.Forms.GroupBox
- Dim newPositionLabel As System.Windows.Forms.Label
- Dim WithEvents positionComboBox As System.Windows.Forms.ComboBox
- Dim newTitleTextBox As System.Windows.Forms.TextBox
- Dim newTitleLabel As System.Windows.Forms.Label
- Dim newISBNLabel As System.Windows.Forms.Label
- Dim newPriceLabel As System.Windows.Forms.Label
- Dim newISBNTextBox As System.Windows.Forms.TextBox
- Dim newPriceTextBox As System.Windows.Forms.TextBox
- Dim newPubDateLabel As System.Windows.Forms.Label
- Dim newGenreLabel As System.Windows.Forms.Label
- Dim newPubDateTextBox As System.Windows.Forms.TextBox
- Dim WithEvents addNewBookButton As System.Windows.Forms.Button
- Dim newGenreTextBox As System.Windows.Forms.TextBox
- Dim generateSchemaCheckBox As System.Windows.Forms.CheckBox
- Dim EditElementGroupBox As System.Windows.Forms.GroupBox
- Dim editTitleTextBox As System.Windows.Forms.TextBox
- Dim editTitleLabel As System.Windows.Forms.Label
- Dim editISBNLabel As System.Windows.Forms.Label
- Dim editPriceLabel As System.Windows.Forms.Label
- Dim editISBNTextBox As System.Windows.Forms.TextBox
- Dim editPriceTextBox As System.Windows.Forms.TextBox
- Dim editPubDateLabel As System.Windows.Forms.Label
- Dim editGenreLabel As System.Windows.Forms.Label
- Dim editPubDateTextBox As System.Windows.Forms.TextBox
- Dim WithEvents submitButton As System.Windows.Forms.Button
- Dim editGenreTextBox As System.Windows.Forms.TextBox
- Dim WithEvents deleteButton As System.Windows.Forms.Button
- Dim toolTip1 As System.Windows.Forms.ToolTip
- Dim WithEvents positionDownButton As System.Windows.Forms.Button
- Dim WithEvents positionUpButton As System.Windows.Forms.Button
- Dim WithEvents saveButton As System.Windows.Forms.Button
- Dim WithEvents refreshTreeButton As System.Windows.Forms.Button
- Dim filterTab As System.Windows.Forms.TabPage
- Dim groupBox1 As System.Windows.Forms.GroupBox
- Dim WithEvents clearButton As System.Windows.Forms.Button
- Dim condition1Panel As System.Windows.Forms.Panel
- Dim WithEvents addFilterButton As System.Windows.Forms.Button
- Dim condition4Panel As System.Windows.Forms.Panel
- Dim WithEvents condition4CheckBox As System.Windows.Forms.CheckBox
- Dim operator4ComboBox As System.Windows.Forms.ComboBox
- Dim WithEvents condition4ComboBox As System.Windows.Forms.ComboBox
- Dim condition4TextBox As System.Windows.Forms.TextBox
- Dim condition3Panel As System.Windows.Forms.Panel
- Dim WithEvents condition3CheckBox As System.Windows.Forms.CheckBox
- Dim operator3ComboBox As System.Windows.Forms.ComboBox
- Dim WithEvents condition3ComboBox As System.Windows.Forms.ComboBox
- Dim condition3TextBox As System.Windows.Forms.TextBox
- Dim condition2Panel As System.Windows.Forms.Panel
- Dim WithEvents condition2CheckBox As System.Windows.Forms.CheckBox
- Dim operator2ComboBox As System.Windows.Forms.ComboBox
- Dim WithEvents condition2ComboBox As System.Windows.Forms.ComboBox
- Dim condition2TextBox As System.Windows.Forms.TextBox
- Dim WithEvents condition1CheckBox As System.Windows.Forms.CheckBox
- Dim operator1ComboBox As System.Windows.Forms.ComboBox
- Dim WithEvents condition1ComboBox As System.Windows.Forms.ComboBox
- Dim condition1TextBox As System.Windows.Forms.TextBox
- Dim applyLabel As System.Windows.Forms.Label
- Dim filterBox As System.Windows.Forms.GroupBox
- Dim WithEvents filterTreeView As System.Windows.Forms.TreeView
- Dim WithEvents matchesComboBox As System.Windows.Forms.ComboBox
- Dim matchesLabel As System.Windows.Forms.Label
-
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/form1.resx b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/form1.resx
deleted file mode 100644
index f02a07c46d1dd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/form1.resx
+++ /dev/null
@@ -1,279 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAAB4AAAAfCAIAAAB/DupQAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- wwAADsMBx2+oZAAAB7ZJREFUSEvFln081Nkex79jk4eolVZh4taSDCJEHqO0KuVaepCEWFxJXaVErhAp
- eW4ozwyGkZrMSi4zxjBImBnjWfOAQsraora7r73r7vlpXtvdfe2re3f/2c/rO6/XOd9zznvO73u+3/P7
- wf8lBSVYrSqjqYs3sQGldaiLkwz8YSmrg6Ed2B2Cvd7gEgiuJ8Hlb/DXQNjjhTnREJrwu/WpCpjtAydf
- 8L4IIUm4mIKNWVSTwofmxfX6ObQ110rhTDIcD4e9PmC2F1Z9Jln1v6VtAo6ecOISXLxlQmoMax1M6R1L
- 5IoTuOJ4rvgaT5wz+KxkZDKIzlW5XgZeEbD7GGgbS9Z+TAa24BKANqWaVRP7+MlVnvgyRxTdI4jpEcZx
- hLE9gmu94vtjLx6/fN0286puYjawoRvOpsGBr8DARkL4belZgWsQhN20rmSl9k1Ec0SxHGEiV5TME6f1
- ijN6xem94tv9E8zJb4Sv34rmv+ufe8Ocmsvmj8lE52FnQLCUcH6t9ZvhgB+EZdpUtSYPTcf1TaQNPssd
- nS4VzJQPPyMPPSUPjJP6xMV8Ub1wemRu4e0PP/64uPj87b9ap18VDz1dFnUbOxu8joT2QcvlYOcRCLmO
- z6m7KXiZXNf89+gEuyO+G2ydFPUtDf3CrIMvHYxJiyik5D9glDHYDe1dUzMv/rOk2Xffo+CkcoRw6hrY
- HwZpWQlTIn0rOBYGcaTMwWd+jd0rNpmCuj5sNAaNLfiDAWc6hMF0/hlmvwe5UXqb4/6QiPapuZbOnm/n
- F5bgi+ML79jPX395twWOhv4yLDJy4OAB59L3UDs2U7vgSjGoE0DXArONxtruJ//RMXKpiXulbcAntwrW
- bgKlDUFUVlJOUVff4Mzs3A+Liy/ffd839+bB+EvpiCzY6Q7Lf964hi4cPg0JpdJ5dKkiJj6lAtbr/4wm
- eASjh73Rxif2jJwmUUFND9QIoV+zYd3mxJySdm7fkFA89uqNcP677tmFA1VMcDuFHZtEpl9AYCyk3oM8
- +pqyls1plR/QG7Zu8TxVMDCW3zNIHhBGVdIQF1lsYydCw+cmiXmkOlYbZ0QgWHjXPTsf82gY/KLB2EFC
- xqo2LF3mVh3k0zXIrcYZVf+NNvcNpY3P1IyKGU+nUmsbQB4PK/BZnf2gqgubzEDHPJNEKalj1E99SxE+
- J/aPw+kbsOPgEhflhqOndHSedE6DdAFdu5K9PbMK8EtoHXPQMJTeYpvR0JxV15jXwChqak6kUBOqaw/G
- JMNaHdAyRf9t6uqdRqFlD0/Fowrgj+OicrD6xMItvwr2+cjGFS3Pa5QpZBAq2VbEO4DXw7hapmZ+oeY+
- IUaHfU3d/Sw8vrI85m9+LMD4qL/h0QAz31DV3YcQGkU/mXwva2gKq1XemGJCCezzBjlFhF6J0PLxxTL5
- DNkiuh6Fbf0ejdf3L7xbKpimiSfZz2eG5udm/z2PDDVQt0Y8WTgwfls4K2vigNLU9XxsvuAFugmu88dW
- JJDA6cQSGv32eMnHFSoUMJYXMHQr2ZY3l9BqhFMVD4ndwyTeMG3kScuYmDM1wZmeQA3a8BPkTO/oS+oR
- fuZwCOW+tot30dg36FZAAQEUEHTryq4A+GQZ7HKHcKJmGQuX3/h5BdvsfazVCAFltamdQ3ndg1X9ow9G
- BXSRiC4UoQalfxQ5UTrGdwmUd7qBpqH8rsNF43MxHNHlLgGEpmFAnNTSSVo6Q/DVLWQW5Daol7cYZlCw
- DFEn+JR8ndDWj3ZXgDKPP1I9MIqsgj+CusgZx+JFdYwqIfRfDGGHW7Zo9gpPdKSuG4LiwfLAEhdJxww8
- z+vl18kUMVeSWFrv81pdz72gJpLFj2/pTW3vy348gHaKDDVQN76Fd5HOCW0d+tTeFUPbut548iKpb0Lz
- Fg08wwDdExIprcUCH5W7r44D+Yx1yUvVqK7nnHsvpJEbTu+JaeZebe29zuYnsfmocbkZcwY/7PJv6l9p
- h9BGYOOaLJiN7ByF8GwMhV5SH7R9P/hf3lbG0KZ2SaHsQWi8nkMezaeeE1TfHdrICWfwIpm9yMKbeKiL
- nF61nUeahhTsUUCMYIdr/uS82u1aBAFzJwlTIhUN2O8LF4iBrIHVJCYob0CPqex8Ym9lswuZ7k5hHL/D
- 9F6y41VM1EVOR3KTcRoZNAzQqej4nvNtG4XzNzHImvUS5gdttQePsxBXEsGbwCfkg57N+0LHNvWbtsEI
- tExA3xp2e+yq50NMMbbc0F5C+4WkloH1l3AiEhLKwjnju5lDuGKWKpltUN1hca/TjvrY4T5mqIG6BtWP
- NCntCuVsKGWrVj5CS8A3EqxdQOoTCe3XQpWJbhZED8twqqBfaOYRSA2Qelcuk7qaeH9ddo3qLZpKds0q
- 4n3pTCqkUxWJNOUUCpxLA+9wbCFWgR8RGrZyBreTcDpJLuWO2z+5lzhiZ3rfpupHiiSWVCFDqrBJqbxV
- s7JdvaRJOrUazqZgky32g5yChPBR4XB6llixou+bc+koiCrZtK3lTNtqttUdtkFpkxKxBh0JXMjEJuzx
- whEsft93Gk5hNRjZg8NRbFNeFyEgFk5eRUWLvTQQ0S0IG9q6E4c+B/+g0C2jpgWE7bDNEStfZKihux1z
- YhfQnyKAnwDLOZxsk1HGXQAAAABJRU5ErkJggg==
-
-
-
- 17, 17
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAAB4AAAAfCAIAAAB/DupQAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- wwAADsMBx2+oZAAAB4xJREFUSEvFlnlUk1caxt8AVSnMSFkiCkkAQdbIooiIigpSpR4XFBRR3MAWQQWR
- oq1sLuy7IwIiYSkgIAEELUsSFlkMkBASlhASghGoMiBQ0HGqHeZ+zndmTj3OtJ0z58xz7h85J9/95eZ9
- nvf9LvwOEQhAkMM//w+kqEwgGRGstsEmF9jiClvdYPN+sHEGAytQIeLP/F4RlijBantwOgIHz4NXGPjF
- QGAyfJ0K5+PBOwLcA8H5OKzfBRpkfMNvFEHHDJw84NglCEzVT686/KgzhC2K40nRiu0eDmkXHnnIJicV
- g1c4fHESVm/Gt/26qJtg31dwPoF8uwoRo3tGIrqHQzkStEI44qvc4QLxDw3j0/WjU5GdItWoPDgUABt2
- wyeL8e3/VqgIrmchOG135ZMEgQzhIjiSSK4kpns4njcc1yO9JfyB9Xx2aPZ1//R824vZByMTdnm1cDQY
- Nu4D+U9wyEe00gJcfBDXo4YTzX8awZMm9o+mi57nSia+E7/IGxyPzCn5Nia5rKldNDkz9/bd3E9vBS/n
- akentt9jgUcQrHXCOR9K+TNwOgoXkuxLHycOTSSL/xzP7j9DK3O9lrrTP9QtLD5NIKNLJ/Lbe+Izchqf
- dP04/2phYeHtzz8PTM/Xjb40TiuHvT5AMcVpv9AaRzgV8mky/e7Tl8duJKuttgN1A1hhCiQqkM1BVc/v
- sdCzsj24UXCnXZBbUt4jHPrrT28R/c27d7ypuWLxc7iYDFsPgrwCDsT1B1VwPgGX032b+yj0DjnfG6Cm
- B0brwdgWX8sMv2FyrzTyguo5fgze8Zt5JdW1/RLp6zdv/rawIJt73Tk5d6SqHQ76A0rXL2RoDccvKyTc
- V6Q1LLnLsCjv3JZbC2Tqv+jLTYJKa5M7BqJb+FebeFfahCprHcrqGrr7hWMzcyNzfxHOvEKWQkAC2O3B
- mbg27YMLCXCzCrIY2nkNDtXcVd6XQdcCg65ah/2Alplven5B33BmZ3/Kk95EjtjcO0jZwr60htXa0yeZ
- fzM0+6rlxazRLTrsOAZKS3EsLP4UdhyVD8siZNQtzmYYFzVvL2QB0QAjGlgvtd0BmsagTXUPj62TjZX0
- imjcgTSu6NSdEmSGkfOh7JJy5vg0c2yqWDqxvbgBDpyF5Xo4GZsGe79Uii2CzPo/0pjryjsongGga4mh
- iYbFw8+vFNBhkebewBDO5EStWHK/T0TjiUK/bwVNI+Sz16WIbJ44tfdpVM/IoeoOLOMoxLg0SHDATyWx
- FO4wVGmszY96FpnbY3XQszI8cKpEMl4z8uyxTDY4M9E7MdomG6keFBf2Dt2ob8fQBtYqVlsKBFg3oaY9
- Wc+Dk6FgYouTMbSrn1oKHTIZarks++pu0DLBjkyiukWnFQ5IHwjFbc+eDk6OSafHBmYnm8bGS4XSi4VV
- WDTRY6orMziiJD42DzA0mmWmG3AyqGuDyxnNlDLs1Dksu/IOWGH03jpT39zyXIGY3j/UIJVyxmWSVy+3
- eZ1zD4tmTs07X4oCijkY2oC2WTjvWTJfeo037PqwE05cAeN1OBnrw12nVOMKFWksZRrTppoHlPex0zL1
- ya3I7BYV8gerBsUMyTD/xxnMA03jxeb2StaOsMoGFY3o4n2iaSCZP3KdN7KxqAHreIoJTgY5eXBwJ3xz
- W7+oRS6r3qyCo7xxNxisRQXZH5eV0iXK6Oov6BGW9olqZONbfYJAxwJzAnHRz5OpuyrYTlVdifyRGIFM
- PakU9vmA2gqcjMn6c/jq2obSFsio0y5u0wmIwvpF19L0mH9Mlziulf8ndm9mVz8qjn9OGVbif/QRQuuv
- WbrjsGUBK77vWWinGC6mwnYPUFiEYzFpG4LrOe2b5fol7Sja5hUc0DHHjkYxD2FLQhp415t7UB/GtgqS
- uyWw7L0T/6RrmRBN1t2UzdoUNWIeWjniTFxyCrDtIPgnHK7rhqz6ZYUtq2LygKgP5NVrL1wPahEG1nGC
- GdxLDG44W6zhcACVGPQsgWSGlpzjIYvE/Oi+Mfj2Duw5jYXiQ6Gcu51TiCrwaxuEjFpyWSclOBE0VoKG
- vst3dafred7VbO+H7C/ruu1CU5ANJI/z1Ng8o0qufGHbiXaxZtoD8AoFm5047UOhyeIVpnW7KrBDTMiq
- 1yx5YpBSKofyv5S09Vbp/kq2S1nrnrLW3Q86nWv46ys6dYtaFLOZhLtMaj4TLiTC50ewCfpxoS8cD8OZ
- SK306nCulHKvRSGbtbKSR4mkqR0NsKOzbYuarYuaqAWNevkN6jksFKcltAaV9EcQfAv2eIMOFed8XEQy
- ZrHPNfnYYt/H/d5tg8uy6yDxvnLG96ibNHKYn9GYStlM+bsMyGIS85sUU8ohKAUrsZENTvhPUtfCrjKe
- weglqZlU4kZvPtvc+wVDYEZnk+61kO616he3amfXE9Fhr+agyMJOT9C3xPf+uhYpgpUDmrTg+TWKDYTn
- KCeVkTIfkjMfqaRWQDgNOykyDRXBdheoLsd3/XYRVIgE8y2oUWHvaXAPwP4HuvR4XMTe+sgxG2fCcj0C
- /ux/J3R3QVFFY8FgDbZ0qQQiGbu2/d8E8HfFSE6iQQnYUAAAAABJRU5ErkJggg==
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAAB4AAAAfCAIAAAB/DupQAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- wwAADsMBx2+oZAAAB7ZJREFUSEullnlUU9cWh3dQqlAVrcjgwBMhVKhiBURQBCwCWlB5ClJF0KqtVXCo
- U3EJgoKEIchQRcYwBmRQEAUhCUlIgpEhE4mADAmDVgYRgvIebUV7brx9PrtcrV39rfPHvXfd85199t5n
- 7wMfKrUpMFUdpkzFX/+ppn4EC4xhhQPYeYCjF3zhDet3gP02WOUChubw8Wz8t7+nKeqw1BoD/fs72HMW
- DkXA8ctw5kc4nQj+UbAvGDyPgLMPWG6AWdr4lA+S3mJw8ATvYxAQrRmZ71rC+Z4jixLJyeJuslgRJZSf
- 4sjcitkaIangG4gt8Kk1PvEvZGwBG/3gYBhcyttHF8U294SJFCFC+XlBV7CgM7ipk9zcXd4zxHz87HbP
- 0LfVTXAmETy+AysXIBBwwvtFtIDN++F4rGFaZYy4+4III4YJu0iirmiRPFbWS5b2UtoeCYaUHcpxyfBz
- 9k8jOW2P9GLywesorNqIQ94jfSPYtBe+v7wsm35Z2ougESJ5nERxTdqdLuvJaX8SU0aLLKqgtvY1DIz2
- jv1n/NeXg//9+f6gskwxYJhQDNsDwNwBR70j9elY0PwjdJJux8v6SGLFFVlPZFNHUF1LEFdGauryj00O
- jIqPTM6MziyofaLsGn3x6+Tk69evX/zysmlorFQ+oBWWCW77MPv+qGV24HMKLuaQJT3ID64VjaZ5LOs8
- lmshZ9sN3gGmTO3z9aC7dPoK+w1+h7iDzwX9I4PjE69evUL00Ylf6geViWI5HI6AddsA/t/pGjOwQJ9M
- 2H6n0a1arJZaTcxhOhVyt9+s21vOP1zZEHy/Q2uNGxBXgYk1zDUK5HfcaO1rHVYOjU+8fPXq5eRkp3Kc
- P6D8Io8G2w7DoqU4FtMSc9h5AiKohgU8SKlekstywIyt+/r2/aNVTWdrhHFixSd2KvRSG5hvFi1S+Fc2
- UMRdbcNjfWPj/eMTirFx2cgLSksvcinYuuNYTGs2QwAJ4ssgla6dxbTMr3Uv4fmW849UNZ5jikhcSVbb
- I207dxytb5rW+iiELQq425Ai7BANjLQNP5crx9uV49z+Uf3oPHDxBU0tFRedZmcfwrlratfuTslgLM5l
- ORZyvErrDlY0BDKEEVzJlfoHt7qf6Ni7gzGOLpb3x9Q1BzFF+2/fz2mWM7oHuY+Hef0jpd1DdrnIJ/6/
- B3PmJ7DlwLRLOWqpdA1KjWke27WI53Pr3tGqxhCWKI4vzRS2svuH9DC0lQptVvV4CK0XzpGcoAl8b927
- 8fBR1oPepAdY1nuU1sHuM2BiqULPnY98r0UuRN6YmclcQa11K+Gi6KFpaPLVellB88PGZ8/mO2zG0Xqm
- nMHhtKaWaF5zYI1wTzk/lCujoEwVdV0Qyn2rBFiFWb5OhdYxAE9/7bgSSGPMzmKupLI3l6AA8s9xW2Ib
- 2pIbW4pk7ZLRkQWOb9H3nj6jCFvJddIQ7oMAhgQlUn5rX7S466JYvocmhAMhYOGkQs9dgKzWjitG6FmZ
- zM9VMTzElNoeu7A1LDG/86dC6UPByDtW84aeZQhak5q7vRNzVp8I33pHEC/sJIvlF0XyHRWNmNXm9ir0
- rLnI17OjqZoUpgaF8Rmy+laDbVA8yl+Ya+x0/HzF46e8waf6b9FmjCdPqR2Pt0dchTlLYJ4x8Vj4aX47
- WaIIFyvWF7LB9wcwsVKh1aeBiw8hKNkwn6OWTkdJ7XyD755RDtpGGGieievJ0PqJSd23GWLGVP68MzoZ
- Wxu9ahtZRmX5MCQxEgWpuWfRlVLwOgILiCo00tqtKK9XF3EhhaaXzbQpqPWqFG5JKgId4hu6d3iCodtO
- HL1kZQClBOfqEG1CrziVC1zK66Mk3SSRAgKvwZd7YMYcnIzV0l0njVNu61K5GhkMlH8birh+NIlHUiHM
- U9ENVsBSW+wBG7ZgYP6Guzb0R0+a1DyPva7sfqysZ1MZHw5fwrrdW32sBRt9UX/aRRejg66bzbQsqN1U
- zNtLl2y9UoDT0TC1xcabZ8Q9n7iTLrW7zpmfVeNwpzHhQR+E5cKOI2C4DMfiWuEIfmfmJd78iiWD5KpF
- OSxrFd2XJtmUQMU98z+0DnF1UJw3XWpfyDHJY09Jox3gtVpRWRAQiXXnP3b96TPAaScERK29XuvFRPTq
- hdlMi/xaVP8874odY3NxOhq6xJVnYz2qpbYFtca5bK3MGhQhP7TdH5LA4yAYmOHAd2RgCu77UWndcLPO
- n9+OskWLwkBGWeXXOt8RWpAooI1SzejT09GOFZJlVPbCHJYmhQHpjAXZTAihwK4TYOmMo94jM1ts5ZMJ
- pln0MFG3RVk9cv0sCgPtwPRGw7/I1IXhGSZlQv1s5kxKDaTTp2ex5qXTIJQCvmdgzRbsGvRnQnT3fZjX
- SPnb7wqChYr1lcI5ubWQSiOQcgmXsiDhJmTUzM7l6GezNOJLIfAqeB8FG3fsfPy1kGecvoLdp+FkPITn
- Lc+p2VYp8C7lbLzOtMmlLU8pJ6ZVTrtcAkEp8G0ofLn392P9gUJRRfcx1NXQRefgRfAnoU4PpxLhVAIc
- J8M3IVgjdfsaM1Z7ET7l70lzJixeRljlijV7l92wyQ9cfbENrdlCQFViji7+2z8RatEE9WmEaZqEjzQI
- BDX8658L4Df7IJnYzd+2ZQAAAABJRU5ErkJggg==
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAAB4AAAAfCAIAAAB/DupQAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- wwAADsMBx2+oZAAAB6VJREFUSEutlnlcU1cWx89DLLI4tshWQVRQFo2ioCgqVWGogAiyVHHBiHXDBSii
- dVBkVSgIaJ0KCgRMArJvAhqSkJ1VkrAWBJKA4FLFCoLWKdTeh8+ZOh+nH9vO7/M+74/3efd7f/fcc869
- 8IHCAMOmKGNKyhjx4a8JUTDduRhpDazdAhu2gr032G2DdV7YSifMeCk2XZP47w8Jhxpb4Dj3Q0AOgcMx
- cPwShCRjIckQmAD7I8A7CBzJgObQ1CPGfJBmzgJbd/jiGBz9Ri0227FQGCzoiJPI46WKeKk8QSoPq+/a
- UV6rF5cFvmfAaQ8s+QwwJWLs72nOItjoAwciIJpGrhIntPRFSeRh4t6zTT3oCW3qiWtWlCh+4D34kXFv
- KLSmQyOSAl/4wxpXUFElCO/XnIWwaQ/4x+sn34yTyiMkMoSLEvfGSmTxEllia39i+73Ujnv1j571DI+1
- PR0VPXxWLH9kmV4BO0/gC1X+iOD8tzQ/xf0GxBul3UKUsKbeGKnsUos8pU1Bae/Llj+5zKyJvp5P7xwQ
- 3X+qGBl78fP48KufpUPPbw8MraMzYUcwWDsRqHeFga0HHIpUv1iU1NYf2yz/tlURWtcZxG0NrG4Ol/Tt
- TUwlB50+n0y5kJnDuf+s6+nzn8YnXr9+/a/xCWSfMTBk+l0RuPvB/GUE7z9Cn7YFwNmMc02yM009tiX1
- RtfZq7K4Tnl8X27H4qNhMNMYDC3QY+609VwqtXX41cDoy/GJXxAd2Rc/eZ7b8wBOfosnqIoawcSlNAU2
- bIPAC/YFwo23JXCVMZ/Ksc8VeBaJAkR3rQMjQNcUzFaBuQ3+NraCTxd6BITIXr1+MPrTq/GJiYlfFCMv
- Gh6PkCvqYHsQmK4gsLhmGYPXEYiial3nwDXGPBrnsxy+eyHOXRkYSXBNrHH0G/r85WC4xNLLt+flhHz4
- xeDoS8XzF9//OFre9xg7cQnVFIHFtWwDHAiHhEJIZWlmVi/L5m3KFx4Rdq0MQH5NwHQVAmmuccbpZjaw
- YIWW7WaYtwzmLiW5+XSMjbc+Gel+Nto9PCZ8NGxxtRQ2fQmf/LuO1nvB8aSPkiuxNJYBlWObw99V1Wzl
- H05wNY2TWELLHQfByAp3rWt6c3BIzcoeocFgscO+AO7DEWb/Y9bAUJ7sB5dCAXh/BfNIk9ypKvD5LuWz
- qVOvVk1NZy2gcT8vqPGgM2CGIZiuRNywgsr6kTGSx24CrWVSoRjM7h5UfUPXNonMyKV1P7jUoohpVpBv
- N+ElSlo7iVb7GzjvUY3KVE5lTqOwF6KsyBfuq5IqobXPmHMyp7xENlD3+LGFJ/ktegGzb4DacjelrQ+n
- q+q5xKTc6HkYJ+kNl/Qe5rTgHcbK4S16k6/GeerUNJYahbWIznMuEJDL6k/X3E24050q7c5p7WwcGlr6
- GzS7f5Aq7UqqbYtp7ParbHArbbje3ndBKovA0a1wMAqsHSfR09TBiawenalOYatQ2OZ0rmOe0Ke0NpBx
- J4rffLmuLaulq/Zd11V9AxmSzgui1tPVEr9bjS75grOijqRmeaREtpshhn3hYGk3iZ6iDPbbsZAr+jSu
- UhrTmMaxzxNsL6k5eqsxlCNJqGmliL9nDT4iub+NtbZJaU9/SmPHeUHzSWbTvvJ653yBL0Oc1KKIlsr/
- ns+H3afAbOUkGmmNGxyLXZzNg2tMfSpnbQ7fo0i0v7wejTw3abxIdt9siw9eLJNoeoc8sbYtjCPxv33H
- p6zWIVfgXFqX0KKIbekzuFyMd2P9BQQZzKzB52uLDIZSOntGBtticid3ltYi4yFsMXJH6eif77qLQOuY
- fCfpjuQ3B1c1oem9ikVrb/BsCmviWhRRYhl8fQUcd4P6DIIMn+iCy5cQlu5Q0YSqfA4NN76lULSnrPbY
- 7cZTbHGCWDbX5S1a1/RcXecJlvhQRQOKGzJBonMsC2qS2u/Z5vLhYCTYuBBYQjabUfu3zeEa5AinpTPN
- 6Fy7XIF7kYhcVotyAGWLgfNOAq1nGsxtOzDJ3VQgXHWDr5PJtilr+KZZAaFp4OH3m2i8kY4hbvzUlcO8
- do1MjkY6CyX4+ly+a4HIu6TGj9Om6+gN8wn0XobYq7jGMR9xeXNpqO1UHRJ1zUouxy2jbXuPltrBzmB0
- boU09Ohk8VXSmKgy0WCHPIHnLam243a8b6D61DbeUiFZnytYms2bTeVMS2cpUapXZHEg6CJKYpipT9De
- kZIyrHWHvachJusf9d0bKsUo7loZbFM6d3mu0OraTdy1nolh4HnLwnojGlcrsxpLY6pmcj5OqUTLBfeD
- YLKcQL1HqtPxlugbAmcpruUNIU0yUmEdWq9qGlObxp9N48zOZOlm8TUo7ClpLEhj6VB5qpeK8RMA3SlI
- tgTkfwoV5+rNsM0fjl9USShwq2g81djjyWkj3eBpJ5ep/bNkxpWyuXm1s+k8nau3ICIT/KJRC3q3/f++
- zFfBxl3gcxK+SoTQ9OkXixZkMCzo1YuorFkp5RCTDWeuwZFz4HkYP8i1DYlRHyqNj/HeaLcV3A7AzuOw
- 9wx+OdkfhocLnaJox1a7gqE58fOfEdpbLX0wWowtWo1ZrMOW2GJorwxM4M9d+P4/AvgVfdiJ1gRIRIEA
- AAAASUVORK5CYII=
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/form1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/form1.vb
deleted file mode 100644
index e229c01927390..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/form1.vb
+++ /dev/null
@@ -1,715 +0,0 @@
-Imports System.Xml
-Imports System.Collections
-
-Public Class Form1
- Dim _globalTag As String = ""
- Dim _xmlHelperMethods As XMLHelperMethods
- Dim _ISBNOfSelectedBookNode As String = ""
- Dim _doc As XmlDocument = Nothing
- Dim _selectionStart As Integer
- Dim _selectionLength As Integer
- Dim _currentlySelectedNode As XmlNode = Nothing
-
- Sub New()
-
- ' This call is required by the designer.
- InitializeComponent()
-
- _xmlHelperMethods = New XMLHelperMethods
-
- End Sub
-
- '************************************************************************************
- '
- ' Load Xml from file. Keep white spaces and newlines.
- ' Then, call a method to populate a tree view control with the elements of the XML.
- '
- '************************************************************************************
- Private Sub loadXML(ByVal generateXML As Boolean, ByVal validateXML As Boolean, ByVal generateSchema As Boolean)
- If validateXML Then
- _doc = _xmlHelperMethods.LoadDocumentWithSchemaValidation(generateXML, generateSchema)
- Else
- _doc = _xmlHelperMethods.LoadDocument(generateXML)
- End If
- If (_doc Is Nothing) Then
- MessageBox.Show("Unable to load XML file or schema. The XML file or schema validation file does not exist. Consider ge" & _
- "nerating the XML file and/or schema file")
- Else
- XmlTextBox.Text = _doc.InnerXml
- populateTreeView(_doc)
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Populate the TreeView control with the elements of the XML file.
- '
- '************************************************************************************
- Private Sub populateTreeView(ByVal doc As XmlDocument)
-
- xmlTreeView.Nodes.Clear()
- addTreeNodes(doc.DocumentElement.ChildNodes, xmlTreeView)
- xmlTreeView.ExpandAll()
-
- End Sub
-
- '************************************************************************************
- '
- ' Helper method for populating the TreeView control with the elements of the XML file.
- '
- '************************************************************************************
- Private Sub addTreeNode_Recursive(ByVal xmlNode As XmlNode, ByVal treeNode As TreeNode)
-
- Dim xNodeList As XmlNodeList
-
- If xmlNode.HasChildNodes Then
- xNodeList = xmlNode.ChildNodes
- For Each node As XmlNode In xmlNode.ChildNodes
- If (node.NodeType <> XmlNodeType.Whitespace) Then
- Dim tempTreeNode As TreeNode = New TreeNode(node.Name)
- If (Not (node.Attributes) Is Nothing) Then
- Dim tempXMLNode As XmlNode = node.Attributes.GetNamedItem("ISBN")
- If (Not (tempXMLNode) Is Nothing) Then
- _globalTag = tempXMLNode.Value
- End If
- End If
- tempTreeNode.Tag = _globalTag
- treeNode.Nodes.Add(tempTreeNode)
- addTreeNode_Recursive(node, tempTreeNode)
- End If
- Next
- Else
- treeNode.Text = xmlNode.OuterXml.Trim
- End If
- End Sub
-
- Private Sub addTreeNodes(ByVal books As XmlNodeList, ByVal treeView As TreeView)
- For Each book As XmlNode In books
-
- If (book.NodeType = XmlNodeType.Element) Then
- Dim bookElement As XmlElement = CType(book, XmlElement)
- Dim tempTreeNode As TreeNode = New TreeNode(bookElement("title").InnerText)
- Dim tempXMLNode As XmlNode = bookElement.Attributes.GetNamedItem("ISBN")
- _globalTag = tempXMLNode.Value
- tempTreeNode.Tag = _globalTag
- treeView.Nodes.Add(tempTreeNode)
- End If
-
- Next
- End Sub
-
- '************************************************************************************
- '
- ' When an item is selected in the TreeView, highlight the related XMLNode in the RichTextBox.
- '
- '************************************************************************************
- Private Sub xmlTreeView_AfterSelect(ByVal sender As Object, ByVal e As TreeViewEventArgs) _
- Handles xmlTreeView.AfterSelect
- filterTreeView.SelectedNode = Nothing
- unHighlightXML()
- _ISBNOfSelectedBookNode = CType(e.Node.Tag, String)
- If (Not (_ISBNOfSelectedBookNode) Is Nothing) Then
- highlightXML()
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Remove the highlighted XML in the XML pane.
- '
- '************************************************************************************
- Private Sub unHighlightXML()
- ' Set any previously selected text back to black.
- XmlTextBox.Select(_selectionStart, _selectionLength)
- Dim tempFont As Font = New Font(FontFamily.GenericSansSerif, 10.0!, FontStyle.Regular)
- XmlTextBox.SelectionFont = tempFont
- XmlTextBox.SelectionColor = Color.White
- End Sub
-
- '************************************************************************************
- '
- ' Highlight XML in the XML pane. Use the current selection in the TreeView node to
- ' choose which element to highlight.
- '
- '************************************************************************************
- Private Function highlightXML() As Boolean
- Dim selectedBookNode As XmlNode = _xmlHelperMethods.GetBook(_ISBNOfSelectedBookNode, _doc)
- If (Not (selectedBookNode) Is Nothing) Then
- _currentlySelectedNode = selectedBookNode
-
- ' Use node to get search string.
- Dim stringToHighlight As String = selectedBookNode.OuterXml
-
- ' Cannot search RichTextBox with newlines so do some magic to get the highlight string.
- Dim numberOfCharactersBefore As Integer = stringToHighlight.Substring(0, stringToHighlight.IndexOf(_ISBNOfSelectedBookNode)).Length
- Dim lengthOfSelection As Integer = (stringToHighlight.Length - Constants.lengthOfNamespaceDeclaration)
-
- ' Highlight the new selected text.
- XmlTextBox.SelectionLength = _ISBNOfSelectedBookNode.Length
- Dim tempSelectionIndex As Integer = XmlTextBox.Find(_ISBNOfSelectedBookNode)
-
- ' Select the entire node in the RichTextBox. Not just the attribute value.
- XmlTextBox.SelectionStart = (tempSelectionIndex - numberOfCharactersBefore)
- XmlTextBox.SelectionLength = lengthOfSelection
-
- ' Store globally because user can manually select XML Text box and we need to know highlighted area later.
- _selectionStart = XmlTextBox.SelectionStart
- _selectionLength = XmlTextBox.SelectionLength
- Dim tempFont As Font = New Font(FontFamily.GenericSansSerif, 9.0!, FontStyle.Bold)
- XmlTextBox.SelectionFont = tempFont
- XmlTextBox.SelectionColor = Color.Yellow
- XmlTextBox.ScrollToCaret()
- populateEditBoxes()
- Return True
- Else
- Return False
- End If
- End Function
-
- '************************************************************************************
- '
- ' As the user selects nodes in the treeview control, populate edit boxes in the edit pane
- ' with information from the selected element.
- '
- '************************************************************************************
- Private Sub populateEditBoxes()
- ' Get attribute and element values of a node.
- Dim title As String = ""
- Dim ISBN As String = ""
- Dim publicationDate As String = ""
- Dim genre As String = ""
- Dim price As String = ""
-
- ' get book values.
- _xmlHelperMethods.GetBookInformation(title, ISBN, publicationDate, price, genre, _currentlySelectedNode)
-
- ' populate edit boxes.
- editTitleTextBox.Text = title
- editISBNTextBox.Text = ISBN
- editPubDateTextBox.Text = publicationDate
- editPriceTextBox.Text = price
- editGenreTextBox.Text = genre
- End Sub
-
- '************************************************************************************
- '
- ' Add an XML Element to the XMLDocument object.
- '
- '************************************************************************************
- Private Sub addNewBookButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles addNewBookButton.Click
- If (Not (_doc) Is Nothing) Then
- If (newISBNTextBox.Text <> "") Then
- ' Create a book element.
- Dim bookElement As XmlElement = _xmlHelperMethods.AddNewBook(newGenreTextBox.Text, newISBNTextBox.Text, newPubDateTextBox.Text, newTitleTextBox.Text, newPriceTextBox.Text, _doc)
- If (Not (bookElement) Is Nothing) Then
- Dim selectedBookNode As XmlNode = Nothing
- If (positionComboBox.Text = Constants.positionAbove) Then
- selectedBookNode = _xmlHelperMethods.GetBook(_ISBNOfSelectedBookNode, _doc)
- ElseIf (positionComboBox.Text = Constants.positionBelow) Then
- selectedBookNode = _xmlHelperMethods.GetBook(_ISBNOfSelectedBookNode, _doc)
- End If
-
- 'Insert book element at the beginning, end, before a specific element
- ' or after one depending on what option the user selects.
- _xmlHelperMethods.InsertBookElement(bookElement, positionComboBox.Text, selectedBookNode, validateCheckBox.Checked, generateSchemaCheckBox.Checked)
-
- ' Populate the RichTextBox again.
- XmlTextBox.Text = _doc.InnerXml
- populateTreeView(_doc)
-
- ' Highlight the newly added item.
- _ISBNOfSelectedBookNode = newISBNTextBox.Text
- If highlightXML() Then
- ' Clear the text box controls.
- newGenreTextBox.Text = ""
- newISBNTextBox.Text = ""
- newPubDateTextBox.Text = ""
- newTitleTextBox.Text = ""
- newPriceTextBox.Text = ""
- End If
- End If
- Else
- MessageBox.Show("Please provide an ISBN number")
- End If
- Else
- MessageBox.Show("Please load the XML first by using the Load XML tab")
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Helper method to create custom color tabs. In this case, call black.
- '
- '************************************************************************************
- Private Sub tabControl1_DrawItem(ByVal sender As Object, ByVal e As DrawItemEventArgs) Handles tabControl1.DrawItem
- Dim fillbrush As SolidBrush = New SolidBrush(Color.Black)
-
- 'draw rectangle behind the tabs
- Dim lasttabrect As Rectangle = tabControl1.GetTabRect((tabControl1.TabPages.Count - 1))
- Dim background As Rectangle = New Rectangle
- background.Location = New Point(lasttabrect.Right, 0)
-
- 'pad the rectangle to cover the 1 pixel line between the top of the tabpage and the start of the tabs
- background.Size = New Size((tabControl1.Right - background.Left), (lasttabrect.Height + 1))
- e.Graphics.FillRectangle(fillbrush, background)
- Dim page As TabPage = tabControl1.TabPages(e.Index)
- e.Graphics.FillRectangle(New SolidBrush(page.BackColor), e.Bounds)
- Dim paddedBounds As Rectangle = e.Bounds
- Dim yOffset As Integer = (e.State = DrawItemState.Selected)
-
- 'TODO: Warning!!!, inline IF is not supported ?
- paddedBounds.Offset(1, yOffset)
- TextRenderer.DrawText(e.Graphics, page.Text, Me.Font, paddedBounds, page.ForeColor)
- End Sub
-
- '************************************************************************************
- '
- ' Load XML into the DOM when the user chooses the Load XML button.
- '
- '************************************************************************************
- Private Sub loadButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles loadButton.Click
-
- loadXML(generateCheckBox.Checked, validateCheckBox.Checked, generateSchemaCheckBox.Checked)
-
- ' Clear the text box controls.
- newGenreTextBox.Text = ""
- newISBNTextBox.Text = ""
- newPubDateTextBox.Text = ""
- newTitleTextBox.Text = ""
- newPriceTextBox.Text = ""
- End Sub
-
- '************************************************************************************
- '
- ' To show and hide the generate XML Schema checkboxes.
- '
- '************************************************************************************
- Private Sub validateCheckBox_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles validateCheckBox.CheckedChanged
- If (validateCheckBox.Checked = True) Then
- generateSchemaCheckBox.Enabled = True
- generateSchemaCheckBox.Visible = True
- Else
- generateSchemaCheckBox.Enabled = False
- generateSchemaCheckBox.Visible = False
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Update XML element when user submits changes that they've made to edit boxes.
- '
- '************************************************************************************
- Private Sub submitButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles submitButton.Click
- If (Not (_currentlySelectedNode) Is Nothing) Then
- _xmlHelperMethods.editBook(editTitleTextBox.Text, editISBNTextBox.Text, editPubDateTextBox.Text, editGenreTextBox.Text, editPriceTextBox.Text, _currentlySelectedNode, validateCheckBox.Checked, generateCheckBox.Checked)
-
- ' Populate the RichTextBox again.
- XmlTextBox.Text = _doc.InnerXml
- populateTreeView(_doc)
- highlightXML()
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Delete an element from the DOM.
- '
- '************************************************************************************
- Private Sub deleteButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles deleteButton.Click
- If (Not (_currentlySelectedNode) Is Nothing) Then
- _xmlHelperMethods.deleteBook(_currentlySelectedNode)
- _currentlySelectedNode = Nothing
- XmlTextBox.Text = _doc.InnerXml
- populateTreeView(_doc)
-
- ' populate edit boxes.
- editTitleTextBox.Text = ""
- editISBNTextBox.Text = ""
- editPubDateTextBox.Text = ""
- editPriceTextBox.Text = ""
- editGenreTextBox.Text = ""
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Position an element up one level in the list of XML elements.
- '
- '************************************************************************************
- Private Sub positionUpButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles positionUpButton.Click
- If ((Not (_currentlySelectedNode) Is Nothing) _
- AndAlso (Not (xmlTreeView.SelectedNode) Is Nothing)) Then
- _xmlHelperMethods.MoveElementUp(_currentlySelectedNode)
- XmlTextBox.Text = _doc.InnerXml
- unHighlightXML()
- If (Not (_ISBNOfSelectedBookNode) Is Nothing) Then
- highlightXML()
- End If
-
- ' Move items up the tree.
- Dim selectedNode As TreeNode = xmlTreeView.SelectedNode
- Dim previousNode As TreeNode = xmlTreeView.SelectedNode.PrevNode
- If (Not (previousNode) Is Nothing) Then
- xmlTreeView.Nodes.Remove(selectedNode)
- Dim insertedNode As TreeNode = xmlTreeView.Nodes.Insert(previousNode.Index, selectedNode.Text)
- insertedNode.Tag = selectedNode.Tag
- xmlTreeView.SelectedNode = insertedNode
- End If
- xmlTreeView.Focus()
- Else
- MessageBox.Show("Select the node that you want to reposition in the list")
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Position an element one level down in the list of XML elements.
- '
- '************************************************************************************
- Private Sub positionDownButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles positionDownButton.Click
- If ((Not (_currentlySelectedNode) Is Nothing) _
- AndAlso (Not (xmlTreeView.SelectedNode) Is Nothing)) Then
- _xmlHelperMethods.MoveElementDown(_currentlySelectedNode)
- XmlTextBox.Text = _doc.InnerXml
- unHighlightXML()
- If (Not (_ISBNOfSelectedBookNode) Is Nothing) Then
- highlightXML()
- End If
-
- ' Move items down in the tree.
- Dim selectedNode As TreeNode = xmlTreeView.SelectedNode
- Dim nextNode As TreeNode = xmlTreeView.SelectedNode.NextNode
- If (Not (nextNode) Is Nothing) Then
- Dim insertionIndex As Integer = nextNode.Index
- Dim insertedNode As TreeNode = Nothing
- xmlTreeView.Nodes.Remove(selectedNode)
- If (insertionIndex < xmlTreeView.Nodes.Count) Then
- insertedNode = xmlTreeView.Nodes.Insert(insertionIndex, selectedNode.Text)
- Else
- insertedNode = xmlTreeView.Nodes.Add(selectedNode.Text)
- End If
- insertedNode.Tag = selectedNode.Tag
- xmlTreeView.SelectedNode = insertedNode
- xmlTreeView.Focus()
- End If
- xmlTreeView.Focus()
- Else
- MessageBox.Show("Select the node that you want to reposition in the list")
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Save XML.
- '
- '************************************************************************************
- Private Sub saveButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles saveButton.Click
- _xmlHelperMethods.SaveXML(_doc)
- MessageBox.Show("XML saved.")
- End Sub
-
- '************************************************************************************
- '
- ' Add a filter condition to the list of filter conditions in the UI.
- '
- '************************************************************************************
- Private Sub addFilterButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles addFilterButton.Click
- If (condition1Panel.Visible <> True) Then
- condition1Panel.Visible = True
- applyLabel.Visible = True
- matchesLabel.Visible = True
- matchesComboBox.Visible = True
- ElseIf (condition2Panel.Visible <> True) Then
- condition2Panel.Visible = True
- ElseIf (condition3Panel.Visible <> True) Then
- condition3Panel.Visible = True
- Else
- condition4Panel.Visible = True
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Clear conditions from the list of conditions.
- '
- '************************************************************************************
- Private Sub clearButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles clearButton.Click
- If (condition4Panel.Visible <> False) Then
- condition4Panel.Visible = False
- condition4CheckBox.Checked = False
- ElseIf (condition3Panel.Visible <> False) Then
- condition3Panel.Visible = False
- condition3CheckBox.Checked = False
- ElseIf (condition2Panel.Visible <> False) Then
- condition2Panel.Visible = False
- condition2CheckBox.Checked = False
- Else
- condition1Panel.Visible = False
- applyLabel.Visible = False
- matchesComboBox.Visible = False
- matchesLabel.Visible = False
- condition1CheckBox.Checked = False
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Handle condition 1 combobox
- '
- '************************************************************************************
- Private Sub condition1ComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles condition1ComboBox.SelectedIndexChanged
- populateOperatorComboBox(condition1ComboBox, operator1ComboBox)
- End Sub
-
- '************************************************************************************
- '
- ' Handle condition 2 combobox
- '
- '************************************************************************************
- Private Sub condition2ComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles condition2ComboBox.SelectedIndexChanged
- populateOperatorComboBox(condition2ComboBox, operator2ComboBox)
- End Sub
-
- '************************************************************************************
- '
- ' Handle condition 3 combobox
- '
- '************************************************************************************
- Private Sub condition3ComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles condition3ComboBox.SelectedIndexChanged
- populateOperatorComboBox(condition3ComboBox, operator3ComboBox)
- End Sub
-
- '************************************************************************************
- '
- ' Handle condition 4 combobox
- '
- '************************************************************************************
- Private Sub condition4ComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles condition4ComboBox.SelectedIndexChanged
- populateOperatorComboBox(condition4ComboBox, operator4ComboBox)
- End Sub
-
- '************************************************************************************
- '
- ' Based on which type of filter condition, the user selects, choose the relevant operators
- ' and populate the operator combo box with those values.
- '
- '************************************************************************************
- Public Sub populateOperatorComboBox(ByVal conditionComboBox As ComboBox, ByVal operatorComboBox As ComboBox)
- operatorComboBox.Items.Clear()
-
- Select Case (conditionComboBox.Text)
-
- Case Constants.Title
- operatorComboBox.Items.Add("=")
- operatorComboBox.Items.Add("Contains")
- operatorComboBox.Items.Add("Excludes")
-
- Case Constants.Genre
- operatorComboBox.Items.Add("=")
-
- Case Constants.PubDate
- operatorComboBox.Items.Add("=")
-
- Case Constants.Price
- operatorComboBox.Items.Add("=")
- operatorComboBox.Items.Add(">")
- operatorComboBox.Items.Add("<")
- operatorComboBox.Items.Add(">=")
- operatorComboBox.Items.Add("<=")
- operatorComboBox.Items.Add("<>")
-
- Case Constants.ISBN
- operatorComboBox.Items.Add("=")
- operatorComboBox.Items.Add("Contains")
- operatorComboBox.Items.Add("Excludes")
-
- End Select
- End Sub
-
- '************************************************************************************
- '
- ' Handle condition 1 checkbox.
- '
- '************************************************************************************
- Private Sub condition1CheckBox_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles condition1CheckBox.CheckedChanged
- ConditionCheckChanged(CType(sender, CheckBox))
- End Sub
-
- '************************************************************************************
- '
- ' Handle condition 2 checkbox.
- '
- '************************************************************************************
- Private Sub condition2CheckBox_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles condition2CheckBox.CheckedChanged
- ConditionCheckChanged(CType(sender, CheckBox))
- End Sub
-
- '************************************************************************************
- '
- ' Handle condition 3 checkbox.
- '
- '************************************************************************************
- Private Sub condition3CheckBox_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles condition3CheckBox.CheckedChanged
- ConditionCheckChanged(CType(sender, CheckBox))
- End Sub
-
- '************************************************************************************
- '
- ' Handle condition 4 checkbox.
- '
- '************************************************************************************
- Private Sub condition4CheckBox_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles condition4CheckBox.CheckedChanged
- ConditionCheckChanged(CType(sender, CheckBox))
- End Sub
-
- '************************************************************************************
- '
- ' Handle when any checkbox is checked or cleared. Queue up the conditions, operators
- ' and values for each selected condition and pass them to a method for processing.
- '
- '************************************************************************************
- Private Sub ConditionCheckChanged(ByVal conditionCheckBox As CheckBox)
-
- Dim Conditions As ArrayList = New ArrayList
- Dim Operators As ArrayList = New ArrayList
- Dim Values As ArrayList = New ArrayList
-
- If (condition1CheckBox.Checked = True) Then
- Conditions.Add(condition1ComboBox.Text)
- Operators.Add(operator1ComboBox.Text)
- Values.Add(condition1TextBox.Text)
- End If
-
- If (condition2CheckBox.Checked = True) Then
- Conditions.Add(condition2ComboBox.Text)
- Operators.Add(operator2ComboBox.Text)
- Values.Add(condition2TextBox.Text)
- End If
-
- If (condition3CheckBox.Checked = True) Then
- Conditions.Add(condition3ComboBox.Text)
- Operators.Add(operator3ComboBox.Text)
- Values.Add(condition3TextBox.Text)
- End If
-
- If (condition4CheckBox.Checked = True) Then
- Conditions.Add(condition4ComboBox.Text)
- Operators.Add(operator4ComboBox.Text)
- Values.Add(condition4TextBox.Text)
- End If
-
- FilterChecked(Conditions, Operators, Values, conditionCheckBox)
- End Sub
-
- '************************************************************************************
- '
- ' Clear filter treeview and requery for filter conditions.
- '
- '************************************************************************************
- Private Sub RemoveFilter()
- filterTreeView.Nodes.Clear()
-
- If (condition1CheckBox.Checked = True) Then
- ConditionCheckChanged(condition1CheckBox)
-
- ElseIf (condition2CheckBox.Checked = True) Then
- ConditionCheckChanged(condition2CheckBox)
-
- ElseIf (condition3CheckBox.Checked = True) Then
- ConditionCheckChanged(condition3CheckBox)
-
- ElseIf (condition4CheckBox.Checked = True) Then
- ConditionCheckChanged(condition4CheckBox)
-
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Show or hide the filtered results box based on whether filter conditions are selected.
- '
- '************************************************************************************
- Private Sub ShowOrHideFilterBox()
-
- If ((condition1CheckBox.Checked = False) _
- AndAlso ((condition2CheckBox.Checked = False) _
- AndAlso ((condition3CheckBox.Checked = False) _
- AndAlso (condition4CheckBox.Checked = False)))) Then
- filterBox.Visible = False
- Else
- filterBox.Visible = True
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Query XML Document based on filter conditions.
- '
- '************************************************************************************
- Private Sub FilterChecked(ByVal conditions As ArrayList, ByVal operatorSymbols As ArrayList, ByVal values As ArrayList, ByVal conditionCheckBox As CheckBox)
-
- If (conditionCheckBox.Checked = True) Then
- Dim nodes As XmlNodeList = Nothing
- Dim failure As Boolean = False
-
- For Each _condition As String In conditions
- If (_condition = Constants.Condition) Then
- MessageBox.Show("Missing a condition")
- conditionCheckBox.Checked = False
- failure = True
- Exit For
- End If
- Next
-
- For Each _value As String In values
- If (_value = "") Then
- MessageBox.Show("Missing a value")
- conditionCheckBox.Checked = False
- failure = True
- Exit For
- End If
- Next
-
- If (failure <> True) Then
- nodes = _xmlHelperMethods.ApplyFilters(conditions, operatorSymbols, values, _doc, matchesComboBox.Text)
- filterTreeView.Nodes.Clear()
- If (nodes Is Nothing) Then
- MessageBox.Show("No results found")
- conditionCheckBox.Checked = False
- ElseIf (nodes.Count = 0) Then
- MessageBox.Show("No results found")
- conditionCheckBox.Checked = False
- Else
- addTreeNodes(nodes, filterTreeView)
- End If
- End If
- Else
- RemoveFilter()
- End If
- ShowOrHideFilterBox()
- End Sub
-
- '************************************************************************************
- '
- ' Handle when items in the filtered results viewed are selected by the user.
- '
- '************************************************************************************
- Private Sub filterTreeView_AfterSelect(ByVal sender As Object, ByVal e As TreeViewEventArgs) Handles filterTreeView.AfterSelect
- xmlTreeView.SelectedNode = Nothing
- unHighlightXML()
- _ISBNOfSelectedBookNode = CType(e.Node.Tag, String)
- If (Not (_ISBNOfSelectedBookNode) Is Nothing) Then
- highlightXML()
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Handle when the user chooses to "All" or "Any" in the "Matches" combo box.
- '
- '************************************************************************************
- Private Sub matchesComboBox_SelectedValueChanged(ByVal sender As Object, ByVal e As EventArgs) Handles matchesComboBox.SelectedValueChanged
- RemoveFilter()
- End Sub
-
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/application.designer.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/application.designer.vb
deleted file mode 100644
index 345c3b20203a8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/application.designer.vb
+++ /dev/null
@@ -1,38 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:4.0.30319.34014
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict On
-Option Explicit On
-
-
-Namespace My
-
- 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
- ' or if you encounter build errors in this file, go to the Project Designer
- ' (go to Project Properties or double-click the My Project node in
- ' Solution Explorer), and make changes on the Application tab.
- '
- Partial Friend Class MyApplication
-
- _
- Public Sub New()
- MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
- Me.IsSingleInstance = false
- Me.EnableVisualStyles = true
- Me.SaveMySettingsOnExit = true
- Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
- End Sub
-
- _
- Protected Overrides Sub OnCreateMainForm()
- Me.MainForm = Global.XMLProcessingAppVB.Form1
- End Sub
- End Class
-End Namespace
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/assemblyinfo.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/assemblyinfo.vb
deleted file mode 100644
index ca1b8f76cf177..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/assemblyinfo.vb
+++ /dev/null
@@ -1,34 +0,0 @@
-Imports System.Reflection
-Imports System.Runtime.InteropServices
-
-' General Information about an assembly is controlled through the following
-' set of attributes. Change these attribute values to modify the information
-' associated with an assembly.
-
-' Review the values of the assembly attributes
-
-
-
-
-
-
-
-
-
-
-'The following GUID is for the ID of the typelib if this project is exposed to COM
-
-
-' Version information for an assembly consists of the following four values:
-'
-' Major Version
-' Minor Version
-' Build Number
-' Revision
-'
-' You can specify all the values or you can default the Build and Revision Numbers
-' by using the '*' as shown below:
-'
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/resources.designer.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/resources.designer.vb
deleted file mode 100644
index 4e9cf1f4c17c1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/resources.designer.vb
+++ /dev/null
@@ -1,62 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:4.0.30319.34014
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict On
-Option Explicit On
-
-
-Namespace My.Resources
-
- 'This class was auto-generated by the StronglyTypedResourceBuilder
- 'class via a tool like ResGen or Visual Studio.
- 'To add or remove a member, edit your .ResX file then rerun ResGen
- 'with the /str option, or rebuild your VS project.
- '''
- ''' A strongly-typed resource class, for looking up localized strings, etc.
- '''
- _
- Friend Module Resources
-
- Private resourceMan As Global.System.Resources.ResourceManager
-
- Private resourceCulture As Global.System.Globalization.CultureInfo
-
- '''
- ''' Returns the cached ResourceManager instance used by this class.
- '''
- _
- Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
- Get
- If Object.ReferenceEquals(resourceMan, Nothing) Then
- Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("XMLProcessingAppVB.Resources", GetType(Resources).Assembly)
- resourceMan = temp
- End If
- Return resourceMan
- End Get
- End Property
-
- '''
- ''' Overrides the current thread's CurrentUICulture property for all
- ''' resource lookups using this strongly typed resource class.
- '''
- _
- Friend Property Culture() As Global.System.Globalization.CultureInfo
- Get
- Return resourceCulture
- End Get
- Set(ByVal value As Global.System.Globalization.CultureInfo)
- resourceCulture = value
- End Set
- End Property
- End Module
-End Namespace
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/resources.resx b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/resources.resx
deleted file mode 100644
index af7dbebbacef5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/settings.designer.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/settings.designer.vb
deleted file mode 100644
index 77493f1dce1dd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/my project/settings.designer.vb
+++ /dev/null
@@ -1,73 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:4.0.30319.34014
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict On
-Option Explicit On
-
-
-Namespace My
-
- _
- Partial Friend NotInheritable Class MySettings
- Inherits Global.System.Configuration.ApplicationSettingsBase
-
- Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
-
-#Region "My.Settings Auto-Save Functionality"
-#If _MyType = "WindowsForms" Then
- Private Shared addedHandler As Boolean
-
- Private Shared addedHandlerLockObject As New Object
-
- _
- Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
- If My.Application.SaveMySettingsOnExit Then
- My.Settings.Save()
- End If
- End Sub
-#End If
-#End Region
-
- Public Shared ReadOnly Property [Default]() As MySettings
- Get
-
-#If _MyType = "WindowsForms" Then
- If Not addedHandler Then
- SyncLock addedHandlerLockObject
- If Not addedHandler Then
- AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
- addedHandler = True
- End If
- End SyncLock
- End If
-#End If
- Return defaultInstance
- End Get
- End Property
- End Class
-End Namespace
-
-Namespace My
-
- _
- Friend Module MySettingsProperty
-
- _
- Friend ReadOnly Property Settings() As Global.XMLProcessingAppVB.My.MySettings
- Get
- Return Global.XMLProcessingAppVB.My.MySettings.Default
- End Get
- End Property
- End Module
-End Namespace
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/refreshtree.png b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/refreshtree.png
deleted file mode 100644
index ced06520cdead..0000000000000
Binary files a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/refreshtree.png and /dev/null differ
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/save.png b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/save.png
deleted file mode 100644
index 5389f58d8e382..0000000000000
Binary files a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/save.png and /dev/null differ
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/snippets.5000.json b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/snippets.5000.json
deleted file mode 100644
index 9493e733615c7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/snippets.5000.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "host": "visualstudio"
-}
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/source.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/source.vb
deleted file mode 100644
index b913c09961406..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/source.vb
+++ /dev/null
@@ -1,30 +0,0 @@
-'
-Imports System.IO
-Imports System.Xml
-
-public class Sample
-
- public shared sub Main()
-
- 'Create the XmlDocument.
- Dim doc as XmlDocument = new XmlDocument()
- doc.Load("booksort.xml")
-
- Dim book as XmlNode
- Dim nodeList as XmlNodeList
- Dim root as XmlNode = doc.DocumentElement
-
- nodeList=root.SelectNodes("descendant::book[author/last-name='Austen']")
-
- 'Change the price on the books.
- for each book in nodeList
- book.LastChild.InnerText="15.95"
- next
-
- Console.WriteLine("Display the modified XML document....")
- doc.Save(Console.Out)
-
- end sub
-end class
- '
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/uparrow.png b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/uparrow.png
deleted file mode 100644
index 435a984775157..0000000000000
Binary files a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/uparrow.png and /dev/null differ
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/xmlhelpermethods.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/xmlhelpermethods.vb
deleted file mode 100644
index c92ea769f4c79..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/xmlhelpermethods.vb
+++ /dev/null
@@ -1,559 +0,0 @@
-Imports System.Collections
-Imports System.IO
-Imports System.Xml
-Imports System.Xml.Schema
-Imports System.Text
-
-Public Class XMLHelperMethods
-
-#Region "Load and Save XML"
- '************************************************************************************
- '
- ' Loads XML from a file. If the file is not found, load XML from a string.
- '
- '************************************************************************************
- Public Function LoadDocument(ByVal generateXML As Boolean) As XmlDocument
- '
- Dim doc As XmlDocument = New XmlDocument
- doc.PreserveWhitespace = True
- Try
- doc.Load("booksData.xml")
- Catch ex As System.IO.FileNotFoundException
- ' If no file is found, generate some XML.
- doc.LoadXml(" " & ControlChars.NewLine & _
- " " & ControlChars.NewLine & _
- " " & ControlChars.NewLine & _
- " Pride And Prejudice " & ControlChars.NewLine & _
- " 24.95 " & ControlChars.NewLine & _
- " " & ControlChars.NewLine & _
- " " & ControlChars.NewLine & _
- " The Handmaid's Tale " & ControlChars.NewLine & _
- " 29.95 " & ControlChars.NewLine & _
- " " & ControlChars.NewLine & _
- "")
- End Try
- '
- Return doc
- End Function
-
- '************************************************************************************
- '
- ' Helper method that generates an XML string.
- '
- '************************************************************************************
- Private Function generateXMLString() As String
- Dim xml As String = " " & ControlChars.NewLine & _
- " " & ControlChars.NewLine & _
- " " & ControlChars.NewLine & _
- " Pride And Prejudice " & ControlChars.NewLine & _
- " 24.95 " & ControlChars.NewLine & _
- " " & ControlChars.NewLine & _
- " " & ControlChars.NewLine & _
- " The Handmaid's Tale " & ControlChars.NewLine & _
- " 29.95 " & ControlChars.NewLine & _
- " " & ControlChars.NewLine & _
- " " & ControlChars.NewLine &
- " Sense and Sensibility " & ControlChars.NewLine & _
- " 19.95 " & ControlChars.NewLine & _
- " " & ControlChars.NewLine & _
- ""
- Return xml
- End Function
-
- '************************************************************************************
- '
- ' Summery: Loads XML from a file. If the file is not found, load XML from a string.
- '
- '************************************************************************************
- Public Sub SaveXML(ByVal doc As XmlDocument)
- doc.Save(Constants.booksFileName)
- End Sub
-
-#End Region
-
-#Region "Validate XML against a Schema"
- '
- '************************************************************************************
- '
- ' Associate the schema with XML. Then, load the XML and validate it against
- ' the schema.
- '
- '************************************************************************************
- Public Function LoadDocumentWithSchemaValidation(ByVal generateXML As Boolean, ByVal generateSchema As Boolean) As XmlDocument
- Dim reader As XmlReader
- Dim settings As XmlReaderSettings = New XmlReaderSettings
- ' Helper method to retrieve schema.
- Dim schema As XmlSchema = getSchema(generateSchema)
- If (schema Is Nothing) Then
- Return Nothing
- End If
- settings.Schemas.Add(schema)
- AddHandler settings.ValidationEventHandler, AddressOf settings_ValidationEventHandler
- settings.ValidationFlags = (settings.ValidationFlags Or XmlSchemaValidationFlags.ReportValidationWarnings)
- settings.ValidationType = ValidationType.Schema
- Try
- reader = XmlReader.Create("booksData.xml", settings)
- Catch ex As System.IO.FileNotFoundException
- If generateXML Then
- Dim xml As String = generateXMLString()
- Dim byteArray() As Byte = Encoding.UTF8.GetBytes(xml)
- Dim stream As MemoryStream = New MemoryStream(byteArray)
- reader = XmlReader.Create(stream, settings)
- Else
- Return Nothing
- End If
- End Try
- Dim doc As XmlDocument = New XmlDocument
- doc.PreserveWhitespace = True
- doc.Load(reader)
- reader.Close()
- Return doc
- End Function
-
- '************************************************************************************
- '
- ' Helper method that generates an XML Schema.
- '
- '************************************************************************************
- Private Function generateXMLSchema() As String
-
- Dim generatedXmlSchema As String = " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " " & _
- " "
-
-
- Return generatedXmlSchema
-
- End Function
-
- '************************************************************************************
- '
- ' Helper method that gets a schema
- '
- '************************************************************************************
- Private Function getSchema(ByVal generateSchema As Boolean) As XmlSchema
- Dim xs As XmlSchemaSet = New XmlSchemaSet
- Dim schema As XmlSchema
- Try
- schema = xs.Add("http://www.contoso.com/books", "booksData.xsd")
- Catch ex As System.IO.FileNotFoundException
- If generateSchema Then
- Dim xmlSchemaString As String = generateXMLSchema()
- Dim byteArray() As Byte = Encoding.UTF8.GetBytes(xmlSchemaString)
- Dim stream As MemoryStream = New MemoryStream(byteArray)
- Dim reader As XmlReader = XmlReader.Create(stream)
- schema = xs.Add("http://www.contoso.com/books", reader)
- Else
- Return Nothing
- End If
- End Try
- Return schema
- End Function
-
- '************************************************************************************
- '
- ' Helper method to validate the XML against the schema.
- '
- '************************************************************************************
- Private Sub validateXML(ByVal generateSchema As Boolean, ByVal doc As XmlDocument)
- If (doc.Schemas.Count = 0) Then
- ' Helper method to retrieve schema.
- Dim schema As XmlSchema = getSchema(generateSchema)
- doc.Schemas.Add(schema)
- End If
- ' Use an event handler to validate the XML node against the schema.
- doc.Validate(AddressOf settings_ValidationEventHandler)
- End Sub
-
- '************************************************************************************
- '
- ' Event handler that is raised when XML doesn't validate against the schema.
- '
- '************************************************************************************
- Private Sub settings_ValidationEventHandler(ByVal sender As Object, ByVal e As System.Xml.Schema.ValidationEventArgs)
- If (e.Severity = XmlSeverityType.Warning) Then
- System.Windows.Forms.MessageBox.Show(("The following validation warning occurred: " & e.Message))
- ElseIf (e.Severity = XmlSeverityType.Error) Then
- System.Windows.Forms.MessageBox.Show(("The following critical validation errors occurred: " & e.Message))
- Dim objectType As Type = sender.GetType
- End If
- End Sub
- '
-
-#End Region
-
-#Region "Find Elements and attributes"
-
- '************************************************************************************
- '
- ' Search the XML tree for a specific XMLNode element by using an attribute value.
- ' Description: Must identify the namespace of the nodes and define a prefix. Also include the
- ' prefix in the XPath string.
- '
- '************************************************************************************
- '
- Public Function GetBook(ByVal uniqueAttribute As String, ByVal doc As XmlDocument) As XmlNode
- Dim nsmgr As XmlNamespaceManager = New XmlNamespaceManager(doc.NameTable)
- nsmgr.AddNamespace("bk", "http://www.contoso.com/books")
- Dim xPathString As String = ("//bk:books/bk:book[@ISBN='" _
- & (uniqueAttribute & "']"))
- Dim xmlNode As XmlNode = doc.DocumentElement.SelectSingleNode(xPathString, nsmgr)
- Return xmlNode
- End Function
- '
-
- '************************************************************************************
- '
- ' Get information about a specific book. Pass in an XMLNode that
- ' represents the book and populate strings passed in by reference.
- '
- '************************************************************************************
- '
- Public Sub GetBookInformation(ByRef title As String, ByRef ISBN As String, ByRef publicationDate As String, ByRef price As String, ByRef genre As String, ByVal book As XmlNode)
- Dim bookElement As XmlElement = CType(book, XmlElement)
- ' Get the attributes of a book.
- Dim attr As XmlAttribute = bookElement.GetAttributeNode("ISBN")
- ISBN = attr.InnerXml
- attr = bookElement.GetAttributeNode("genre")
- genre = attr.InnerXml
- attr = bookElement.GetAttributeNode("publicationdate")
- publicationDate = attr.InnerXml
- ' Get the values of child elements of a book.
- title = bookElement("title").InnerText
- price = bookElement("price").InnerText
- End Sub
- '
-
- '************************************************************************************
- '
- ' Uses filter criteria collection in the UI to retrieve specific elements and attributes.
- '
- '************************************************************************************
- Public Function ApplyFilters(ByVal conditions As ArrayList, ByVal operatorSymbols As ArrayList, ByVal values As ArrayList, ByVal doc As XmlDocument, ByVal matchString As String) As XmlNodeList
- Dim nsmgr As XmlNamespaceManager = New XmlNamespaceManager(doc.NameTable)
-
- nsmgr.AddNamespace("bk", "http://www.contoso.com/books")
- Dim xPathQueryString As String = "//bk:books/bk:book["
- Dim xPathQueryEnding As String = "]"
- Dim xPathQueryStrings As ArrayList = New ArrayList
- Dim booleanOperator As String
- If (matchString = "Any") Then
- booleanOperator = "or "
- Else
- booleanOperator = "and "
- End If
- Dim counter As Integer = 0
- Dim operatorArray() As String = CType(operatorSymbols.ToArray(GetType(System.String)), String())
- Dim valueArray() As String = CType(values.ToArray(GetType(System.String)), String())
- For Each condition As String In conditions
- Dim xPathQueryPart As String = ""
- Dim operatorSymbol As String = operatorArray(counter)
- Dim value As String = valueArray(counter)
- If (counter > 0) Then
- xPathQueryString = (xPathQueryString & booleanOperator)
- End If
- counter = (counter + 1)
- Select Case (condition)
- Case Constants.Title
- Select Case (operatorSymbol)
- Case "Contains"
- xPathQueryPart = ("contains(bk:title,'" _
- & (value & "')"))
- Case "Excludes"
- xPathQueryPart = ("not(contains(bk:title,'" _
- & (value & "'))"))
- Case "="
- xPathQueryPart = ("bk:title='" _
- & (value & "'"))
- End Select
- Case Constants.ISBN
- Select Case (operatorSymbol)
- Case "Contains"
- xPathQueryPart = ("contains(@ISBN, '" _
- & (value & "')"))
- Case "Excludes"
- xPathQueryPart = ("not(contains(@ISBN, '" _
- & (value & "'))"))
- Case "="
- xPathQueryPart = ("@ISBN='" _
- & (value & "'"))
- End Select
- Case Constants.PubDate
- xPathQueryPart = ("contains(@publicationdate, '" _
- & (value & "')"))
- Case Constants.Price
- Select Case (operatorSymbol)
- Case "="
- xPathQueryPart = ("bk:price='" _
- & (value & "'"))
- Case ">"
- xPathQueryPart = ("bk:price>'" _
- & (value & "'"))
- Case "<"
- xPathQueryPart = ("bk:price<'" _
- & (value & "'"))
- Case ">="
- xPathQueryPart = ("bk:price>='" _
- & (value & "'"))
- Case "<="
- xPathQueryPart = ("bk:price<='" _
- & (value & "'"))
- Case "<>"
- xPathQueryPart = ("bk:price!='" _
- & (value & "'"))
- End Select
- Case Constants.Genre
- xPathQueryPart = ("@genre='" _
- & (value & "'"))
- End Select
- xPathQueryString = (xPathQueryString & xPathQueryPart)
- Next
- xPathQueryString = (xPathQueryString & xPathQueryEnding)
- Dim nodeList As XmlNodeList = doc.DocumentElement.SelectNodes(xPathQueryString, nsmgr)
- Return nodeList
- End Function
-
-#End Region
-
-#Region "Add XML elements and attributes"
- '************************************************************************************
- '
- ' Add an element to the XML document.
- ' This method creates a new book element and saves that element to the
- ' XMLDocument object. It addes attributes for the new element and introduces
- ' newline characters between elements fora nice readable format.
- '
- '
- '************************************************************************************
- '
- Public Function AddNewBook(ByVal genre As String, ByVal ISBN As String, ByVal misc As String, ByVal title As String, ByVal price As String, ByVal doc As XmlDocument) As XmlElement
- ' Create a new book element.
- Dim bookElement As XmlElement = doc.CreateElement("book", "http://www.contoso.com/books")
-
- ' Create attributes for book and append them to the book element.
- Dim attribute As XmlAttribute = doc.CreateAttribute("genre")
- attribute.Value = genre
- bookElement.Attributes.Append(attribute)
-
- attribute = doc.CreateAttribute("ISBN")
- attribute.Value = ISBN
- bookElement.Attributes.Append(attribute)
-
- attribute = doc.CreateAttribute("publicationdate")
- attribute.Value = misc
- bookElement.Attributes.Append(attribute)
-
- ' Create and append a child element for the title of the book.
- Dim titleElement As XmlElement = doc.CreateElement("title")
- titleElement.InnerText = title
- bookElement.AppendChild(titleElement)
-
- ' Introduce a newline character so that XML is nicely formatted.
- bookElement.InnerXml = bookElement.InnerXml.Replace(titleElement.OuterXml, _
- "\n " & titleElement.OuterXml & " " & ControlChars.NewLine + " ")
- ' Create and append a child element for the price of the book.
- Dim priceElement As XmlElement = doc.CreateElement("price")
- priceElement.InnerText = price
- bookElement.AppendChild(priceElement)
-
- ' Introduce a newline character so that XML is nicely formatted.
- bookElement.InnerXml = bookElement.InnerXml.Replace(priceElement.OuterXml,
- (priceElement.OuterXml & " " & ControlChars.NewLine & " "))
- Return bookElement
- End Function
- '
-
- '************************************************************************************
- '
- ' Add an element to the XML document at a specific location
- ' Takes a string that describes where the user wants the new node
- ' to be positioned. The string comes from a series of radio buttons in a UI.
- ' this method also accepts the XMLDocument in context. You have to use the
- ' this instance because it is the object that was used to generate the
- ' selectedBook XMLNode.
- '
- '************************************************************************************
- Public Sub InsertBookElement(ByVal bookElement As XmlElement, ByVal position As String,
- ByVal selectedBook As XmlNode, ByVal validateNode As Boolean,
- ByVal generateSchema As Boolean)
- Dim doc As XmlDocument = bookElement.OwnerDocument
- Dim stringThatContainsNewline As String = bookElement.OuterXml
-
- Dim sigWhiteSpace As XmlSignificantWhitespace
-
- Select Case (position)
-
- Case Constants.positionTop
- ' Add newline characters and spaces to make XML more readable.
- sigWhiteSpace = doc.CreateSignificantWhitespace(ControlChars.NewLine & " ")
- doc.DocumentElement.InsertBefore(sigWhiteSpace, doc.DocumentElement.FirstChild)
- doc.DocumentElement.InsertAfter(bookElement, doc.DocumentElement.FirstChild)
-
- Case Constants.positionBottom
- ' Add newline characters to make XML more readable.
- Dim whitespace As XmlWhitespace = doc.CreateWhitespace(" ")
- Dim appendedNode As XmlNode = doc.DocumentElement.AppendChild(bookElement)
- doc.DocumentElement.InsertBefore(whitespace, appendedNode)
- sigWhiteSpace = doc.CreateSignificantWhitespace(ControlChars.NewLine)
- doc.DocumentElement.InsertAfter(sigWhiteSpace, appendedNode)
-
- Case Constants.positionAbove
- ' Add newline characters to make XML more readable.
- Dim currNode As XmlNode = doc.DocumentElement.InsertBefore(bookElement, selectedBook)
- sigWhiteSpace = doc.CreateSignificantWhitespace(ControlChars.NewLine & " ")
- doc.DocumentElement.InsertAfter(sigWhiteSpace, currNode)
-
- Case Constants.positionBelow
- ' Add newline characters to make XML more readable.
- sigWhiteSpace = doc.CreateSignificantWhitespace(ControlChars.NewLine & " ")
- Dim whiteSpaceNode As XmlNode = doc.DocumentElement.InsertAfter(sigWhiteSpace, selectedBook)
- doc.DocumentElement.InsertAfter(bookElement, whiteSpaceNode)
-
- Case Else
- doc.DocumentElement.AppendChild(bookElement)
-
- End Select
-
- If validateNode Then
- validateXML(generateSchema, doc)
- End If
- End Sub
-#End Region
-
-#Region "Edit XML elements and attributes"
- '************************************************************************************
- '
- ' Edit an XML element
- '
- '
- '************************************************************************************
- '
- Public Sub editBook(ByVal title As String, ByVal ISBN As String,
- ByVal publicationDate As String, ByVal genre As String,
- ByVal price As String, ByVal book As XmlNode, ByVal validateNode As Boolean,
- ByVal generateSchema As Boolean)
-
- Dim bookElement As XmlElement = CType(book, XmlElement)
-
- ' Get the attributes of a book.
- bookElement.SetAttribute("ISBN", ISBN)
- bookElement.SetAttribute("genre", genre)
- bookElement.SetAttribute("publicationdate", publicationDate)
-
- ' Get the values of child elements of a book.
- bookElement("title").InnerText = title
- bookElement("price").InnerText = price
- If validateNode Then
- validateXML(generateSchema, bookElement.OwnerDocument)
- End If
-
- End Sub
- '
-
-#End Region
-
-#Region "Remove elements"
- '************************************************************************************
- '
- ' Summary: Delete a book node from the XMLDocument.
- '
- '
- '************************************************************************************
- '
- Public Sub deleteBook(ByVal book As XmlNode)
-
- Dim prevNode As XmlNode = book.PreviousSibling
- book.OwnerDocument.DocumentElement.RemoveChild(book)
-
- If ((prevNode.NodeType = XmlNodeType.Whitespace) _
- OrElse (prevNode.NodeType = XmlNodeType.SignificantWhitespace)) Then
- prevNode.OwnerDocument.DocumentElement.RemoveChild(prevNode)
-
- End If
- End Sub
- '
-
-#End Region
-
-#Region "Position elements"
-'
- '************************************************************************************
- '
- ' Summary: Move elements up in the XML.
- '
- '
- '************************************************************************************
- Public Sub MoveElementUp(ByVal book As XmlNode)
- Dim previousNode As XmlNode = book.PreviousSibling
-
- While ((Not (previousNode) Is Nothing) _
- AndAlso (previousNode.NodeType <> XmlNodeType.Element))
- previousNode = previousNode.PreviousSibling
-
- End While
- If (Not (previousNode) Is Nothing) Then
- Dim newLineNode As XmlNode = book.NextSibling
- book.OwnerDocument.DocumentElement.RemoveChild(book)
-
- If ((newLineNode.NodeType = XmlNodeType.Whitespace) _
- Or (newLineNode.NodeType = XmlNodeType.SignificantWhitespace)) Then
- newLineNode.OwnerDocument.DocumentElement.RemoveChild(newLineNode)
- End If
-
- InsertBookElement(CType(book, XmlElement), Constants.positionAbove,
- previousNode, False, False)
- End If
- End Sub
-
- '************************************************************************************
- '
- ' Summary: Move elements down in the XML.
- '
- '
- '************************************************************************************
- Public Sub MoveElementDown(ByVal book As XmlNode)
- ' Walk backwards until we find an element - ignore text nodes
- Dim NextNode As XmlNode = book.NextSibling
-
- While ((Not (NextNode) Is Nothing) _
- AndAlso (NextNode.NodeType <> XmlNodeType.Element))
- NextNode = NextNode.NextSibling
-
- End While
-
- If (Not (NextNode) Is Nothing) Then
- Dim newLineNode As XmlNode = book.PreviousSibling
- book.OwnerDocument.DocumentElement.RemoveChild(book)
-
- If ((newLineNode.NodeType = XmlNodeType.Whitespace) _
- Or (newLineNode.NodeType = XmlNodeType.SignificantWhitespace)) Then
- newLineNode.OwnerDocument.DocumentElement.RemoveChild(newLineNode)
- End If
-
- InsertBookElement(CType(book, XmlElement), Constants.positionBelow,
- NextNode, False, False)
- End If
- End Sub
-'
-#End Region
-
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/xmlprocessingappvb.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/xmlprocessingappvb.vbproj
deleted file mode 100644
index 44cd4117c7bf1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/vb/WinForms/xmlprocessingappvb.vbproj
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {645CA08B-99A5-4FEC-8642-93D47C7F1093}
- WinExe
- XMLProcessingAppVB.My.MyApplication
- XMLProcessingAppVB
- XMLProcessingAppVB
- 512
- WindowsForms
- v4.8
- SAK
- SAK
- SAK
- SAK
-
-
- AnyCPU
- true
- full
- true
- true
- bin\Debug\
- XMLProcessingAppVB.xml
- 41999,42016,42017,42018,42019,42020,42021,42022,42030,42032,42036,42104,42108,42109
-
-
- AnyCPU
- pdbonly
- false
- true
- true
- bin\Release\
- XMLProcessingAppVB.xml
- 41999,42016,42017,42018,42019,42020,42021,42022,42030,42032,42036,42104,42108,42109
-
-
- On
-
-
- Binary
-
-
- Off
-
-
- On
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Form
-
-
- Form1.vb
- Form
-
-
-
- True
- Application.myapp
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
-
-
-
- Form1.vb
- Designer
-
-
- VbMyResourcesResXFileCodeGenerator
- Resources.Designer.vb
- My.Resources
- Designer
-
-
-
-
- Designer
- Always
-
-
- MyApplicationCodeGenerator
- Application.Designer.vb
-
-
- SettingsSingleFileGenerator
- My
- Settings.Designer.vb
-
-
-
-
- Always
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlLinkedNode/csharp/PreviousSibling/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlLinkedNode/csharp/PreviousSibling/Project.csproj
deleted file mode 100644
index a369cfa8a8090..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlLinkedNode/csharp/PreviousSibling/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlLinkedNode/csharp/PreviousSibling/source.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlLinkedNode/csharp/PreviousSibling/source.cs
deleted file mode 100644
index 8a8e4631c8acd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlLinkedNode/csharp/PreviousSibling/source.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
- using System;
- using System.Xml;
-
- public class Sample {
-
- public static void Main() {
-
- XmlDocument doc = new XmlDocument();
- doc.Load("books.xml");
-
- XmlNode lastNode = doc.DocumentElement.LastChild;
- Console.WriteLine("Last book...");
- Console.WriteLine(lastNode.OuterXml);
-
- XmlNode prevNode = lastNode.PreviousSibling;
- Console.WriteLine("\r\nPrevious book...");
- Console.WriteLine(prevNode.OuterXml);
- }
- }
- //
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlParserContext/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlParserContext/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlParserContext/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlParserContext/Overview/csharp/XmlReader_Create.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlParserContext/Overview/csharp/XmlReader_Create.cs
deleted file mode 100644
index 6b6749a1e5591..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlParserContext/Overview/csharp/XmlReader_Create.cs
+++ /dev/null
@@ -1,217 +0,0 @@
-using System;
-using System.Text;
-using System.IO;
-using System.Xml;
-using System.Xml.Schema;
-using System.Net;
-
-class XmlReaderSettings_Examples
-{
- static void Main()
- {
- }
-
- //
- static void String_Fragment()
- {
- //
- string xmlFrag = """
- hammer
- paint
- saw
- """;
-
- // Create the XmlNamespaceManager.
- NameTable nt = new NameTable();
- XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt);
- nsmgr.AddNamespace("rk", "urn:store-items");
-
- // Create the XmlParserContext.
- XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
-
- // Create the reader.
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.ConformanceLevel = ConformanceLevel.Fragment;
- XmlReader reader = XmlReader.Create(new StringReader(xmlFrag), settings, context);
- //
- }
-
- // Load URI with XmlResolver
- static void Settings_Resolver()
- {
- string UserName = "username";
- string SecurelyStoredPassword = "psswd";
- string Domain = "domain";
-
- //
- // Create an XmlUrlResolver with the credentials necessary to access the Web server.
- var resolver = new XmlUrlResolver();
- var myCred = new NetworkCredential(UserName, SecurelyStoredPassword, Domain);
- resolver.Credentials = myCred;
-
- var settings = new XmlReaderSettings();
- settings.XmlResolver = resolver;
-
- // Create the reader.
- XmlReader reader = XmlReader.Create("http://serverName/data/books.xml", settings);
- //
- }
-
- // DTD Validation
- static void Settings_ProhibitDtd()
- {
- //
- // Set the validation settings.
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.DtdProcessing = DtdProcessing.Parse;
- settings.ValidationType = ValidationType.DTD;
- settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack);
-
- // Create the XmlReader object.
- XmlReader reader = XmlReader.Create("itemDTD.xml", settings);
-
- // Parse the file.
- while (reader.Read()) { }
- //
- }
-
- //
- // Display any validation errors.
- private static void ValidationCallBack(object sender, ValidationEventArgs e)
- {
- Console.WriteLine($"Validation Error: {e.Message}");
- }
- //
-
- // Wrapped Reader
- static void WrappedReader_Settings()
- {
- //
- // Create the XmlNodeReader object.
- XmlDocument doc = new XmlDocument();
- doc.Load("books.xml");
- XmlNodeReader nodeReader = new XmlNodeReader(doc);
-
- // Set the validation settings.
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.ValidationType = ValidationType.Schema;
- settings.Schemas.Add("urn:bookstore-schema", "books.xsd");
- settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack);
-
- // Create a validating reader that wraps the XmlNodeReader object.
- XmlReader reader = XmlReader.Create(nodeReader, settings);
- // Parse the XML file.
- while (reader.Read()) ;
-
- //
- }
-
- static void URI()
- {
- //
- // Create the XmlReader object.
- XmlReader reader = XmlReader.Create("books.xml");
- //
- }
-
- static void XML_String()
- {
- //
- string xmlData = """
-
- 5.95
-
- """;
-
- // Create the XmlReader object.
- XmlReader reader = XmlReader.Create(new StringReader(xmlData));
- //
- }
-
- static void FileStream()
- {
- //
- FileStream fs = new FileStream(
- @"C:\data\books.xml",
- FileMode.OpenOrCreate,
- FileAccess.Read,
- FileShare.Read);
-
- // Create the XmlReader object.
- XmlReader reader = XmlReader.Create(fs);
- //
- }
-
- static void FileStream_Settings()
- {
- //
-
- FileStream fs = new FileStream(
- @"C:\data\books.xml",
- FileMode.OpenOrCreate,
- FileAccess.Read,
- FileShare.Read);
-
- XmlUrlResolver resolver = new XmlUrlResolver();
- resolver.Credentials = CredentialCache.DefaultCredentials;
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.XmlResolver = resolver;
-
- // Create the XmlReader object.
- XmlReader reader = XmlReader.Create(fs, settings);
- //
- }
-
- // Secure Resolver
- static void Settings_SecureResolver()
- {
- //
- // Create an XmlSecureResolver with default credentials.
- var myResolver = new XmlSecureResolver(new XmlUrlResolver(), "http://serverName/data/");
- myResolver.Credentials = CredentialCache.DefaultCredentials;
-
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.XmlResolver = myResolver;
-
- // Create the reader.
- XmlReader reader = XmlReader.Create("http://serverName/data/books.xml", settings);
- //
- }
-
- //
- static void GeneralSettings()
- {
- //
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.ConformanceLevel = ConformanceLevel.Fragment;
- settings.IgnoreWhitespace = true;
- settings.IgnoreComments = true;
- XmlReader reader = XmlReader.Create("books.xml", settings);
- //
- }
-
- //
- static void ChainReaders()
- {
- //
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.ValidationType = ValidationType.DTD;
- XmlReader inner = XmlReader.Create("book.xml", settings); // DTD Validation
- settings.Schemas.Add("urn:book-schema", "book.xsd");
- settings.ValidationType = ValidationType.Schema;
- XmlReader outer = XmlReader.Create(inner, settings); // XML Schema Validation
- //
- }
-
- //
- static void WrapTextReader()
- {
- //
- XmlTextReader txtReader = new XmlTextReader("bookOrder.xml");
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.Schemas.Add("urn:po-schema", "PO.xsd");
- settings.ValidationType = ValidationType.Schema;
- XmlReader reader = XmlReader.Create(txtReader, settings);
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/csharp/factory_rdr_cctor2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/csharp/factory_rdr_cctor2.cs
deleted file mode 100644
index 552fc2b489ae4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/csharp/factory_rdr_cctor2.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Xml;
-
-public class Sample
-{
- public static void Main()
- {
- //
- // Set the reader settings.
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.IgnoreComments = true;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreWhitespace = true;
- //
-
- //
- // Create a resolver with default credentials.
- XmlUrlResolver resolver = new XmlUrlResolver();
- resolver.Credentials = System.Net.CredentialCache.DefaultCredentials;
-
- // Set the reader settings object to use the resolver.
- settings.XmlResolver = resolver;
-
- // Create the XmlReader object.
- XmlReader reader = XmlReader.Create("http://ServerName/data/books.xml", settings);
- //
-
- // Parse the file.
- while (reader.Read()) ;
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/csharp/factory_rdr_cctor21.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/csharp/factory_rdr_cctor21.cs
deleted file mode 100644
index b728f5eafd6b6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/csharp/factory_rdr_cctor21.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Xml;
-
-public class Sample1
-{
- public static void Main()
- {
- //
- // Set the reader settings.
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.IgnoreComments = true;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreWhitespace = true;
- //
-
- //
- // Create a resolver with default credentials.
- XmlUrlResolver resolver = new XmlUrlResolver();
- resolver.Credentials = System.Net.CredentialCache.DefaultCredentials;
-
- // Set the reader settings object to use the resolver.
- settings.XmlResolver = resolver;
-
- // Create the XmlReader object.
- XmlReader reader = XmlReader.Create("http://ServerName/data/books.xml", settings);
- //
-
- // Parse the file.
- while (reader.Read()) ;
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/vb/XmlReader_Create.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/vb/XmlReader_Create.vb
deleted file mode 100644
index 26785a03e260d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/vb/XmlReader_Create.vb
+++ /dev/null
@@ -1,202 +0,0 @@
-Imports System.Text
-Imports System.IO
-Imports System.Xml
-Imports System.Xml.Schema
-Imports System.Net
-
-
-Class XmlReaderSettings_Examples
-
- Shared Sub Main()
-
- End Sub
-
- '
- Shared Sub String_Fragment()
- '
- Dim xmlFrag As String = "hammer " & _
- "paint" & _
- "saw"
-
- ' Create the XmlNamespaceManager.
- Dim nt As New NameTable()
- Dim nsmgr As New XmlNamespaceManager(nt)
- nsmgr.AddNamespace("rk", "urn:store-items")
-
- ' Create the XmlParserContext.
- Dim context As New XmlParserContext(Nothing, nsmgr, Nothing, XmlSpace.None)
-
- ' Create the reader.
- Dim settings As New XmlReaderSettings()
- settings.ConformanceLevel = ConformanceLevel.Fragment
- Dim reader As XmlReader = XmlReader.Create(New StringReader(xmlFrag), settings, context)
- '
- End Sub
-
-
- ' Load URI with XmlResolver
- Shared Sub Settings_Resolver()
- Dim UserName As String = "username"
- Dim SecurelyStoredPassword As String = "psswd"
- Dim Domain As String = "domain"
-
- '
- ' Create an XmlUrlResolver with the credentials necessary to access the Web server.
- Dim resolver As New XmlUrlResolver()
- Dim myCred As System.Net.NetworkCredential
- myCred = New System.Net.NetworkCredential(UserName, SecurelyStoredPassword, Domain)
- resolver.Credentials = myCred
-
- Dim settings As New XmlReaderSettings()
- settings.XmlResolver = resolver
-
- ' Create the reader.
- Dim reader As XmlReader = XmlReader.Create("http://serverName/data/books.xml", settings)
- '
- End Sub
-
-
- ' DTD Validation
- Shared Sub Settings_ProhibitDtd()
- '
- ' Set the validation settings.
- Dim settings As New XmlReaderSettings()
- settings.DtdProcessing = DtdProcessing.Parse
- settings.ValidationType = ValidationType.DTD
- AddHandler settings.ValidationEventHandler, AddressOf ValidationCallBack
-
- ' Create the XmlReader object.
- Dim reader As XmlReader = XmlReader.Create("itemDTD.xml", settings)
-
- ' Parse the file.
- While reader.Read()
- End While
- '
- End Sub
-
-
- '
- ' Display any validation errors.
- Private Shared Sub ValidationCallBack(ByVal sender As Object, ByVal e As ValidationEventArgs)
- Console.WriteLine("Validation Error: {0}", e.Message)
-
- End Sub
-
- '
-
- ' Wrapped Reader
- Shared Sub WrappedReader_Settings()
- '
- ' Create the XmlNodeReader object.
- Dim doc As New XmlDocument()
- doc.Load("books.xml")
- Dim nodeReader As New XmlNodeReader(doc)
-
- ' Set the validation settings.
- Dim settings As New XmlReaderSettings()
- settings.ValidationType = ValidationType.Schema
- settings.Schemas.Add("urn:bookstore-schema", "books.xsd")
- AddHandler settings.ValidationEventHandler, AddressOf ValidationCallBack
-
- ' Create a validating reader that wraps the XmlNodeReader object.
- Dim reader As XmlReader = XmlReader.Create(nodeReader, settings)
- ' Parse the XML file.
- While reader.Read()
- End While
- '
- End Sub
-
-
- Shared Sub URI()
- '
- ' Create the XmlReader object.
- Dim reader As XmlReader = XmlReader.Create("books.xml")
- '
- End Sub
-
-
- Shared Sub XML_String()
- '
- Dim xmlData As String = "" & _
- "5.95" & _
- ""
-
- ' Create the XmlReader object.
- Dim reader As XmlReader = XmlReader.Create(New StringReader(xmlData))
- '
- End Sub
-
-
- Shared Sub FileStream()
- '
- Dim fs As New FileStream("C:\data\books.xml", FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read)
-
- ' Create the XmlReader object.
- Dim reader As XmlReader = XmlReader.Create(fs)
-
- End Sub
- '
-
- Shared Sub FileStream_Settings()
- '
- Dim fs As New FileStream("C:\data\books.xml", FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read)
-
- Dim resolver As New XmlUrlResolver()
- resolver.Credentials = CredentialCache.DefaultCredentials
- Dim settings As New XmlReaderSettings()
- settings.XmlResolver = resolver
-
- ' Create the XmlReader object.
- Dim reader As XmlReader = XmlReader.Create(fs, settings)
- '
- End Sub
-
- ' Secure Resolver
- Shared Sub Settings_SecureResolver()
- '
-' Create an XmlSecureResolver with default credentials.
-Dim myResolver As New XmlSecureResolver(New XmlUrlResolver(), "http://serverName/data/")
-myResolver.Credentials = CredentialCache.DefaultCredentials
-
-Dim settings As New XmlReaderSettings()
-settings.XmlResolver = myResolver
-
-' Create the reader.
-Dim reader As XmlReader = XmlReader.Create("http://serverName/data/books.xml", settings)
-
- '
- End Sub
-
- '
- Shared Sub GeneralSettings()
- '
-Dim settings As New XmlReaderSettings()
-settings.ConformanceLevel = ConformanceLevel.Fragment
-settings.IgnoreWhitespace = true
-settings.IgnoreComments = true
-Dim reader As XmlReader = XmlReader.Create("books.xml", settings)
- '
- End Sub
-
- Shared Sub ChainReaders()
- '
-Dim settings As New XmlReaderSettings()
-settings.ValidationType = ValidationType.DTD
-Dim inner As XmlReader = XmlReader.Create("book.xml", settings) ' DTD Validation
-settings.Schemas.Add("urn:book-schema", "book.xsd")
-settings.ValidationType = ValidationType.Schema
-Dim outer As XmlReader = XmlReader.Create(inner, settings) ' XML Schema Validation
- '
- End Sub
-
- Shared Sub WrapTextReader()
- '
-Dim txtReader As XmlTextReader = New XmlTextReader("bookOrder.xml")
-Dim settings As New XmlReaderSettings()
-settings.Schemas.Add("urn:po-schema", "PO.xsd")
-settings.ValidationType = ValidationType.Schema
-Dim reader As XmlReader = XmlReader.Create(txtReader, settings)
- '
- End Sub
-
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/vb/factory_rdr_cctor2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/vb/factory_rdr_cctor2.vb
deleted file mode 100644
index efff7cb8710c8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Create/vb/factory_rdr_cctor2.vb
+++ /dev/null
@@ -1,35 +0,0 @@
-Imports System.Xml
-Imports System.Xml.Schema
-Imports System.IO
-
-public class Sample
-
- public shared sub Main()
-
- '
- ' Set the reader settings.
- Dim settings as XmlReaderSettings = new XmlReaderSettings()
- settings.IgnoreComments = true
- settings.IgnoreProcessingInstructions = true
- settings.IgnoreWhitespace = true
- '
-
- '
- ' Create a resolver with default credentials.
- Dim resolver as XmlUrlResolver = new XmlUrlResolver()
- resolver.Credentials = System.Net.CredentialCache.DefaultCredentials
-
- ' Set the reader settings object to use the resolver.
- settings.XmlResolver = resolver
-
- ' Create the XmlReader object.
- Dim reader as XmlReader = XmlReader.Create("http://ServerName/data/books.xml", settings)
- '
-
- ' Parse the file.
- while reader.Read()
- end while
- end sub
-
-
-end class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/XmlReader_Basic.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/XmlReader_Basic.cs
deleted file mode 100644
index 7d44c23aeb8c9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/XmlReader_Basic.cs
+++ /dev/null
@@ -1,352 +0,0 @@
-using System;
-using System.Text;
-using System.IO;
-using System.Xml;
-
-class XmlReader_Samples {
-
- static void Main() {
-}
-
-static void AttributeCount() {
-XmlReader reader = XmlReader.Create("books.xml");
-reader.ReadToDescendant("book");
-//
-// Display all attributes.
-if (reader.HasAttributes) {
- Console.WriteLine("Attributes of <" + reader.Name + ">");
- for (int i = 0; i < reader.AttributeCount; i++) {
- Console.WriteLine($" {reader[i]}");
- }
- // Move the reader back to the element node.
- reader.MoveToElement();
-}
-//
-}
-
-//==============================//
-//
-static void GetAttribute1() {
-XmlReader reader = XmlReader.Create("books.xml");
-//
-reader.ReadToFollowing("book");
-string isbn = reader.GetAttribute(2);
-//
-}
-//==============================//
-//
-static void GetAttribute2() {
-XmlReader reader = XmlReader.Create("books.xml");
-//
-reader.ReadToFollowing("book");
-string isbn = reader.GetAttribute("ISBN");
-Console.WriteLine("The ISBN value: " + isbn);
-//
-}
-
-//==============================//
-//
-static void MoveToAttribute1() {
-XmlReader reader = XmlReader.Create("books.xml");
-reader.ReadToFollowing("book");
-//
-if (reader.HasAttributes) {
- Console.WriteLine("Attributes of <" + reader.Name + ">");
- for (int i = 0; i < reader.AttributeCount; i++) {
- reader.MoveToAttribute(i);
- Console.Write(" {0}={1}", reader.Name, reader.Value);
- }
-reader.MoveToElement(); // Moves the reader back to the element node.
-}
-//
-}
-
-//==============================//
-//
-static void MoveToFirstAttribute() {
-XmlReader reader = XmlReader.Create("books.xml");
-//
-reader.ReadToFollowing("book");
-reader.MoveToFirstAttribute();
-string genre = reader.Value;
-Console.WriteLine("The genre value: " + genre);
-//
-}
-
-//==============================//
-//
-static void MoveToNextAttribute() {
-XmlReader reader = XmlReader.Create("books.xml");
-reader.ReadToFollowing("book");
-//
-if (reader.HasAttributes) {
- Console.WriteLine("Attributes of <" + reader.Name + ">");
- while (reader.MoveToNextAttribute()) {
- Console.WriteLine($" {reader.Name}={reader.Value}");
- }
- // Move the reader back to the element node.
- reader.MoveToElement();
-}
-//
-}
-
-//==============================//
-//
-static void Item() {
-XmlReader reader = XmlReader.Create("books.xml");
-//
-reader.ReadToDescendant("book");
-string isbn =reader["ISBN"];
-Console.WriteLine("The ISBN value: " + isbn);
-//
-}
-
-//==============================//
-//
-static void Node_Value() {
-
-//
-XmlReaderSettings settings = new XmlReaderSettings();
-settings.DtdProcessing = DtdProcessing.Parse;
-XmlReader reader = XmlReader.Create("items.xml", settings);
-
-reader.MoveToContent();
- // Parse the file and display each of the nodes.
- while (reader.Read()) {
- switch (reader.NodeType) {
- case XmlNodeType.Element:
- Console.Write("<{0}>", reader.Name);
- break;
- case XmlNodeType.Text:
- Console.Write(reader.Value);
- break;
- case XmlNodeType.CDATA:
- Console.Write("", reader.Value);
- break;
- case XmlNodeType.ProcessingInstruction:
- Console.Write("{0} {1}?>", reader.Name, reader.Value);
- break;
- case XmlNodeType.Comment:
- Console.Write("", reader.Value);
- break;
- case XmlNodeType.XmlDeclaration:
- Console.Write("");
- break;
- case XmlNodeType.Document:
- break;
- case XmlNodeType.DocumentType:
- Console.Write("", reader.Name);
- break;
- }
-}
-//
-}
-
-//==============================//
-//
-static void NamespaceURI() {
-//
-XmlReader reader = XmlReader.Create("book2.xml");
-
-// Parse the file. If they exist, display the prefix and
-// namespace URI of each node.
-while (reader.Read()) {
- if (reader.IsStartElement()) {
- if (reader.Prefix==String.Empty)
- {
- Console.WriteLine($"<{reader.LocalName}>");
- }
- else {
- Console.Write("<{0}:{1}>", reader.Prefix, reader.LocalName);
- Console.WriteLine(" The namespace URI is " + reader.NamespaceURI);
- }
- }
-}
-reader.Close();
-//
-}
-
-//==============================//
-//
-static void IsStartElement() {
-XmlReader reader = XmlReader.Create("elems.xml");
-//
-while (reader.Read()) {
- if (reader.IsStartElement()) {
- if (reader.IsEmptyElement)
- {
- Console.WriteLine($"<{reader.Name}/>");
- }
- else {
- Console.Write("<{0}> ", reader.Name);
- reader.Read(); // Read the start tag.
- if (reader.IsStartElement()) // Handle nested elements.
- Console.Write("\r\n<{0}>", reader.Name);
- Console.WriteLine(reader.ReadString()); //Read the text content of the element.
- }
- }
-}
-//
-}
-
-//==============================//
-//
-static void ReadEndElement() {
-//
-using (XmlReader reader = XmlReader.Create("book3.xml")) {
-
- // Parse the XML document. ReadString is used to
- // read the text content of the elements.
- reader.Read();
- reader.ReadStartElement("book");
- reader.ReadStartElement("title");
- Console.Write("The content of the title element: ");
- Console.WriteLine(reader.ReadString());
- reader.ReadEndElement();
- reader.ReadStartElement("price");
- Console.Write("The content of the price element: ");
- Console.WriteLine(reader.ReadString());
- reader.ReadEndElement();
- reader.ReadEndElement();
-}
-//
- }
-//==============================//
-//
-static void ReadInnerXml() {
-//
-// Load the file and ignore all white space.
-XmlReaderSettings settings = new XmlReaderSettings();
-settings.IgnoreWhitespace = true;
-using (XmlReader reader = XmlReader.Create("2books.xml")) {
-
- // Moves the reader to the root element.
- reader.MoveToContent();
-
- // Moves to book node.
- reader.Read();
-
- // Note that ReadInnerXml only returns the markup of the node's children
- // so the book's attributes are not returned.
- Console.WriteLine("Read the first book using ReadInnerXml...");
- Console.WriteLine(reader.ReadInnerXml());
-
- // ReadOuterXml returns the markup for the current node and its children
- // so the book's attributes are also returned.
- Console.WriteLine("Read the second book using ReadOuterXml...");
- Console.WriteLine(reader.ReadOuterXml());
-}
-//
- }
-
-//==============================//
-//
-static void ReadSubtree() {
-//
-XmlReaderSettings settings = new XmlReaderSettings();
-settings.IgnoreWhitespace = true;
-using (XmlReader reader = XmlReader.Create("books.xml", settings)) {
-
- // Position the reader on the second book node
- reader.ReadToFollowing("Book");
- reader.Skip();
-
- // Create another reader that contains just the second book node.
- XmlReader inner = reader.ReadSubtree();
-
- inner.ReadToDescendant("Title");
- Console.WriteLine(inner.Name);
-
- // Do additional processing on the inner reader. After you
- // are done, call Close on the inner reader and
- // continue processing using the original reader.
- inner.Close();
-}
-//
-}
-
-//==============================//
-//
-static void ReadtoDescendant() {
-//
-using (XmlReader reader = XmlReader.Create("2books.xml")) {
-
- // Move the reader to the second book node.
- reader.MoveToContent();
- reader.ReadToDescendant("book");
- reader.Skip(); //Skip the first book.
-
- // Parse the file starting with the second book node.
- do {
- switch (reader.NodeType) {
- case XmlNodeType.Element:
- Console.Write("<{0}", reader.Name);
- while (reader.MoveToNextAttribute()) {
- Console.Write(" {0}='{1}'", reader.Name, reader.Value);
- }
- Console.Write(">");
- break;
- case XmlNodeType.Text:
- Console.Write(reader.Value);
- break;
- case XmlNodeType.EndElement:
- Console.Write("{0}>", reader.Name);
- break;
- }
- } while (reader.Read());
-}
-//
-}
-
-//==============================//
-//
-static void ReadToFollowing() {
-//
-using (XmlReader reader = XmlReader.Create("books.xml")) {
- reader.ReadToFollowing("book");
- do {
- Console.WriteLine($"ISBN: {reader.GetAttribute("ISBN")}");
- } while (reader.ReadToNextSibling("book"));
-}
-//
-}
-
-//==============================//
-//
-static void HasValue() {
-//
-XmlReaderSettings settings = new XmlReaderSettings();
-settings.IgnoreWhitespace = true;
-using (XmlReader reader = XmlReader.Create("book1.xml", settings)) {
- // Parse the file and display each node.
- while (reader.Read()) {
- if (reader.HasValue)
- Console.WriteLine($"({reader.NodeType}) {reader.Name}={reader.Value}");
- else
- Console.WriteLine($"({reader.NodeType}) {reader.Name}");
- }
-}
-//
-}
-
-//==============================//
-//
-static void IsStartElement_2() {
-using (XmlReader reader = XmlReader.Create("books.xml")) {
-//
- // Parse the file and display each price node.
- while (reader.Read()) {
- if (reader.IsStartElement("price")) {
- Console.WriteLine(reader.ReadInnerXml());
- }
- }
-//
-}
-}
-}
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/program.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/program.cs
deleted file mode 100644
index 270ca42e00a9a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/program.cs
+++ /dev/null
@@ -1,188 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml;
-
-namespace XmlReaderExampleCS
-{
- static class Program
- {
- static void Main(string[] args)
- {
- }
-
- //
- public static async Task ReadStartElementAsync(this XmlReader reader, string localname, string ns)
- {
- if (await reader.MoveToContentAsync() != XmlNodeType.Element)
- {
- throw new InvalidOperationException(reader.NodeType.ToString() + " is an invalid XmlNodeType");
- }
- if ((reader.LocalName == localname) && (reader.NamespaceURI == ns))
- {
- await reader.ReadAsync();
- }
- else
- {
- throw new InvalidOperationException("localName or namespace doesn’t match");
- }
- }
- //
-
- //
- public static async Task ReadEndElementAsync(this XmlReader reader)
- {
- if (await reader.MoveToContentAsync() != XmlNodeType.EndElement)
- {
- throw new InvalidOperationException();
- }
- await reader.ReadAsync();
- }
- //
-
- //
- public static async Task ReadToNextSiblingAsync(this XmlReader reader, string localName, string namespaceURI)
- {
- if (localName == null || localName.Length == 0)
- {
- throw new ArgumentException("localName is empty or null");
- }
- if (namespaceURI == null)
- {
- throw new ArgumentNullException("namespaceURI");
- }
-
- // atomize local name and namespace
- localName = reader.NameTable.Add(localName);
- namespaceURI = reader.NameTable.Add(namespaceURI);
-
- // find the next sibling
- XmlNodeType nt;
- do
- {
- await reader.SkipAsync();
- if (reader.ReadState != ReadState.Interactive)
- break;
- nt = reader.NodeType;
- if (nt == XmlNodeType.Element &&
- ((object)localName == (object)reader.LocalName) &&
- ((object)namespaceURI ==(object)reader.NamespaceURI))
- {
- return true;
- }
- } while (nt != XmlNodeType.EndElement && !reader.EOF);
-
- return false;
- }
- //
-
- //
- public static async Task ReadToFollowingAsync(this XmlReader reader, string localName, string namespaceURI)
- {
- if (localName == null || localName.Length == 0)
- {
- throw new ArgumentException("localName is empty or null");
- }
- if (namespaceURI == null)
- {
- throw new ArgumentNullException("namespaceURI");
- }
-
- // atomize local name and namespace
- localName = reader.NameTable.Add(localName);
- namespaceURI = reader.NameTable.Add(namespaceURI);
-
- // find element with that name
- while (await reader.ReadAsync())
- {
- if (reader.NodeType == XmlNodeType.Element && ((object)localName == (object)reader.LocalName) && ((object)namespaceURI == (object)reader.NamespaceURI))
- {
- return true;
- }
- }
- return false;
- }
- //
-
- //
- public static async Task ReadToDescendantAsync(this XmlReader reader, string localName, string namespaceURI)
- {
- if (localName == null || localName.Length == 0)
- {
- throw new ArgumentException("localName is empty or null");
- }
- if (namespaceURI == null)
- {
- throw new ArgumentNullException("namespaceURI");
- }
- // save the element or root depth
- int parentDepth = reader.Depth;
- if (reader.NodeType != XmlNodeType.Element)
- {
- // adjust the depth if we are on root node
- if (reader.ReadState == ReadState.Initial)
- {
- parentDepth--;
- }
- else
- {
- return false;
- }
- }
- else if (reader.IsEmptyElement)
- {
- return false;
- }
-
- // atomize local name and namespace
- localName = reader.NameTable.Add(localName);
- namespaceURI = reader.NameTable.Add(namespaceURI);
-
- // find the descendant
- while (await reader.ReadAsync() && reader.Depth > parentDepth)
- {
- if (reader.NodeType == XmlNodeType.Element && ((object)localName == (object)reader.LocalName) && ((object)namespaceURI == (object)reader.NamespaceURI))
- {
- return true;
- }
- }
- return false;
- }
- //
- }
-
- class AnotherClass
- {
- //
- async Task TestReader(System.IO.Stream stream)
- {
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.Async = true;
-
- using (XmlReader reader = XmlReader.Create(stream, settings))
- {
- while (await reader.ReadAsync())
- {
- switch (reader.NodeType)
- {
- case XmlNodeType.Element:
- Console.WriteLine($"Start Element {reader.Name}");
- break;
- case XmlNodeType.Text:
- Console.WriteLine($"Text Node: {await reader.GetValueAsync()}");
- break;
- case XmlNodeType.EndElement:
- Console.WriteLine($"End Element {reader.Name}");
- break;
- default:
- Console.WriteLine($"Other node {reader.NodeType} with value {reader.Value}");
- break;
- }
- }
- }
- }
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/readElementContentAs.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/readElementContentAs.cs
deleted file mode 100644
index 0af4d46c4199e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/csharp/readElementContentAs.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-using System;
-using System.Text;
-using System.IO;
-using System.Xml;
-
-class Read_Typed_Element {
-
- static void Main() {
-
- ReadElementContentAsString_1();
- ReadElementContentAsString_2();
- ReadElementContentAsLong_1();
- ReadElementContentAsDateTime_1();
- ReadElementContentAs_1() ;
- ReadElementContentAsObject();
- ReadElementContentAsDouble_1();
- }
-
-public static void ReadElementContentAsString_1() {
-//
- using (XmlReader reader = XmlReader.Create("dataFile.xml")) {
- reader.ReadToFollowing("stringValue");
- Console.WriteLine(reader.ReadElementContentAsString());
- }
-//
-}
-
-public static void ReadElementContentAsString_2() {
-//
- using (XmlReader reader = XmlReader.Create("dataFile.xml")) {
- reader.ReadToFollowing("stringValue");
- Console.WriteLine(reader.ReadElementContentAsString("stringValue", ""));
- }
-//
-}
-
-public static void ReadElementContentAsLong_1() {
-//
- using (XmlReader reader = XmlReader.Create("dataFile.xml")) {
- reader.ReadToFollowing("longValue");
- long number = reader.ReadElementContentAsLong();
- // Do some processing with the number object.
- }
-//
-}
-
-public static void ReadElementContentAsDateTime_1() {
-//
- using (XmlReader reader = XmlReader.Create("dataFile.xml")) {
- reader.ReadToFollowing("date");
- DateTime date = reader.ReadElementContentAsDateTime();
-
- // If the current culture is "en-US",
- // this writes "Wednesday, January 8, 2003".
- Console.WriteLine(date.ToLongDateString());
- }
-//
-}
-
-public static void ReadElementContentAs_1() {
-//
- using (XmlReader reader = XmlReader.Create("dataFile.xml")) {
- reader.ReadToFollowing("date");
- DateTime date = (DateTime) reader.ReadElementContentAs(typeof(System.DateTime), null);
-
- // If the current culture is "en-US",
- // this writes "Wednesday, January 8, 2003".
- Console.WriteLine(date.ToLongDateString());
- }
-//
-}
-
-public static void ReadElementContentAsObject() {
-//
- // Create a validating reader.
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.ValidationType = ValidationType.Schema;
- settings.Schemas.Add("urn:items", "item.xsd");
- XmlReader reader = XmlReader.Create("item.xml", settings);
-
- // Get the CLR type of the price element.
- reader.ReadToFollowing("price");
- Console.WriteLine(reader.ValueType);
-
- // Return the value of the price element as Decimal object.
- Decimal price = (Decimal) reader.ReadElementContentAsObject();
-
- // Add 2.50 to the price.
- price = Decimal.Add(price, 2.50m);
-
-//
-}
-
-public static void ReadElementContentAsDouble_1() {
-//
- using (XmlReader reader = XmlReader.Create("dataFile.xml")) {
- reader.ReadToFollowing("double");
- Double number = reader.ReadElementContentAsDouble();
- // Do some processing with the number object.
- }
-//
-}
-
-public static void ReadTypedData1() {
-//
-// Create a validating XmlReader object. The schema
-// provides the necessary type information.
-XmlReaderSettings settings = new XmlReaderSettings();
-settings.ValidationType = ValidationType.Schema;
-settings.Schemas.Add("urn:empl-hire", "hireDate.xsd");
-using (XmlReader reader = XmlReader.Create("hireDate.xml", settings)) {
-
- // Move to the hire-date element.
- reader.MoveToContent();
- reader.ReadToDescendant("hire-date");
-
- // Return the hire-date as a DateTime object.
- DateTime hireDate = reader.ReadElementContentAsDateTime();
- Console.WriteLine($"Six Month Review Date: {hireDate.AddMonths(6)}");
-}
-//
-}
-
-public static void ReadTypedData2() {
-//
-// Create an XmlReader object.
-using (XmlReader reader = XmlReader.Create("hireDate_1.xml")) {
- // Move to the hire-date element.
- reader.MoveToContent();
- reader.ReadToDescendant("hire-date");
-
- // Return the hire-date as a DateTime object.
- DateTime hireDate = reader.ReadElementContentAsDateTime();
- Console.WriteLine($"Six Month Review Date: {hireDate.AddMonths(6)}");
-}
-//
-}
-} // end class.
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/module1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/module1.vb
deleted file mode 100644
index 68960c3d3ea3b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/module1.vb
+++ /dev/null
@@ -1,170 +0,0 @@
-Imports System.Runtime.CompilerServices
-Imports System.Xml
-
-Module Module1
-
- Sub Main()
- If True Then
-
- End If
- End Sub
-
-
- '
-
- Public Async Function ReadStartElementAsync(reader As XmlReader, localname As String, ns As String) As Task
- If (Await reader.MoveToContentAsync() <> XmlNodeType.Element) Then
- Throw New InvalidOperationException(reader.NodeType.ToString() + " is an invalid XmlNodeType")
- End If
-
- If ((reader.LocalName = localname) And (reader.NamespaceURI = ns)) Then
- Await reader.ReadAsync()
- Else
- Throw New InvalidOperationException("localName or namespace doesn’t match")
- End If
- End Function
- '
-
- '
-
- Public Async Function ReadEndElementAsync(reader As XmlReader) As task
- If (Await reader.MoveToContentAsync() <> XmlNodeType.EndElement) Then
- Throw New InvalidOperationException()
- End If
- Await reader.ReadAsync()
- End Function
- '
-
-
- '
-
- Public Async Function ReadToNextSiblingAsync(reader As XmlReader, localName As String, namespaceURI As String) As Task(Of Boolean)
- If (localName = Nothing Or localName.Length = 0) Then
- Throw New ArgumentException("localName is empty or null")
- End If
-
- If (namespaceURI = Nothing) Then
- Throw New ArgumentNullException("namespaceURI")
- End If
-
- ' atomize local name and namespace
- localName = reader.NameTable.Add(localName)
- namespaceURI = reader.NameTable.Add(namespaceURI)
-
- ' find the next sibling
- Dim nt As XmlNodeType
- Do
-
- Await reader.SkipAsync()
- If (reader.ReadState <> ReadState.Interactive) Then
- Exit Do
- End If
- nt = reader.NodeType
- If ((nt = XmlNodeType.Element) And
- ((CObj(localName) = CObj(reader.LocalName))) And
- (CObj(namespaceURI) = CObj(reader.NamespaceURI))) Then
- Return True
- End If
- Loop While (nt <> XmlNodeType.EndElement And (Not reader.EOF))
-
- Return False
-
- End Function
- '
-
-
- '
-
- Public Async Function ReadToFollowingAsync(reader As XmlReader, localName As String, namespaceURI As String) As Task(Of Boolean)
- If (localName = Nothing Or localName.Length = 0) Then
- Throw New ArgumentException("localName is empty or null")
- End If
-
- If (namespaceURI = Nothing) Then
- Throw New ArgumentNullException("namespaceURI")
- End If
-
- ' atomize local name and namespace
- localName = reader.NameTable.Add(localName)
- namespaceURI = reader.NameTable.Add(namespaceURI)
-
- ' find element with that name
- While (Await reader.ReadAsync())
- If ((reader.NodeType = XmlNodeType.Element) And
- (CObj(localName) = CObj(reader.LocalName)) And
- (CObj(namespaceURI) = CObj(reader.NamespaceURI))) Then
- Return True
- End If
- End While
-
- Return False
- End Function
- '
-
- '
-
- Public Async Function ReadToDescendantAsync(reader As XmlReader, localName As String, namespaceURI As String) As Task(Of Boolean)
- If (localName = Nothing Or localName.Length = 0) Then
- Throw New ArgumentException("localName is empty or null")
- End If
-
- If (namespaceURI = Nothing) Then
- Throw New ArgumentNullException("namespaceURI")
- End If
-
- ' save the element or root depth
- Dim parentDepth As Integer = reader.Depth
- If (reader.NodeType <> XmlNodeType.Element) Then
- ' adjust the depth if we are on root node
- If (reader.ReadState = ReadState.Initial) Then
- parentDepth -= 1
- Else
- Return False
- End If
- ElseIf (reader.IsEmptyElement) Then
- Return False
- End If
- ' atomize local name and namespace
- localName = reader.NameTable.Add(localName)
- namespaceURI = reader.NameTable.Add(namespaceURI)
-
- ' find the descendant
- While (Await reader.ReadAsync() And reader.Depth > parentDepth)
- If (reader.NodeType = XmlNodeType.Element And
- (CObj(localName) = CObj(reader.LocalName)) And
- (CObj(namespaceURI) = CObj(reader.NamespaceURI))) Then
- Return True
- End If
- End While
-
- Return False
- End Function
- '
-
- '
- Public Async Function TestReader(stream As System.IO.Stream) As Task
- Dim settings As New XmlReaderSettings()
- settings.Async = True
-
- Using reader As XmlReader = XmlReader.Create(stream, settings)
- While (Await reader.ReadAsync())
- Select Case (reader.NodeType)
- Case XmlNodeType.Element
- Console.WriteLine("Start Element {0}", reader.Name)
- Case XmlNodeType.Text
- Console.WriteLine("Text Node: {0}",
- Await reader.GetValueAsync())
- Case XmlNodeType.EndElement
- Console.WriteLine("End Element {0}", reader.Name)
- Case Else
- Console.WriteLine("Other node {0} with value {1}",
- reader.NodeType, reader.Value)
- End Select
- End While
- End Using
- End Function
- '
-
-
-
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/readElementContentAs.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/readElementContentAs.vb
deleted file mode 100644
index 29dbfd0f6a744..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/readElementContentAs.vb
+++ /dev/null
@@ -1,148 +0,0 @@
-Imports System.Text
-Imports System.IO
-Imports System.Xml
-
-Class Read_Typed_Element
-
-
- Shared Sub Main()
-
-
- ReadElementContentAsString_1()
- ReadElementContentAsString_2()
- ReadElementContentAsLong_1()
- ReadElementContentAsDateTime_1()
- ReadElementContentAs_1()
- ReadElementContentAsObject()
- ReadElementContentAsDouble_1()
-
- End Sub
-
-
-
- Public Shared Sub ReadElementContentAsString_1()
- '
- Using reader As XmlReader = XmlReader.Create("dataFile.xml")
- reader.ReadToFollowing("stringValue")
- Console.WriteLine(reader.ReadElementContentAsString())
- End Using
- '
- End Sub
-
-
- Public Shared Sub ReadElementContentAsString_2()
- '
- Using reader As XmlReader = XmlReader.Create("dataFile.xml")
- reader.ReadToFollowing("stringValue")
- Console.WriteLine(reader.ReadElementContentAsString("stringValue", ""))
- End Using
- '
- End Sub
-
-
- Public Shared Sub ReadElementContentAsLong_1()
- '
- Using reader As XmlReader = XmlReader.Create("dataFile.xml")
- reader.ReadToFollowing("longValue")
- Dim number As Long = reader.ReadElementContentAsLong()
- ' Do some processing with the number object.
- End Using
- '
- End Sub
-
-
- Public Shared Sub ReadElementContentAsDateTime_1()
- '
- Using reader As XmlReader = XmlReader.Create("dataFile.xml")
- reader.ReadToFollowing("date")
- Dim [date] As DateTime = reader.ReadElementContentAsDateTime()
-
- ' If the current culture is "en-US",
- ' this writes "Wednesday, January 8, 2003".
- Console.WriteLine([date].ToLongDateString())
- End Using
- '
- End Sub
-
-
- Public Shared Sub ReadElementContentAs_1()
- '
- Using reader As XmlReader = XmlReader.Create("dataFile.xml")
- reader.ReadToFollowing("date")
- Dim [date] As DateTime = CType(reader.ReadElementContentAs(GetType(System.DateTime), Nothing), DateTime)
-
- ' If the current culture is "en-US",
- ' this writes "Wednesday, January 8, 2003".
- Console.WriteLine([date].ToLongDateString())
- End Using
- '
- End Sub
-
-
- Public Shared Sub ReadElementContentAsObject()
- '
- ' Create a validating reader.
- Dim settings As New XmlReaderSettings()
- settings.ValidationType = ValidationType.Schema
- settings.Schemas.Add("urn:items", "item.xsd")
- Dim reader As XmlReader = XmlReader.Create("item.xml", settings)
-
- ' Get the CLR type of the price element.
- reader.ReadToFollowing("price")
- Console.WriteLine(reader.ValueType)
-
- ' Return the value of the price element as Decimal object.
- Dim price As [Decimal] = CType(reader.ReadElementContentAsObject(), [Decimal])
-
- ' Add 2.50 to the price.
- price = [Decimal].Add(price, 2.5D)
-
- '
- End Sub
-
-
- Public Shared Sub ReadElementContentAsDouble_1()
- '
- Using reader As XmlReader = XmlReader.Create("dataFile.xml")
- reader.ReadToFollowing("double")
- Dim number As [Double] = reader.ReadElementContentAsDouble()
- ' Do some processing with the number object.
- End Using
- '
- End Sub
-
-Public Shared Sub ReadTypedData1()
-'
-' Create a validating XmlReader object. The schema
-' provides the necessary type information.
-Dim settings As XmlReaderSettings = New XmlReaderSettings()
-settings.ValidationType = ValidationType.Schema
-settings.Schemas.Add("urn:empl-hire", "hireDate.xsd")
-Using reader As XmlReader = XmlReader.Create("hireDate.xml", settings)
- ' Move to the hire-date element.
- reader.MoveToContent()
- reader.ReadToDescendant("hire-date")
-
- ' Return the hire-date as a DateTime object.
- Dim hireDate As DateTime = reader.ReadElementContentAsDateTime()
- Console.WriteLine("Six Month Review Date: {0}", hireDate.AddMonths(6))
-End Using
- '
-End Sub
-
-Public Shared Sub ReadTypedData2()
-'
-' Create an XmlReader object.
-Using reader As XmlReader = XmlReader.Create("hireDate_1.xml")
- ' Move to the hire-date element.
- reader.MoveToContent()
- reader.ReadToDescendant("hire-date")
-
- ' Return the hire-date as a DateTime object.
- Dim hireDate As DateTime = reader.ReadElementContentAsDateTime()
- Console.WriteLine("Six Month Review Date: {0}", hireDate.AddMonths(6))
-End Using
- '
-End Sub
-
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/xmlreader_basic.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/xmlreader_basic.vb
deleted file mode 100644
index 002af406050e2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/vb/xmlreader_basic.vb
+++ /dev/null
@@ -1,353 +0,0 @@
-Imports System.Text
-Imports System.IO
-Imports System.Xml
-
-
-Class XmlReader_Samples
-
-
- Shared Sub Main()
-
- End Sub
-
-
-Shared Sub AttributeCount()
-Dim reader As XmlReader = XmlReader.Create("books.xml")
-reader.ReadToDescendant("book")
-'
-' Display all attributes.
-If reader.HasAttributes Then
- Console.WriteLine("Attributes of <" + reader.Name + ">")
- Dim i As Integer
- For i = 0 To (reader.AttributeCount - 1)
- Console.WriteLine(" {0}", reader(i))
- Next i
- ' Move the reader back to the element node.
- reader.MoveToElement()
-End If
-'
-End Sub
-
-'==============================
-'
-Shared Sub GetAttribute1()
-Dim reader As XmlReader = XmlReader.Create("books.xml")
-'
-reader.ReadToFollowing("book")
-Dim isbn As String = reader.GetAttribute(2)
- '
-End Sub
-
-'==============================//
-'
-Shared Sub GetAttribute2()
-Dim reader As XmlReader = XmlReader.Create("books.xml")
-'
-reader.ReadToFollowing("book")
-Dim isbn As String = reader.GetAttribute("ISBN")
-Console.WriteLine("The ISBN value: " + isbn)
-'
-End Sub
-
-'==============================//
-'
-Shared Sub MoveToAttribute1()
-Dim reader As XmlReader = XmlReader.Create("books.xml")
-reader.ReadToFollowing("book")
-'
-If reader.HasAttributes Then
- Console.WriteLine("Attributes of <" + reader.Name + ">")
- Dim i As Integer
- For i = 0 To reader.AttributeCount - 1
- reader.MoveToAttribute(i)
- Console.Write(" {0}={1}", reader.Name, reader.Value)
- Next i
- reader.MoveToElement() 'Moves the reader back to the element node.
-End If
-'
-End Sub
-
-'==============================//
-'
-Shared Sub MoveToFirstAttribute()
-Dim reader As XmlReader = XmlReader.Create("books.xml")
-'
-reader.ReadToFollowing("book")
-reader.MoveToFirstAttribute()
-Dim genre As String = reader.Value
-Console.WriteLine("The genre value: " + genre)
-'
-End Sub
-
-'==============================//
-'
-Shared Sub MoveToNextAttribute()
-Dim reader As XmlReader = XmlReader.Create("books.xml")
-reader.ReadToFollowing("book")
-'
-If reader.HasAttributes Then
- Console.WriteLine("Attributes of <" + reader.Name + ">")
- While reader.MoveToNextAttribute()
- Console.WriteLine(" {0}={1}", reader.Name, reader.Value)
- End While
- ' Move the reader back to the element node.
- reader.MoveToElement()
-End If
-'
-End Sub
-
-
-'==============================//
-'
-Shared Sub Item()
-Dim reader As XmlReader = XmlReader.Create("books.xml")
-'
-reader.ReadToDescendant("book")
-Dim isbn As String = reader("ISBN")
-Console.WriteLine("The ISBN value: " + isbn)
-'
-End Sub
-
-
-'==============================//
-'
-Shared Sub Node_Value()
-'
-Dim settings As New XmlReaderSettings()
-settings.DtdProcessing = DtdProcessing.Parse
-Dim reader As XmlReader = XmlReader.Create("items.xml", settings)
-reader.MoveToContent()
-' Parse the file and display each of the nodes.
-While reader.Read()
- Select Case reader.NodeType
- Case XmlNodeType.Element
- Console.Write("<{0}>", reader.Name)
- Case XmlNodeType.Text
- Console.Write(reader.Value)
- Case XmlNodeType.CDATA
- Console.Write("", reader.Value)
- Case XmlNodeType.ProcessingInstruction
- Console.Write("{0} {1}?>", reader.Name, reader.Value)
- Case XmlNodeType.Comment
- Console.Write("", reader.Value)
- Case XmlNodeType.XmlDeclaration
- Console.Write("")
- Case XmlNodeType.Document
- Case XmlNodeType.DocumentType
- Console.Write("", reader.Name)
- End Select
-End While
-'
-End Sub
-
-
-'==============================//
-'
-Shared Sub NamespaceURI()
-'
-Dim reader As XmlReader = XmlReader.Create("book2.xml")
-
-' Parse the file. If they exist, display the prefix and
-' namespace URI of each node.
-While reader.Read()
- If reader.IsStartElement() Then
- If reader.Prefix = String.Empty Then
- Console.WriteLine("<{0}>", reader.LocalName)
- Else
- Console.Write("<{0}:{1}>", reader.Prefix, reader.LocalName)
- Console.WriteLine(" The namespace URI is " + reader.NamespaceURI)
- End If
- End If
-End While
-reader.Close()
-'
-End Sub
-
-
-'==============================
-'
-Shared Sub IsStartElement()
-Dim reader As XmlReader = XmlReader.Create("elems.xml")
-'
-While reader.Read()
- If reader.IsStartElement() Then
- If reader.IsEmptyElement Then
- Console.WriteLine("<{0}/>", reader.Name)
- Else
- Console.Write("<{0}> ", reader.Name)
- reader.Read() ' Read the start tag.
- If reader.IsStartElement() Then ' Handle nested elements.
- Console.Write(vbCr + vbLf + "<{0}>", reader.Name)
- End If
- Console.WriteLine(reader.ReadString()) 'Read the text content of the element.
- End If
- End If
-End While
-'
-End Sub
-
-
-'==============================
-'
-Shared Sub ReadEndElement()
-'
-Using reader As XmlReader = XmlReader.Create("book3.xml")
- ' Parse the XML document. ReadString is used to
- ' read the text content of the elements.
- reader.Read()
- reader.ReadStartElement("book")
- reader.ReadStartElement("title")
- Console.Write("The content of the title element: ")
- Console.WriteLine(reader.ReadString())
- reader.ReadEndElement()
- reader.ReadStartElement("price")
- Console.Write("The content of the price element: ")
- Console.WriteLine(reader.ReadString())
- reader.ReadEndElement()
- reader.ReadEndElement()
-End Using
-'
-End Sub
-
-'==============================
-'
-Shared Sub ReadInnerXml()
-'
-' Load the file and ignore all white space.
-Dim settings As New XmlReaderSettings()
-settings.IgnoreWhitespace = True
-Using reader As XmlReader = XmlReader.Create("2books.xml")
-
- ' Moves the reader to the root element.
- reader.MoveToContent()
-
- ' Moves to book node.
- reader.Read()
-
- ' Note that ReadInnerXml only returns the markup of the node's children
- ' so the book's attributes are not returned.
- Console.WriteLine("Read the first book using ReadInnerXml...")
- Console.WriteLine(reader.ReadInnerXml())
-
- ' ReadOuterXml returns the markup for the current node and its children
- ' so the book's attributes are also returned.
- Console.WriteLine("Read the second book using ReadOuterXml...")
- Console.WriteLine(reader.ReadOuterXml())
-
-End Using
-'
-End Sub
-
-
-'==============================
-'
-Shared Sub ReadSubtree()
-'
-Dim settings As New XmlReaderSettings()
-settings.IgnoreWhitespace = True
-Using reader As XmlReader = XmlReader.Create("books.xml", settings)
-
- ' Position the reader on the second book node.
- reader.ReadToFollowing("Book")
- reader.Skip()
-
- ' Create another reader that contains just the second book node.
- Dim inner As XmlReader = reader.ReadSubtree()
-
- inner.ReadToDescendant("Title")
- Console.WriteLine(inner.Name)
-
- ' Do additional processing on the inner reader. After you
- ' are done, call Close on the inner reader and
- ' continue processing using the original reader.
- inner.Close()
-
-End Using
-'
-End Sub
-
-
-'==============================
-'
-Shared Sub ReadtoDescendant()
-'
-Using reader As XmlReader = XmlReader.Create("2books.xml")
-
- ' Move the reader to the second book node.
- reader.MoveToContent()
- reader.ReadToDescendant("book")
- reader.Skip() 'Skip the first book.
- ' Parse the file starting with the second book node.
- Do
- Select Case reader.NodeType
- Case XmlNodeType.Element
- Console.Write("<{0}", reader.Name)
- While reader.MoveToNextAttribute()
- Console.Write(" {0}='{1}'", reader.Name, reader.Value)
- End While
- Console.Write(">")
- Case XmlNodeType.Text
- Console.Write(reader.Value)
- Case XmlNodeType.EndElement
- Console.Write("{0}>", reader.Name)
- End Select
- Loop While reader.Read()
-
-End Using
-'
-End Sub
-
-
-'==============================
-'
-Shared Sub ReadToFollowing()
-'
-Using reader As XmlReader = XmlReader.Create("books.xml")
- reader.ReadToFollowing("book")
- Do
- Console.WriteLine("ISBN: {0}", reader.GetAttribute("ISBN"))
- Loop While reader.ReadToNextSibling("book")
-End Using
-'
-End Sub
-
-
-'==============================
-'
-Shared Sub HasValue()
-'
-Dim settings As New XmlReaderSettings()
-settings.IgnoreWhitespace = True
-Using reader As XmlReader = XmlReader.Create("book1.xml", settings)
- ' Parse the file and display each node.
- While reader.Read()
- If reader.HasValue Then
- Console.WriteLine("({0}) {1}={2}", reader.NodeType, reader.Name, reader.Value)
- Else
- Console.WriteLine("({0}) {1}", reader.NodeType, reader.Name)
- End If
- End While
-End Using
-'
-End Sub
-
-'==============================
-'
-Shared Sub IsStartElement_2()
-Using reader As XmlReader = XmlReader.Create("books.xml")
-'
- ' Parse the file and display each price node.
- While reader.Read()
- If reader.IsStartElement("price") Then
- Console.WriteLine(reader.ReadInnerXml())
- End If
- End While
-'
-End Using
-End Sub
-
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/dataFile.xml b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/dataFile.xml
deleted file mode 100644
index 649c634502055..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/dataFile.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
- text value of the element.
-
- 270000000000001
- 0
- 2E10
- 2003-01-08T15:00:00-00:00
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/hireDate.xml b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/hireDate.xml
deleted file mode 100644
index aef2eca11857b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/hireDate.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- 12365
- 2003-01-08
- Accountant
-
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/hireDate.xsd b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/hireDate.xsd
deleted file mode 100644
index 2a1abcfa49fbf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/hireDate.xsd
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/hireDate_1.xml b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/hireDate_1.xml
deleted file mode 100644
index 08fe3369f4977..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/hireDate_1.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
- 12365
- 2003-01-08T15:00:00-00:00
- Accountant
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/item.xml b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/item.xml
deleted file mode 100644
index b06a269e3292f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/item.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
- hammer
- 9.95
- 1929
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/item.xsd b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/item.xsd
deleted file mode 100644
index bca02f6537572..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReader/Overview/xml/item.xsd
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReaderSettings/ValidationType/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReaderSettings/ValidationType/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReaderSettings/ValidationType/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReaderSettings/ValidationType/csharp/validschemaset.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReaderSettings/ValidationType/csharp/validschemaset.cs
deleted file mode 100644
index d883db55e5921..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlReaderSettings/ValidationType/csharp/validschemaset.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-using System;
-using System.Xml;
-using System.Xml.Schema;
-using System.IO;
-
-public class Sample
-{
- public static void Main() {
-
- // Create the XmlSchemaSet class.
- XmlSchemaSet sc = new XmlSchemaSet();
-
- // Add the schema to the collection.
- sc.Add("urn:bookstore-schema", "books.xsd");
-
- // Set the validation settings.
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.ValidationType = ValidationType.Schema;
- settings.Schemas = sc;
- settings.ValidationEventHandler += ValidationCallBack;
-
- // Create the XmlReader object.
- XmlReader reader = XmlReader.Create("booksSchemaFail.xml", settings);
-
- // Parse the file.
- while (reader.Read());
- }
-
- // Display any validation errors.
- private static void ValidationCallBack(object sender, ValidationEventArgs e) {
- Console.WriteLine($"Validation Error:\n {e.Message}\n");
- }
-}
-// The example displays output like the following:
-// Validation Error:
-// The element 'book' in namespace 'urn:bookstore-schema' has invalid child element 'author'
-// in namespace 'urn:bookstore-schema'. List of possible elements expected: 'title' in
-// namespace 'urn:bookstore-schema'.
-//
-// Validation Error:
-// The element 'author' in namespace 'urn:bookstore-schema' has invalid child element 'name'
-// in namespace 'urn:bookstore-schema'. List of possible elements expected: 'first-name' in
-// namespace 'urn:bookstore-schema'.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/csharp/Xslt_Load_v2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/csharp/Xslt_Load_v2.cs
deleted file mode 100644
index c40b92defd4d8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/csharp/Xslt_Load_v2.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-using System;
-using System.Text;
-using System.IO;
-using System.Xml;
-using System.Xml.Xsl;
-using System.Xml.XPath;
-using System.Net;
-
-class XslCompiledTransformLoad {
-
- static void Main() {
- }
-
-// Load with XPathDocument.
-static void XslCompiledTransform_Load1() {
-//
-XslCompiledTransform xslt = new XslCompiledTransform();
-xslt.Load(new XPathDocument("http://serverName/data/xsl/sort.xsl"));
-//
-}
-
-//==============================//
-// Load URI with XmlResolver
-static void XslCompiledTransform_Load2() {
-//
-// Create the XslCompiledTransform object.
-XslCompiledTransform xslt = new XslCompiledTransform();
-
-// Create a resolver and set the credentials to use.
-XmlSecureResolver resolver = new XmlSecureResolver(new XmlUrlResolver(), "http://serverName/data/");
-resolver.Credentials = CredentialCache.DefaultCredentials;
-
-// Load the style sheet.
-xslt.Load("http://serverName/data/xsl/sort.xsl", null, resolver);
-//
-}
-//==============================//
-// Load reader with resolver & settings
-static void XslCompiledTransform_Load3() {
-//
-// Create the XslCompiledTransform object.
-XslCompiledTransform xslt = new XslCompiledTransform();
-
-// Create a resolver and set the credentials to use.
-XmlSecureResolver resolver = new XmlSecureResolver(new XmlUrlResolver(), "http://serverName/data/");
-resolver.Credentials = CredentialCache.DefaultCredentials;
-
-XmlReader reader = XmlReader.Create("http://serverName/data/xsl/sort.xsl");
-
-// Create the XsltSettings object with script enabled.
-XsltSettings settings = new XsltSettings(false,true);
-
-// Load the style sheet.
-xslt.Load(reader, settings, resolver);
-//
-}
-
-//==============================//
-// Load with XPathDocument and credentials
-static void XslCompiledTransform_Load4() {
-
- string UserName = "username";
- string SecurelyStoredPassword = "psswd";
- string Domain= "domain";
-
-//
-// Create a resolver and specify the necessary credentials.
-XmlUrlResolver resolver = new XmlUrlResolver();
-System.Net.NetworkCredential myCred;
-myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
-resolver.Credentials = myCred;
-
-// Load the style sheet.
-XslCompiledTransform xslt = new XslCompiledTransform();
-xslt.Load(new XPathDocument("http://serverName/data/xsl/sort.xsl"), XsltSettings.Default, resolver);
-//
-}
-
-//==============================//
-// Load with XmlReader
-static void XslCompiledTransform_Load5() {
-//
-// Create a reader that contains the style sheet.
-XmlReader reader = XmlReader.Create("titles.xsl");
-reader.ReadToDescendant("xsl:stylesheet");
-
-// Load the style sheet.
-XslCompiledTransform xslt = new XslCompiledTransform();
-xslt.Load(reader);
-//
-}
-
-//==============================//
-// Load with script enabled.
-static void XslCompiledTransform_Load6() {
-//
-// Create the XsltSettings object with script enabled.
-XsltSettings settings = new XsltSettings(false,true);
-
-// Create the XslCompiledTransform object and load the style sheet.
-XslCompiledTransform xslt = new XslCompiledTransform();
-xslt.Load("sort.xsl", settings, new XmlUrlResolver());
-//
-}
-
-//==============================//
-// Load with default XSLT settings.
-static void XslCompiledTransform_Load7() {
-//
-// Create the XslCompiledTransform object and load the style sheet.
-XslCompiledTransform xslt = new XslCompiledTransform();
-xslt.Load("sort.xsl", XsltSettings.Default, new XmlUrlResolver());
-//
-}
-
-//==============================//
-// Load with trusted XSLT settings.
-static void XslCompiledTransform_Load8() {
-
- string UserName = "username";
- string SecurelyStoredPassword = "psswd";
- string Domain= "domain";
-
-//
-// Create a resolver and specify the necessary credentials.
-XmlSecureResolver resolver = new XmlSecureResolver(new XmlUrlResolver(), "http://serverName/data/");
-System.Net.NetworkCredential myCred;
-myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
-resolver.Credentials = myCred;
-
-// Create the XslCompiledTransform object and load the style sheet.
-XslCompiledTransform xslt = new XslCompiledTransform();
-xslt.Load("http://serverName/data/script.xsl", XsltSettings.TrustedXslt, resolver);
-//
-}
-
-//==============================//
-// Load with script enabled.
-static void XslCompiledTransform_Load9() {
-//
-// Create the XsltSettings object with script enabled.
-XsltSettings settings = new XsltSettings();
-settings.EnableScript = true;
-
-// Create a resolver that will be used to resolve the style sheet.
-XmlSecureResolver resolver = new XmlSecureResolver(new XmlUrlResolver(), "http://serverName/data/");
-
-// Create the XslCompiledTransform object and load the style sheet.
-XslCompiledTransform xslt = new XslCompiledTransform();
-xslt.Load("http://serverName/data/sort.xsl", settings, resolver);
-//
- }
-//==============================//
-//
-static void XslCompiledTransform_Debug() {
-//
-// Enable XSLT debugging.
-XslCompiledTransform xslt = new XslCompiledTransform(true);
-
-// Load the style sheet.
-xslt.Load("output.xsl");
-
-// Create the writer.
-XmlWriterSettings settings = new XmlWriterSettings();
-settings.Indent=true;
-XmlWriter writer = XmlWriter.Create("output.xml", settings);
-
-// Execute the transformation.
-xslt.Transform("books.xml", writer);
-writer.Close();
-//
-}
-
-//==============================//
-// Load w/ credential cache.
-static void Cache() {
-
- string UserName = "username";
- string SecurelyStoredPassword = "psswd";
- string Domain= "domain";
-
-//
-// Create the credentials.
-NetworkCredential myCred = new NetworkCredential(UserName,SecurelyStoredPassword,Domain);
-CredentialCache myCache = new CredentialCache();
-myCache.Add(new Uri("http://www.contoso.com/"), "Basic", myCred);
-myCache.Add(new Uri("http://app.contoso.com/"), "Basic", myCred);
-
-// Set the credentials on the XmlUrlResolver object.
-XmlUrlResolver resolver = new XmlUrlResolver();
-resolver.Credentials = myCache;
-
-// Compile the style sheet.
-XslCompiledTransform xslt = new XslCompiledTransform();
-xslt.Load("http://serverName/data/xsl/order.xsl",XsltSettings.Default, resolver);
-//
-}
-}
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/vb/Xslt_Load_v2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/vb/Xslt_Load_v2.vb
deleted file mode 100644
index 5fe7727d2f4b5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/vb/Xslt_Load_v2.vb
+++ /dev/null
@@ -1,203 +0,0 @@
-Imports System.Text
-Imports System.IO
-Imports System.Xml
-Imports System.Xml.Xsl
-Imports System.Xml.XPath
-Imports System.Net
-
-Class XslCompiledTransformLoad
-
- Shared Sub Main()
-
- End Sub
-
-' Load with XPathDocument.
-Shared Sub XslCompiledTransform_Load1()
-'
-Dim xslt As New XslCompiledTransform()
-xslt.Load(New XPathDocument("http://serverName/data/xsl/sort.xsl"))
-'
-End Sub
-
-
-'==============================//
-' Load URI with XmlResolver
-Shared Sub XslCompiledTransform_Load2()
-'
-' Create the XslCompiledTransform object.
-Dim xslt As New XslCompiledTransform()
-
-' Create a resolver and set the credentials to use.
-Dim resolver As New XmlSecureResolver(New XmlUrlResolver(), "http://serverName/data/")
-resolver.Credentials = CredentialCache.DefaultCredentials
-
-' Load the style sheet.
-xslt.Load("http://serverName/data/xsl/sort.xsl", Nothing, resolver)
-'
-End Sub
-
-'==============================//
-' Load reader with resolver & settings
-Shared Sub XslCompiledTransform_Load3()
-'
-' Create the XslCompiledTransform object.
-Dim xslt As New XslCompiledTransform()
-
-' Create a resolver and set the credentials to use.
-Dim resolver As New XmlSecureResolver(New XmlUrlResolver(), "http://serverName/data/")
-resolver.Credentials = CredentialCache.DefaultCredentials
-
-Dim reader As XmlReader = XmlReader.Create("http://serverName/data/xsl/sort.xsl")
-
-' Create the XsltSettings object with script enabled.
-Dim settings As New XsltSettings(False, True)
-
-' Load the style sheet.
-xslt.Load(reader, settings, resolver)
-'
-End Sub
-
-'==============================//
-' Load with XPathDocument and credentials
-Shared Sub XslCompiledTransform_Load4()
-
- Dim UserName As String = "username"
- Dim SecurelyStoredPassword As String = "psswd"
- Dim Domain As String = "domain"
-
-'
-' Create a resolver and specify the necessary credentials.
-Dim resolver As New XmlUrlResolver()
-Dim myCred As System.Net.NetworkCredential
-myCred = New System.Net.NetworkCredential(UserName, SecurelyStoredPassword, Domain)
-resolver.Credentials = myCred
-
-' Load the style sheet.
-Dim xslt As New XslCompiledTransform()
-xslt.Load(New XPathDocument("http://serverName/data/xsl/sort.xsl"), XsltSettings.Default, resolver)
-'
-End Sub
-
-'==============================//
-' Load with XmlReader
-Shared Sub XslCompiledTransform_Load5()
-'
-' Create a reader that contains the style sheet.
-Dim reader As XmlReader = XmlReader.Create("titles.xsl")
-reader.ReadToDescendant("xsl:stylesheet")
-
-' Load the style sheet.
-Dim xslt As New XslCompiledTransform()
-xslt.Load(reader)
-'
-End Sub
-
-'==============================//
-' Load with script enabled.
-Shared Sub XslCompiledTransform_Load6()
-'
-' Create the XsltSettings object with script enabled.
-Dim settings As New XsltSettings(False, True)
-
-' Create the XslCompiledTransform object and load the style sheet.
-Dim xslt As New XslCompiledTransform()
-xslt.Load("sort.xsl", settings, New XmlUrlResolver())
-'
-End Sub
-
-'==============================//
-' Load with default XSLT settings.
-Shared Sub XslCompiledTransform_Load7()
-'
-' Create the XslCompiledTransform object and load the style sheet.
-Dim xslt As New XslCompiledTransform()
-xslt.Load("sort.xsl", XsltSettings.Default, New XmlUrlResolver())
-'
-End Sub
-
-'==============================//
-' Load with trusted XSLT settings.
-Shared Sub XslCompiledTransform_Load8()
-
- Dim UserName As String = "username"
- Dim SecurelyStoredPassword As String = "psswd"
- Dim Domain As String = "domain"
-
-'
-' Create a resolver and specify the necessary credentials.
-Dim resolver As New XmlSecureResolver(New XmlUrlResolver(), "http://serverName/data/")
-Dim myCred As System.Net.NetworkCredential
-myCred = New System.Net.NetworkCredential(UserName, SecurelyStoredPassword, Domain)
-resolver.Credentials = myCred
-
-' Create the XslCompiledTransform object and load the style sheet.
-Dim xslt As New XslCompiledTransform()
-xslt.Load("http://serverName/data/script.xsl", XsltSettings.TrustedXslt, resolver)
-'
-End Sub
-
-'==============================//
-' Load with script enabled.
-Shared Sub XslCompiledTransform_Load9()
-'
-' Create the XsltSettings object with script enabled.
-Dim settings As New XsltSettings()
-settings.EnableScript = True
-
-' Create a resolver that will be used to resolve the style sheet.
-Dim resolver As New XmlSecureResolver(New XmlUrlResolver(), "http://serverName/data/")
-
-' Create the XslCompiledTransform object and load the style sheet.
-Dim xslt As New XslCompiledTransform()
-xslt.Load("http://serverName/data/sort.xsl", settings, resolver)
-'
-End Sub
-
-'==============================//
-'
-Shared Sub XslCompiledTransform_Debug()
-'
-' Enable XSLT debugging.
-Dim xslt As New XslCompiledTransform(true)
-
-' Load the style sheet.
-xslt.Load("output.xsl")
-
-' Create the writer.
-Dim settings As New XmlWriterSettings()
-settings.Indent=true
-Dim writer As XmlWriter = XmlWriter.Create("output.xml", settings)
-
-' Execute the transformation.
-xslt.Transform("books.xml", writer)
-writer.Close()
-'
-End Sub
-
-'==============================//
-' Load w/ cache
-Shared Sub Cache()
-
- Dim UserName As String = "username"
- Dim SecurelyStoredPassword As String = "psswd"
- Dim Domain As String = "domain"
-
-'
-' Create the credentials.
-Dim myCred As NetworkCredential = New NetworkCredential(UserName,SecurelyStoredPassword,Domain)
-Dim myCache As CredentialCache = New CredentialCache()
-myCache.Add(new Uri("http://www.contoso.com/"), "Basic", myCred)
-myCache.Add(new Uri("http://app.contoso.com/"), "Basic", myCred)
-
-' Set the credentials on the XmlUrlResolver object.
-Dim resolver As XmlUrlResolver = New XmlUrlResolver()
-resolver.Credentials = myCache
-
-' Compile the style sheet.
-Dim xslt As XslCompiledTransform = New XslCompiledTransform()
-xslt.Load("http://serverName/data/xsl/order.xsl", XsltSettings.Default, resolver)
-
-'
-End Sub
-
-End Class
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/vb/factory_rdr_cctor2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/vb/factory_rdr_cctor2.vb
deleted file mode 100644
index efff7cb8710c8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlResolver/Overview/vb/factory_rdr_cctor2.vb
+++ /dev/null
@@ -1,35 +0,0 @@
-Imports System.Xml
-Imports System.Xml.Schema
-Imports System.IO
-
-public class Sample
-
- public shared sub Main()
-
- '
- ' Set the reader settings.
- Dim settings as XmlReaderSettings = new XmlReaderSettings()
- settings.IgnoreComments = true
- settings.IgnoreProcessingInstructions = true
- settings.IgnoreWhitespace = true
- '
-
- '
- ' Create a resolver with default credentials.
- Dim resolver as XmlUrlResolver = new XmlUrlResolver()
- resolver.Credentials = System.Net.CredentialCache.DefaultCredentials
-
- ' Set the reader settings object to use the resolver.
- settings.XmlResolver = resolver
-
- ' Create the XmlReader object.
- Dim reader as XmlReader = XmlReader.Create("http://ServerName/data/books.xml", settings)
- '
-
- ' Parse the file.
- while reader.Read()
- end while
- end sub
-
-
-end class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/csharp/Project.csproj
deleted file mode 100644
index ed40953e21b35..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net481
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/csharp/XmlSecureResolver_ex.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/csharp/XmlSecureResolver_ex.cs
deleted file mode 100644
index 07ccb6ed242e5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/csharp/XmlSecureResolver_ex.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-using System;
-using System.IO;
-using System.Xml;
-using System.Xml.Xsl;
-using System.Security.Policy;
-using System.Security;
-using System.Security.Permissions;
-using System.Net;
-using System.Reflection;
-
-class XmlSecureResolver_Samples
-{
- static void Main()
- {
- }
-
- public void Assembly_Evidence()
- {
- //
- Evidence myEvidence = this.GetType().Assembly.Evidence;
- XmlSecureResolver myResolver;
- myResolver = new XmlSecureResolver(new XmlUrlResolver(), myEvidence);
- //
- }
-
- //==============================
- //
- static void URI_Evidence()
- {
- string sourceURI = "http://serverName/data";
- //
-
- Evidence myEvidence = XmlSecureResolver.CreateEvidenceForUrl(sourceURI);
- XmlSecureResolver myResolver = new XmlSecureResolver(new XmlUrlResolver(), myEvidence);
- //
- }
- //==============================
- //
- static void Use_URL()
- {
- //
- XmlSecureResolver myResolver = new XmlSecureResolver(new XmlUrlResolver(), "http://myLocalSite/");
- //
- }
-
- //==============================
- //
- static void Use_PermissionSet()
- {
- //
- WebPermission myWebPermission = new WebPermission(PermissionState.None);
- //
- //
- myWebPermission.AddPermission(NetworkAccess.Connect, "http://www.contoso.com/");
- myWebPermission.AddPermission(NetworkAccess.Connect, "http://litwareinc.com/data/");
- //
- //
- PermissionSet myPermissions = new PermissionSet(PermissionState.None);
- myPermissions.AddPermission(myWebPermission);
- //
- //
- XmlSecureResolver myResolver = new XmlSecureResolver(new XmlUrlResolver(), myPermissions);
- //
- }
-
- //==============================
- //
- static void Reader_Resolver()
- {
- XmlSecureResolver myResolver = new XmlSecureResolver(new XmlUrlResolver(), "http://myLocalSite/");
- //
- XmlReaderSettings settings = new XmlReaderSettings();
- settings.XmlResolver = myResolver;
- //
- //
- XmlReader reader = XmlReader.Create("books.xml", settings);
- //
- }
-
- //==============================
- //
- static void XSLT_Resolver()
- {
- XmlSecureResolver myResolver = new XmlSecureResolver(new XmlUrlResolver(), "http://myLocalSite/");
- //
- XslCompiledTransform xslt = new XslCompiledTransform();
- xslt.Load("http://serverName/data/xsl/sort.xsl", null, myResolver);
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/vb/Project.vbproj
deleted file mode 100644
index e7ab3e8988d5b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net48
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/vb/XmlSecureResolver_ex.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/vb/XmlSecureResolver_ex.vb
deleted file mode 100644
index a55bc54a60e03..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlSecureResolver/Overview/vb/XmlSecureResolver_ex.vb
+++ /dev/null
@@ -1,86 +0,0 @@
-Imports System.IO
-Imports System.Xml
-Imports System.Xml.Xsl
-Imports System.Security.Policy
-Imports System.Security
-Imports System.Security.Permissions
-Imports System.Net
-Imports System.Reflection
-
-Class XmlSecureResolver_Samples
-
- Shared Sub Main()
-
- End Sub
-
- Public Sub Assembly_Evidence()
- '
- Dim myEvidence As Evidence = Me.GetType().Assembly.Evidence
- Dim myResolver As XmlSecureResolver
- myResolver = New XmlSecureResolver(New XmlUrlResolver(), myEvidence)
- '
- End Sub
-
- '==============================
- '
- Shared Sub URI_Evidence()
- Dim sourceURI As String = "http://serverName/data"
- '
- Dim myEvidence As Evidence = XmlSecureResolver.CreateEvidenceForUrl(sourceURI)
- Dim myResolver As New XmlSecureResolver(New XmlUrlResolver(), myEvidence)
- '
- End Sub
-
- '==============================
- '
- Shared Sub Use_URL()
- '
- Dim myResolver As New XmlSecureResolver(New XmlUrlResolver(), "http://myLocalSite/")
- '
- End Sub
-
- '==============================
- '
- Shared Sub Use_PermissionSet()
- '
- Dim myWebPermission As New WebPermission(PermissionState.None)
- '
- '
- myWebPermission.AddPermission(NetworkAccess.Connect, "http://www.contoso.com/")
- myWebPermission.AddPermission(NetworkAccess.Connect, "http://litwareinc.com/data/")
- '
- '
- Dim myPermissions As New PermissionSet(PermissionState.None)
- myPermissions.AddPermission(myWebPermission)
- '
- '
- Dim myResolver As New XmlSecureResolver(New XmlUrlResolver(), myPermissions)
- '
- End Sub
-
- '==============================
- '
- Shared Sub Reader_Resolver()
- Dim myResolver As New XmlSecureResolver(New XmlUrlResolver(), "http://myLocalSite/")
- '
- Dim settings As New XmlReaderSettings()
- settings.XmlResolver = myResolver
- '
- '
- Dim reader As XmlReader = XmlReader.Create("books.xml", settings)
- '
- End Sub
-
- '==============================
- '
- Shared Sub XSLT_Resolver()
- Dim myResolver As New XmlSecureResolver(New XmlUrlResolver(), "http://myLocalSite/")
- '
- Dim xslt As New XslCompiledTransform()
- xslt.Load("http://serverName/data/xsl/sort.xsl", Nothing, myResolver)
- '
- End Sub
-
-End Class
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/csharp/writer_v2.cs b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/csharp/writer_v2.cs
deleted file mode 100644
index 7f5c8cff9c404..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/csharp/writer_v2.cs
+++ /dev/null
@@ -1,284 +0,0 @@
-using System;
-using System.Text;
-using System.IO;
-using System.Xml;
-
-class Whidbey_Write_Methods
-{
-
- static void Main()
- {
-
- // WriteQName();
- }
-
- public static void WriteDateTime()
- {
- //
- Double price = 9.95;
- DateTime date = new DateTime(2004, 5, 20);
-
- using (XmlWriter writer = XmlWriter.Create("data.xml"))
- {
- writer.WriteStartElement("book");
- writer.WriteStartAttribute("pub-date");
- writer.WriteValue(date);
- writer.WriteEndAttribute();
-
- writer.WriteStartElement("price");
- writer.WriteValue(price);
- writer.WriteEndElement();
-
- writer.WriteEndElement();
- writer.Flush();
- }
- //
- }
-
- public static void CreateURI()
- {
- //
- using (XmlWriter writer = XmlWriter.Create("output.xml"))
- {
- writer.WriteStartElement("book");
- writer.WriteElementString("price", "19.95");
- writer.WriteEndElement();
- writer.Flush();
- }
-
- //
- }
-
- public static void Create_Console()
- {
- //
- using (XmlWriter writer = XmlWriter.Create(Console.Out))
- {
- writer.WriteStartElement("book");
- writer.WriteElementString("price", "19.95");
- writer.WriteEndElement();
- writer.Flush();
- }
-
- //
- }
-
- public static void Create_StringWriter()
- {
- //
- XmlWriterSettings settings = new XmlWriterSettings();
- settings.OmitXmlDeclaration = true;
- StringWriter sw = new StringWriter();
-
- using (XmlWriter writer = XmlWriter.Create(sw, settings))
- {
- writer.WriteStartElement("book");
- writer.WriteElementString("price", "19.95");
- writer.WriteEndElement();
- writer.Flush();
-
- String output = sw.ToString();
- }
-
- //
- }
-
- public static void WriteQName()
- {
- //
- XmlWriterSettings settings = new XmlWriterSettings();
- settings.Indent = true;
- settings.OmitXmlDeclaration = true;
- using (XmlWriter writer = XmlWriter.Create(Console.Out, settings))
- {
- writer.WriteStartElement("root");
- writer.WriteAttributeString("xmlns", "x", null, "urn:abc");
- writer.WriteStartElement("item");
- writer.WriteStartAttribute("href", null);
- writer.WriteString("#");
- writer.WriteQualifiedName("test", "urn:abc");
- writer.WriteEndAttribute();
- writer.WriteEndElement();
- writer.WriteEndElement();
- }
- //
- }
-
- // # 6 placeholder for XmlQualfieldName.Empty snippet
-
- public static void GenericCreate()
- {
- //
- XmlWriterSettings settings = new XmlWriterSettings();
- settings.Indent = true;
- settings.IndentChars = (" ");
- using (XmlWriter writer = XmlWriter.Create("books.xml", settings))
- {
- // Write XML data.
- writer.WriteStartElement("book");
- writer.WriteElementString("price", "19.95");
- writer.WriteEndElement();
- writer.Flush();
- }
- //
- }
-
- public static void Output1()
- {
- //
- XmlWriterSettings settings = new XmlWriterSettings();
- settings.Indent = true;
- settings.IndentChars = "\t";
- XmlWriter writer = XmlWriter.Create("books.xml", settings);
- //
- }
-
- public static void Output2()
- {
- //
- XmlWriterSettings settings = new XmlWriterSettings();
- settings.Indent = true;
- settings.NewLineOnAttributes = true;
- XmlWriter writer = XmlWriter.Create("books.xml", settings);
- //
- }
-
- public static void Attrs1()
- {
- //
- XmlWriterSettings settings = new XmlWriterSettings();
- settings.Indent = true;
- using (XmlWriter writer = XmlWriter.Create(Console.Out, settings))
- {
- writer.WriteStartElement("Product");
- writer.WriteAttributeString("supplierID", "A23-1");
- writer.WriteElementString("ProductID", "12345");
- writer.WriteEndElement();
- }
- //
- }
-
- public static void Attrs2()
- {
- //
- DateTime hireDate = new DateTime(2008, 5, 20);
- XmlWriterSettings settings = new XmlWriterSettings();
- settings.Indent = true;
- using (XmlWriter writer = XmlWriter.Create(Console.Out, settings))
- {
- writer.WriteStartElement("Employee");
- writer.WriteStartAttribute("review-date");
- writer.WriteValue(hireDate.AddMonths(6));
- writer.WriteEndAttribute();
- writer.WriteElementString("EmployeeID", "12345");
- writer.WriteEndElement();
- }
- //
- }
-
- public static void Attrs3()
- {
- //
- XmlReader reader = XmlReader.Create("book.xml");
- reader.ReadToDescendant("book");
- XmlWriterSettings settings = new XmlWriterSettings();
- settings.Indent = true;
- using (XmlWriter writer = XmlWriter.Create(Console.Out, settings))
- {
-
- writer.WriteStartElement("root");
- writer.WriteAttributes(reader, true);
- writer.WriteEndElement();
- }
- //
- }
-
- public static void Elems1()
- {
- XmlWriter writer = XmlWriter.Create(Console.Out);
- //
- writer.WriteElementString("price", "19.95");
- //
- writer.Flush();
- }
-
- public static void Elems2()
- {
- XmlWriter writer = XmlWriter.Create(Console.Out);
- //
- writer.WriteStartElement("bk", "book", "urn:books");
- writer.WriteAttributeString("genre", "urn:books", "mystery");
- writer.WriteElementString("price", "19.95");
- writer.WriteEndElement();
- //
- writer.Flush();
- }
-
- public static void Elems3()
- {
- //
- // Create a reader and position it on the book node.
- XmlReader reader = XmlReader.Create("books.xml");
- reader.ReadToFollowing("book");
-
- // Write out the book node.
- XmlWriter writer = XmlWriter.Create("newBook.xml");
- writer.WriteNode(reader, true);
- writer.Flush();
- //
- }
-
- public static void TypedWrite()
- {
- // Create a reader and position it on the book node.
- XmlReader reader = XmlReader.Create("books.xml");
- XmlWriter writer = XmlWriter.Create(Console.Out);
- //
- reader.ReadToDescendant("price");
- writer.WriteStartElement("price");
- writer.WriteValue((reader.ReadElementContentAsDouble()) * 1.15);
- writer.WriteEndElement();
- //
- writer.Flush();
- }
-
- public static void Namespace1()
- {
- XmlWriter writer = XmlWriter.Create(Console.Out);
- //
- writer.WriteStartElement("root");
- writer.WriteAttributeString("xmlns", "x", null, "urn:1");
- writer.WriteStartElement("item", "urn:1");
- writer.WriteEndElement();
- writer.WriteStartElement("item", "urn:1");
- writer.WriteEndElement();
- writer.WriteEndElement();
- //
- writer.Flush();
- }
-
- public static void Namespace2()
- {
- XmlWriter writer = XmlWriter.Create(Console.Out);
- //
- writer.WriteStartElement("x", "root", "123");
- writer.WriteStartElement("item");
- writer.WriteAttributeString("xmlns", "x", null, "abc");
- writer.WriteEndElement();
- writer.WriteEndElement();
- //
- writer.Flush();
- }
-
- public static void Namespace3()
- {
- XmlWriter writer = XmlWriter.Create(Console.Out);
- //
- writer.WriteStartElement("x", "root", "urn:1");
- writer.WriteStartElement("y", "item", "urn:1");
- writer.WriteEndElement();
- writer.WriteEndElement();
- //
- writer.Flush();
- }
-} // end class.
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/vb/writer_v2.vb b/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/vb/writer_v2.vb
deleted file mode 100644
index e9360e2e4ff52..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlWriter/Overview/vb/writer_v2.vb
+++ /dev/null
@@ -1,256 +0,0 @@
-Imports System.Text
-Imports System.IO
-Imports System.Xml
-
-Class Whidbey_Write_Methods
-
-
- Shared Sub Main()
-
- End Sub
-
- ' WriteQName();
-
-
-Public Shared Sub WriteDateTime()
-'
-Dim price As [Double] = 9.95
-Dim [date] As New DateTime(2004, 5, 20)
-
-Using writer As XmlWriter = XmlWriter.Create("data.xml")
- writer.WriteStartElement("book")
- writer.WriteStartAttribute("pub-date")
- writer.WriteValue([date])
- writer.WriteEndAttribute()
-
- writer.WriteStartElement("price")
- writer.WriteValue(price)
- writer.WriteEndElement()
-
- writer.WriteEndElement()
- writer.Flush()
-End Using
-'
-End Sub
-
-
-Public Shared Sub CreateURI()
-'
-Using writer As XmlWriter = XmlWriter.Create("output.xml")
- writer.WriteStartElement("book")
- writer.WriteElementString("price", "19.95")
- writer.WriteEndElement()
- writer.Flush()
-End Using
-'
-End Sub
-
-Public Shared Sub Create_Console()
-'
-Using writer As XmlWriter = XmlWriter.Create(Console.Out)
- writer.WriteStartElement("book")
- writer.WriteElementString("price", "19.95")
- writer.WriteEndElement()
- writer.Flush()
-End Using
-'
-End Sub
-
-Public Shared Sub Create_StringWriter()
-'
-Dim settings As New XmlWriterSettings()
-settings.OmitXmlDeclaration = True
-Dim sw As New StringWriter()
-
-Using writer As XmlWriter = XmlWriter.Create(sw, settings)
- writer.WriteStartElement("book")
- writer.WriteElementString("price", "19.95")
- writer.WriteEndElement()
- writer.Flush()
-
- Dim output As String = sw.ToString()
-End Using
- '
-End Sub
-
-Public Shared Sub WriteQName()
-'
-Dim settings As New XmlWriterSettings()
-settings.Indent = True
-settings.OmitXmlDeclaration = True
-Using writer As XmlWriter = XmlWriter.Create(Console.Out, settings)
- writer.WriteStartElement("root")
- writer.WriteAttributeString("xmlns", "x", Nothing, "urn:abc")
- writer.WriteStartElement("item")
- writer.WriteStartAttribute("href", Nothing)
- writer.WriteString("#")
- writer.WriteQualifiedName("test", "urn:abc")
- writer.WriteEndAttribute()
- writer.WriteEndElement()
- writer.WriteEndElement()
-End Using
-'
-End Sub
-
-
-' # 6 placeholder for XmlQualfieldName.Empty snippet
-
-Public Shared Sub GenericCreate()
-'
-Dim settings As New XmlWriterSettings()
-settings.Indent = True
-settings.IndentChars = " "
-Using writer As XmlWriter = XmlWriter.Create("books.xml", settings)
- ' Write XML data.
- writer.WriteStartElement("book")
- writer.WriteElementString("price", "19.95")
- writer.WriteEndElement()
- writer.Flush()
-End Using
-'
-End Sub
-
-Public Shared Sub Output1()
-'
-Dim settings As New XmlWriterSettings()
-settings.Indent = True
-settings.IndentChars = vbTab
-Dim writer As XmlWriter = XmlWriter.Create("books.xml", settings)
-'
-End Sub
-
-Public Shared Sub Output2()
-'
-Dim settings As New XmlWriterSettings()
-settings.Indent = True
-settings.NewLineOnAttributes = True
-Dim writer As XmlWriter = XmlWriter.Create("books.xml", settings)
-'
-End Sub
-
-Public Shared Sub Attrs1()
-'
-Dim settings As New XmlWriterSettings()
-settings.Indent = True
-Using writer As XmlWriter = XmlWriter.Create(Console.Out, settings)
- writer.WriteStartElement("Product")
- writer.WriteAttributeString("supplierID", "A23-1")
- writer.WriteElementString("ProductID", "12345")
- writer.WriteEndElement()
-End Using
-'
-End Sub
-
-Public Shared Sub Attrs2()
-'
-Dim hireDate As New DateTime(2008, 5, 20)
-Dim settings As New XmlWriterSettings()
-settings.Indent = True
-Using writer As XmlWriter = XmlWriter.Create(Console.Out, settings)
- writer.WriteStartElement("Employee")
- writer.WriteStartAttribute("review-date")
- writer.WriteValue(hireDate.AddMonths(6))
- writer.WriteEndAttribute()
- writer.WriteElementString("EmployeeID", "12345")
- writer.WriteEndElement()
-End Using
-'
-End Sub
-
-Public Shared Sub Attrs3()
-'
-Dim reader As XmlReader = XmlReader.Create("book.xml")
-reader.ReadToDescendant("book")
-Dim settings As New XmlWriterSettings()
-settings.Indent = True
-Using writer As XmlWriter = XmlWriter.Create(Console.Out, settings)
- writer.WriteStartElement("root")
- writer.WriteAttributes(reader, True)
- writer.WriteEndElement()
-End Using
-'
-End Sub
-
-Public Shared Sub Elems1()
-Dim writer As XmlWriter = XmlWriter.Create(Console.Out)
-'
-writer.WriteElementString("price", "19.95")
-'
-writer.Flush()
-End Sub
-
-Public Shared Sub Elems2()
-Dim writer As XmlWriter = XmlWriter.Create(Console.Out)
-'
-writer.WriteStartElement("bk", "book", "urn:books")
-writer.WriteAttributeString("genre", "urn:books", "mystery")
-writer.WriteElementString("price", "19.95")
-writer.WriteEndElement()
-'
-writer.Flush()
-End Sub
-
-Public Shared Sub Elems3()
-'
-' Create a reader and position it on the book node.
-Dim reader As XmlReader = XmlReader.Create("books.xml")
-reader.ReadToFollowing("book")
-
-' Write out the book node.
-Dim writer As XmlWriter = XmlWriter.Create("newBook.xml")
-writer.WriteNode(reader, True)
-writer.Flush()
-'
-End Sub
-
-Public Shared Sub TypedWrite()
-' Create a reader and position it on the book node.
-Dim reader As XmlReader = XmlReader.Create("books.xml")
-Dim writer As XmlWriter = XmlWriter.Create(Console.Out)
-'
-reader.ReadToDescendant("price")
-writer.WriteStartElement("price")
-writer.WriteValue(reader.ReadElementContentAsDouble() * 1.15)
-writer.WriteEndElement()
-'
-writer.Flush()
-End Sub
-
-Public Shared Sub Namespace1()
-Dim writer As XmlWriter = XmlWriter.Create(Console.Out)
-'
-writer.WriteStartElement("root")
-writer.WriteAttributeString("xmlns", "x", Nothing, "urn:1")
-writer.WriteStartElement("item", "urn:1")
-writer.WriteEndElement()
-writer.WriteStartElement("item", "urn:1")
-writer.WriteEndElement()
-writer.WriteEndElement()
- '
-writer.Flush()
-End Sub
-
-Public Shared Sub Namespace2()
-Dim writer As XmlWriter = XmlWriter.Create(Console.Out)
-'
-writer.WriteStartElement("x", "root", "123")
-writer.WriteStartElement("item")
-writer.WriteAttributeString("xmlns", "x", Nothing, "abc")
-writer.WriteEndElement()
-writer.WriteEndElement()
-'
-writer.Flush()
-End Sub
-
-Public Shared Sub Namespace3()
-Dim writer As XmlWriter = XmlWriter.Create(Console.Out)
-'
-writer.WriteStartElement("x", "root", "urn:1")
-writer.WriteStartElement("y", "item", "urn:1")
-writer.WriteEndElement()
-writer.WriteEndElement()
-'
-writer.Flush()
-End Sub
-
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V1/Example4.cs b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V1/Example4.cs
deleted file mode 100644
index 7b86a80ab5eb9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V1/Example4.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-using System;
-using System.Reflection;
-
-[assembly: AssemblyVersion("1.0.0.0")]
-
-public static class StringLibrary1
-{
- public static int SubstringStartsAt(string fullString, string substr)
- {
- return fullString.IndexOf(substr, StringComparison.Ordinal);
- }
-}
-//
-
-namespace App
-{
- //
- using System;
-
- public class Example1
- {
- public static void Main()
- {
- string value = "The archaeologist";
- string substring = "archæ";
- int position = StringLibrary1.SubstringStartsAt(value, substring);
- if (position >= 0)
- Console.WriteLine($"'{substring}' found in '{value}' starting at position {position}");
- else
- Console.WriteLine($"'{substring}' not found in '{value}'");
- }
- }
- // The example displays the following output:
- // 'archæ' not found in 'The archaeologist'
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V1/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V1/Project.csproj
deleted file mode 100644
index 369b05a893e74..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V1/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- false
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V2/Example6.cs b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V2/Example6.cs
deleted file mode 100644
index c31bea12489a1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V2/Example6.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-using System;
-using System.Reflection;
-
-[assembly: AssemblyVersion("2.0.0.0")]
-
-public static class StringLibrary2
-{
- public static int SubstringStartsAt(string fullString, string substr)
- {
- return fullString.IndexOf(substr, StringComparison.CurrentCulture);
- }
-}
-//
-
-namespace App
-{
- //
- using System;
-
- public class Example2
- {
- public static void Main()
- {
- string value = "The archaeologist";
- string substring = "archæ";
- int position = StringLibrary2.SubstringStartsAt(value, substring);
- if (position >= 0)
- Console.WriteLine($"'{substring}' found in '{value}' starting at position {position}");
- else
- Console.WriteLine($"'{substring}' not found in '{value}'");
- }
- }
- // The example displays the following output:
- // 'archæ' found in 'The archaeologist' starting at position 4
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V2/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V2/Project.csproj
deleted file mode 100644
index 369b05a893e74..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V2/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- false
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V3/Example8.cs b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V3/Example8.cs
deleted file mode 100644
index 585f7e8eaec95..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V3/Example8.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-using System;
-using System.Reflection;
-
-[assembly: AssemblyVersion("2.0.0.0")]
-
-public static class StringLibrary
-{
- public static int SubstringStartsAt(string fullString, string substr)
- {
- bool flag;
- if (AppContext.TryGetSwitch("StringLibrary.DoNotUseCultureSensitiveComparison", out flag) && flag == true)
- return fullString.IndexOf(substr, StringComparison.Ordinal);
- else
- return fullString.IndexOf(substr, StringComparison.CurrentCulture);
- }
-}
-//
-
-namespace App
-{
- //
- using System;
-
- public class Example
- {
- public static void Main()
- {
- string value = "The archaeologist";
- string substring = "archæ";
- int position = StringLibrary.SubstringStartsAt(value, substring);
- if (position >= 0)
- Console.WriteLine($"'{substring}' found in '{value}' starting at position {position}");
- else
- Console.WriteLine($"'{substring}' not found in '{value}'");
- }
- }
- // The example displays the following output:
- // 'archæ' found in 'The archaeologist' starting at position 4
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V3/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V3/Project.csproj
deleted file mode 100644
index 369b05a893e74..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/csharp/V3/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- false
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/fsharp/Example4.fs b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/fsharp/Example4.fs
deleted file mode 100644
index 7aca0ebeb0868..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/fsharp/Example4.fs
+++ /dev/null
@@ -1,30 +0,0 @@
-module Example4
-
-//
-open System
-open System.Reflection
-
-[]
-do ()
-
-module StringLibrary =
- let substringStartsAt (fullString: string) (substr: string) =
- fullString.IndexOf(substr, StringComparison.Ordinal)
-
-//
-
-//
-let value = "The archaeologist"
-let substring = "archæ"
-
-let position =
- StringLibrary.substringStartsAt value substring
-
-if position >= 0 then
- printfn $"'{substring}' found in '{value}' starting at position {position}"
-else
- printfn $"'{substring}' not found in '{value}'"
-
-// The example displays the following output:
-// 'archæ' not found in 'The archaeologist'
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/fsharp/Example6.fs b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/fsharp/Example6.fs
deleted file mode 100644
index 32aefd261fdc5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/fsharp/Example6.fs
+++ /dev/null
@@ -1,30 +0,0 @@
-module Example6
-
-//
-open System
-open System.Reflection
-
-[]
-do ()
-
-module StringLibrary =
- let substringStartsAt (fullString: string) (substr: string) =
- fullString.IndexOf(substr, StringComparison.CurrentCulture)
-
-//
-
-//
-let value = "The archaeologist"
-let substring = "archæ"
-
-let position =
- StringLibrary.substringStartsAt value substring
-
-if position >= 0 then
- printfn $"'{substring}' found in '{value}' starting at position {position}"
-else
- printfn $"'{substring}' not found in '{value}'"
-
-// The example displays the following output:
-// 'archæ' found in 'The archaeologist' starting at position 4
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/fsharp/Example8.fs b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/fsharp/Example8.fs
deleted file mode 100644
index 5b4f8b2691a96..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/fsharp/Example8.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module Example8
-
-//
-open System
-open System.Reflection
-
-[]
-do ()
-
-AppContext.SetSwitch("StringLibrary.DoNotUseCultureSensitiveComparison",true)
-
-module StringLibrary =
- let substringStartsAt (fullString: string) (substr: string) =
- match AppContext.TryGetSwitch "StringLibrary.DoNotUseCultureSensitiveComparison" with
- | true, true -> fullString.IndexOf(substr, StringComparison.Ordinal)
- | _ -> fullString.IndexOf(substr, StringComparison.CurrentCulture)
-
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V1/Example4.vb b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V1/Example4.vb
deleted file mode 100644
index 2dcb806cc7f12..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V1/Example4.vb
+++ /dev/null
@@ -1,32 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Reflection
-
-
-
-Public Class StringLibrary
- Public Shared Function SubstringStartsAt(fullString As String, substr As String) As Integer
- Return fullString.IndexOf(substr, StringComparison.Ordinal)
- End Function
-End Class
-'
-
-'
-Public Module Example4
- Public Sub Main()
- Dim value As String = "The archaeologist"
- Dim substring As String = "archæ"
- Dim position As Integer = StringLibrary.SubstringStartsAt(value, substring)
- If position >= 0 Then
- Console.WriteLine("'{0}' found in '{1}' starting at position {2}",
- substring, value, position)
- Else
- Console.WriteLine("'{0}' not found in '{1}'", substring, value)
- End If
- End Sub
-End Module
-' The example displays the following output:
-' 'archæ' not found in 'The archaeologist'
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V1/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V1/Project.vbproj
deleted file mode 100644
index 369b05a893e74..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V1/Project.vbproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- false
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V2/Example6.vb b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V2/Example6.vb
deleted file mode 100644
index 26f0a4a5ed8a8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V2/Example6.vb
+++ /dev/null
@@ -1,32 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Reflection
-
-
-
-Public Class StringLibrary
- Public Shared Function SubstringStartsAt(fullString As String, substr As String) As Integer
- Return fullString.IndexOf(substr, StringComparison.CurrentCulture)
- End Function
-End Class
-'
-
-'
-Public Module Example6
- Public Sub Main()
- Dim value As String = "The archaeologist"
- Dim substring As String = "archæ"
- Dim position As Integer = StringLibrary.SubstringStartsAt(value, substring)
- If position >= 0 Then
- Console.WriteLine("'{0}' found in '{1}' starting at position {2}",
- substring, value, position)
- Else
- Console.WriteLine("'{0}' not found in '{1}'", substring, value)
- End If
- End Sub
-End Module
-' The example displays the following output:
-' 'archæ' found in 'The archaeologist' starting at position 4
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V2/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V2/Project.vbproj
deleted file mode 100644
index 369b05a893e74..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V2/Project.vbproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- false
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V3/Example8.vb b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V3/Example8.vb
deleted file mode 100644
index eb221282b6a7f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V3/Example8.vb
+++ /dev/null
@@ -1,37 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Reflection
-
-
-
-Public Class StringLibrary
- Public Shared Function SubstringStartsAt(fullString As String, substr As String) As Integer
- Dim flag As Boolean
- If AppContext.TryGetSwitch("StringLibrary.DoNotUseCultureSensitiveComparison", flag) AndAlso flag = True Then
- Return fullString.IndexOf(substr, StringComparison.Ordinal)
- Else
- Return fullString.IndexOf(substr, StringComparison.CurrentCulture)
- End If
- End Function
-End Class
-'
-
-'
-Public Module Example8
- Public Sub Main()
- Dim value As String = "The archaeologist"
- Dim substring As String = "archæ"
- Dim position As Integer = StringLibrary.SubstringStartsAt(value, substring)
- If position >= 0 Then
- Console.WriteLine("'{0}' found in '{1}' starting at position {2}",
- substring, value, position)
- Else
- Console.WriteLine("'{0}' not found in '{1}'", substring, value)
- End If
- End Sub
-End Module
-' The example displays the following output:
-' 'archæ' not found in 'The archaeologist'
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V3/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V3/Project.vbproj
deleted file mode 100644
index 369b05a893e74..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/vb/V3/Project.vbproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- false
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/Project.csproj
deleted file mode 100644
index 22dd9034898ba..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- true
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/binary1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/binary1.cs
deleted file mode 100644
index 157211ddb538c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/binary1.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-using System;
-
-public class Example1
-{
- public static void Main()
- {
- bool[] flags = { true, false };
- foreach (var flag in flags)
- {
- // Get binary representation of flag.
- Byte value = BitConverter.GetBytes(flag)[0];
- Console.WriteLine($"Original value: {flag}");
- Console.WriteLine($"Binary value: {value} ({GetBinaryString(value)})");
- // Restore the flag from its binary representation.
- bool newFlag = BitConverter.ToBoolean(new Byte[] { value }, 0);
- Console.WriteLine($"Restored value: {newFlag}{Environment.NewLine}");
- }
- }
-
- private static string GetBinaryString(Byte value)
- {
- string retVal = Convert.ToString(value, 2);
- return new string('0', 8 - retVal.Length) + retVal;
- }
-}
-// The example displays the following output:
-// Original value: True
-// Binary value: 1 (00000001)
-// Restored value: True
-//
-// Original value: False
-// Binary value: 0 (00000000)
-// Restored value: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/conversion1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/conversion1.cs
deleted file mode 100644
index a73bec266eeb3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/conversion1.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-using System;
-
-public class Example2
-{
- public static void Main()
- {
- Byte byteValue = 12;
- Console.WriteLine(Convert.ToBoolean(byteValue));
- Byte byteValue2 = 0;
- Console.WriteLine(Convert.ToBoolean(byteValue2));
- int intValue = -16345;
- Console.WriteLine(Convert.ToBoolean(intValue));
- long longValue = 945;
- Console.WriteLine(Convert.ToBoolean(longValue));
- SByte sbyteValue = -12;
- Console.WriteLine(Convert.ToBoolean(sbyteValue));
- double dblValue = 0;
- Console.WriteLine(Convert.ToBoolean(dblValue));
- float sngValue = .0001f;
- Console.WriteLine(Convert.ToBoolean(sngValue));
- }
-}
-// The example displays the following output:
-// True
-// False
-// True
-// True
-// True
-// False
-// True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/conversion3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/conversion3.cs
deleted file mode 100644
index 5cc0408da7fef..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/conversion3.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-using System;
-
-public class Example3
-{
- public static void Main()
- {
- bool flag = true;
-
- byte byteValue;
- byteValue = Convert.ToByte(flag);
- Console.WriteLine($"{flag} -> {byteValue}");
-
- sbyte sbyteValue;
- sbyteValue = Convert.ToSByte(flag);
- Console.WriteLine($"{flag} -> {sbyteValue}");
-
- double dblValue;
- dblValue = Convert.ToDouble(flag);
- Console.WriteLine($"{flag} -> {dblValue}");
-
- int intValue;
- intValue = Convert.ToInt32(flag);
- Console.WriteLine($"{flag} -> {intValue}");
- }
-}
-// The example displays the following output:
-// True -> 1
-// True -> 1
-// True -> 1
-// True -> 1
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/format3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/format3.cs
deleted file mode 100644
index 7bc1f096f475c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/format3.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example4
-{
- public static void Main()
- {
- String[] cultureNames = { "", "en-US", "fr-FR", "ru-RU" };
- foreach (var cultureName in cultureNames) {
- bool value = true;
- CultureInfo culture = CultureInfo.CreateSpecificCulture(cultureName);
- BooleanFormatter formatter = new BooleanFormatter(culture);
-
- string result = string.Format(formatter, "Value for '{0}': {1}", culture.Name, value);
- Console.WriteLine(result);
- }
- }
-}
-
-public class BooleanFormatter : ICustomFormatter, IFormatProvider
-{
- private CultureInfo culture;
-
- public BooleanFormatter() : this(CultureInfo.CurrentCulture)
- { }
-
- public BooleanFormatter(CultureInfo culture)
- {
- this.culture = culture;
- }
-
- public Object GetFormat(Type formatType)
- {
- if (formatType == typeof(ICustomFormatter))
- return this;
- else
- return null;
- }
-
- public string Format(string fmt, Object arg, IFormatProvider formatProvider)
- {
- // Exit if another format provider is used.
- if (! formatProvider.Equals(this)) return null;
-
- // Exit if the type to be formatted is not a Boolean
- if (! (arg is Boolean)) return null;
-
- bool value = (bool) arg;
- switch (culture.Name) {
- case "en-US":
- return value.ToString();
- case "fr-FR":
- if (value)
- return "vrai";
- else
- return "faux";
- case "ru-RU":
- if (value)
- return "верно";
- else
- return "неверно";
- default:
- return value.ToString();
- }
- }
-}
-// The example displays the following output:
-// Value for '': True
-// Value for 'en-US': True
-// Value for 'fr-FR': vrai
-// Value for 'ru-RU': верно
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/operations1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/operations1.cs
deleted file mode 100644
index 5ac64bf26c320..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/operations1.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Threading;
-
-public class Example5
-{
- public static void Main()
- {
- // Initialize flag variables.
- bool isRedirected = false;
- bool isBoth = false;
- String fileName = "";
- StreamWriter sw = null;
-
- // Get any command line arguments.
- String[] args = Environment.GetCommandLineArgs();
- // Handle any arguments.
- if (args.Length > 1) {
- for (int ctr = 1; ctr < args.Length; ctr++) {
- String arg = args[ctr];
- if (arg.StartsWith("/") || arg.StartsWith("-")) {
- switch (arg.Substring(1).ToLower())
- {
- case "f":
- isRedirected = true;
- if (args.Length < ctr + 2) {
- ShowSyntax("The /f switch must be followed by a filename.");
- return;
- }
- fileName = args[ctr + 1];
- ctr++;
- break;
- case "b":
- isBoth = true;
- break;
- default:
- ShowSyntax(String.Format("The {0} switch is not supported",
- args[ctr]));
- return;
- }
- }
- }
- }
-
- // If isBoth is True, isRedirected must be True.
- if (isBoth && ! isRedirected) {
- ShowSyntax("The /f switch must be used if /b is used.");
- return;
- }
-
- // Handle output.
- if (isRedirected) {
- sw = new StreamWriter(fileName);
- if (!isBoth)
- Console.SetOut(sw);
- }
- String msg = String.Format("Application began at {0}", DateTime.Now);
- Console.WriteLine(msg);
- if (isBoth) sw.WriteLine(msg);
- Thread.Sleep(5000);
- msg = String.Format("Application ended normally at {0}", DateTime.Now);
- Console.WriteLine(msg);
- if (isBoth) sw.WriteLine(msg);
- if (isRedirected) sw.Close();
- }
-
- private static void ShowSyntax(String errMsg)
- {
- Console.WriteLine(errMsg);
- Console.WriteLine("\nSyntax: Example [[/f [/b]]\n");
- }
-}
-//
-
-public class Evaluation
-{
- public void SomeMethod()
- {
- bool booleanValue = false;
-
- //
- if (booleanValue == true) {
- //
- }
-
- //
- if (booleanValue) {
- //
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/operations2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/operations2.cs
deleted file mode 100644
index d64b1de060221..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/operations2.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-using System;
-
-public class Example6
-{
- public static void Main()
- {
- bool[] hasServiceCharges = { true, false };
- Decimal subtotal = 120.62m;
- Decimal shippingCharge = 2.50m;
- Decimal serviceCharge = 5.00m;
-
- foreach (var hasServiceCharge in hasServiceCharges) {
- Decimal total = subtotal + shippingCharge +
- (hasServiceCharge ? serviceCharge : 0);
- Console.WriteLine($"hasServiceCharge = {hasServiceCharge}: The total is {total:C2}.");
- }
- }
-}
-// The example displays output like the following:
-// hasServiceCharge = True: The total is $128.12.
-// hasServiceCharge = False: The total is $123.12.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/parse2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/parse2.cs
deleted file mode 100644
index 6aa174bbb7562..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/parse2.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-using System;
-
-public class Example7
-{
- public static void Main()
- {
- string[] values = { null, String.Empty, "True", "False",
- "true", "false", " true ",
- "TrUe", "fAlSe", "fa lse", "0",
- "1", "-1", "string" };
- // Parse strings using the Boolean.Parse method.
- foreach (var value in values) {
- try {
- bool flag = Boolean.Parse(value);
- Console.WriteLine($"'{value}' --> {flag}");
- }
- catch (ArgumentException) {
- Console.WriteLine("Cannot parse a null string.");
- }
- catch (FormatException) {
- Console.WriteLine($"Cannot parse '{value}'.");
- }
- }
- Console.WriteLine();
- // Parse strings using the Boolean.TryParse method.
- foreach (var value in values) {
- bool flag = false;
- if (Boolean.TryParse(value, out flag))
- Console.WriteLine($"'{value}' --> {flag}");
- else
- Console.WriteLine($"Unable to parse '{value}'");
- }
- }
-}
-// The example displays the following output:
-// Cannot parse a null string.
-// Cannot parse ''.
-// 'True' --> True
-// 'False' --> False
-// 'true' --> True
-// 'false' --> False
-// ' true ' --> True
-// 'TrUe' --> True
-// 'fAlSe' --> False
-// Cannot parse 'fa lse'.
-// Cannot parse '0'.
-// Cannot parse '1'.
-// Cannot parse '-1'.
-// Cannot parse 'string'.
-//
-// Unable to parse ''
-// Unable to parse ''
-// 'True' --> True
-// 'False' --> False
-// 'true' --> True
-// 'false' --> False
-// ' true ' --> True
-// 'TrUe' --> True
-// 'fAlSe' --> False
-// Cannot parse 'fa lse'.
-// Unable to parse '0'
-// Unable to parse '1'
-// Unable to parse '-1'
-// Unable to parse 'string'
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/parse3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/parse3.cs
deleted file mode 100644
index b4b08281b353b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/parse3.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-using System;
-
-public class Example8
-{
- public static void Main()
- {
- String[] values = { "09", "12.6", "0", "-13 " };
- foreach (var value in values) {
- bool success, result;
- int number;
- success = Int32.TryParse(value, out number);
- if (success) {
- // The method throws no exceptions.
- result = Convert.ToBoolean(number);
- Console.WriteLine($"Converted '{value}' to {result}");
- }
- else {
- Console.WriteLine($"Unable to convert '{value}'");
- }
- }
- }
-}
-// The example displays the following output:
-// Converted '09' to True
-// Unable to convert '12.6'
-// Converted '0' to False
-// Converted '-13 ' to True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/size1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/size1.cs
deleted file mode 100644
index 2e145259d26dc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/size1.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-using System;
-
-public struct BoolStruct
-{
- public bool flag1;
- public bool flag2;
- public bool flag3;
- public bool flag4;
- public bool flag5;
-}
-
-public class Example9
-{
- public static void Main()
- {
- unsafe {
- BoolStruct b = new BoolStruct();
- bool* addr = (bool*) &b;
- Console.WriteLine($"Size of BoolStruct: {sizeof(BoolStruct)}");
- Console.WriteLine("Field offsets:");
- Console.WriteLine($" flag1: {(bool*) &b.flag1 - addr}");
- Console.WriteLine($" flag2: {(bool*) &b.flag2 - addr}");
- Console.WriteLine($" flag3: {(bool*) &b.flag3 - addr}");
- Console.WriteLine($" flag4: {(bool*) &b.flag4 - addr}");
- Console.WriteLine($" flag5: {(bool*) &b.flag5 - addr}");
- }
- }
-}
-// The example displays the following output:
-// Size of BoolStruct: 5
-// Field offsets:
-// flag1: 0
-// flag2: 1
-// flag3: 2
-// flag4: 3
-// flag5: 4
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/tostring1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/tostring1.cs
deleted file mode 100644
index 09cfd324cd89c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/tostring1.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-using System;
-
-public class Example10
-{
- public static void Main()
- {
- bool raining = false;
- bool busLate = true;
-
- Console.WriteLine($"It is raining: {raining}");
- Console.WriteLine($"The bus is late: {busLate}");
- }
-}
-// The example displays the following output:
-// It is raining: False
-// The bus is late: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/tostring2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/tostring2.cs
deleted file mode 100644
index c691140aa0595..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/csharp/tostring2.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-using System;
-
-public class Example11
-{
- public static void Main()
- {
- bool raining = false;
- bool busLate = true;
-
- Console.WriteLine($"It is raining: {(raining ? "Yes" : "No")}");
- Console.WriteLine($"The bus is late: {(busLate ? "Yes" : "No")}");
- }
-}
-// The example displays the following output:
-// It is raining: No
-// The bus is late: Yes
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/binary1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/binary1.fs
deleted file mode 100644
index 25197bf61b565..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/binary1.fs
+++ /dev/null
@@ -1,28 +0,0 @@
-module binary1
-
-//
-open System
-
-let getBinaryString (value: byte) =
- let retValue = Convert.ToString(value, 2)
- String('0', 8 - retValue.Length) + retValue
-
-let flags = [ true; false ]
-for flag in flags do
- // Get binary representation of flag.
- let value = BitConverter.GetBytes(flag)[0];
- printfn $"Original value: {flag}"
- printfn $"Binary value: {value} ({getBinaryString value})"
- // Restore the flag from its binary representation.
- let newFlag = BitConverter.ToBoolean([|value|], 0)
- printfn $"Restored value: {newFlag}\n"
-
-// The example displays the following output:
-// Original value: True
-// Binary value: 1 (00000001)
-// Restored value: True
-//
-// Original value: False
-// Binary value: 0 (00000000)
-// Restored value: False
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/conversion1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/conversion1.fs
deleted file mode 100644
index c2e95248186cf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/conversion1.fs
+++ /dev/null
@@ -1,29 +0,0 @@
-module conversion1
-
-//
-open System
-
-let byteValue = 12uy
-printfn $"{Convert.ToBoolean byteValue}"
-let byteValue2 = 0uy
-printfn $"{Convert.ToBoolean byteValue2}"
-let intValue = -16345
-printfn $"{Convert.ToBoolean intValue}"
-let longValue = 945L
-printfn $"{Convert.ToBoolean longValue}"
-let sbyteValue = -12y
-printfn $"{Convert.ToBoolean sbyteValue}"
-let dblValue = 0.0
-printfn $"{Convert.ToBoolean dblValue}"
-let sngValue = 0.0001f
-printfn $"{Convert.ToBoolean sngValue}"
-
-// The example displays the following output:
-// True
-// False
-// True
-// True
-// True
-// False
-// True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/conversion3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/conversion3.fs
deleted file mode 100644
index b661da60d8ed5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/conversion3.fs
+++ /dev/null
@@ -1,25 +0,0 @@
-module conversion3
-
-//
-open System
-
-let flag = true
-
-let byteValue = Convert.ToByte flag
-printfn $"{flag} -> {byteValue}"
-
-let sbyteValue = Convert.ToSByte flag
-printfn $"{flag} -> {sbyteValue}"
-
-let dblValue = Convert.ToDouble flag
-printfn $"{flag} -> {dblValue}"
-
-let intValue = Convert.ToInt32(flag);
-printfn $"{flag} -> {intValue}"
-
-// The example displays the following output:
-// True -> 1
-// True -> 1
-// True -> 1
-// True -> 1
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/format3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/format3.fs
deleted file mode 100644
index 21058d0e378a0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/format3.fs
+++ /dev/null
@@ -1,42 +0,0 @@
-module format3
-
-//
-open System
-open System.Globalization
-
-type BooleanFormatter(culture) =
- interface ICustomFormatter with
- member this.Format(_, arg, formatProvider) =
- if formatProvider <> this then null
- else
- match arg with
- | :? bool as value ->
- match culture.Name with
- | "en-US" -> string arg
- | "fr-FR" when value -> "vrai"
- | "fr-FR" -> "faux"
- | "ru-RU" when value -> "верно"
- | "ru-RU" -> "неверно"
- | _ -> string arg
- | _ -> null
- interface IFormatProvider with
- member this.GetFormat(formatType) =
- if formatType = typeof then this
- else null
- new() = BooleanFormatter CultureInfo.CurrentCulture
-
-let cultureNames = [ ""; "en-US"; "fr-FR"; "ru-RU" ]
-for cultureName in cultureNames do
- let value = true
- let culture = CultureInfo.CreateSpecificCulture cultureName
- let formatter = BooleanFormatter culture
-
- String.Format(formatter, "Value for '{0}': {1}", culture.Name, value)
- |> printfn "%s"
-
-// The example displays the following output:
-// Value for '': True
-// Value for 'en-US': True
-// Value for 'fr-FR': vrai
-// Value for 'ru-RU': верно
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/operations1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/operations1.fs
deleted file mode 100644
index 1b422f2bd062b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/operations1.fs
+++ /dev/null
@@ -1,75 +0,0 @@
-module operations1
-
-//
-open System
-open System.IO
-open System.Threading
-
-let showSyntax errMsg =
- printfn $"{errMsg}\n\nSyntax: Example [[/f [/b]]\n"
-
-let mutable isRedirected = false
-let mutable isBoth = false
-let mutable fileName = ""
-
-let rec parse = function
- | [] -> ()
- | "-b" :: rest
- | "/b" :: rest ->
- isBoth <- true
- // Parse remaining arguments.
- parse rest
- | "-f" :: file :: rest
- | "/f" :: file :: rest ->
- isRedirected <- true
- fileName <- file
- // Parse remaining arguments.
- parse rest
- | "-f" :: []
- | "/f" :: [] ->
- isRedirected <- true
- // No more arguments to parse.
- | x -> showSyntax $"The {x} switch is not supported"
-
-Environment.GetCommandLineArgs()[1..]
-|> List.ofArray
-|> parse
-
-// If isBoth is True, isRedirected must be True.
-if isBoth && not isRedirected then
- showSyntax "The /f switch must be used if /b is used."
-// If isRedirected is True, a fileName must be specified.
-elif fileName = "" && isRedirected then
- showSyntax "The /f switch must be followed by a filename."
-else
- use mutable sw = null
-
- // Handle output.
- let writeLine =
- if isRedirected then
- sw <- new StreamWriter(fileName)
- if isBoth then
- fun text ->
- printfn "%s" text
- sw.WriteLine text
- else sw.WriteLine
- else printfn "%s"
-
- writeLine $"Application began at {DateTime.Now}"
- Thread.Sleep 5000
- writeLine $"Application ended normally at {DateTime.Now}"
-
-//
-module Evaluation =
- let someFunction () =
- let booleanValue = false
-
- //
- if booleanValue = true then
- //
- ()
-
- //
- if booleanValue then
- //
- ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/operations2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/operations2.fs
deleted file mode 100644
index 93b2482543836..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/operations2.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module operations2
-
-//
-let hasServiceCharges = [ true; false ]
-let subtotal = 120.62M
-let shippingCharge = 2.50M
-let serviceCharge = 5.00M
-
-for hasServiceCharge in hasServiceCharges do
- let total =
- subtotal + shippingCharge + if hasServiceCharge then serviceCharge else 0M
- printfn $"hasServiceCharge = {hasServiceCharge}: The total is {total:C2}."
-
-// The example displays output like the following:
-// hasServiceCharge = True: The total is $128.12.
-// hasServiceCharge = False: The total is $123.12.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/parse2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/parse2.fs
deleted file mode 100644
index 5185a448978fc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/parse2.fs
+++ /dev/null
@@ -1,60 +0,0 @@
-module parse2
-
-//
-open System
-
-let values =
- [ null; String.Empty; "True"; "False"
- "true"; "false"; " true "
- "TrUe"; "fAlSe"; "fa lse"; "0"
- "1"; "-1"; "string" ]
-// Parse strings using the Boolean.Parse method.
-for value in values do
- try
- let flag = Boolean.Parse value
- printfn $"'{value}' --> {flag}"
- with
- | :? ArgumentException ->
- printfn "Cannot parse a null string."
- | :? FormatException ->
- printfn $"Cannot parse '{value}'."
-printfn ""
-// Parse strings using the Boolean.TryParse method.
-for value in values do
- match Boolean.TryParse value with
- | true, flag ->
- printfn $"'{value}' --> {flag}"
- | false, _ ->
- printfn $"Unable to parse '{value}'"
-
-// The example displays the following output:
-// Cannot parse a null string.
-// Cannot parse ''.
-// 'True' --> True
-// 'False' --> False
-// 'true' --> True
-// 'false' --> False
-// ' true ' --> True
-// 'TrUe' --> True
-// 'fAlSe' --> False
-// Cannot parse 'fa lse'.
-// Cannot parse '0'.
-// Cannot parse '1'.
-// Cannot parse '-1'.
-// Cannot parse 'string'.
-//
-// Unable to parse ''
-// Unable to parse ''
-// 'True' --> True
-// 'False' --> False
-// 'true' --> True
-// 'false' --> False
-// ' true ' --> True
-// 'TrUe' --> True
-// 'fAlSe' --> False
-// Cannot parse 'fa lse'.
-// Unable to parse '0'
-// Unable to parse '1'
-// Unable to parse '-1'
-// Unable to parse 'string'
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/parse3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/parse3.fs
deleted file mode 100644
index a0c96718728d1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/parse3.fs
+++ /dev/null
@@ -1,21 +0,0 @@
-module parse3
-
-//
-open System
-
-let values = [ "09"; "12.6"; "0"; "-13 " ]
-for value in values do
- match Int32.TryParse value with
- | true, number ->
- // The method throws no exceptions.
- let result = Convert.ToBoolean number
- printfn $"Converted '{value}' to {result}"
- | false, _ ->
- printfn $"Unable to convert '{value}'"
-
-// The example displays the following output:
-// Converted '09' to True
-// Unable to convert '12.6'
-// Converted '0' to False
-// Converted '-13 ' to True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/size1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/size1.fs
deleted file mode 100644
index 91f9d7f48840e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/size1.fs
+++ /dev/null
@@ -1,36 +0,0 @@
-module size1
-
-//
-#nowarn "9" "51"
-open FSharp.NativeInterop
-
-[]
-type BoolStruct =
- val flag1: bool
- val flag2: bool
- val flag3: bool
- val flag4: bool
- val flag5: bool
-
-let inline nint addr = NativePtr.toNativeInt addr
-
-let mutable b = BoolStruct()
-let addr = &&b
-
-printfn $"Size of BoolStruct: {sizeof}"
-printfn "Field offsets:"
-printfn $" flag1: {nint &&b.flag1 - nint addr}"
-printfn $" flag2: {nint &&b.flag2 - nint addr}"
-printfn $" flag3: {nint &&b.flag3 - nint addr}"
-printfn $" flag4: {nint &&b.flag4 - nint addr}"
-printfn $" flag5: {nint &&b.flag5 - nint addr}"
-
-// The example displays the following output:
-// Size of BoolStruct: 5
-// Field offsets:
-// flag1: 0
-// flag1: 1
-// flag1: 2
-// flag1: 3
-// flag1: 4
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/tostring1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/tostring1.fs
deleted file mode 100644
index b29d047de9875..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/tostring1.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module tostring1
-
-//
-let raining = false
-let busLate = true
-
-printfn $"It is raining: {raining}"
-printfn $"The bus is late: {busLate}"
-
-// The example displays the following output:
-// It is raining: False
-// The bus is late: True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/tostring2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/tostring2.fs
deleted file mode 100644
index ba30c17a4a8e5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/fsharp/tostring2.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module tostring2
-
-//
-let raining = false
-let busLate = true
-
-printfn $"""It is raining: %s{if raining then "Yes" else "No"}"""
-printfn $"""The bus is late: %s{if busLate then "Yes" else "No"}"""
-
-// The example displays the following output:
-// It is raining: No
-// The bus is late: Yes
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/binary1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/binary1.vb
deleted file mode 100644
index 1f05bc46a8579..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/binary1.vb
+++ /dev/null
@@ -1,34 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example1
- Public Sub Main()
- Dim flags() As Boolean = {True, False}
- For Each flag In flags
- ' Get binary representation of flag.
- Dim value As Byte = BitConverter.GetBytes(flag)(0)
- Console.WriteLine("Original value: {0}", flag)
- Console.WriteLine("Binary value: {0} ({1})", value,
- GetBinaryString(value))
- ' Restore the flag from its binary representation.
- Dim newFlag As Boolean = BitConverter.ToBoolean({value}, 0)
- Console.WriteLine("Restored value: {0}", newFlag)
- Console.WriteLine()
- Next
- End Sub
-
- Private Function GetBinaryString(value As Byte) As String
- Dim retVal As String = Convert.ToString(value, 2)
- Return New String("0"c, 8 - retVal.Length) + retVal
- End Function
-End Module
-' The example displays the following output:
-' Original value: True
-' Binary value: 1 (00000001)
-' Restored value: True
-'
-' Original value: False
-' Binary value: 0 (00000000)
-' Restored value: False
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/conversion1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/conversion1.vb
deleted file mode 100644
index 9f3f725044928..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/conversion1.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example2
- Public Sub Main()
- Dim byteValue As Byte = 12
- Console.WriteLine(Convert.ToBoolean(byteValue))
- Dim byteValue2 As Byte = 0
- Console.WriteLine(Convert.ToBoolean(byteValue2))
- Dim intValue As Integer = -16345
- Console.WriteLine(Convert.ToBoolean(intValue))
- Dim longValue As Long = 945
- Console.WriteLine(Convert.ToBoolean(longValue))
- Dim sbyteValue As SByte = -12
- Console.WriteLine(Convert.ToBoolean(sbyteValue))
- Dim dblValue As Double = 0
- Console.WriteLine(Convert.ToBoolean(dblValue))
- Dim sngValue As Single = 0.0001
- Console.WriteLine(Convert.ToBoolean(sngValue))
- End Sub
-End Module
-' The example displays the following output:
-' True
-' False
-' True
-' True
-' True
-' False
-' True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/conversion3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/conversion3.vb
deleted file mode 100644
index 5eee5aa991315..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/conversion3.vb
+++ /dev/null
@@ -1,51 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example3
- Public Sub Main()
- Dim flag As Boolean = True
-
- Dim byteValue As Byte
- byteValue = Convert.ToByte(flag)
- Console.WriteLine("{0} -> {1} ({2})", flag, byteValue,
- byteValue.GetType().Name)
- byteValue = CByte(flag)
- Console.WriteLine("{0} -> {1} ({2})", flag, byteValue,
- byteValue.GetType().Name)
-
- Dim sbyteValue As SByte
- sbyteValue = Convert.ToSByte(flag)
- Console.WriteLine("{0} -> {1} ({2})", flag, sbyteValue,
- sbyteValue.GetType().Name)
- sbyteValue = CSByte(flag)
- Console.WriteLine("{0} -> {1} ({2})", flag, sbyteValue,
- sbyteValue.GetType().Name)
-
- Dim dblValue As Double
- dblValue = Convert.ToDouble(flag)
- Console.WriteLine("{0} -> {1} ({2})", flag, dblValue,
- dblValue.GetType().Name)
- dblValue = CDbl(flag)
- Console.WriteLine("{0} -> {1} ({2})", flag, dblValue,
- dblValue.GetType().Name)
-
- Dim intValue As Integer
- intValue = Convert.ToInt32(flag)
- Console.WriteLine("{0} -> {1} ({2})", flag, intValue,
- intValue.GetType().Name)
- intValue = CInt(flag)
- Console.WriteLine("{0} -> {1} ({2})", flag, intValue,
- intValue.GetType().Name)
- End Sub
-End Module
-' The example displays the following output:
-' True -> 1 (Byte)
-' True -> 255 (Byte)
-' True -> 1 (SByte)
-' True -> -1 (SByte)
-' True -> 1 (Double)
-' True -> -1 (Double)
-' True -> 1 (Int32)
-' True -> -1 (Int32)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/format3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/format3.vb
deleted file mode 100644
index 41496eb8cba93..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/format3.vb
+++ /dev/null
@@ -1,78 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-
-Module Example4
- Public Sub Main()
- Dim cultureNames() As String = {"", "en-US", "fr-FR", "ru-RU"}
- For Each cultureName In cultureNames
- Dim value As Boolean = True
- Dim culture As CultureInfo = CultureInfo.CreateSpecificCulture(cultureName)
- Dim formatter As New BooleanFormatter(culture)
-
- Dim result As String = String.Format(formatter, "Value for '{0}': {1}", culture.Name, value)
- Console.WriteLine(result)
- Next
- End Sub
-End Module
-
-Public Class BooleanFormatter
- Implements ICustomFormatter, IFormatProvider
-
- Private culture As CultureInfo
-
- Public Sub New()
- Me.New(CultureInfo.CurrentCulture)
- End Sub
-
- Public Sub New(culture As CultureInfo)
- Me.culture = culture
- End Sub
-
- Public Function GetFormat(formatType As Type) As Object _
- Implements IFormatProvider.GetFormat
- If formatType Is GetType(ICustomFormatter) Then
- Return Me
- Else
- Return Nothing
- End If
- End Function
-
- Public Function Format(fmt As String, arg As Object,
- formatProvider As IFormatProvider) As String _
- Implements ICustomFormatter.Format
- ' Exit if another format provider is used.
- If Not formatProvider.Equals(Me) Then Return Nothing
-
- ' Exit if the type to be formatted is not a Boolean
- If Not TypeOf arg Is Boolean Then Return Nothing
-
- Dim value As Boolean = CBool(arg)
- Select culture.Name
- Case "en-US"
- Return value.ToString()
- Case "fr-FR"
- If value Then
- Return "vrai"
- Else
- Return "faux"
- End If
- Case "ru-RU"
- If value Then
- Return "верно"
- Else
- Return "неверно"
- End If
- Case Else
- Return value.ToString()
- End Select
- End Function
-End Class
-' The example displays the following output:
-' Value for '': True
-' Value for 'en-US': True
-' Value for 'fr-FR': vrai
-' Value for 'ru-RU': верно
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/operations1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/operations1.vb
deleted file mode 100644
index e7a1126473d9c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/operations1.vb
+++ /dev/null
@@ -1,89 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-Imports System.Threading
-
-Module Example5
- Public Sub Main()
- ' Initialize flag variables.
- Dim isRedirected, isBoth As Boolean
- Dim fileName As String = ""
- Dim sw As StreamWriter = Nothing
-
- ' Get any command line arguments.
- Dim args() As String = Environment.GetCommandLineArgs()
- ' Handle any arguments.
- If args.Length > 1 Then
- For ctr = 1 To args.Length - 1
- Dim arg As String = args(ctr)
- If arg.StartsWith("/") OrElse arg.StartsWith("-") Then
- Select Case arg.Substring(1).ToLower()
- Case "f"
- isRedirected = True
- If args.Length < ctr + 2 Then
- ShowSyntax("The /f switch must be followed by a filename.")
- Exit Sub
- End If
- fileName = args(ctr + 1)
- ctr += 1
- Case "b"
- isBoth = True
- Case Else
- ShowSyntax(String.Format("The {0} switch is not supported",
- args(ctr)))
- Exit Sub
- End Select
- End If
- Next
- End If
-
- ' If isBoth is True, isRedirected must be True.
- If isBoth And Not isRedirected Then
- ShowSyntax("The /f switch must be used if /b is used.")
- Exit Sub
- End If
-
- ' Handle output.
- If isRedirected Then
- sw = New StreamWriter(fileName)
- If Not isBoth Then
- Console.SetOut(sw)
- End If
- End If
- Dim msg As String = String.Format("Application began at {0}", Date.Now)
- Console.WriteLine(msg)
- If isBoth Then sw.WriteLine(msg)
- Thread.Sleep(5000)
- msg = String.Format("Application ended normally at {0}", Date.Now)
- Console.WriteLine(msg)
- If isBoth Then sw.WriteLine(msg)
- If isRedirected Then sw.Close()
- End Sub
-
- Private Sub ShowSyntax(errMsg As String)
- Console.WriteLine(errMsg)
- Console.WriteLine()
- Console.WriteLine("Syntax: Example [[/f [/b]]")
- Console.WriteLine()
- End Sub
-End Module
-'
-
-
-Public Class Evaluation
- Public Sub SomeMethod()
- Dim booleanValue As Boolean
-
- '
- If booleanValue = True Then
- '
- End If
-
- '
- If booleanValue Then
- '
- End If
- End Sub
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/operations2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/operations2.vb
deleted file mode 100644
index 1ec2daa75bfde..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/operations2.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example6
- Public Sub Main()
- Dim hasServiceCharges() As Boolean = {True, False}
- Dim subtotal As Decimal = 120.62D
- Dim shippingCharge As Decimal = 2.5D
- Dim serviceCharge As Decimal = 5D
-
- For Each hasServiceCharge In hasServiceCharges
- Dim total As Decimal = subtotal + shippingCharge +
- If(hasServiceCharge, serviceCharge, 0)
- Console.WriteLine("hasServiceCharge = {1}: The total is {0:C2}.",
- total, hasServiceCharge)
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' hasServiceCharge = True: The total is $128.12.
-' hasServiceCharge = False: The total is $123.12.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/parse2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/parse2.vb
deleted file mode 100644
index fdc1d5091c484..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/parse2.vb
+++ /dev/null
@@ -1,65 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example7
- Public Sub Main()
- Dim values() As String = {Nothing, String.Empty, "True", "False",
- "true", "false", " true ",
- "TrUe", "fAlSe", "fa lse", "0",
- "1", "-1", "string"}
- ' Parse strings using the Boolean.Parse method.
- For Each value In values
- Try
- Dim flag As Boolean = Boolean.Parse(value)
- Console.WriteLine("'{0}' --> {1}", value, flag)
- Catch e As ArgumentException
- Console.WriteLine("Cannot parse a null string.")
- Catch e As FormatException
- Console.WriteLine("Cannot parse '{0}'.", value)
- End Try
- Next
- Console.WriteLine()
- ' Parse strings using the Boolean.TryParse method.
- For Each value In values
- Dim flag As Boolean = False
- If Boolean.TryParse(value, flag) Then
- Console.WriteLine("'{0}' --> {1}", value, flag)
- Else
- Console.WriteLine("Cannot parse '{0}'.", value)
- End If
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Cannot parse a null string.
-' Cannot parse ''.
-' 'True' --> True
-' 'False' --> False
-' 'true' --> True
-' 'false' --> False
-' ' true ' --> True
-' 'TrUe' --> True
-' 'fAlSe' --> False
-' Cannot parse 'fa lse'.
-' Cannot parse '0'.
-' Cannot parse '1'.
-' Cannot parse '-1'.
-' Cannot parse 'string'.
-'
-' Unable to parse ''
-' Unable to parse ''
-' 'True' --> True
-' 'False' --> False
-' 'true' --> True
-' 'false' --> False
-' ' true ' --> True
-' 'TrUe' --> True
-' 'fAlSe' --> False
-' Cannot parse 'fa lse'.
-' Unable to parse '0'
-' Unable to parse '1'
-' Unable to parse '-1'
-' Unable to parse 'string'
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/parse3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/parse3.vb
deleted file mode 100644
index ccaaf8c828594..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/parse3.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example8
- Public Sub Main()
- Dim values() As String = {"09", "12.6", "0", "-13 "}
- For Each value In values
- Dim success, result As Boolean
- Dim number As Integer
- success = Int32.TryParse(value, number)
- If success Then
- ' The method throws no exceptions.
- result = Convert.ToBoolean(number)
- Console.WriteLine("Converted '{0}' to {1}", value, result)
- Else
- Console.WriteLine("Unable to convert '{0}'", value)
- End If
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Converted '09' to True
-' Unable to convert '12.6'
-' Converted '0' to False
-' Converted '-13 ' to True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/tostring1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/tostring1.vb
deleted file mode 100644
index 0c3536e307d2f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/tostring1.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example9
- Public Sub Main()
- Dim raining As Boolean = False
- Dim busLate As Boolean = True
-
- Console.WriteLine("It is raining: {0}", raining)
- Console.WriteLine("The bus is late: {0}", busLate)
- End Sub
-End Module
-' The example displays the following output:
-' It is raining: False
-' The bus is late: True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/tostring2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/tostring2.vb
deleted file mode 100644
index e77645b1a822e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Boolean/Overview/vb/tostring2.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- Dim raining As Boolean = False
- Dim busLate As Boolean = True
-
- Console.WriteLine("It is raining: {0}",
- If(raining, "Yes", "No"))
- Console.WriteLine("The bus is late: {0}",
- If(busLate, "Yes", "No"))
- End Sub
-End Module
-' The example displays the following output:
-' It is raining: No
-' The bus is late: Yes
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/bitwise1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/bitwise1.cs
deleted file mode 100644
index 5257ff862bfeb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/bitwise1.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example
-{
- public static void Main()
- {
- string[] values = { Convert.ToString(12, 16),
- Convert.ToString(123, 16),
- Convert.ToString(245, 16) };
-
- byte mask = 0xFE;
- foreach (string value in values) {
- Byte byteValue = Byte.Parse(value, NumberStyles.AllowHexSpecifier);
- Console.WriteLine($"{byteValue} And {mask} = {byteValue & mask}");
- }
- }
-}
-// The example displays the following output:
-// 12 And 254 = 12
-// 123 And 254 = 122
-// 245 And 254 = 244
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/bitwise2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/bitwise2.cs
deleted file mode 100644
index 010bb8c2004f2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/bitwise2.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-
-public struct ByteString
-{
- public string Value;
- public int Sign;
-}
-
-public class Example1
-{
- public static void Main()
- {
- ByteString[] values = CreateArray(-15, 123, 245);
-
- byte mask = 0x14; // Mask all bits but 2 and 4.
-
- foreach (ByteString strValue in values)
- {
- byte byteValue = Byte.Parse(strValue.Value, NumberStyles.AllowHexSpecifier);
- Console.WriteLine($"{strValue.Sign * byteValue} ({Convert.ToString(byteValue, 2)}) And {mask} ({Convert.ToString(mask, 2)}) = {(strValue.Sign & Math.Sign(mask)) * (byteValue & mask)} ({Convert.ToString(byteValue & mask, 2)})");
- }
- }
-
- private static ByteString[] CreateArray(params int[] values)
- {
- List byteStrings = new List();
-
- foreach (object value in values)
- {
- ByteString temp = new ByteString();
- int sign = Math.Sign((int)value);
- temp.Sign = sign;
-
- // Change two's complement to magnitude-only representation.
- temp.Value = Convert.ToString(((int)value) * sign, 16);
-
- byteStrings.Add(temp);
- }
- return byteStrings.ToArray();
- }
-}
-// The example displays the following output:
-// -15 (1111) And 20 (10100) = 4 (100)
-// 123 (1111011) And 20 (10100) = 16 (10000)
-// 245 (11110101) And 20 (10100) = 20 (10100)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/byteinstantiation1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/byteinstantiation1.cs
deleted file mode 100644
index 1879982e3db82..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/byteinstantiation1.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-using System;
-
-public class Example2
-{
- public static void Main()
- {
- InstantiateByAssignment();
- InstantiateByNarrowingConversion();
- Parse();
- }
-
- private static void InstantiateByAssignment()
- {
- //
- byte value1 = 64;
- byte value2 = 255;
- //
- Console.WriteLine($"{value1} {value2}");
- }
-
- private static void InstantiateByNarrowingConversion()
- {
- //
- int int1 = 128;
- try
- {
- byte value1 = (byte)int1;
- Console.WriteLine(value1);
- }
- catch (OverflowException)
- {
- Console.WriteLine($"{int1} is out of range of a byte.");
- }
-
- double dbl2 = 3.997;
- try
- {
- byte value2 = (byte)dbl2;
- Console.WriteLine(value2);
- }
- catch (OverflowException)
- {
- Console.WriteLine($"{dbl2} is out of range of a byte.");
- }
- // The example displays the following output:
- // 128
- // 3
- //
- }
-
- private static void Parse()
- {
- //
- string string1 = "244";
- try
- {
- byte byte1 = Byte.Parse(string1);
- Console.WriteLine(byte1);
- }
- catch (OverflowException)
- {
- Console.WriteLine($"'{string1}' is out of range of a byte.");
- }
- catch (FormatException)
- {
- Console.WriteLine($"'{string1}' is out of range of a byte.");
- }
-
- string string2 = "F9";
- try
- {
- byte byte2 = Byte.Parse(string2,
- System.Globalization.NumberStyles.HexNumber);
- Console.WriteLine(byte2);
- }
- catch (OverflowException)
- {
- Console.WriteLine($"'{string2}' is out of range of a byte.");
- }
- catch (FormatException)
- {
- Console.WriteLine($"'{string2}' is out of range of a byte.");
- }
- // The example displays the following output:
- // 244
- // 249
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/formatting1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/formatting1.cs
deleted file mode 100644
index bb9107ccaa4f9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/formatting1.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using System;
-
-public class Example4
-{
- public static void Main()
- {
- CallToString();
- Console.WriteLine("-----");
- CallConvert();
- }
-
- private static void CallToString()
- {
- //
- byte[] numbers = { 0, 16, 104, 213 };
- foreach (byte number in numbers)
- {
- // Display value using default formatting.
- Console.Write("{0,-3} --> ", number.ToString());
- // Display value with 3 digits and leading zeros.
- Console.Write(number.ToString("D3") + " ");
- // Display value with hexadecimal.
- Console.Write(number.ToString("X2") + " ");
- // Display value with four hexadecimal digits.
- Console.WriteLine(number.ToString("X4"));
- }
- // The example displays the following output:
- // 0 --> 000 00 0000
- // 16 --> 016 10 0010
- // 104 --> 104 68 0068
- // 213 --> 213 D5 00D5
- //
- }
-
- private static void CallConvert()
- {
- //
- byte[] numbers = { 0, 16, 104, 213 };
- Console.WriteLine("{0} {1,8} {2,5} {3,5}",
- "Value", "Binary", "Octal", "Hex");
- foreach (byte number in numbers)
- {
- Console.WriteLine("{0,5} {1,8} {2,5} {3,5}",
- number, Convert.ToString(number, 2),
- Convert.ToString(number, 8),
- Convert.ToString(number, 16));
- }
- // The example displays the following output:
- // Value Binary Octal Hex
- // 0 0 0 0
- // 16 10000 20 10
- // 104 1101000 150 68
- // 213 11010101 325 d5
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/tobyte1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/tobyte1.cs
deleted file mode 100644
index c5a27d237fcb2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/csharp/tobyte1.cs
+++ /dev/null
@@ -1,287 +0,0 @@
-using System;
-
-public class Example3
-{
- public static void Main()
- {
- ConvertBoolean();
- Console.WriteLine("-----");
- ConvertChar();
- Console.WriteLine("-----");
- ConvertInt16();
- Console.WriteLine("-----");
- ConvertInt32();
- Console.WriteLine("-----");
- ConvertInt64();
- Console.WriteLine("-----");
- ConvertObject();
- Console.WriteLine("-----");
- ConvertSByte();
- Console.WriteLine("-----");
- ConvertUInt16();
- Console.WriteLine("-----");
- ConvertUInt32();
- Console.WriteLine("-----");
- ConvertUInt64();
- }
- private static void ConvertBoolean()
- {
- //
- bool falseFlag = false;
- bool trueFlag = true;
-
- Console.WriteLine($"{falseFlag} converts to {Convert.ToByte(falseFlag)}.");
- Console.WriteLine($"{trueFlag} converts to {Convert.ToByte(trueFlag)}.");
- // The example displays the following output:
- // False converts to 0.
- // True converts to 1.
- //
- }
-
- private static void ConvertChar()
- {
- //
- char[] chars = { 'a', 'z', '\x0007', '\x03FF' };
- foreach (char ch in chars)
- {
- try
- {
- byte result = Convert.ToByte(ch);
- Console.WriteLine($"{ch} is converted to {result}.");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"Unable to convert u+{Convert.ToInt16(ch).ToString("X4")} to a byte.");
- }
- }
- // The example displays the following output:
- // a is converted to 97.
- // z is converted to 122.
- // is converted to 7.
- // Unable to convert u+03FF to a byte.
- //
- }
-
- private static void ConvertInt16()
- {
- //
- short[] numbers = { Int16.MinValue, -1, 0, 121, 340, Int16.MaxValue };
- byte result;
- foreach (short number in numbers)
- {
- try
- {
- result = Convert.ToByte(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Byte type.");
- }
- }
- // The example displays the following output:
- // The Int16 value -32768 is outside the range of the Byte type.
- // The Int16 value -1 is outside the range of the Byte type.
- // Converted the Int16 value 0 to the Byte value 0.
- // Converted the Int16 value 121 to the Byte value 121.
- // The Int16 value 340 is outside the range of the Byte type.
- // The Int16 value 32767 is outside the range of the Byte type.
- //
- }
-
- private static void ConvertInt32()
- {
- //
- int[] numbers = { Int32.MinValue, -1, 0, 121, 340, Int32.MaxValue };
- byte result;
- foreach (int number in numbers)
- {
- try
- {
- result = Convert.ToByte(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Byte type.");
- }
- }
- // The example displays the following output:
- // The Int32 value -2147483648 is outside the range of the Byte type.
- // The Int32 value -1 is outside the range of the Byte type.
- // Converted the Int32 value 0 to the Byte value 0.
- // Converted the Int32 value 121 to the Byte value 121.
- // The Int32 value 340 is outside the range of the Byte type.
- // The Int32 value 2147483647 is outside the range of the Byte type.
- //
- }
-
- private static void ConvertInt64()
- {
- //
- long[] numbers = { Int64.MinValue, -1, 0, 121, 340, Int64.MaxValue };
- byte result;
- foreach (long number in numbers)
- {
- try
- {
- result = Convert.ToByte(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Byte type.");
- }
- }
- // The example displays the following output:
- // The Int64 value -9223372036854775808 is outside the range of the Byte type.
- // The Int64 value -1 is outside the range of the Byte type.
- // Converted the Int64 value 0 to the Byte value 0.
- // Converted the Int64 value 121 to the Byte value 121.
- // The Int64 value 340 is outside the range of the Byte type.
- // The Int64 value 9223372036854775807 is outside the range of the Byte type.
- //
- }
-
- private static void ConvertObject()
- {
- //
- object[] values = { true, -12, 163, 935, 'x', "104", "103.0", "-1",
- "1.00e2", "One", 1.00e2};
- byte result;
- foreach (object value in values)
- {
- try
- {
- result = Convert.ToByte(value);
- Console.WriteLine($"Converted the {value.GetType().Name} value {value} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"The {value.GetType().Name} value {value} is outside the range of the Byte type.");
- }
- catch (FormatException)
- {
- Console.WriteLine($"The {value.GetType().Name} value {value} is not in a recognizable format.");
- }
- catch (InvalidCastException)
- {
- Console.WriteLine($"No conversion to a Byte exists for the {value.GetType().Name} value {value}.");
- }
- }
- // The example displays the following output:
- // Converted the Boolean value True to the Byte value 1.
- // The Int32 value -12 is outside the range of the Byte type.
- // Converted the Int32 value 163 to the Byte value 163.
- // The Int32 value 935 is outside the range of the Byte type.
- // Converted the Char value x to the Byte value 120.
- // Converted the String value 104 to the Byte value 104.
- // The String value 103.0 is not in a recognizable format.
- // The String value -1 is outside the range of the Byte type.
- // The String value 1.00e2 is not in a recognizable format.
- // The String value One is not in a recognizable format.
- // Converted the Double value 100 to the Byte value 100.
- //
- }
-
- private static void ConvertSByte()
- {
- //
- sbyte[] numbers = { SByte.MinValue, -1, 0, 10, SByte.MaxValue };
- byte result;
- foreach (sbyte number in numbers)
- {
- try
- {
- result = Convert.ToByte(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Byte type.");
- }
- }
- // The example displays the following output:
- // The SByte value -128 is outside the range of the Byte type.
- // The SByte value -1 is outside the range of the Byte type.
- // Converted the SByte value 0 to the Byte value 0.
- // Converted the SByte value 10 to the Byte value 10.
- // Converted the SByte value 127 to the Byte value 127.
- //
- }
-
- private static void ConvertUInt16()
- {
- //
- ushort[] numbers = { UInt16.MinValue, 121, 340, UInt16.MaxValue };
- byte result;
- foreach (ushort number in numbers)
- {
- try
- {
- result = Convert.ToByte(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Byte type.");
- }
- }
- // The example displays the following output:
- // Converted the UInt16 value 0 to the Byte value 0.
- // Converted the UInt16 value 121 to the Byte value 121.
- // The UInt16 value 340 is outside the range of the Byte type.
- // The UInt16 value 65535 is outside the range of the Byte type.
- //
- }
-
- private static void ConvertUInt32()
- {
- //
- uint[] numbers = { UInt32.MinValue, 121, 340, UInt32.MaxValue };
- byte result;
- foreach (uint number in numbers)
- {
- try
- {
- result = Convert.ToByte(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Byte type.");
- }
- }
- // The example displays the following output:
- // Converted the UInt32 value 0 to the Byte value 0.
- // Converted the UInt32 value 121 to the Byte value 121.
- // The UInt32 value 340 is outside the range of the Byte type.
- // The UInt32 value 4294967295 is outside the range of the Byte type.
- //
- }
-
- private static void ConvertUInt64()
- {
- //
- ulong[] numbers = { UInt64.MinValue, 121, 340, UInt64.MaxValue };
- byte result;
- foreach (ulong number in numbers)
- {
- try
- {
- result = Convert.ToByte(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Byte type.");
- }
- }
- // The example displays the following output:
- // Converted the UInt64 value 0 to the Byte value 0.
- // Converted the UInt64 value 121 to the Byte value 121.
- // The UInt64 value 340 is outside the range of the Byte type.
- // The UInt64 value 18446744073709551615 is outside the range of the Byte type.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/bitwise1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/bitwise1.fs
deleted file mode 100644
index 5226be1e856dd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/bitwise1.fs
+++ /dev/null
@@ -1,22 +0,0 @@
-module bitwise1
-
-//
-open System
-open System.Globalization
-
-let values =
- [ Convert.ToString(12, 16)
- Convert.ToString(123, 16)
- Convert.ToString(245, 16) ]
-
-let mask = 0xFEuy
-for value in values do
- let byteValue = Byte.Parse(value, NumberStyles.AllowHexSpecifier)
- printfn $"{byteValue} And {mask} = {byteValue &&& mask}"
-
-
-// The example displays the following output:
-// 12 And 254 = 12
-// 123 And 254 = 122
-// 245 And 254 = 244
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/bitwise2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/bitwise2.fs
deleted file mode 100644
index 210dbdbb06b00..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/bitwise2.fs
+++ /dev/null
@@ -1,33 +0,0 @@
-module bitwise2
-
-//
-open System
-open System.Collections.Generic
-open System.Globalization
-
-[]
-type ByteString =
- { Sign: int
- Value: string }
-
-let createArray values =
- [ for value in values do
- let sign = sign value
- { Sign = sign
- // Change two's complement to magnitude-only representation.
- Value = Convert.ToString(value * sign, 16)} ]
-
-
-let values = createArray [ -15; 123; 245 ]
-
-let mask = 0x14uy // Mask all bits but 2 and 4.
-
-for strValue in values do
- let byteValue = Byte.Parse(strValue.Value, NumberStyles.AllowHexSpecifier)
- printfn $"{strValue.Sign * int byteValue} ({Convert.ToString(byteValue, 2)}) And {mask} ({Convert.ToString(mask, 2)}) = {(strValue.Sign &&& (int mask |> sign)) * int (byteValue &&& mask)} ({Convert.ToString(byteValue &&& mask, 2)})"
-
-// The example displays the following output:
-// -15 (1111) And 20 (10100) = 4 (100)
-// 123 (1111011) And 20 (10100) = 16 (10000)
-// 245 (11110101) And 20 (10100) = 20 (10100)
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/byteinstantiation1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/byteinstantiation1.fs
deleted file mode 100644
index 73d3855f0ae18..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/byteinstantiation1.fs
+++ /dev/null
@@ -1,56 +0,0 @@
-open System
-
-let ``instantiate by assignment`` =
- //
- let value1 = 64uy
- let value2 = 255uy
- //
- ()
-
-let ``instantiateByNarrowingConversion`` =
- //
- let int1 = 128
- try
- let value1 = byte int1
- printfn $"{value1}"
- with :? OverflowException ->
- printfn $"{int1} is out of range of a byte."
-
- let dbl2 = 3.997
- try
- let value2 = byte dbl2
- printfn $"{value2}"
- with :? OverflowException ->
- printfn $"{dbl2} is out of range of a byte."
-
- // The example displays the following output:
- // 128
- // 3
- //
-
-let parse =
- //
- let string1 = "244"
- try
- let byte1 = Byte.Parse string1
- printfn $"{byte1}"
- with
- | :? OverflowException ->
- printfn $"'{string1}' is out of range of a byte."
- | :? FormatException ->
- printfn $"'{string1}' is out of range of a byte."
-
- let string2 = "F9"
- try
- let byte2 = Byte.Parse(string2, System.Globalization.NumberStyles.HexNumber)
- printfn $"{byte2}"
- with
- | :? OverflowException ->
- printfn $"'{string2}' is out of range of a byte."
- | :? FormatException ->
- printfn $"'{string2}' is out of range of a byte."
-
- // The example displays the following output:
- // 244
- // 249
- //
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/formatting1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/formatting1.fs
deleted file mode 100644
index 270bf0e82916a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/formatting1.fs
+++ /dev/null
@@ -1,47 +0,0 @@
-open System
-
-let callToString () =
- //
- let numbers = [| 0; 16; 104; 213 |]
- for number in numbers do
- // Display value using default formatting.
- number.ToString()
- |> printf "%-3s --> "
-
- // Display value with 3 digits and leading zeros.
- number.ToString "D3"
- |> printf "%s "
-
- // Display value with hexadecimal.
- number.ToString "X2"
- |> printf "%s "
-
- // Display value with four hexadecimal digits.
- number.ToString "X4"
- |> printfn "%s"
-
- // The example displays the following output:
- // 0 --> 000 00 0000
- // 16 --> 016 10 0010
- // 104 --> 104 68 0068
- // 213 --> 213 D5 00D5
- //
-
-let callConvert () =
- //
- let numbers = [| 0; 16; 104; 213 |]
- printfn "%s %8s %5s %5s" "Value" "Binary" "Octal" "Hex"
- for number in numbers do
- printfn $"%5i{number} %8s{Convert.ToString(number, 2)} %5s{Convert.ToString(number, 8)} %5s{Convert.ToString(number, 16)}"
-
- // The example displays the following output:
- // Value Binary Octal Hex
- // 0 0 0 0
- // 16 10000 20 10
- // 104 1101000 150 68
- // 213 11010101 325 d5
- //
-
-callToString ()
-printfn "-----"
-callConvert ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/tobyte1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/tobyte1.fs
deleted file mode 100644
index e06090622e281..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/fsharp/tobyte1.fs
+++ /dev/null
@@ -1,200 +0,0 @@
-module tobyte1
-
-open System
-
-let convertBoolean () =
- //
- let falseFlag = false
- let trueFlag = true
-
- printfn $"{falseFlag} converts to {Convert.ToByte falseFlag}."
- printfn $"{trueFlag} converts to {Convert.ToByte trueFlag}."
- // The example displays the following output:
- // False converts to 0.
- // True converts to 1.
- //
-
-let convertChar () =
- //
- let chars = [| 'a'; 'z'; '\u0007'; '\u03FF' |]
- for ch in chars do
- try
- let result = Convert.ToByte ch
- printfn $"{ch} is converted to {result}."
- with :? OverflowException ->
- printfn $"Unable to convert u+{Convert.ToInt16 ch:X4} to a byte."
- // The example displays the following output:
- // a is converted to 97.
- // z is converted to 122.
- // is converted to 7.
- // Unable to convert u+03FF to a byte.
- //
-
-let convertInt16 () =
- //
- let numbers = [| Int16.MinValue; -1s; 0s; 121s; 340s; Int16.MaxValue |]
- for number in numbers do
- try
- let result = Convert.ToByte number
- printfn $"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"The {number.GetType().Name} value {number} is outside the range of the Byte type."
- // The example displays the following output:
- // The Int16 value -32768 is outside the range of the Byte type.
- // The Int16 value -1 is outside the range of the Byte type.
- // Converted the Int16 value 0 to the Byte value 0.
- // Converted the Int16 value 121 to the Byte value 121.
- // The Int16 value 340 is outside the range of the Byte type.
- // The Int16 value 32767 is outside the range of the Byte type.
- //
-
-let convertInt32 () =
- //
- let numbers = [| Int32.MinValue; -1; 0; 121; 340; Int32.MaxValue |]
- for number in numbers do
- try
- let result = Convert.ToByte number
- printfn $"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"The {number.GetType().Name} value {number} is outside the range of the Byte type."
- // The example displays the following output:
- // The Int32 value -2147483648 is outside the range of the Byte type.
- // The Int32 value -1 is outside the range of the Byte type.
- // Converted the Int32 value 0 to the Byte value 0.
- // Converted the Int32 value 121 to the Byte value 121.
- // The Int32 value 340 is outside the range of the Byte type.
- // The Int32 value 2147483647 is outside the range of the Byte type.
- //
-
-let convertInt64 () =
- //
- let numbers = [| Int64.MinValue; -1L; 0L; 121L; 34L; Int64.MaxValue |]
- for number in numbers do
- try
- let result = Convert.ToByte number
- printfn $"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"The {number.GetType().Name} value {number} is outside the range of the Byte type."
- // The example displays the following output:
- // The Int64 value -9223372036854775808 is outside the range of the Byte type.
- // The Int64 value -1 is outside the range of the Byte type.
- // Converted the Int64 value 0 to the Byte value 0.
- // Converted the Int64 value 121 to the Byte value 121.
- // The Int64 value 340 is outside the range of the Byte type.
- // The Int64 value 9223372036854775807 is outside the range of the Byte type.
- //
-
-let convertObject () =
- //
- let values: obj[] =
- [| true; -12; 163; 935; 'x'; "104"; "103.0"
- "-1"; "1.00e2"; "One"; 1.00e2 |]
- for value in values do
- try
- let result = Convert.ToByte value
- printfn $"Converted the {value.GetType().Name} value {value} to the {result.GetType().Name} value {result}."
- with
- | :? OverflowException ->
- printfn $"The {value.GetType().Name} value {value} is outside the range of the Byte type."
- | :? FormatException ->
- printfn $"The {value.GetType().Name} value {value} is not in a recognizable format."
- | :? InvalidCastException ->
- printfn $"No conversion to a Byte exists for the {value.GetType().Name} value {value}."
- // The example displays the following output:
- // Converted the Boolean value True to the Byte value 1.
- // The Int32 value -12 is outside the range of the Byte type.
- // Converted the Int32 value 163 to the Byte value 163.
- // The Int32 value 935 is outside the range of the Byte type.
- // Converted the Char value x to the Byte value 120.
- // Converted the String value 104 to the Byte value 104.
- // The String value 103.0 is not in a recognizable format.
- // The String value -1 is outside the range of the Byte type.
- // The String value 1.00e2 is not in a recognizable format.
- // The String value One is not in a recognizable format.
- // Converted the Double value 100 to the Byte value 100.
- //
-
-let convertSByte () =
- //
- let numbers = [| SByte.MinValue; -1y; 0y; 10y; SByte.MaxValue |]
- for number in numbers do
- try
- let result = Convert.ToByte number
- printfn $"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"The {number.GetType().Name} value {number} is outside the range of the Byte type."
- // The example displays the following output:
- // The SByte value -128 is outside the range of the Byte type.
- // The SByte value -1 is outside the range of the Byte type.
- // Converted the SByte value 0 to the Byte value 0.
- // Converted the SByte value 10 to the Byte value 10.
- // Converted the SByte value 127 to the Byte value 127.
- //
-
-let convertUInt16 () =
- //
- let numbers = [| UInt16.MinValue; 121us; 340us; UInt16.MaxValue |]
- for number in numbers do
- try
- let result = Convert.ToByte number
- printfn $"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"The {number.GetType().Name} value {number} is outside the range of the Byte type."
- // The example displays the following output:
- // Converted the UInt16 value 0 to the Byte value 0.
- // Converted the UInt16 value 121 to the Byte value 121.
- // The UInt16 value 340 is outside the range of the Byte type.
- // The UInt16 value 65535 is outside the range of the Byte type.
- //
-
-let convertUInt32 () =
- //
- let numbers = [| UInt32.MinValue; 121u; 340u; UInt32.MaxValue |]
- for number in numbers do
- try
- let result = Convert.ToByte number
- printfn $"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"The {number.GetType().Name} value {number} is outside the range of the Byte type."
- // The example displays the following output:
- // Converted the UInt32 value 0 to the Byte value 0.
- // Converted the UInt32 value 121 to the Byte value 121.
- // The UInt32 value 340 is outside the range of the Byte type.
- // The UInt32 value 4294967295 is outside the range of the Byte type.
- //
-
-let convertUInt64 () =
- //
- let numbers= [| UInt64.MinValue; 121uL; 340uL; UInt64.MaxValue |]
- for number in numbers do
- try
- let result = Convert.ToByte number
- printfn $"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"The {number.GetType().Name} value {number} is outside the range of the Byte type."
- // The example displays the following output:
- // Converted the UInt64 value 0 to the Byte value 0.
- // Converted the UInt64 value 121 to the Byte value 121.
- // The UInt64 value 340 is outside the range of the Byte type.
- // The UInt64 value 18446744073709551615 is outside the range of the Byte type.
- //
-
-convertBoolean ()
-printfn "-----"
-convertChar ()
-printfn "-----"
-convertInt16 ()
-printfn "-----"
-convertInt32 ()
-printfn "-----"
-convertInt64 ()
-printfn "-----"
-convertObject ()
-printfn "-----"
-convertSByte ()
-printfn "-----"
-convertUInt16 ()
-printfn "-----"
-convertUInt32 ()
-printfn "-----"
-convertUInt64 ()
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/bitwise1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/bitwise1.vb
deleted file mode 100644
index 907dd931e3501..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/bitwise1.vb
+++ /dev/null
@@ -1,25 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-
-Module Example1
- Public Sub Main()
- Dim values() As String = {Convert.ToString(12, 16),
- Convert.ToString(123, 16),
- Convert.ToString(245, 16)}
-
- Dim mask As Byte = &HFE
- For Each value As String In values
- Dim byteValue As Byte = Byte.Parse(value, NumberStyles.AllowHexSpecifier)
- Console.WriteLine("{0} And {1} = {2}", byteValue, mask,
- byteValue And mask)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 12 And 254 = 12
-' 123 And 254 = 122
-' 245 And 254 = 244
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/bitwise2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/bitwise2.vb
deleted file mode 100644
index 9525117f6ec07..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/bitwise2.vb
+++ /dev/null
@@ -1,48 +0,0 @@
-' Visual Basic .NET Document
-
-'
-Imports System.Collections.Generic
-Imports System.Globalization
-
-Public Structure ByteString
- Public Value As String
- Public Sign As Integer
-End Structure
-
-Module Example2
- Public Sub Main()
- Dim values() As ByteString = CreateArray(-15, 123, 245)
-
- Dim mask As Byte = &H14 ' Mask all bits but 2 and 4.
-
- For Each strValue As ByteString In values
- Dim byteValue As Byte = Byte.Parse(strValue.Value, NumberStyles.AllowHexSpecifier)
- Console.WriteLine("{0} ({1}) And {2} ({3}) = {4} ({5})",
- strValue.Sign * byteValue,
- Convert.ToString(byteValue, 2),
- mask, Convert.ToString(mask, 2),
- (strValue.Sign And Math.Sign(mask)) * (byteValue And mask),
- Convert.ToString(byteValue And mask, 2))
- Next
- End Sub
-
- Private Function CreateArray(ParamArray values() As Object) As ByteString()
- Dim byteStrings As New List(Of ByteString)
- For Each value As Object In values
- Dim temp As New ByteString()
- Dim sign As Integer = Math.Sign(value)
- temp.Sign = sign
- ' Change two's complement to magnitude-only representation.
- value = value * sign
-
- temp.Value = Convert.ToString(value, 16)
- byteStrings.Add(temp)
- Next
- Return byteStrings.ToArray()
- End Function
-End Module
-' The example displays the following output:
-' -15 (1111) And 20 (10100) = 4 (100)
-' 123 (1111011) And 20 (10100) = 16 (10000)
-' 245 (11110101) And 20 (10100) = 20 (10100)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/byteinstantiate1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/byteinstantiate1.vb
deleted file mode 100644
index 07d6b83196855..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/byteinstantiate1.vb
+++ /dev/null
@@ -1,69 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example3
- Public Sub Main()
- InstantiateByAssignment()
- InstantiateByNarrowingConversion()
- Parse()
- End Sub
-
- Private Sub InstantiateByAssignment()
- '
- Dim value1 As Byte = 64
- Dim value2 As Byte = 255
- '
- End Sub
-
- Private Sub InstantiateByNarrowingConversion()
- '
- Dim int1 As Integer = 128
- Try
- Dim value1 As Byte = CByte(int1)
- Console.WriteLine(value1)
- Catch e As OverflowException
- Console.WriteLine("{0} is out of range of a byte.", int1)
- End Try
-
- Dim dbl2 As Double = 3.997
- Try
- Dim value2 As Byte = CByte(dbl2)
- Console.WriteLine(value2)
- Catch e As OverflowException
- Console.WriteLine("{0} is out of range of a byte.", dbl2)
- End Try
- ' The example displays the following output:
- ' 128
- ' 4
- '
- End Sub
-
- Private Sub Parse()
- '
- Dim string1 As String = "244"
- Try
- Dim byte1 As Byte = Byte.Parse(string1)
- Console.WriteLine(byte1)
- Catch e As OverflowException
- Console.WriteLine("'{0}' is out of range of a byte.", string1)
- Catch e As FormatException
- Console.WriteLine("'{0}' is out of range of a byte.", string1)
- End Try
-
- Dim string2 As String = "F9"
- Try
- Dim byte2 As Byte = Byte.Parse(string2,
- System.Globalization.NumberStyles.HexNumber)
- Console.WriteLine(byte2)
- Catch e As OverflowException
- Console.WriteLine("'{0}' is out of range of a byte.", string2)
- Catch e As FormatException
- Console.WriteLine("'{0}' is out of range of a byte.", string2)
- End Try
- ' The example displays the following output:
- ' 244
- ' 249
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/formatting1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/formatting1.vb
deleted file mode 100644
index 06ccb5a74c49f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/formatting1.vb
+++ /dev/null
@@ -1,52 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example4
- Public Sub Main()
- CallToString()
- Console.WriteLine("-----")
- CallConvert()
- End Sub
-
- Private Sub CallToString()
- '
- Dim numbers() As Byte = {0, 16, 104, 213}
- For Each number As Byte In numbers
- ' Display value using default formatting.
- Console.Write("{0,-3} --> ", number.ToString())
- ' Display value with 3 digits and leading zeros.
- Console.Write(number.ToString("D3") + " ")
- ' Display value with hexadecimal.
- Console.Write(number.ToString("X2") + " ")
- ' Display value with four hexadecimal digits.
- Console.WriteLine(number.ToString("X4"))
- Next
- ' The example displays the following output:
- ' 0 --> 000 00 0000
- ' 16 --> 016 10 0010
- ' 104 --> 104 68 0068
- ' 213 --> 213 D5 00D5
- '
- End Sub
-
- Private Sub CallConvert()
- '
- Dim numbers() As Byte = {0, 16, 104, 213}
- Console.WriteLine("{0} {1,8} {2,5} {3,5}",
- "Value", "Binary", "Octal", "Hex")
- For Each number As Byte In numbers
- Console.WriteLine("{0,5} {1,8} {2,5} {3,5}",
- number, Convert.ToString(number, 2),
- Convert.ToString(number, 8),
- Convert.ToString(number, 16))
- Next
- ' The example displays the following output:
- ' Value Binary Octal Hex
- ' 0 0 0 0
- ' 16 10000 20 10
- ' 104 1101000 150 68
- ' 213 11010101 325 d5
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/GetUnicodeCategory3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/GetUnicodeCategory3.cs
deleted file mode 100644
index a41456fc514a0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/GetUnicodeCategory3.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-class Example
-{
- public static void Main()
- {
- // Define a string with a variety of character categories.
- String s = "The red car drove down the long, narrow, secluded road.";
- // Determine the category of each character.
- foreach (var ch in s)
- Console.WriteLine($"'{ch}': {Char.GetUnicodeCategory(ch)}");
- }
-}
-// The example displays the following output:
-// 'T': UppercaseLetter
-// 'h': LowercaseLetter
-// 'e': LowercaseLetter
-// ' ': SpaceSeparator
-// 'r': LowercaseLetter
-// 'e': LowercaseLetter
-// 'd': LowercaseLetter
-// ' ': SpaceSeparator
-// 'c': LowercaseLetter
-// 'a': LowercaseLetter
-// 'r': LowercaseLetter
-// ' ': SpaceSeparator
-// 'd': LowercaseLetter
-// 'r': LowercaseLetter
-// 'o': LowercaseLetter
-// 'v': LowercaseLetter
-// 'e': LowercaseLetter
-// ' ': SpaceSeparator
-// 'd': LowercaseLetter
-// 'o': LowercaseLetter
-// 'w': LowercaseLetter
-// 'n': LowercaseLetter
-// ' ': SpaceSeparator
-// 't': LowercaseLetter
-// 'h': LowercaseLetter
-// 'e': LowercaseLetter
-// ' ': SpaceSeparator
-// 'l': LowercaseLetter
-// 'o': LowercaseLetter
-// 'n': LowercaseLetter
-// 'g': LowercaseLetter
-// ',': OtherPunctuation
-// ' ': SpaceSeparator
-// 'n': LowercaseLetter
-// 'a': LowercaseLetter
-// 'r': LowercaseLetter
-// 'r': LowercaseLetter
-// 'o': LowercaseLetter
-// 'w': LowercaseLetter
-// ',': OtherPunctuation
-// ' ': SpaceSeparator
-// 's': LowercaseLetter
-// 'e': LowercaseLetter
-// 'c': LowercaseLetter
-// 'l': LowercaseLetter
-// 'u': LowercaseLetter
-// 'd': LowercaseLetter
-// 'e': LowercaseLetter
-// 'd': LowercaseLetter
-// ' ': SpaceSeparator
-// 'r': LowercaseLetter
-// 'o': LowercaseLetter
-// 'a': LowercaseLetter
-// 'd': LowercaseLetter
-// '.': OtherPunctuation
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/charstructure.cs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/charstructure.cs
deleted file mode 100644
index 8b5600d535c00..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/charstructure.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-using System;
-
-public class CharStructureSample
-{
- public static void Main()
- {
- char chA = 'A';
- char ch1 = '1';
- string str = "test string";
-
- Console.WriteLine(chA.CompareTo('B')); //----------- Output: "-1" (meaning 'A' is 1 less than 'B')
- Console.WriteLine(chA.Equals('A')); //----------- Output: "True"
- Console.WriteLine(Char.GetNumericValue(ch1)); //----------- Output: "1"
- Console.WriteLine(Char.IsControl('\t')); //----------- Output: "True"
- Console.WriteLine(Char.IsDigit(ch1)); //----------- Output: "True"
- Console.WriteLine(Char.IsLetter(',')); //----------- Output: "False"
- Console.WriteLine(Char.IsLower('u')); //----------- Output: "True"
- Console.WriteLine(Char.IsNumber(ch1)); //----------- Output: "True"
- Console.WriteLine(Char.IsPunctuation('.')); //----------- Output: "True"
- Console.WriteLine(Char.IsSeparator(str, 4)); //----------- Output: "True"
- Console.WriteLine(Char.IsSymbol('+')); //----------- Output: "True"
- Console.WriteLine(Char.IsWhiteSpace(str, 4)); //----------- Output: "True"
- Console.WriteLine(Char.Parse("S")); //----------- Output: "S"
- Console.WriteLine(Char.ToLower('M')); //----------- Output: "m"
- Console.WriteLine('x'.ToString()); //----------- Output: "x"
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/grapheme1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/grapheme1.cs
deleted file mode 100644
index 1a3e2a6ca71e7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/grapheme1.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-using System;
-using System.IO;
-
-public class Example1
-{
- public static void Main()
- {
- StreamWriter sw = new StreamWriter("chars1.txt");
- char[] chars = { '\u0061', '\u0308' };
- string strng = new String(chars);
- sw.WriteLine(strng);
- sw.Close();
- }
-}
-// The example produces the following output:
-// ä
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/normalized.cs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/normalized.cs
deleted file mode 100644
index e4ab14896b7fb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/normalized.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-using System;
-
-public class Example2
-{
- public static void Main()
- {
- string combining = "\u0061\u0308";
- ShowString(combining);
-
- string normalized = combining.Normalize();
- ShowString(normalized);
- }
-
- private static void ShowString(string s)
- {
- Console.Write("Length of string: {0} (", s.Length);
- for (int ctr = 0; ctr < s.Length; ctr++)
- {
- Console.Write("U+{0:X4}", Convert.ToUInt16(s[ctr]));
- if (ctr != s.Length - 1) Console.Write(" ");
- }
- Console.WriteLine(")\n");
- }
-}
-// The example displays the following output:
-// Length of string: 2 (U+0061 U+0308)
-//
-// Length of string: 1 (U+00E4)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/surrogate1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/surrogate1.cs
deleted file mode 100644
index 96056b3c61d6e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/surrogate1.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-using System;
-using System.IO;
-
-public class Example3
-{
- public static void Main()
- {
- StreamWriter sw = new StreamWriter(@".\chars2.txt");
- int utf32 = 0x1D160;
- string surrogate = Char.ConvertFromUtf32(utf32);
- sw.WriteLine("U+{0:X6} UTF-32 = {1} ({2}) UTF-16",
- utf32, surrogate, ShowCodePoints(surrogate));
- sw.Close();
- }
-
- private static string ShowCodePoints(string value)
- {
- string retval = null;
- foreach (var ch in value)
- retval += String.Format("U+{0:X4} ", Convert.ToUInt16(ch));
-
- return retval.Trim();
- }
-}
-// The example produces the following output:
-// U+01D160 UTF-32 = ð (U+D834 U+DD60) UTF-16
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/textelements2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/textelements2.cs
deleted file mode 100644
index c039c6183736f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/textelements2.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-using System;
-
-public class Example5
-{
- public static void Main()
- {
- string result = String.Empty;
- for (int ctr = 0x10107; ctr <= 0x10110; ctr++) // Range of Aegean numbers.
- result += Char.ConvertFromUtf32(ctr);
-
- Console.WriteLine($"The string contains {result.Length} characters.");
- }
-}
-// The example displays the following output:
-// The string contains 20 characters.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/textelements2a.cs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/textelements2a.cs
deleted file mode 100644
index e6bcb56f7d7cf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/csharp/textelements2a.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example4
-{
- public static void Main()
- {
- string result = String.Empty;
- for (int ctr = 0x10107; ctr <= 0x10110; ctr++) // Range of Aegean numbers.
- result += Char.ConvertFromUtf32(ctr);
-
- StringInfo si = new StringInfo(result);
- Console.WriteLine($"The string contains {si.LengthInTextElements} characters.");
- }
-}
-// The example displays the following output:
-// The string contains 10 characters.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/GetUnicodeCategory3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/GetUnicodeCategory3.fs
deleted file mode 100644
index eb5ad2ae77755..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/GetUnicodeCategory3.fs
+++ /dev/null
@@ -1,68 +0,0 @@
-module GetUnicodeCategory3
-
-//
-open System
-
-// Define a string with a variety of character categories.
-let s = "The red car drove down the long, narrow, secluded road."
-// Determine the category of each character.
-for ch in s do
- printfn $"'{ch}': {Char.GetUnicodeCategory ch}"
-
-// The example displays the following output:
-// 'T': UppercaseLetter
-// 'h': LowercaseLetter
-// 'e': LowercaseLetter
-// ' ': SpaceSeparator
-// 'r': LowercaseLetter
-// 'e': LowercaseLetter
-// 'd': LowercaseLetter
-// ' ': SpaceSeparator
-// 'c': LowercaseLetter
-// 'a': LowercaseLetter
-// 'r': LowercaseLetter
-// ' ': SpaceSeparator
-// 'd': LowercaseLetter
-// 'r': LowercaseLetter
-// 'o': LowercaseLetter
-// 'v': LowercaseLetter
-// 'e': LowercaseLetter
-// ' ': SpaceSeparator
-// 'd': LowercaseLetter
-// 'o': LowercaseLetter
-// 'w': LowercaseLetter
-// 'n': LowercaseLetter
-// ' ': SpaceSeparator
-// 't': LowercaseLetter
-// 'h': LowercaseLetter
-// 'e': LowercaseLetter
-// ' ': SpaceSeparator
-// 'l': LowercaseLetter
-// 'o': LowercaseLetter
-// 'n': LowercaseLetter
-// 'g': LowercaseLetter
-// ',': OtherPunctuation
-// ' ': SpaceSeparator
-// 'n': LowercaseLetter
-// 'a': LowercaseLetter
-// 'r': LowercaseLetter
-// 'r': LowercaseLetter
-// 'o': LowercaseLetter
-// 'w': LowercaseLetter
-// ',': OtherPunctuation
-// ' ': SpaceSeparator
-// 's': LowercaseLetter
-// 'e': LowercaseLetter
-// 'c': LowercaseLetter
-// 'l': LowercaseLetter
-// 'u': LowercaseLetter
-// 'd': LowercaseLetter
-// 'e': LowercaseLetter
-// 'd': LowercaseLetter
-// ' ': SpaceSeparator
-// 'r': LowercaseLetter
-// 'o': LowercaseLetter
-// 'a': LowercaseLetter
-// 'd': LowercaseLetter
-// '.': OtherPunctuation
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/grapheme1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/grapheme1.fs
deleted file mode 100644
index 8cb8c8aad6f3b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/grapheme1.fs
+++ /dev/null
@@ -1,15 +0,0 @@
-module grapheme1
-
-//
-open System
-open System.IO
-
-let sw = new StreamWriter("chars1.txt")
-let chars = [| '\u0061'; '\u0308' |]
-let string = String chars
-sw.WriteLine string
-sw.Close()
-
-// The example produces the following output:
-// ä
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/normalized.fs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/normalized.fs
deleted file mode 100644
index 820606350eba0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/normalized.fs
+++ /dev/null
@@ -1,23 +0,0 @@
-module normalized
-
-//
-open System
-
-let showString (s: string) =
- printf $"Length of string: {s.Length} ("
- for i = 0 to s.Length - 1 do
- printf $"U+{Convert.ToUInt16 s[i]:X4}"
- if i <> s.Length - 1 then printf " "
- printfn ")\n"
-
-let combining = "\u0061\u0308"
-showString combining
-
-let normalized = combining.Normalize()
-showString normalized
-
-// The example displays the following output:
-// Length of string: 2 (U+0061 U+0308)
-//
-// Length of string: 1 (U+00E4)
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/surrogate1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/surrogate1.fs
deleted file mode 100644
index 33bf60c03305d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/surrogate1.fs
+++ /dev/null
@@ -1,22 +0,0 @@
-module surrogate1
-
-//
-open System
-open System.IO
-
-let showCodePoints (value: char seq) =
- let str =
- value
- |> Seq.map (fun ch -> $"U+{Convert.ToUInt16 ch:X4}")
- |> String.concat ""
- str.Trim()
-
-let sw = new StreamWriter(@".\chars2.txt")
-let utf32 = 0x1D160
-let surrogate = Char.ConvertFromUtf32 utf32
-sw.WriteLine $"U+{utf32:X6} UTF-32 = {surrogate} ({showCodePoints surrogate}) UTF-16"
-sw.Close()
-
-// The example produces the following output:
-// U+01D160 UTF-32 = ð (U+D834 U+DD60) UTF-16
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/textelements2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/textelements2.fs
deleted file mode 100644
index 5006ace1d5736..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/textelements2.fs
+++ /dev/null
@@ -1,16 +0,0 @@
-module textelements2
-
-//
-open System
-
-let result =
- [ for i in 0x10107..0x10110 do // Range of Aegean numbers.
- Char.ConvertFromUtf32 i ]
- |> String.concat ""
-
-printfn $"The string contains {result.Length} characters."
-
-
-// The example displays the following output:
-// The string contains 20 characters.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/textelements2a.fs b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/textelements2a.fs
deleted file mode 100644
index a7e6ae71aaf49..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/fsharp/textelements2a.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module textelements2a
-
-//
-open System
-open System.Globalization
-
-let result =
- [ for i in 0x10107..0x10110 do // Range of Aegean numbers.
- Char.ConvertFromUtf32 i ]
- |> String.concat ""
-
-
-let si = StringInfo result
-printfn $"The string contains {si.LengthInTextElements} characters."
-
-// The example displays the following output:
-// The string contains 10 characters.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/GetUnicodeCategory3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/GetUnicodeCategory3.vb
deleted file mode 100644
index 8a87bb1d6c2b5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/GetUnicodeCategory3.vb
+++ /dev/null
@@ -1,74 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-
-Module Example1
- Public Sub Main()
- ' Define a string with a variety of character categories.
- Dim s As String = "The car drove down the narrow, secluded road."
- ' Determine the category of each character.
- For Each ch In s
- Console.WriteLine("'{0}': {1}", ch, Char.GetUnicodeCategory(ch))
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 'T': UppercaseLetter
-' 'h': LowercaseLetter
-' 'e': LowercaseLetter
-' ' ': SpaceSeparator
-' 'r': LowercaseLetter
-' 'e': LowercaseLetter
-' 'd': LowercaseLetter
-' ' ': SpaceSeparator
-' 'c': LowercaseLetter
-' 'a': LowercaseLetter
-' 'r': LowercaseLetter
-' ' ': SpaceSeparator
-' 'd': LowercaseLetter
-' 'r': LowercaseLetter
-' 'o': LowercaseLetter
-' 'v': LowercaseLetter
-' 'e': LowercaseLetter
-' ' ': SpaceSeparator
-' 'd': LowercaseLetter
-' 'o': LowercaseLetter
-' 'w': LowercaseLetter
-' 'n': LowercaseLetter
-' ' ': SpaceSeparator
-' 't': LowercaseLetter
-' 'h': LowercaseLetter
-' 'e': LowercaseLetter
-' ' ': SpaceSeparator
-' 'l': LowercaseLetter
-' 'o': LowercaseLetter
-' 'n': LowercaseLetter
-' 'g': LowercaseLetter
-' ',': OtherPunctuation
-' ' ': SpaceSeparator
-' 'n': LowercaseLetter
-' 'a': LowercaseLetter
-' 'r': LowercaseLetter
-' 'r': LowercaseLetter
-' 'o': LowercaseLetter
-' 'w': LowercaseLetter
-' ',': OtherPunctuation
-' ' ': SpaceSeparator
-' 's': LowercaseLetter
-' 'e': LowercaseLetter
-' 'c': LowercaseLetter
-' 'l': LowercaseLetter
-' 'u': LowercaseLetter
-' 'd': LowercaseLetter
-' 'e': LowercaseLetter
-' 'd': LowercaseLetter
-' ' ': SpaceSeparator
-' 'r': LowercaseLetter
-' 'o': LowercaseLetter
-' 'a': LowercaseLetter
-' 'd': LowercaseLetter
-' '.': OtherPunctuation
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/grapheme1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/grapheme1.vb
deleted file mode 100644
index ad93be4dbe3ad..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/grapheme1.vb
+++ /dev/null
@@ -1,18 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-
-Module Example2
- Public Sub Main()
- Dim sw As New StreamWriter("chars1.txt")
- Dim chars() As Char = {ChrW(&H61), ChrW(&H308)}
- Dim strng As New String(chars)
- sw.WriteLine(strng)
- sw.Close()
- End Sub
-End Module
-' The example produces the following output:
-' ä
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/normalized.vb b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/normalized.vb
deleted file mode 100644
index 9aeffac27ef7f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/normalized.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example3
- Public Sub Main()
- Dim combining As String = ChrW(&H61) + ChrW(&H308)
- ShowString(combining)
-
- Dim normalized As String = combining.Normalize()
- ShowString(normalized)
- End Sub
-
- Private Sub ShowString(s As String)
- Console.Write("Length of string: {0} (", s.Length)
- For ctr As Integer = 0 To s.Length - 1
- Console.Write("U+{0:X4}", Convert.ToUInt16(s(ctr)))
- If ctr <> s.Length - 1 Then Console.Write(" ")
- Next
- Console.WriteLine(")")
- Console.WriteLine()
- End Sub
-End Module
-' The example displays the following output:
-' Length of string: 2 (U+0061 U+0308)
-'
-' Length of string: 1 (U+00E4)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/surrogate1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/surrogate1.vb
deleted file mode 100644
index 59d27a79c681b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/surrogate1.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-
-Module Example4
- Public Sub Main()
- Dim sw As New StreamWriter(".\chars2.txt")
- Dim utf32 As Integer = &H1D160
- Dim surrogate As String = Char.ConvertFromUtf32(utf32)
- sw.WriteLine("U+{0:X6} UTF-32 = {1} ({2}) UTF-16",
- utf32, surrogate, ShowCodePoints(surrogate))
- sw.Close()
- End Sub
-
- Private Function ShowCodePoints(value As String) As String
- Dim retval As String = Nothing
- For Each ch In value
- retval += String.Format("U+{0:X4} ", Convert.ToUInt16(ch))
- Next
- Return retval.Trim()
- End Function
-End Module
-' The example produces the following output:
-' U+01D160 UTF-32 = ð (U+D834 U+DD60) UTF-16
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/textelements2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/textelements2.vb
deleted file mode 100644
index c71e91c70cad3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/textelements2.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example5
- Public Sub Main()
- Dim result As String = String.Empty
- For ctr As Integer = &H10107 To &H10110 ' Range of Aegean numbers.
- result += Char.ConvertFromUtf32(ctr)
- Next
- Console.WriteLine("The string contains {0} characters.", result.Length)
- End Sub
-End Module
-' The example displays the following output:
-' The string contains 20 characters.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/textelements2a.vb b/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/textelements2a.vb
deleted file mode 100644
index f6c71a0d154d3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Char/Overview/vb/textelements2a.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-
-Module Example6
- Public Sub Main()
- Dim result As String = String.Empty
- For ctr As Integer = &H10107 To &H10110 ' Range of Aegean numbers.
- result += Char.ConvertFromUtf32(ctr)
- Next
- Dim si As New StringInfo(result)
- Console.WriteLine("The string contains {0} characters.", si.LengthInTextElements)
- End Sub
-End Module
-' The example displays the following output:
-' The string contains 10 characters.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/Project.csproj
deleted file mode 100644
index 22dd9034898ba..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- true
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/example3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/example3.cs
deleted file mode 100644
index 1e977ce6ccef8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/example3.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-// dump a range of Unicode characters as a 16x16 array
-//
-using System;
-using System.IO;
-using System.Globalization;
-using System.Text;
-
-public static class DisplayChars
-{
- private static void Main(string[] args)
- {
- uint rangeStart = 0;
- uint rangeEnd = 0;
- bool setOutputEncodingToUnicode = true;
- // Get the current encoding so we can restore it.
- Encoding originalOutputEncoding = Console.OutputEncoding;
-
- try
- {
- switch (args.Length)
- {
- case 2:
- rangeStart = uint.Parse(args[0], NumberStyles.HexNumber);
- rangeEnd = uint.Parse(args[1], NumberStyles.HexNumber);
- setOutputEncodingToUnicode = true;
- break;
- case 3:
- if (!uint.TryParse(args[0], NumberStyles.HexNumber, null, out rangeStart))
- throw new ArgumentException(string.Format("{0} is not a valid hexadecimal number.", args[0]));
-
- if (!uint.TryParse(args[1], NumberStyles.HexNumber, null, out rangeEnd))
- throw new ArgumentException(string.Format("{0} is not a valid hexadecimal number.", args[1]));
-
- _ = bool.TryParse(args[2], out setOutputEncodingToUnicode);
- break;
- default:
- Console.WriteLine("Usage: {0} <{1}> <{2}> [{3}]",
- Environment.GetCommandLineArgs()[0],
- "startingCodePointInHex",
- "endingCodePointInHex",
- "");
- return;
- }
-
- if (setOutputEncodingToUnicode)
- {
- try
- {
- // Set encoding using endianness of this system.
- // We're interested in displaying individual Char objects, so
- // we don't want a Unicode BOM or exceptions to be thrown on
- // invalid Char values.
- Console.OutputEncoding = new UnicodeEncoding(!BitConverter.IsLittleEndian, false);
- Console.WriteLine("\nOutput encoding set to UTF-16");
- }
- catch (IOException)
- {
- Console.OutputEncoding = new UTF8Encoding();
- Console.WriteLine("Output encoding set to UTF-8");
- }
- }
- else
- {
- Console.WriteLine($"The console encoding is {Console.OutputEncoding.EncodingName} (code page {Console.OutputEncoding.CodePage})");
- }
- DisplayRange(rangeStart, rangeEnd);
- }
- catch (ArgumentException ex)
- {
- Console.WriteLine(ex.Message);
- }
- finally
- {
- // Restore console environment.
- Console.OutputEncoding = originalOutputEncoding;
- }
- }
-
- public static void DisplayRange(uint start, uint end)
- {
- const uint upperRange = 0x10FFFF;
- const uint surrogateStart = 0xD800;
- const uint surrogateEnd = 0xDFFF;
-
- if (end <= start)
- {
- uint t = start;
- start = end;
- end = t;
- }
-
- // Check whether the start or end range is outside of last plane.
- if (start > upperRange)
- throw new ArgumentException(string.Format("0x{0:X5} is outside the upper range of Unicode code points (0x{1:X5})",
- start, upperRange));
- if (end > upperRange)
- throw new ArgumentException(string.Format("0x{0:X5} is outside the upper range of Unicode code points (0x{0:X5})",
- end, upperRange));
-
- // Since we're using 21-bit code points, we can't use U+D800 to U+DFFF.
- if ((start < surrogateStart & end > surrogateStart) || (start >= surrogateStart & start <= surrogateEnd))
- throw new ArgumentException(string.Format("0x{0:X5}-0x{1:X5} includes the surrogate pair range 0x{2:X5}-0x{3:X5}",
- start, end, surrogateStart, surrogateEnd));
- uint last = RoundUpToMultipleOf(0x10, end);
- uint first = RoundDownToMultipleOf(0x10, start);
-
- uint rows = (last - first) / 0x10;
-
- for (uint r = 0; r < rows; ++r)
- {
- // Display the row header.
- Console.Write("{0:x5} ", first + 0x10 * r);
-
- for (uint c = 0; c < 0x10; ++c)
- {
- uint cur = (first + 0x10 * r + c);
- if (cur < start)
- {
- Console.Write($" {(char)(0x20)} ");
- }
- else if (end < cur)
- {
- Console.Write($" {(char)(0x20)} ");
- }
- else
- {
- // the cast to int is safe, since we know that val <= upperRange.
- String chars = Char.ConvertFromUtf32((int)cur);
- // Display a space for code points that are not valid characters.
- if (CharUnicodeInfo.GetUnicodeCategory(chars[0]) ==
- UnicodeCategory.OtherNotAssigned)
- Console.Write($" {(char)(0x20)} ");
- // Display a space for code points in the private use area.
- else if (CharUnicodeInfo.GetUnicodeCategory(chars[0]) ==
- UnicodeCategory.PrivateUse)
- Console.Write($" {(char)(0x20)} ");
- // Is surrogate pair a valid character?
- // Note that the console will interpret the high and low surrogate
- // as separate (and unrecognizable) characters.
- else if (chars.Length > 1 && CharUnicodeInfo.GetUnicodeCategory(chars, 0) ==
- UnicodeCategory.OtherNotAssigned)
- Console.Write($" {(char)(0x20)} ");
- else
- Console.Write($" {chars} ");
- }
-
- switch (c)
- {
- case 3:
- case 11:
- Console.Write("-");
- break;
- case 7:
- Console.Write("--");
- break;
- }
- }
-
- Console.WriteLine();
- if (0 < r && r % 0x10 == 0)
- Console.WriteLine();
- }
- }
-
- private static uint RoundUpToMultipleOf(uint b, uint u)
- {
- return RoundDownToMultipleOf(b, u) + b;
- }
-
- private static uint RoundDownToMultipleOf(uint b, uint u)
- {
- return u - (u % b);
- }
-}
-// If the example is run with the command line
-// DisplayChars 0400 04FF true
-// the example displays the Cyrillic character set as follows:
-// Output encoding set to UTF-16
-// 00400 Ѐ Ё Ђ Ѓ - Є Ѕ І Ї -- Ј Љ Њ Ћ - Ќ Ѝ Ў Џ
-// 00410 А Б В Г - Д Е Ж З -- И Й К Л - М Н О П
-// 00420 Р С Т У - Ф Х Ц Ч -- Ш Щ Ъ Ы - Ь Э Ю Я
-// 00430 а б в г - д е ж з -- и й к л - м н о п
-// 00440 р с т у - ф х ц ч -- ш щ ъ ы - ь э ю я
-// 00450 ѐ ё ђ ѓ - є ѕ і ї -- ј љ њ ћ - ќ ѝ ў џ
-// 00460 Ѡ ѡ Ѣ ѣ - Ѥ ѥ Ѧ ѧ -- Ѩ ѩ Ѫ ѫ - Ѭ ѭ Ѯ ѯ
-// 00470 Ѱ ѱ Ѳ ѳ - Ѵ ѵ Ѷ ѷ -- Ѹ ѹ Ѻ ѻ - Ѽ ѽ Ѿ ѿ
-// 00480 Ҁ ҁ ҂ ҃ - ҄ ҅ ҆ ҇ -- ҈ ҉ Ҋ ҋ - Ҍ ҍ Ҏ ҏ
-// 00490 Ґ ґ Ғ ғ - Ҕ ҕ Җ җ -- Ҙ ҙ Қ қ - Ҝ ҝ Ҟ ҟ
-// 004a0 Ҡ ҡ Ң ң - Ҥ ҥ Ҧ ҧ -- Ҩ ҩ Ҫ ҫ - Ҭ ҭ Ү ү
-// 004b0 Ұ ұ Ҳ ҳ - Ҵ ҵ Ҷ ҷ -- Ҹ ҹ Һ һ - Ҽ ҽ Ҿ ҿ
-// 004c0 Ӏ Ӂ ӂ Ӄ - ӄ Ӆ ӆ Ӈ -- ӈ Ӊ ӊ Ӌ - ӌ Ӎ ӎ ӏ
-// 004d0 Ӑ ӑ Ӓ ӓ - Ӕ ӕ Ӗ ӗ -- Ә ә Ӛ ӛ - Ӝ ӝ Ӟ ӟ
-// 004e0 Ӡ ӡ Ӣ ӣ - Ӥ ӥ Ӧ ӧ -- Ө ө Ӫ ӫ - Ӭ ӭ Ӯ ӯ
-// 004f0 Ӱ ӱ Ӳ ӳ - Ӵ ӵ Ӷ ӷ -- Ӹ ӹ Ӻ ӻ - Ӽ ӽ Ӿ ӿ
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/fontlink1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/fontlink1.cs
deleted file mode 100644
index 46a9fb5d6e364..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/fontlink1.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-using Microsoft.Win32;
-using System;
-
-public class Example
-{
- public static void Main()
- {
- string valueName = "Lucida Console";
- string newFont = "simsun.ttc,SimSun";
- string[] fonts = null;
- RegistryValueKind kind = 0;
- bool toAdd;
-
- RegistryKey key = Registry.LocalMachine.OpenSubKey(
- @"Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink",
- true);
- if (key == null) {
- Console.WriteLine("Font linking is not enabled.");
- }
- else {
- // Determine if the font is a base font.
- string[] names = key.GetValueNames();
- if (Array.Exists(names, s => s.Equals(valueName,
- StringComparison.OrdinalIgnoreCase))) {
- // Get the value's type.
- kind = key.GetValueKind(valueName);
-
- // Type should be RegistryValueKind.MultiString, but we can't be sure.
- switch (kind) {
- case RegistryValueKind.String:
- fonts = new string[] { (string) key.GetValue(valueName) };
- break;
- case RegistryValueKind.MultiString:
- fonts = (string[]) key.GetValue(valueName);
- break;
- case RegistryValueKind.None:
- // Do nothing.
- fonts = new string[] { };
- break;
- }
- // Determine whether SimSun is a linked font.
- if (Array.FindIndex(fonts, s =>s.IndexOf("SimSun",
- StringComparison.OrdinalIgnoreCase) >=0) >= 0) {
- Console.WriteLine("Font is already linked.");
- toAdd = false;
- }
- else {
- // Font is not a linked font.
- toAdd = true;
- }
- }
- else {
- // Font is not a base font.
- toAdd = true;
- fonts = new string[] { };
- }
-
- if (toAdd) {
- Array.Resize(ref fonts, fonts.Length + 1);
- fonts[fonts.GetUpperBound(0)] = newFont;
- // Change REG_SZ to REG_MULTI_SZ.
- if (kind == RegistryValueKind.String)
- key.DeleteValue(valueName, false);
-
- key.SetValue(valueName, fonts, RegistryValueKind.MultiString);
- Console.WriteLine("SimSun added to the list of linked fonts.");
- }
- }
-
- if (key != null) key.Close();
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/normalize1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/normalize1.cs
deleted file mode 100644
index 2fe762560df15..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/normalize1.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-using System.IO;
-
-public class Example1
-{
- public static void Main()
- {
- char[] chars = { '\u0061', '\u0308' };
-
- string combining = new String(chars);
- Console.WriteLine(combining);
-
- combining = combining.Normalize();
- Console.WriteLine(combining);
- }
-}
-// The example displays the following output:
-// a"
-// ä
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/setfont1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/setfont1.cs
deleted file mode 100644
index e43bb14b40f02..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/setfont1.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-using System;
-using System.Runtime.InteropServices;
-
-public class Example2
-{
- [DllImport("kernel32.dll", SetLastError = true)]
- static extern IntPtr GetStdHandle(int nStdHandle);
-
- [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- static extern bool GetCurrentConsoleFontEx(
- IntPtr consoleOutput,
- bool maximumWindow,
- ref CONSOLE_FONT_INFO_EX lpConsoleCurrentFontEx);
-
- [DllImport("kernel32.dll", SetLastError = true)]
- static extern bool SetCurrentConsoleFontEx(
- IntPtr consoleOutput,
- bool maximumWindow,
- CONSOLE_FONT_INFO_EX consoleCurrentFontEx);
-
- private const int STD_OUTPUT_HANDLE = -11;
- private const int TMPF_TRUETYPE = 4;
- private const int LF_FACESIZE = 32;
- private static IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1);
-
- public static unsafe void Main()
- {
- string fontName = "Lucida Console";
- IntPtr hnd = GetStdHandle(STD_OUTPUT_HANDLE);
- if (hnd != INVALID_HANDLE_VALUE)
- {
- CONSOLE_FONT_INFO_EX info = new CONSOLE_FONT_INFO_EX();
- info.cbSize = (uint)Marshal.SizeOf(info);
- bool tt = false;
- // First determine whether there's already a TrueType font.
- if (GetCurrentConsoleFontEx(hnd, false, ref info))
- {
- tt = (info.FontFamily & TMPF_TRUETYPE) == TMPF_TRUETYPE;
- if (tt)
- {
- Console.WriteLine("The console already is using a TrueType font.");
- return;
- }
- // Set console font to Lucida Console.
- CONSOLE_FONT_INFO_EX newInfo = new CONSOLE_FONT_INFO_EX();
- newInfo.cbSize = (uint)Marshal.SizeOf(newInfo);
- newInfo.FontFamily = TMPF_TRUETYPE;
- IntPtr ptr = new IntPtr(newInfo.FaceName);
- Marshal.Copy(fontName.ToCharArray(), 0, ptr, fontName.Length);
- // Get some settings from current font.
- newInfo.dwFontSize = new COORD(info.dwFontSize.X, info.dwFontSize.Y);
- newInfo.FontWeight = info.FontWeight;
- SetCurrentConsoleFontEx(hnd, false, newInfo);
- }
- }
- }
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct COORD
- {
- internal short X;
- internal short Y;
-
- internal COORD(short x, short y)
- {
- X = x;
- Y = y;
- }
- }
-
- [StructLayout(LayoutKind.Sequential)]
- internal unsafe struct CONSOLE_FONT_INFO_EX
- {
- internal uint cbSize;
- internal uint nFont;
- internal COORD dwFontSize;
- internal int FontFamily;
- internal int FontWeight;
- internal fixed char FaceName[LF_FACESIZE];
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/source.cs
deleted file mode 100644
index 740f731ba2245..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/source.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-
-public class Example4
-{
- public static void Main()
- {
- Console.Write("Hello ");
- Console.WriteLine("World!");
- Console.Write("Enter your name: ");
- string name = Console.ReadLine();
- Console.Write("Good day, ");
- Console.Write(name);
- Console.WriteLine("!");
- }
-}
-// The example displays output similar to the following:
-// Hello World!
-// Enter your name: James
-// Good day, James!
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/unicode1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/unicode1.cs
deleted file mode 100644
index bb493473c6ecc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/unicode1.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-using System;
-
-public class Example3
-{
- public static void Main()
- {
- // Create a Char array for the modern Cyrillic alphabet,
- // from U+0410 to U+044F.
- int nChars = 0x044F - 0x0410 + 1;
- char[] chars = new char[nChars];
- ushort codePoint = 0x0410;
- for (int ctr = 0; ctr < chars.Length; ctr++)
- {
- chars[ctr] = (char)codePoint;
- codePoint++;
- }
-
- Console.WriteLine($"Current code page: {Console.OutputEncoding.CodePage}\n");
- // Display the characters.
- foreach (var ch in chars)
- {
- Console.Write("{0} ", ch);
- if (Console.CursorLeft >= 70)
- Console.WriteLine();
- }
- }
-}
-// The example displays the following output:
-// Current code page: 437
-//
-// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
-// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
-// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/example3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/example3.fs
deleted file mode 100644
index 5ff62571827d2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/example3.fs
+++ /dev/null
@@ -1,163 +0,0 @@
-// dump a range of Unicode characters as a 16x16 array
-//
-module DisplayChars
-
-open System
-open System.IO
-open System.Globalization
-open System.Text
-
-type uint = uint32
-
-let inline roundDownToMultipleOf b u = u - (u % b)
-
-let inline roundUpToMultipleOf b u = roundDownToMultipleOf b u |> (+) b
-
-let displayRange (start: uint) (``end``: uint) =
-
- let upperRange = 0x10FFFFu
- let surrogateStart = 0xD800u
- let surrogateEnd = 0xDFFFu
-
- let start, ``end`` =
- if ``end`` <= start then ``end``, start
- else start, ``end``
-
- // Check whether the start or end range is outside of last plane.
- if start > upperRange then
- invalidArg "start"
- (String.Format("0x{0:X5} is outside the upper range of Unicode code points (0x{1:X5})", start, upperRange))
- if ``end`` > upperRange then
- invalidArg "end"
- (String.Format("0x{0:X5} is outside the upper range of Unicode code points (0x{0:X5})", ``end``, upperRange))
-
- // Since we're using 21-bit code points, we can't use U+D800 to U+DFFF.
- if (start < surrogateStart && ``end`` > surrogateStart) || (start >= surrogateStart && start <= surrogateEnd) then
- raise
- (ArgumentException
- (String.Format
- ("0x{0:X5}-0x{1:X5} includes the surrogate pair range 0x{2:X5}-0x{3:X5}", start, ``end``,
- surrogateStart, surrogateEnd)))
- let last = roundUpToMultipleOf 0x10u ``end``
- let first = roundDownToMultipleOf 0x10u start
-
- let rows = (last - first) / 0x10u
-
- for r in 0u .. (rows - 1u) do
- // Display the row header.
- printf "%05x " (first + 0x10u * r)
-
- for c in 0u .. (0x10u - 1u) do
- let cur = (first + 0x10u * r + c)
- if cur < start || ``end`` < cur then
- printf " %c " (Convert.ToChar 0x20)
- else
- // the cast to int is safe, since we know that val <= upperRange.
- let chars = Char.ConvertFromUtf32(int cur)
- // Display a space for code points that are not valid characters.
- if CharUnicodeInfo.GetUnicodeCategory(chars[0]) = UnicodeCategory.OtherNotAssigned then
- printf " %c " (Convert.ToChar 0x20)
- else
- // Display a space for code points in the private use area.
- if CharUnicodeInfo.GetUnicodeCategory(chars[0]) = UnicodeCategory.PrivateUse then
- printf " %c " (Convert.ToChar 0x20)
- else if chars.Length > 1
- && CharUnicodeInfo.GetUnicodeCategory(chars, 0) = UnicodeCategory.OtherNotAssigned then
- printf " %c " (Convert.ToChar 0x20)
- else printf " %s " chars
-
- match c with
- | 3u
- | 11u -> printf "-"
- | 7u -> printf "--"
- | _ -> ()
-
- Console.WriteLine()
- if (0u < r && r % 0x10u = 0u) then Console.WriteLine()
-
-
-
-[]
-let main args =
- // Get the current encoding so we can restore it.
- let originalOutputEncoding = Console.OutputEncoding
-
- try
- try
- let parsedArgs =
- match args.Length with
- | 2 ->
- Some
- {| setOutputEncodingToUnicode = true
- rangeStart = uint.Parse(args[0], NumberStyles.HexNumber)
- rangeEnd = uint.Parse(args[1], NumberStyles.HexNumber) |}
- | 3 ->
- let parseHexNumberOrThrow (value: string) parameterName =
- (uint.TryParse(value, NumberStyles.HexNumber, null))
- |> function
- | (false, _) ->
- invalidArg parameterName (String.Format("{0} is not a valid hexadecimal number.", value))
- | (true, value) -> value
-
- let setOutputEncodingToUnicode =
- match bool.TryParse args[2] with
- | true, value -> value
- | false, _ -> true
-
- Some
- {| setOutputEncodingToUnicode = setOutputEncodingToUnicode
- rangeStart = parseHexNumberOrThrow args[0] "rangeStart"
- rangeEnd = parseHexNumberOrThrow args[1] "rangeEnd" |}
- | _ ->
- printfn "Usage: %s <%s> <%s> [%s]" (Environment.GetCommandLineArgs()[0]) "startingCodePointInHex"
- "endingCodePointInHex" ""
- None
-
- match parsedArgs with
- | None -> ()
- | Some parsedArgs ->
- if parsedArgs.setOutputEncodingToUnicode then
- // This won't work before .NET Framework 4.5.
- try
- // Set encoding using endianness of this system.
- // We're interested in displaying individual Char objects, so
- // we don't want a Unicode BOM or exceptions to be thrown on
- // invalid Char values.
- Console.OutputEncoding <- UnicodeEncoding(not BitConverter.IsLittleEndian, false)
- printfn "\nOutput encoding set to UTF-16"
-
- with :? IOException ->
- printfn "Output encoding set to UTF-8"
- Console.OutputEncoding <- UTF8Encoding()
- else
- printfn "The console encoding is %s (code page %i)" (Console.OutputEncoding.EncodingName)
- (Console.OutputEncoding.CodePage)
-
- displayRange parsedArgs.rangeStart parsedArgs.rangeEnd
- with :? ArgumentException as ex -> Console.WriteLine(ex.Message)
- finally
- // Restore console environment.
- Console.OutputEncoding <- originalOutputEncoding
- 0
-
-// If the example is run with the command line
-// DisplayChars 0400 04FF true
-// the example displays the Cyrillic character set as follows:
-// Output encoding set to UTF-16
-// 00400 Ѐ Ё Ђ Ѓ - Є Ѕ І Ї -- Ј Љ Њ Ћ - Ќ Ѝ Ў Џ
-// 00410 А Б В Г - Д Е Ж З -- И Й К Л - М Н О П
-// 00420 Р С Т У - Ф Х Ц Ч -- Ш Щ Ъ Ы - Ь Э Ю Я
-// 00430 а б в г - д е ж з -- и й к л - м н о п
-// 00440 р с т у - ф х ц ч -- ш щ ъ ы - ь э ю я
-// 00450 ѐ ё ђ ѓ - є ѕ і ї -- ј љ њ ћ - ќ ѝ ў џ
-// 00460 Ѡ ѡ Ѣ ѣ - Ѥ ѥ Ѧ ѧ -- Ѩ ѩ Ѫ ѫ - Ѭ ѭ Ѯ ѯ
-// 00470 Ѱ ѱ Ѳ ѳ - Ѵ ѵ Ѷ ѷ -- Ѹ ѹ Ѻ ѻ - Ѽ ѽ Ѿ ѿ
-// 00480 Ҁ ҁ ҂ ҃ - ҄ ҅ ҆ ҇ -- ҈ ҉ Ҋ ҋ - Ҍ ҍ Ҏ ҏ
-// 00490 Ґ ґ Ғ ғ - Ҕ ҕ Җ җ -- Ҙ ҙ Қ қ - Ҝ ҝ Ҟ ҟ
-// 004a0 Ҡ ҡ Ң ң - Ҥ ҥ Ҧ ҧ -- Ҩ ҩ Ҫ ҫ - Ҭ ҭ Ү ү
-// 004b0 Ұ ұ Ҳ ҳ - Ҵ ҵ Ҷ ҷ -- Ҹ ҹ Һ һ - Ҽ ҽ Ҿ ҿ
-// 004c0 Ӏ Ӂ ӂ Ӄ - ӄ Ӆ ӆ Ӈ -- ӈ Ӊ ӊ Ӌ - ӌ Ӎ ӎ ӏ
-// 004d0 Ӑ ӑ Ӓ ӓ - Ӕ ӕ Ӗ ӗ -- Ә ә Ӛ ӛ - Ӝ ӝ Ӟ ӟ
-// 004e0 Ӡ ӡ Ӣ ӣ - Ӥ ӥ Ӧ ӧ -- Ө ө Ӫ ӫ - Ӭ ӭ Ӯ ӯ
-// 004f0 Ӱ ӱ Ӳ ӳ - Ӵ ӵ Ӷ ӷ -- Ӹ ӹ Ӻ ӻ - Ӽ ӽ Ӿ ӿ
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/fontlink1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/fontlink1.fs
deleted file mode 100644
index 7fe8c63e5468b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/fontlink1.fs
+++ /dev/null
@@ -1,54 +0,0 @@
-module fontlink1
-
-//
-open System
-open Microsoft.Win32
-
-let valueName = "Lucida Console"
-let newFont = "simsun.ttc,SimSun"
-
-let key =
- Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink", true)
-if isNull key then
- printfn "Font linking is not enabled."
-else
- // Determine if the font is a base font.
- let names = key.GetValueNames()
-
- let (fonts, kind, toAdd) =
- if names |> Array.exists (fun s -> s.Equals(valueName, StringComparison.OrdinalIgnoreCase)) then
- // Get the value's type.
- let kind = key.GetValueKind(valueName)
-
- // Type should be RegistryValueKind.MultiString, but we can't be sure.
- let fonts =
- match kind with
- | RegistryValueKind.String -> [| key.GetValue(valueName) :?> string |]
- | RegistryValueKind.MultiString -> (key.GetValue(valueName) :?> string array)
- | _ -> [||]
-
- // Determine whether SimSun is a linked font.
- let toAdd =
- not (fonts |> Array.exists (fun s -> s.IndexOf("SimSun", StringComparison.OrdinalIgnoreCase) >= 0))
-
- (fonts, kind, toAdd)
- else
- // Font is not a base font.
- ([||], RegistryValueKind.Unknown, true)
-
- if toAdd then
- // Font is not a linked font.
- let newFonts = Array.append fonts [| newFont |]
-
- // Change REG_SZ to REG_MULTI_SZ.
- if kind = RegistryValueKind.String then key.DeleteValue(valueName, false)
-
- key.SetValue(valueName, newFonts, RegistryValueKind.MultiString)
- printfn "SimSun added to the list of linked fonts."
- else
- printfn "Font is already linked."
-
-
-if not (isNull key) then key.Close()
-
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/normalize1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/normalize1.fs
deleted file mode 100644
index 48d57694c8ec5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/normalize1.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module normalize1
-
-//
-open System
-
-let chars = [| '\u0061'; '\u0308' |]
-
-let combining = String chars
-Console.WriteLine combining
-
-let combining2 = combining.Normalize()
-Console.WriteLine combining2
-
-
-// The example displays the following output:
-// a"
-// ä
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/setfont1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/setfont1.fs
deleted file mode 100644
index 01305d3cb8be9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/setfont1.fs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-module Example
-
-open System
-open System.Runtime.InteropServices
-
-[]
-let STD_OUTPUT_HANDLE = -11
-
-[]
-let TMPF_TRUETYPE = 4
-
-[]
-let LF_FACESIZE = 32
-
-let INVALID_HANDLE_VALUE = IntPtr(-1)
-
-
-[]
-[]
-type COORD =
- val mutable X: int16
- val mutable Y: int16
-
- internal new(x: int16, y: int16) =
- { X = x
- Y = y }
-
-[]
-[]
-type CONSOLE_FONT_INFO_EX =
- val mutable cbSize: uint32
- val mutable nFont: uint32
- val mutable dwFontSize: COORD
- val mutable FontFamily: int
- val mutable FontWeight: int
- []
- val mutable FaceName: string
-
-[]
-extern IntPtr GetStdHandle(int nStdHandle)
-
-[]
-extern bool GetCurrentConsoleFontEx(IntPtr consoleOutput, bool maximumWindow, CONSOLE_FONT_INFO_EX lpConsoleCurrentFontEx)
-
-[]
-extern bool SetCurrentConsoleFontEx(IntPtr consoleOutput, bool maximumWindow, CONSOLE_FONT_INFO_EX consoleCurrentFontEx)
-
-[]
-let main argv =
- let fontName = "Lucida Console"
- let hnd = GetStdHandle(STD_OUTPUT_HANDLE)
- if hnd <> INVALID_HANDLE_VALUE then
- let mutable info = CONSOLE_FONT_INFO_EX()
- info.cbSize <- uint32 (Marshal.SizeOf(info))
- // First determine whether there's already a TrueType font.
- if (GetCurrentConsoleFontEx(hnd, false, info)) then
- if (((info.FontFamily) &&& TMPF_TRUETYPE) = TMPF_TRUETYPE) then
- Console.WriteLine("The console already is using a TrueType font.")
- else
- // Set console font to Lucida Console.
- let mutable newInfo = CONSOLE_FONT_INFO_EX()
- newInfo.cbSize <- uint32 (Marshal.SizeOf(newInfo))
- newInfo.FontFamily <- TMPF_TRUETYPE
- newInfo.FaceName <- fontName
- // Get some settings from current font.
- newInfo.dwFontSize <- COORD(info.dwFontSize.X, info.dwFontSize.Y)
- newInfo.FontWeight <- info.FontWeight
- SetCurrentConsoleFontEx(hnd, false, newInfo) |> ignore
- Console.WriteLine("The console is now using a TrueType font.")
-
- // Return zero for success
- 0
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/source.fs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/source.fs
deleted file mode 100644
index 7e427b2bfb61f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/source.fs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-module Example
-
-open System
-
-[]
-let main argv =
- Console.Write("Hello ")
- Console.WriteLine("World!")
- Console.Write("Enter your name: ")
- let name = Console.ReadLine()
- Console.Write("Good day, ")
- Console.Write(name)
- Console.WriteLine("!")
- 0
-
-// The example displays output similar to the following:
-// Hello World!
-// Enter your name: James
-// Good day, James!
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/unicode1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/unicode1.fs
deleted file mode 100644
index d1b15f28c5798..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/fsharp/unicode1.fs
+++ /dev/null
@@ -1,23 +0,0 @@
-module unicode1
-//
-open System
-
-// Create a char List for the modern Cyrillic alphabet,
-// from U+0410 to U+044F.
-let chars =
- [ for codePoint in 0x0410 .. 0x044F do
- Convert.ToChar codePoint ]
-
-printfn "Current code page: %i\n" Console.OutputEncoding.CodePage
-// Display the characters.
-for ch in chars do
- printf "%c " ch
- if Console.CursorLeft >= 70 then Console.WriteLine()
-
-// The example displays the following output:
-// Current code page: 437
-//
-// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
-// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
-// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/example3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/example3.vb
deleted file mode 100644
index d18c90ab07412..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/example3.vb
+++ /dev/null
@@ -1,174 +0,0 @@
-
-' dump a range of Unicode characters as a 16x16 array
-'
-Imports System.IO
-Imports System.Globalization
-Imports System.Text
-
-Public Module DisplayChars
- Public Sub Main(args() As String)
- Dim rangeStart As UInteger = 0
- Dim rangeEnd As UInteger = 0
- Dim setOutputEncodingToUnicode As Boolean = True
- ' Get the current encoding so we can restore it.
- Dim originalOutputEncoding As Encoding = Console.OutputEncoding
-
- Try
- Select Case args.Length
- Case 2
- rangeStart = UInt32.Parse(args(0), NumberStyles.HexNumber)
- rangeEnd = UInt32.Parse(args(1), NumberStyles.HexNumber)
- setOutputEncodingToUnicode = True
- Case 3
- If Not UInt32.TryParse(args(0), NumberStyles.HexNumber, Nothing, rangeStart) Then
- Throw New ArgumentException(String.Format("{0} is not a valid hexadecimal number.", args(0)))
- End If
-
- If Not UInt32.TryParse(args(1), NumberStyles.HexNumber, Nothing, rangeEnd) Then
- Throw New ArgumentException(String.Format("{0} is not a valid hexadecimal number.", args(1)))
- End If
-
- Boolean.TryParse(args(2), setOutputEncodingToUnicode)
- Case Else
- Console.WriteLine("Usage: {0} <{1}> <{2}> [{3}]",
- Environment.GetCommandLineArgs()(0),
- "startingCodePointInHex",
- "endingCodePointInHex",
- "")
- Exit Sub
- End Select
-
- If setOutputEncodingToUnicode Then
- ' This won't work before .NET Framework 4.5.
- Try
- ' Set encoding Imports endianness of this system.
- ' We're interested in displaying individual Char objects, so
- ' we don't want a Unicode BOM or exceptions to be thrown on
- ' invalid Char values.
- Console.OutputEncoding = New UnicodeEncoding(Not BitConverter.IsLittleEndian, False)
- Console.WriteLine("{0}Output encoding set to UTF-16", vbCrLf)
- Catch e As IOException
- Console.OutputEncoding = New UTF8Encoding()
- Console.WriteLine("Output encoding set to UTF-8")
- End Try
- Else
- Console.WriteLine("The console encoding is {0} (code page {1})",
- Console.OutputEncoding.EncodingName,
- Console.OutputEncoding.CodePage)
- End If
- DisplayRange(rangeStart, rangeEnd)
- Catch ex As ArgumentException
- Console.WriteLine(ex.Message)
- Finally
- ' Restore console environment.
- Console.OutputEncoding = originalOutputEncoding
- End Try
- End Sub
-
- Public Sub DisplayRange(rangeStart As UInteger, rangeEnd As UInteger)
- Const upperRange As UInteger = &h10FFFF
- Const surrogateStart As UInteger = &hD800
- Const surrogateEnd As UInteger = &hDFFF
-
- If rangeEnd <= rangeStart Then
- Dim t As UInteger = rangeStart
- rangeStart = rangeEnd
- rangeEnd = t
- End If
-
- ' Check whether the start or end range is outside of last plane.
- If rangeStart > upperRange Then
- Throw New ArgumentException(String.Format("0x{0:X5} is outside the upper range of Unicode code points (0x{1:X5})",
- rangeStart, upperRange))
- End If
- If rangeEnd > upperRange Then
- Throw New ArgumentException(String.Format("0x{0:X5} is outside the upper range of Unicode code points (0x{0:X5})",
- rangeEnd, upperRange))
- End If
- ' Since we're using 21-bit code points, we can't use U+D800 to U+DFFF.
- If (rangeStart < surrogateStart And rangeEnd > surrogateStart) OrElse (rangeStart >= surrogateStart And rangeStart <= surrogateEnd )
- Throw New ArgumentException(String.Format("0x{0:X5}-0x{1:X5} includes the surrogate pair range 0x{2:X5}-0x{3:X5}",
- rangeStart, rangeEnd, surrogateStart, surrogateEnd))
- End If
-
- Dim last As UInteger = RoundUpToMultipleOf(&h10, rangeEnd)
- Dim first As UInteger = RoundDownToMultipleOf(&h10, rangeStart)
-
- Dim rows As UInteger = (last - first) \ &h10
-
- For r As UInteger = 0 To rows - 1
- ' Display the row header.
- Console.Write("{0:x5} ", first + &h10 * r)
-
- For c As UInteger = 1 To &h10
- Dim cur As UInteger = first + &h10 * r + c
- If cur < rangeStart Then
- Console.Write(" {0} ", Convert.ToChar(&h20))
- Else If rangeEnd < cur Then
- Console.Write(" {0} ", Convert.ToChar(&h20))
- Else
- ' the cast to int is safe, since we know that val <= upperRange.
- Dim chars As String = Char.ConvertFromUtf32(CInt(cur))
- ' Display a space for code points that are not valid characters.
- If CharUnicodeInfo.GetUnicodeCategory(chars(0)) =
- UnicodeCategory.OtherNotAssigned Then
- Console.Write(" {0} ", Convert.ToChar(&h20))
- ' Display a space for code points in the private use area.
- Else If CharUnicodeInfo.GetUnicodeCategory(chars(0)) =
- UnicodeCategory.PrivateUse Then
- Console.Write(" {0} ", Convert.ToChar(&h20))
- ' Is surrogate pair a valid character?
- ' Note that the console will interpret the high and low surrogate
- ' as separate (and unrecognizable) characters.
- Else If chars.Length > 1 AndAlso CharUnicodeInfo.GetUnicodeCategory(chars, 0) =
- UnicodeCategory.OtherNotAssigned Then
- Console.Write(" {0} ", Convert.ToChar(&h20))
- Else
- Console.Write(" {0} ", chars)
- End If
- End If
-
- Select Case c
- Case 3, 11
- Console.Write("-")
- Case 7
- Console.Write("--")
- End Select
- Next
-
- Console.WriteLine()
- If 0 < r AndAlso r Mod &h10 = 0
- Console.WriteLine()
- End If
- Next
- End Sub
-
- Private Function RoundUpToMultipleOf(b As UInteger, u As UInteger) As UInteger
- Return RoundDownToMultipleOf(b, u) + b
- End Function
-
- Private Function RoundDownToMultipleOf(b As UInteger, u As UInteger) As UInteger
- Return u - (u Mod b)
- End Function
-End Module
-' If the example is run with the command line
-' DisplayChars 0400 04FF true
-' the example displays the Cyrillic character set as follows:
-' Output encoding set to UTF-16
-' 00400 Ѐ Ё Ђ Ѓ - Є Ѕ І Ї -- Ј Љ Њ Ћ - Ќ Ѝ Ў Џ
-' 00410 А Б В Г - Д Е Ж З -- И Й К Л - М Н О П
-' 00420 Р С Т У - Ф Х Ц Ч -- Ш Щ Ъ Ы - Ь Э Ю Я
-' 00430 а б в г - д е ж з -- и й к л - м н о п
-' 00440 р с т у - ф х ц ч -- ш щ ъ ы - ь э ю я
-' 00450 ѐ ё ђ ѓ - є ѕ і ї -- ј љ њ ћ - ќ ѝ ў џ
-' 00460 Ѡ ѡ Ѣ ѣ - Ѥ ѥ Ѧ ѧ -- Ѩ ѩ Ѫ ѫ - Ѭ ѭ Ѯ ѯ
-' 00470 Ѱ ѱ Ѳ ѳ - Ѵ ѵ Ѷ ѷ -- Ѹ ѹ Ѻ ѻ - Ѽ ѽ Ѿ ѿ
-' 00480 Ҁ ҁ ҂ ҃ - ҄ ҅ ҆ ҇ -- ҈ ҉ Ҋ ҋ - Ҍ ҍ Ҏ ҏ
-' 00490 Ґ ґ Ғ ғ - Ҕ ҕ Җ җ -- Ҙ ҙ Қ қ - Ҝ ҝ Ҟ ҟ
-' 004a0 Ҡ ҡ Ң ң - Ҥ ҥ Ҧ ҧ -- Ҩ ҩ Ҫ ҫ - Ҭ ҭ Ү ү
-' 004b0 Ұ ұ Ҳ ҳ - Ҵ ҵ Ҷ ҷ -- Ҹ ҹ Һ һ - Ҽ ҽ Ҿ ҿ
-' 004c0 Ӏ Ӂ ӂ Ӄ - ӄ Ӆ ӆ Ӈ -- ӈ Ӊ ӊ Ӌ - ӌ Ӎ ӎ ӏ
-' 004d0 Ӑ ӑ Ӓ ӓ - Ӕ ӕ Ӗ ӗ -- Ә ә Ӛ ӛ - Ӝ ӝ Ӟ ӟ
-' 004e0 Ӡ ӡ Ӣ ӣ - Ӥ ӥ Ӧ ӧ -- Ө ө Ӫ ӫ - Ӭ ӭ Ӯ ӯ
-' 004f0 Ӱ ӱ Ӳ ӳ - Ӵ ӵ Ӷ ӷ -- Ӹ ӹ Ӻ ӻ - Ӽ ӽ Ӿ ӿ
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/fontlink1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/fontlink1.vb
deleted file mode 100644
index 6e3624de869ad..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/fontlink1.vb
+++ /dev/null
@@ -1,68 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports Microsoft.Win32
-
-Module Example2
- Public Sub Main()
- Dim valueName As String = "Lucida Console"
- Dim newFont As String = "simsun.ttc,SimSun"
- Dim fonts() As String = Nothing
- Dim kind As RegistryValueKind
- Dim toAdd As Boolean
-
- Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey(
- "Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink",
- True)
- If key Is Nothing Then
- Console.WriteLine("Font linking is not enabled.")
- Else
- ' Determine if the font is a base font.
- Dim names() As String = key.GetValueNames()
- If Array.Exists(names, Function(s) s.Equals(valueName,
- StringComparison.OrdinalIgnoreCase)) Then
- ' Get the value's type.
- kind = key.GetValueKind(valueName)
-
- ' Type should be RegistryValueKind.MultiString, but we can't be sure.
- Select Case kind
- Case RegistryValueKind.String
- fonts = {CStr(key.GetValue(valueName))}
- Case RegistryValueKind.MultiString
- fonts = CType(key.GetValue(valueName), String())
- Case RegistryValueKind.None
- ' Do nothing.
- fonts = {}
- End Select
- ' Determine whether SimSun is a linked font.
- If Array.FindIndex(fonts, Function(s) s.IndexOf("SimSun",
- StringComparison.OrdinalIgnoreCase) >= 0) >= 0 Then
- Console.WriteLine("Font is already linked.")
- toAdd = False
- Else
- ' Font is not a linked font.
- toAdd = True
- End If
- Else
- ' Font is not a base font.
- toAdd = True
- fonts = {}
- End If
-
- If toAdd Then
- Array.Resize(fonts, fonts.Length + 1)
- fonts(fonts.GetUpperBound(0)) = newFont
- ' Change REG_SZ to REG_MULTI_SZ.
- If kind = RegistryValueKind.String Then
- key.DeleteValue(valueName, False)
- End If
- key.SetValue(valueName, fonts, RegistryValueKind.MultiString)
- Console.WriteLine("SimSun added to the list of linked fonts.")
- End If
- End If
-
- If key IsNot Nothing Then key.Close()
- End Sub
-End Module
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/normalize1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/normalize1.vb
deleted file mode 100644
index 7f2e39ad66d67..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/normalize1.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example3
- Public Sub Main()
- Dim chars() As Char = {ChrW(&H61), ChrW(&H308)}
-
- Dim combining As String = New String(chars)
- Console.WriteLine(combining)
-
- combining = combining.Normalize()
- Console.WriteLine(combining)
- End Sub
-End Module
-' The example displays the following output:
-' a"
-' ä
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/setfont1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/setfont1.vb
deleted file mode 100644
index f633effed0b1c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/setfont1.vb
+++ /dev/null
@@ -1,75 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Runtime.InteropServices
-
-Public Module Example5
- '
- Private Declare Function GetStdHandle Lib "Kernel32" (
- nStdHandle As Integer) As IntPtr
-
- ' [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- Private Declare Function GetCurrentConsoleFontEx Lib "Kernel32" (
- consoleOutput As IntPtr,
- maximumWindow As Boolean,
- ByRef lpConsoleCurrentFontEx As CONSOLE_FONT_INFO_EX) As Boolean
-
- ' [DllImport("kernel32.dll", SetLastError = true)]
- Private Declare Function SetCurrentConsoleFontEx Lib "Kernel32" (
- consoleOutput As IntPtr,
- maximumWindow As Boolean,
- consoleCurrentFontEx As CONSOLE_FONT_INFO_EX) As Boolean
-
- Private Const STD_OUTPUT_HANDLE As Integer = -11
- Private Const TMPF_TRUETYPE As Integer = 4
- Private Const LF_FACESIZE As Integer = 32
- Private INVALID_HANDLE_VALUE As IntPtr = New IntPtr(-1)
-
- Public Sub Main()
- Dim fontName As String = "Lucida Console"
- Dim hnd As IntPtr = GetStdHandle(STD_OUTPUT_HANDLE)
- If hnd <> INVALID_HANDLE_VALUE Then
- Dim info As CONSOLE_FONT_INFO_EX = New CONSOLE_FONT_INFO_EX()
- info.cbSize = CUInt(Marshal.SizeOf(info))
- Dim tt As Boolean = False
- ' First determine whether there's already a TrueType font.
- If GetCurrentConsoleFontEx(hnd, False, info) Then
- tt = (info.FontFamily And TMPF_TRUETYPE) = TMPF_TRUETYPE
- If tt Then
- Console.WriteLine("The console already is using a TrueType font.")
- Return
- End If
- ' Set console font to Lucida Console.
- Dim newInfo As CONSOLE_FONT_INFO_EX = New CONSOLE_FONT_INFO_EX()
- newInfo.cbSize = CUInt(Marshal.SizeOf(newInfo))
- newInfo.FontFamily = TMPF_TRUETYPE
- newInfo.FaceName = fontName
- ' Get some settings from current font.
- newInfo.dwFontSize = New COORD(info.dwFontSize.X, info.dwFontSize.Y)
- newInfo.FontWeight = info.FontWeight
- SetCurrentConsoleFontEx(hnd, False, newInfo)
- End If
- End If
- End Sub
-
- Friend Structure COORD
- Friend X As Short
- Friend Y As Short
-
- Friend Sub New(x As Short, y As Short)
- Me.X = x
- Me.Y = y
- End Sub
- End Structure
-
- Friend Structure CONSOLE_FONT_INFO_EX
- Friend cbSize As UInteger
- Friend nFont As UInteger
- Friend dwFontSize As COORD
- Friend FontFamily As Integer
- Friend FontWeight As Integer
- Friend FaceName As String
- End Structure
-End Module
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/source.vb
deleted file mode 100644
index 5b489ba0ae9da..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/source.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-'
-Public Class Example4
- Public Shared Sub Main()
- Console.Write("Hello ")
- Console.WriteLine("World!")
- Console.Write("Enter your name: ")
- Dim name As String = Console.ReadLine()
- Console.Write("Good day, ")
- Console.Write(name)
- Console.WriteLine("!")
- End Sub
-End Class
-' The example displays output similar to the following:
-' Hello World!
-' Enter your name: James
-' Good day, James!
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/unicode1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/unicode1.vb
deleted file mode 100644
index 7ef4bfcf698d1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/vb/unicode1.vb
+++ /dev/null
@@ -1,33 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- ' Create a Char array for the modern Cyrillic alphabet,
- ' from U+0410 to U+044F.
- Dim nChars As Integer = &h44F - &h0410
- Dim chars(nChars) As Char
- Dim codePoint As UInt16 = &h0410
- For ctr As Integer = 0 To chars.Length - 1
- chars(ctr) = ChrW(codePoint)
- codePoint += CType(1, UShort)
- Next
-
- Console.WriteLine("Current code page: {0}",
- Console.OutputEncoding.CodePage)
- Console.WriteLine()
- ' Display the characters.
- For Each ch In chars
- Console.Write("{0} ", ch)
- If Console.CursorLeft >= 70 Then Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Current code page: 437
-'
-' ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
-' ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
-' ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/csharp/NonDecimal1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/csharp/NonDecimal1.cs
deleted file mode 100644
index 1947fda619195..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/csharp/NonDecimal1.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-using System;
-
-public class Example
-{
- public static void Main()
- {
- int[] baseValues = { 2, 8, 10, 16 };
- short value = Int16.MaxValue;
- foreach (var baseValue in baseValues) {
- String s = Convert.ToString(value, baseValue);
- short value2 = Convert.ToInt16(s, baseValue);
-
- Console.WriteLine($"{value} --> {s} (base {baseValue}) --> {value2}");
- }
- }
-}
-// The example displays the following output:
-// 32767 --> 111111111111111 (base 2) --> 32767
-// 32767 --> 77777 (base 8) --> 32767
-// 32767 --> 32767 (base 10) --> 32767
-// 32767 --> 7fff (base 16) --> 32767
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/csharp/converter.cs b/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/csharp/converter.cs
deleted file mode 100644
index 3711b03f21bca..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/csharp/converter.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using System;
-
-namespace ConvertSnippet
-{
- //This class is the snippet for the class System.Convert
- class Converter
- {
- static void Main(string[] args)
- {
- //
- double dNumber = 23.15;
-
- try {
- // Returns 23
- int iNumber = System.Convert.ToInt32(dNumber);
- }
- catch (System.OverflowException) {
- System.Console.WriteLine(
- "Overflow in double to int conversion.");
- }
- // Returns True
- bool bNumber = System.Convert.ToBoolean(dNumber);
-
- // Returns "23.15"
- string strNumber = System.Convert.ToString(dNumber);
-
- try {
- // Returns '2'
- char chrNumber = System.Convert.ToChar(strNumber[0]);
- }
- catch (System.ArgumentNullException) {
- System.Console.WriteLine("String is null");
- }
- catch (System.FormatException) {
- System.Console.WriteLine("String length is greater than 1.");
- }
-
- // System.Console.ReadLine() returns a string and it
- // must be converted.
- int newInteger = 0;
- try {
- System.Console.WriteLine("Enter an integer:");
- newInteger = System.Convert.ToInt32(
- System.Console.ReadLine());
- }
- catch (System.ArgumentNullException) {
- System.Console.WriteLine("String is null.");
- }
- catch (System.FormatException) {
- System.Console.WriteLine("String does not consist of an " +
- "optional sign followed by a series of digits.");
- }
- catch (System.OverflowException) {
- System.Console.WriteLine(
- "Overflow in string to int conversion.");
- }
-
- System.Console.WriteLine($"Your integer as a double is {System.Convert.ToDouble(newInteger)}");
- //
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/fsharp/NonDecimal1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/fsharp/NonDecimal1.fs
deleted file mode 100644
index c2ffa63e902f4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/fsharp/NonDecimal1.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module NonDecimal
-
-//
-open System
-
-let baseValues = [ 2; 8; 10; 16 ]
-let value = Int16.MaxValue
-for baseValue in baseValues do
- let s = Convert.ToString(value, baseValue)
- let value2 = Convert.ToInt16(s, baseValue)
- printfn $"{value} --> {s} (base {baseValue}) --> {value2}"
-
-// The example displays the following output:
-// 32767 --> 111111111111111 (base 2) --> 32767
-// 32767 --> 77777 (base 8) --> 32767
-// 32767 --> 32767 (base 10) --> 32767
-// 32767 --> 7fff (base 16) --> 32767
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/fsharp/converter.fs b/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/fsharp/converter.fs
deleted file mode 100644
index 71bd7eaaf66d7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/fsharp/converter.fs
+++ /dev/null
@@ -1,48 +0,0 @@
-module converter
-
-open System
-
-//
-let dNumber = 23.15
-
-try
- // Returns 23
- Convert.ToInt32 dNumber
- |> ignore
-with :? OverflowException ->
- printfn "Overflow in double to int conversion."
-// Returns True
-let bNumber = System.Convert.ToBoolean dNumber
-
-// Returns "23.15"
-let strNumber = System.Convert.ToString dNumber
-
-try
- // Returns '2'
- System.Convert.ToChar strNumber[0]
- |> ignore
-with
-| :? ArgumentNullException ->
- printfn "String is null"
-| :? FormatException ->
- printfn "String length is greater than 1."
-
-// System.Console.ReadLine() returns a string and it
-// must be converted.
-let newInteger =
- try
- printfn "Enter an integer:"
- System.Convert.ToInt32(Console.ReadLine())
- with
- | :? ArgumentNullException ->
- printfn "String is null."
- 0
- | :? FormatException ->
- printfn "String does not consist of an optional sign followed by a series of digits."
- 0
- | :? OverflowException ->
- printfn "Overflow in string to int conversion."
- 0
-
-printfn $"Your integer as a double is {System.Convert.ToDouble newInteger}"
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/NonDecimal1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/NonDecimal1.vb
deleted file mode 100644
index 9495423ab5b92..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/NonDecimal1.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example2
- Public Sub Main()
- Dim baseValues() As Integer = {2, 8, 10, 16}
- Dim value As Short = Int16.MaxValue
- For Each baseValue In baseValues
- Dim s As String = Convert.ToString(value, baseValue)
- Dim value2 As Short = Convert.ToInt16(s, baseValue)
-
- Console.WriteLine("{0} --> {1} (base {2}) --> {3}",
- value, s, baseValue, value2)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 32767 --> 111111111111111 (base 2) --> 32767
-' 32767 --> 77777 (base 8) --> 32767
-' 32767 --> 32767 (base 10) --> 32767
-' 32767 --> 7fff (base 16) --> 32767
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/converter.vb b/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/converter.vb
deleted file mode 100644
index 10ae06b1b1ad1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/converter.vb
+++ /dev/null
@@ -1,59 +0,0 @@
-Option Strict On
-
-Namespace ConvertSnippet
- 'This class is the snippet for the class System.Convert
- Class Converter
-
- Public Shared Sub Main()
- '
- Dim dNumber As Double
- dNumber = 23.15
-
- Try
- ' Returns 23
- Dim iNumber As Integer
- iNumber = System.Convert.ToInt32(dNumber)
- Catch exp As System.OverflowException
- System.Console.WriteLine("Overflow in double to int conversion.")
- End Try
-
- ' Returns True
- Dim bNumber As Boolean
- bNumber = System.Convert.ToBoolean(dNumber)
-
- ' Returns "23.15"
- Dim strNumber As String
- strNumber = System.Convert.ToString(dNumber)
-
- Try
- ' Returns '2'
- Dim chrNumber As Char
- chrNumber = System.Convert.ToChar(strNumber.Chars(1))
- Catch exp As System.ArgumentNullException
- System.Console.WriteLine("String is null.")
- Catch exp As System.FormatException
- System.Console.WriteLine("String length is greater than 1.")
- End Try
-
- ' System.Console.ReadLine() returns a string and it
- ' must be converted.
- Dim newInteger As Integer
- newInteger = 0
- Try
- System.Console.WriteLine("Enter an integer:")
- newInteger = System.Convert.ToInt32(System.Console.ReadLine())
- Catch exp As System.ArgumentNullException
- System.Console.WriteLine("String is null.")
- Catch exp As System.FormatException
- System.Console.WriteLine("String does not consist of an " + _
- "optional sign followed by a series of digits.")
- Catch exp As System.OverflowException
- System.Console.WriteLine("Overflow in string to int conversion.")
- End Try
-
- System.Console.WriteLine("Your integer as a double is {0}", _
- System.Convert.ToDouble(newInteger))
- '
- End Sub
- End Class
-End Namespace
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/tobyte1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/tobyte1.vb
deleted file mode 100644
index e4d4a1f6abc3c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/tobyte1.vb
+++ /dev/null
@@ -1,267 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example3
- Public Sub Main()
- ConvertBoolean()
- Console.WriteLine("-----")
- ConvertChar()
- Console.WriteLine("-----")
- ConvertInt16()
- Console.WriteLine("-----")
- ConvertInt32()
- Console.WriteLine("-----")
- ConvertInt64()
- Console.WriteLine("-----")
- ConvertObject()
- Console.WriteLine("-----")
- ConvertSByte()
- Console.WriteLine("-----")
- ConvertUInt16()
- Console.WriteLine("-----")
- ConvertUInt32()
- Console.WriteLine("-----")
- ConvertUInt64()
- End Sub
-
- Private Sub ConvertBoolean()
- '
- Dim falseFlag As Boolean = False
- Dim trueFlag As Boolean = True
-
- Console.WriteLine("{0} converts to {1}.", falseFlag,
- Convert.ToByte(falseFlag))
- Console.WriteLine("{0} converts to {1}.", trueFlag,
- Convert.ToByte(trueFlag))
- ' The example displays the following output:
- ' False converts to 0.
- ' True converts to 1.
- '
- End Sub
-
- Private Sub ConvertChar()
- '
- Dim chars() As Char = {"a"c, "z"c, ChrW(7), ChrW(1023)}
- For Each ch As Char In chars
- Try
- Dim result As Byte = Convert.ToByte(ch)
- Console.WriteLine("{0} is converted to {1}.", ch, result)
- Catch e As OverflowException
- Console.WriteLine("Unable to convert u+{0} to a byte.",
- AscW(ch).ToString("X4"))
- End Try
- Next
- ' The example displays the following output:
- ' a is converted to 97.
- ' z is converted to 122.
- ' is converted to 7.
- ' Unable to convert u+03FF to a byte.
- '
- End Sub
-
- Private Sub ConvertInt16()
- '
- Dim numbers() As Short = {Int16.MinValue, -1, 0, 121, 340, Int16.MaxValue}
- Dim result As Byte
- For Each number As Short In numbers
- Try
- result = Convert.ToByte(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' The Int16 value -32768 is outside the range of the Byte type.
- ' The Int16 value -1 is outside the range of the Byte type.
- ' Converted the Int16 value 0 to the Byte value 0.
- ' Converted the Int16 value 121 to the Byte value 121.
- ' The Int16 value 340 is outside the range of the Byte type.
- ' The Int16 value 32767 is outside the range of the Byte type.
- '
- End Sub
-
- Private Sub ConvertInt32()
- '
- Dim numbers() As Integer = {Int32.MinValue, -1, 0, 121, 340, Int32.MaxValue}
- Dim result As Byte
- For Each number As Integer In numbers
- Try
- result = Convert.ToByte(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' The Int32 value -2147483648 is outside the range of the Byte type.
- ' The Int32 value -1 is outside the range of the Byte type.
- ' Converted the Int32 value 0 to the Byte value 0.
- ' Converted the Int32 value 121 to the Byte value 121.
- ' The Int32 value 340 is outside the range of the Byte type.
- ' The Int32 value 2147483647 is outside the range of the Byte type.
- '
- End Sub
-
- Private Sub ConvertInt64()
- '
- Dim numbers() As Long = {Int64.MinValue, -1, 0, 121, 340, Int64.MaxValue}
- Dim result As Byte
- For Each number As Long In numbers
- Try
- result = Convert.ToByte(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' The Int64 value -9223372036854775808 is outside the range of the Byte type.
- ' The Int64 value -1 is outside the range of the Byte type.
- ' Converted the Int64 value 0 to the Byte value 0.
- ' Converted the Int64 value 121 to the Byte value 121.
- ' The Int64 value 340 is outside the range of the Byte type.
- ' The Int64 value 9223372036854775807 is outside the range of the Byte type.
- '
- End Sub
-
- Private Sub ConvertObject()
- '
- Dim values() As Object = {True, -12, 163, 935, "x"c, "104", "103.0", "-1",
- "1.00e2", "One", 100.0}
- Dim result As Byte
- For Each value As Object In values
- Try
- result = Convert.ToByte(value)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- value.GetType().Name, value,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
- value.GetType().Name, value)
- Catch e As FormatException
- Console.WriteLine("The {0} value {1} is not in a recognizable format.",
- value.GetType().Name, value)
- Catch e As InvalidCastException
- Console.WriteLine("No conversion to a Byte exists for the {0} value {1}.",
- value.GetType().Name, value)
-
- End Try
- Next
- ' The example displays the following output:
- ' Converted the Boolean value True to the Byte value 1.
- ' The Int32 value -12 is outside the range of the Byte type.
- ' Converted the Int32 value 163 to the Byte value 163.
- ' The Int32 value 935 is outside the range of the Byte type.
- ' Converted the Char value x to the Byte value 120.
- ' Converted the String value 104 to the Byte value 104.
- ' The String value 103.0 is not in a recognizable format.
- ' The String value -1 is outside the range of the Byte type.
- ' The String value 1.00e2 is not in a recognizable format.
- ' The String value One is not in a recognizable format.
- ' Converted the Double value 100 to the Byte value 100.
- '
- End Sub
-
- Private Sub ConvertSByte()
- '
- Dim numbers() As SByte = {SByte.MinValue, -1, 0, 10, SByte.MaxValue}
- Dim result As Byte
- For Each number As SByte In numbers
- Try
- result = Convert.ToByte(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' The SByte value -128 is outside the range of the Byte type.
- ' The SByte value -1 is outside the range of the Byte type.
- ' Converted the SByte value 0 to the Byte value 0.
- ' Converted the SByte value 10 to the Byte value 10.
- ' Converted the SByte value 127 to the Byte value 127.
- '
- End Sub
-
- Private Sub ConvertUInt16()
- '
- Dim numbers() As UShort = {UInt16.MinValue, 121, 340, UInt16.MaxValue}
- Dim result As Byte
- For Each number As UShort In numbers
- Try
- result = Convert.ToByte(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' Converted the UInt16 value 0 to the Byte value 0.
- ' Converted the UInt16 value 121 to the Byte value 121.
- ' The UInt16 value 340 is outside the range of the Byte type.
- ' The UInt16 value 65535 is outside the range of the Byte type.
- '
- End Sub
-
- Private Sub ConvertUInt32()
- '
- Dim numbers() As UInteger = {UInt32.MinValue, 121, 340, UInt32.MaxValue}
- Dim result As Byte
- For Each number As UInteger In numbers
- Try
- result = Convert.ToByte(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' Converted the UInt32 value 0 to the Byte value 0.
- ' Converted the UInt32 value 121 to the Byte value 121.
- ' The UInt32 value 340 is outside the range of the Byte type.
- ' The UInt32 value 4294967295 is outside the range of the Byte type.
- '
- End Sub
-
- Private Sub ConvertUInt64()
- '
- Dim numbers() As ULong = {UInt64.MinValue, 121, 340, UInt64.MaxValue}
- Dim result As Byte
- For Each number As ULong In numbers
- Try
- result = Convert.ToByte(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' Converted the UInt64 value 0 to the Byte value 0.
- ' Converted the UInt64 value 121 to the Byte value 121.
- ' The UInt64 value 340 is outside the range of the Byte type.
- ' The UInt64 value 18446744073709551615 is outside the range of the Byte type.
- '
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/toint32_1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/toint32_1.vb
deleted file mode 100644
index 36363c2818229..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/toint32_1.vb
+++ /dev/null
@@ -1,388 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module modMain
- Public Sub Main()
- ConvertBoolean()
- Console.WriteLine("-----")
- ConvertByte()
- Console.WriteLine("-----")
- ConvertChar()
- Console.WriteLine("-----")
- ConvertDecimal()
- Console.WriteLine("-----")
- ConvertDouble()
- Console.WriteLine("-----")
- ConvertInt16()
- Console.WriteLine("-----")
- ConvertInt64()
- Console.WriteLine("-----")
- ConvertObject()
- Console.WriteLine("-----")
- ConvertSByte()
- Console.WriteLine("-----")
- ConvertSingle()
- Console.WriteLine("----")
- ConvertString() ' NEW
- Console.WriteLine("-----")
- ConvertUInt16()
- Console.WriteLine("-----")
- ConvertUInt32()
- Console.WriteLine("-----")
- ConvertUInt64()
- End Sub
-
- Private Sub ConvertBoolean()
- '
- Dim falseFlag As Boolean = False
- Dim trueFlag As Boolean = True
-
- Console.WriteLine("{0} converts to {1}.", falseFlag, _
- Convert.ToInt32(falseFlag))
- Console.WriteLine("{0} converts to {1}.", trueFlag, _
- Convert.ToInt32(trueFlag))
- ' The example displays the following output:
- ' False converts to 0.
- ' True converts to 1.
- '
- End Sub
-
- Private Sub ConvertByte()
- '
- Dim bytes() As Byte = { Byte.MinValue, 14, 122, Byte.MaxValue}
- Dim result As Integer
-
- For Each byteValue As Byte In bytes
- result = Convert.ToInt32(byteValue)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.", _
- byteValue.GetType().Name, byteValue, _
- result.GetType().Name, result)
- Next
- ' The example displays the following output:
- ' Converted the Byte value 0 to the Int32 value 0.
- ' Converted the Byte value 14 to the Int32 value 14.
- ' Converted the Byte value 122 to the Int32 value 122.
- ' Converted the Byte value 255 to the Int32 value 255.
- '
- End Sub
-
- Private Sub ConvertChar()
- '
- Dim chars() As Char = { "a"c, "z"c, ChrW(7), ChrW(1023), _
- ChrW(Short.MaxValue), ChrW(&hFFFE) }
- Dim result As Integer
-
- For Each ch As Char in chars
- Try
- result = Convert.ToInt32(ch)
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.", _
- ch.GetType().Name, ch, _
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("Unable to convert u+{0} to an Int32.", _
- AscW(ch).ToString("X4"))
- End Try
- Next
- ' The example displays the following output:
- ' Converted the Char value 'a' to the Int32 value 97.
- ' Converted the Char value 'z' to the Int32 value 122.
- ' Converted the Char value '' to the Int32 value 7.
- ' Converted the Char value 'Ͽ' to the Int32 value 1023.
- ' Converted the Char value '翿' to the Int32 value 32767.
- ' Converted the Char value '' to the Int32 value 65534.
- '
- End Sub
-
- Private Sub ConvertDecimal()
- '
- Dim values() As Decimal = { Decimal.MinValue, -1034.23d, -12d, 0d, 147d, _
- 199.55d, 9214.16d, Decimal.MaxValue }
- Dim result As Integer
-
- For Each value As Decimal In values
- Try
- result = Convert.ToInt32(value)
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.", _
- value.GetType().Name, value, _
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("{0} is outside the range of the Int32 type.", _
- value)
- End Try
- Next
- ' The example displays the following output:
- ' -79228162514264337593543950335 is outside the range of the Int32 type.
- ' Converted the Decimal value '-1034.23' to the Int32 value -1034.
- ' Converted the Decimal value '-12' to the Int32 value -12.
- ' Converted the Decimal value '0' to the Int32 value 0.
- ' Converted the Decimal value '147' to the Int32 value 147.
- ' Converted the Decimal value '199.55' to the Int32 value 200.
- ' Converted the Decimal value '9214.16' to the Int32 value 9214.
- ' 79228162514264337593543950335 is outside the range of the Int32 type.
- '
- End Sub
-
- Private Sub ConvertDouble()
- '
- Dim values() As Double = { Double.MinValue, -1.38e10, -1023.299, -12.98, _
- 0, 9.113e-16, 103.919, 17834.191, Double.MaxValue }
- Dim result As Integer
-
- For Each value As Double In values
- Try
- result = Convert.ToInt32(value)
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.", _
- value.GetType().Name, value, _
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("{0} is outside the range of the Int32 type.", value)
- End Try
- Next
- ' -1.79769313486232E+308 is outside the range of the Int32 type.
- ' -13800000000 is outside the range of the Int32 type.
- ' Converted the Double value '-1023.299' to the Int32 value -1023.
- ' Converted the Double value '-12.98' to the Int32 value -13.
- ' Converted the Double value '0' to the Int32 value 0.
- ' Converted the Double value '9.113E-16' to the Int32 value 0.
- ' Converted the Double value '103.919' to the Int32 value 104.
- ' Converted the Double value '17834.191' to the Int32 value 17834.
- ' 1.79769313486232E+308 is outside the range of the Int32 type.
- '
- End Sub
-
- Private Sub ConvertInt16()
- '
- Dim numbers() As Short = { Int16.MinValue, -1, 0, 121, 340, Int16.MaxValue }
- Dim result As Integer
-
- For Each number As Short In numbers
- result = Convert.ToInt32(number)
- Console.WriteLine("Converted the {0} value {1} to a {2} value {3}.", _
- number.GetType().Name, number, _
- result.GetType().Name, result)
- Next
- ' The example displays the following output:
- ' Converted the Int16 value -32768 to a Int32 value -32768.
- ' Converted the Int16 value -1 to a Int32 value -1.
- ' Converted the Int16 value 0 to a Int32 value 0.
- ' Converted the Int16 value 121 to a Int32 value 121.
- ' Converted the Int16 value 340 to a Int32 value 340.
- ' Converted the Int16 value 32767 to a Int32 value 32767.
- '
- End Sub
-
- Private Sub ConvertInt64
- '
- Dim numbers() As Long = { Int64.MinValue, -1, 0, 121, 340, Int64.MaxValue }
- Dim result As Integer
- For Each number As Long In numbers
- Try
- result = Convert.ToInt32(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.", _
- number.GetType().Name, number, _
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Int32 type.", _
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' The Int64 value -9223372036854775808 is outside the range of the Int32 type.
- ' Converted the Int64 value -1 to the Int32 value -1.
- ' Converted the Int64 value 0 to the Int32 value 0.
- ' Converted the Int64 value 121 to the Int32 value 121.
- ' Converted the Int64 value 340 to the Int32 value 340.
- ' The Int64 value 9223372036854775807 is outside the range of the Int32 type.
- '
- End Sub
-
- Private Sub ConvertObject()
- '
- Dim values() As Object = { True, -12, 163, 935, "x"c, #5/12/2009#, _
- "104", "103.0", "-1", _
- "1.00e2", "One", 1.00e2, 16.3e42}
- Dim result As Integer
-
- For Each value As Object In values
- Try
- result = Convert.ToInt32(value)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.", _
- value.GetType().Name, value, _
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Int32 type.", _
- value.GetType().Name, value)
- Catch e As FormatException
- Console.WriteLine("The {0} value {1} is not in a recognizable format.", _
- value.GetType().Name, value)
- Catch e As InvalidCastException
- Console.WriteLine("No conversion to an Int32 exists for the {0} value {1}.", _
- value.GetType().Name, value)
-
- End Try
- Next
- ' The example displays the following output:
- ' Converted the Boolean value True to the Int32 value 1.
- ' Converted the Int32 value -12 to the Int32 value -12.
- ' Converted the Int32 value 163 to the Int32 value 163.
- ' Converted the Int32 value 935 to the Int32 value 935.
- ' Converted the Char value x to the Int32 value 120.
- ' No conversion to an Int32 exists for the DateTime value 5/12/2009 12:00:00 AM.
- ' Converted the String value 104 to the Int32 value 104.
- ' The String value 103.0 is not in a recognizable format.
- ' Converted the String value -1 to the Int32 value -1.
- ' The String value 1.00e2 is not in a recognizable format.
- ' The String value One is not in a recognizable format.
- ' Converted the Double value 100 to the Int32 value 100.
- ' The Double value 1.63E+43 is outside the range of the Int32 type.
- '
- End Sub
-
- Private Sub ConvertSByte()
- '
- Dim numbers() As SByte = { SByte.MinValue, -1, 0, 10, SByte.MaxValue }
- Dim result As Integer
-
- For Each number As SByte In numbers
- result = Convert.ToInt32(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.", _
- number.GetType().Name, number, _
- result.GetType().Name, result)
- Next
- ' The example displays the following output:
- ' Converted the SByte value -128 to the Int32 value -128.
- ' Converted the SByte value -1 to the Int32 value -1.
- ' Converted the SByte value 0 to the Int32 value 0.
- ' Converted the SByte value 10 to the Int32 value 10.
- ' Converted the SByte value 127 to the Int32 value 127.
- '
- End Sub
-
- Private Sub ConvertSingle()
- '
- Dim values() As Single = { Single.MinValue, -1.38e10, -1023.299, -12.98, _
- 0, 9.113e-16, 103.919, 17834.191, Single.MaxValue }
- Dim result As Integer
-
- For Each value As Single In values
- Try
- result = Convert.ToInt32(value)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.", _
- value.GetType().Name, value, result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("{0} is outside the range of the Int32 type.", value)
- End Try
- Next
- ' The example displays the following output:
- ' -3.40282346638529E+38 is outside the range of the Int32 type.
- ' -13799999488 is outside the range of the Int32 type.
- ' Converted the Double value -1023.29901123047 to the Int32 value -1023.
- ' Converted the Double value -12.9799995422363 to the Int32 value -13.
- ' Converted the Double value 0 to the Int32 value 0.
- ' Converted the Double value 9.11299983940444E-16 to the Int32 value 0.
- ' Converted the Double value 103.918998718262 to the Int32 value 104.
- ' Converted the Double value 17834.19140625 to the Int32 value 17834.
- ' 3.40282346638529E+38 is outside the range of the Int32 type.
- '
- End Sub
-
- Private Sub ConvertString()
- '
- Dim values() As String = { "One", "1.34e28", "-26.87", "-18", "-6.00", _
- " 0", "137", "1601.9", Int32.MaxValue.ToString() }
- Dim result As Integer
-
- For Each value As String In values
- Try
- result = Convert.ToInt32(value)
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.", _
- value.GetType().Name, value, result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("{0} is outside the range of the Int32 type.", value)
- Catch e As FormatException
- Console.WriteLine("The {0} value '{1}' is not in a recognizable format.", _
- value.GetType().Name, value)
- End Try
- Next
- ' The example displays the following output:
- ' The String value 'One' is not in a recognizable format.
- ' The String value '1.34e28' is not in a recognizable format.
- ' The String value '-26.87' is not in a recognizable format.
- ' Converted the String value '-18' to the Int32 value -18.
- ' The String value '-6.00' is not in a recognizable format.
- ' Converted the String value ' 0' to the Int32 value 0.
- ' Converted the String value '137' to the Int32 value 137.
- ' The String value '1601.9' is not in a recognizable format.
- ' Converted the String value '2147483647' to the Int32 value 2147483647.
- '
- End Sub
-
- Private Sub ConvertUInt16()
- '
- Dim numbers() As UShort = { UInt16.MinValue, 121, 340, UInt16.MaxValue }
- Dim result As Integer
- For Each number As UShort In numbers
- Try
- result = Convert.ToInt32(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.", _
- number.GetType().Name, number, _
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Int32 type.", _
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' Converted the UInt16 value 0 to the Int32 value 0.
- ' Converted the UInt16 value 121 to the Int32 value 121.
- ' Converted the UInt16 value 340 to the Int32 value 340.
- ' Converted the UInt16 value 65535 to the Int32 value 65535.
- '
- End Sub
-
- Private Sub ConvertUInt32()
- '
- Dim numbers() As UInteger = { UInt32.MinValue, 121, 340, UInt32.MaxValue }
- Dim result As Integer
- For Each number As UInteger In numbers
- Try
- result = Convert.ToInt32(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.", _
- number.GetType().Name, number, _
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Int32 type.", _
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' Converted the UInt32 value 0 to the Int32 value 0.
- ' Converted the UInt32 value 121 to the Int32 value 121.
- ' Converted the UInt32 value 340 to the Int32 value 340.
- ' The UInt32 value 4294967295 is outside the range of the Int32 type.
- '
- End Sub
-
- Private Sub ConvertUInt64
- '
- Dim numbers() As ULong = { UInt64.MinValue, 121, 340, UInt64.MaxValue }
- Dim result As Integer
- For Each number As ULong In numbers
- Try
- result = Convert.ToInt32(number)
- Console.WriteLine("Converted the {0} value {1} to a {2} value {3}.", _
- number.GetType().Name, number, _
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Int32 type.", _
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' Converted the UInt64 value 0 to a Int32 value 0.
- ' Converted the UInt64 value 121 to a Int32 value 121.
- ' Converted the UInt64 value 340 to a Int32 value 340.
- ' The UInt64 value 18446744073709551615 is outside the range of the Int32 type.
- '
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/toint64_1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/toint64_1.vb
deleted file mode 100644
index 307a0c4d6550f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/Overview/vb/toint64_1.vb
+++ /dev/null
@@ -1,375 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module modMain2
- Public Sub Main()
- ConvertBoolean()
- Console.WriteLine("-----")
- ConvertByte()
- Console.WriteLine("-----")
- ConvertChar()
- Console.WriteLine("-----")
- ConvertDecimal()
- Console.WriteLine("-----")
- ConvertDouble()
- Console.WriteLine("-----")
- ConvertInt16()
- Console.WriteLine("-----")
- ConvertInt32()
- Console.WriteLine("-----")
- ConvertObject()
- Console.WriteLine("-----")
- ConvertSByte()
- Console.WriteLine("-----")
- ConvertSingle()
- Console.WriteLine("----")
- ConvertString()
- Console.WriteLine("-----")
- ConvertUInt16()
- Console.WriteLine("-----")
- ConvertUInt32()
- Console.WriteLine("-----")
- ConvertUInt64()
- End Sub
-
- Private Sub ConvertBoolean()
- '
- Dim falseFlag As Boolean = False
- Dim trueFlag As Boolean = True
-
- Console.WriteLine("{0} converts to {1}.", falseFlag,
- Convert.ToInt64(falseFlag))
- Console.WriteLine("{0} converts to {1}.", trueFlag,
- Convert.ToInt64(trueFlag))
- ' The example displays the following output:
- ' False converts to 0.
- ' True converts to 1.
- '
- End Sub
-
- Private Sub ConvertByte()
- '
- Dim bytes() As Byte = {Byte.MinValue, 14, 122, Byte.MaxValue}
- Dim result As Long
-
- For Each byteValue As Byte In bytes
- result = Convert.ToInt64(byteValue)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- byteValue.GetType().Name, byteValue,
- result.GetType().Name, result)
- Next
- ' The example displays the following output:
- ' Converted the Byte value 0 to the Int64 value 0.
- ' Converted the Byte value 14 to the Int64 value 14.
- ' Converted the Byte value 122 to the Int64 value 122.
- ' Converted the Byte value 255 to the Int64 value 255.
- '
- End Sub
-
- Private Sub ConvertChar()
- '
- Dim chars() As Char = {"a"c, "z"c, ChrW(7), ChrW(1023),
- ChrW(Short.MaxValue), ChrW(&HFFFE)}
- Dim result As Long
-
- For Each ch As Char In chars
- result = Convert.ToInt64(ch)
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- ch.GetType().Name, ch,
- result.GetType().Name, result)
- Next
- ' The example displays the following output:
- ' Converted the Char value 'a' to the Int64 value 97.
- ' Converted the Char value 'z' to the Int64 value 122.
- ' Converted the Char value '' to the Int64 value 7.
- ' Converted the Char value 'Ͽ' to the Int64 value 1023.
- ' Converted the Char value '翿' to the Int64 value 32767.
- ' Converted the Char value '' to the Int64 value 65534.
- '
- End Sub
-
- Private Sub ConvertDecimal()
- '
- Dim values() As Decimal = {Decimal.MinValue, -1034.23D, -12D, 0D, 147D,
- 199.55D, 9214.16D, Decimal.MaxValue}
- Dim result As Long
-
- For Each value As Decimal In values
- Try
- result = Convert.ToInt64(value)
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- value.GetType().Name, value,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("{0} is outside the range of the Int64 type.",
- value)
- End Try
- Next
- ' The example displays the following output:
- ' -79228162514264337593543950335 is outside the range of the Int64 type.
- ' Converted the Decimal value '-1034.23' to the Int64 value -1034.
- ' Converted the Decimal value '-12' to the Int64 value -12.
- ' Converted the Decimal value '0' to the Int64 value 0.
- ' Converted the Decimal value '147' to the Int64 value 147.
- ' Converted the Decimal value '199.55' to the Int64 value 200.
- ' Converted the Decimal value '9214.16' to the Int64 value 9214.
- ' 79228162514264337593543950335 is outside the range of the Int64 type.
- '
- End Sub
-
- Private Sub ConvertDouble()
- '
- Dim values() As Double = {Double.MinValue, -13800000000.0, -1023.299, -12.98,
- 0, 0.0000000000000009113, 103.919, 17834.191, Double.MaxValue}
- Dim result As Long
-
- For Each value As Double In values
- Try
- result = Convert.ToInt64(value)
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- value.GetType().Name, value,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("{0} is outside the range of the Int64 type.", value)
- End Try
- Next
- ' -1.79769313486232E+308 is outside the range of the Int64 type.
- ' Converted the Double value '-13800000000' to the Int64 value -13800000000.
- ' Converted the Double value '-1023.299' to the Int64 value -1023.
- ' Converted the Double value '-12.98' to the Int64 value -13.
- ' Converted the Double value '0' to the Int64 value 0.
- ' Converted the Double value '9.113E-16' to the Int64 value 0.
- ' Converted the Double value '103.919' to the Int64 value 104.
- ' Converted the Double value '17834.191' to the Int64 value 17834.
- ' 1.79769313486232E+308 is outside the range of the Int64 type.
- '
- End Sub
-
- Private Sub ConvertInt16()
- '
- Dim numbers() As Short = {Int16.MinValue, -1, 0, 121, 340, Int16.MaxValue}
- Dim result As Long
-
- For Each number As Short In numbers
- result = Convert.ToInt64(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Next
- ' The example displays the following output:
- ' Converted the Int16 value -32768 to the Int64 value -32768.
- ' Converted the Int16 value -1 to the Int64 value -1.
- ' Converted the Int16 value 0 to the Int64 value 0.
- ' Converted the Int16 value 121 to the Int64 value 121.
- ' Converted the Int16 value 340 to the Int64 value 340.
- ' Converted the Int16 value 32767 to the Int64 value 32767.
- '
- End Sub
-
- Private Sub ConvertInt32()
- '
- Dim numbers() As Integer = {Int32.MinValue, -1, 0, 121, 340, Int32.MaxValue}
- Dim result As Long
- For Each number As Integer In numbers
- result = Convert.ToInt64(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Next
- ' The example displays the following output:
- ' Converted the Int32 value -2147483648 to the Int64 value -2147483648.
- ' Converted the Int32 value -1 to the Int64 value -1.
- ' Converted the Int32 value 0 to the Int64 value 0.
- ' Converted the Int32 value 121 to the Int64 value 121.
- ' Converted the Int32 value 340 to the Int64 value 340.
- ' Converted the Int32 value 2147483647 to the Int64 value 2147483647.
- '
- End Sub
-
- Private Sub ConvertObject()
- '
- Dim values() As Object = {True, -12, 163, 935, "x"c, #5/12/2009#,
- "104", "103.0", "-1",
- "1.00e2", "One", 100.0, 1.63E+43}
- Dim result As Long
-
- For Each value As Object In values
- Try
- result = Convert.ToInt64(value)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- value.GetType().Name, value,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Int64 type.",
- value.GetType().Name, value)
- Catch e As FormatException
- Console.WriteLine("The {0} value {1} is not in a recognizable format.",
- value.GetType().Name, value)
- Catch e As InvalidCastException
- Console.WriteLine("No conversion to an Int64 exists for the {0} value {1}.",
- value.GetType().Name, value)
-
- End Try
- Next
- ' The example displays the following output:
- ' Converted the Boolean value True to the Int64 value 1.
- ' Converted the Int64 value -12 to the Int64 value -12.
- ' Converted the Int64 value 163 to the Int64 value 163.
- ' Converted the Int64 value 935 to the Int64 value 935.
- ' Converted the Char value x to the Int64 value 120.
- ' No conversion to an Int64 exists for the DateTime value 5/12/2009 12:00:00 AM.
- ' Converted the String value 104 to the Int64 value 104.
- ' The String value 103.0 is not in a recognizable format.
- ' Converted the String value -1 to the Int64 value -1.
- ' The String value 1.00e2 is not in a recognizable format.
- ' The String value One is not in a recognizable format.
- ' Converted the Double value 100 to the Int64 value 100.
- ' The Double value 1.63E+43 is outside the range of the Int64 type.
- '
- End Sub
-
- Private Sub ConvertSByte()
- '
- Dim numbers() As SByte = {SByte.MinValue, -1, 0, 10, SByte.MaxValue}
- Dim result As Long
-
- For Each number As SByte In numbers
- result = Convert.ToInt64(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Next
- ' The example displays the following output:
- ' Converted the SByte value -128 to the Int64 value -128.
- ' Converted the SByte value -1 to the Int64 value -1.
- ' Converted the SByte value 0 to the Int64 value 0.
- ' Converted the SByte value 10 to the Int64 value 10.
- ' Converted the SByte value 127 to the Int64 value 127.
- '
- End Sub
-
- Private Sub ConvertSingle()
- '
- Dim values() As Single = {Single.MinValue, -13800000000.0, -1023.299, -12.98,
- 0, 0.0000000000000009113, 103.919, 17834.191, Single.MaxValue}
- Dim result As Long
-
- For Each value As Single In values
- Try
- result = Convert.ToInt64(value)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- value.GetType().Name, value, result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("{0} is outside the range of the Int64 type.", value)
- End Try
- Next
- ' The example displays the following output:
- ' -3.4028235E+38 is outside the range of the Int64 type.
- ' Converted the Single value -1.38E+10 to the Int64 value -13799999488.
- ' Converted the Single value -1023.299 to the Int64 value -1023.
- ' Converted the Single value -12.98 to the Int64 value -13.
- ' Converted the Single value 0 to the Int64 value 0.
- ' Converted the Single value 9.113E-16 to the Int64 value 0.
- ' Converted the Single value 103.919 to the Int64 value 104.
- ' Converted the Single value 17834.191 to the Int64 value 17834.
- ' 3.4028235E+38 is outside the range of the Int64 type.
- '
- End Sub
-
- Private Sub ConvertString()
- '
- Dim values() As String = {"One", "1.34e28", "-26.87", "-18", "-6.00",
- " 0", "137", "1601.9", Int32.MaxValue.ToString()}
- Dim result As Long
-
- For Each value As String In values
- Try
- result = Convert.ToInt64(value)
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- value.GetType().Name, value, result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("{0} is outside the range of the Int64 type.", value)
- Catch e As FormatException
- Console.WriteLine("The {0} value '{1}' is not in a recognizable format.",
- value.GetType().Name, value)
- End Try
- Next
- ' The example displays the following output:
- ' The String value 'One' is not in a recognizable format.
- ' The String value '1.34e28' is not in a recognizable format.
- ' The String value '-26.87' is not in a recognizable format.
- ' Converted the String value '-18' to the Int64 value -18.
- ' The String value '-6.00' is not in a recognizable format.
- ' Converted the String value ' 0' to the Int64 value 0.
- ' Converted the String value '137' to the Int64 value 137.
- ' The String value '1601.9' is not in a recognizable format.
- ' Converted the String value '2147483647' to the Int64 value 2147483647.
- '
- End Sub
-
- Private Sub ConvertUInt16()
- '
- Dim numbers() As UShort = {UInt16.MinValue, 121, 340, UInt16.MaxValue}
- Dim result As Long
- For Each number As UShort In numbers
- Try
- result = Convert.ToInt64(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Int64 type.",
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' Converted the UInt16 value 0 to the Int64 value 0.
- ' Converted the UInt16 value 121 to the Int64 value 121.
- ' Converted the UInt16 value 340 to the Int64 value 340.
- ' Converted the UInt16 value 65535 to the Int64 value 65535.
- '
- End Sub
-
- Private Sub ConvertUInt32()
- '
- Dim numbers() As UInteger = {UInt32.MinValue, 121, 340, UInt32.MaxValue}
- Dim result As Long
- For Each number As UInteger In numbers
- result = Convert.ToInt64(number)
- Console.WriteLine("Converted the {0} value {1:N0} to the {2} value {3:N0}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Next
- ' The example displays the following output:
- ' Converted the UInt32 value 0 to the Int64 value 0.
- ' Converted the UInt32 value 121 to the Int64 value 121.
- ' Converted the UInt32 value 340 to the Int64 value 340.
- ' Converted the UInt32 value 4,294,967,295 to the Int64 value 4,294,967,295.
- '
- End Sub
-
- Private Sub ConvertUInt64()
- '
- Dim numbers() As ULong = {UInt64.MinValue, 121, 340, UInt64.MaxValue}
- Dim result As Long
-
- For Each number As ULong In numbers
- Try
- result = Convert.ToInt64(number)
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
- result.GetType().Name, result)
- Catch e As OverflowException
- Console.WriteLine("The {0} value {1} is outside the range of the Int64 type.",
- number.GetType().Name, number)
- End Try
- Next
- ' The example displays the following output:
- ' Converted the UInt64 value 0 to the Int64 value 0.
- ' Converted the UInt64 value 121 to the Int64 value 121.
- ' Converted the UInt64 value 340 to the Int64 value 340.
- ' The UInt64 value 18446744073709551615 is outside the range of the Int64 type.
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt32/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt32/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt32/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt32/csharp/toint32_1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt32/csharp/toint32_1.cs
deleted file mode 100644
index 050eb2bb9a995..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt32/csharp/toint32_1.cs
+++ /dev/null
@@ -1,392 +0,0 @@
-using System;
-
-public class Example
-{
- public static void Main()
- {
- ConvertBoolean();
- Console.WriteLine("-----");
- ConvertByte();
- Console.WriteLine("-----");
- ConvertChar();
- Console.WriteLine("-----");
- ConvertDecimal();
- Console.WriteLine("-----");
- ConvertDouble();
- Console.WriteLine("-----");
- ConvertInt16();
- Console.WriteLine("-----");
- ConvertInt64();
- Console.WriteLine("-----");
- ConvertObject();
- Console.WriteLine("-----");
- ConvertSByte();
- Console.WriteLine("-----");
- ConvertSingle();
- Console.WriteLine("----");
- ConvertString();
- Console.WriteLine("-----");
- ConvertUInt16();
- Console.WriteLine("-----");
- ConvertUInt32();
- Console.WriteLine("-----");
- ConvertUInt64();
- }
-
- private static void ConvertBoolean()
- {
- //
- bool falseFlag = false;
- bool trueFlag = true;
-
- Console.WriteLine($"{falseFlag} converts to {Convert.ToInt32(falseFlag)}.");
- Console.WriteLine($"{trueFlag} converts to {Convert.ToInt32(trueFlag)}.");
- // The example displays the following output:
- // False converts to 0.
- // True converts to 1.
- //
- }
-
- private static void ConvertByte()
- {
- //
- byte[] bytes = { Byte.MinValue, 14, 122, Byte.MaxValue};
- int result;
-
- foreach (byte byteValue in bytes)
- {
- result = Convert.ToInt32(byteValue);
- Console.WriteLine($"Converted the {byteValue.GetType().Name} value {byteValue} to the {result.GetType().Name} value {result}.");
- }
- // The example displays the following output:
- // Converted the Byte value 0 to the Int32 value 0.
- // Converted the Byte value 14 to the Int32 value 14.
- // Converted the Byte value 122 to the Int32 value 122.
- // Converted the Byte value 255 to the Int32 value 255.
- //
- }
-
- private static void ConvertChar()
- {
- //
- char[] chars = { 'a', 'z', '\u0007', '\u03FF',
- '\u7FFF', '\uFFFE' };
- int result;
-
- foreach (char ch in chars)
- {
- try {
- result = Convert.ToInt32(ch);
- Console.WriteLine($"Converted the {ch.GetType().Name} value '{ch}' to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"Unable to convert u+{((int)ch).ToString("X4")} to an Int32.");
- }
- }
- // The example displays the following output:
- // Converted the Char value 'a' to the Int32 value 97.
- // Converted the Char value 'z' to the Int32 value 122.
- // Converted the Char value '' to the Int32 value 7.
- // Converted the Char value 'Ͽ' to the Int32 value 1023.
- // Converted the Char value '翿' to the Int32 value 32767.
- // Converted the Char value '' to the Int32 value 65534.
- //
- }
-
- private static void ConvertDecimal()
- {
- //
- decimal[] values= { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
- 199.55m, 9214.16m, Decimal.MaxValue };
- int result;
-
- foreach (decimal value in values)
- {
- try {
- result = Convert.ToInt32(value);
- Console.WriteLine($"Converted the {value.GetType().Name} value '{value}' to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"{value} is outside the range of the Int32 type.");
- }
- }
- // The example displays the following output:
- // -79228162514264337593543950335 is outside the range of the Int32 type.
- // Converted the Decimal value '-1034.23' to the Int32 value -1034.
- // Converted the Decimal value '-12' to the Int32 value -12.
- // Converted the Decimal value '0' to the Int32 value 0.
- // Converted the Decimal value '147' to the Int32 value 147.
- // Converted the Decimal value '199.55' to the Int32 value 200.
- // Converted the Decimal value '9214.16' to the Int32 value 9214.
- // 79228162514264337593543950335 is outside the range of the Int32 type.
- //
- }
-
- private static void ConvertDouble()
- {
- //
- double[] values= { Double.MinValue, -1.38e10, -1023.299, -12.98,
- 0, 9.113e-16, 103.919, 17834.191, Double.MaxValue };
- int result;
-
- foreach (double value in values)
- {
- try {
- result = Convert.ToInt32(value);
- Console.WriteLine($"Converted the {value.GetType().Name} value '{value}' to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"{value} is outside the range of the Int32 type.");
- }
- }
- // -1.79769313486232E+308 is outside the range of the Int32 type.
- // -13800000000 is outside the range of the Int32 type.
- // Converted the Double value '-1023.299' to the Int32 value -1023.
- // Converted the Double value '-12.98' to the Int32 value -13.
- // Converted the Double value '0' to the Int32 value 0.
- // Converted the Double value '9.113E-16' to the Int32 value 0.
- // Converted the Double value '103.919' to the Int32 value 104.
- // Converted the Double value '17834.191' to the Int32 value 17834.
- // 1.79769313486232E+308 is outside the range of the Int32 type.
- //
- }
-
- private static void ConvertInt16()
- {
- //
- short[] numbers= { Int16.MinValue, -1, 0, 121, 340, Int16.MaxValue };
- int result;
-
- foreach (short number in numbers)
- {
- result = Convert.ToInt32(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to a {result.GetType().Name} value {result}.");
- }
- // The example displays the following output:
- // Converted the Int16 value -32768 to a Int32 value -32768.
- // Converted the Int16 value -1 to a Int32 value -1.
- // Converted the Int16 value 0 to a Int32 value 0.
- // Converted the Int16 value 121 to a Int32 value 121.
- // Converted the Int16 value 340 to a Int32 value 340.
- // Converted the Int16 value 32767 to a Int32 value 32767.
- //
- }
-
- private static void ConvertInt64()
- {
- //
- long[] numbers = { Int64.MinValue, -1, 0, 121, 340, Int64.MaxValue };
- int result;
- foreach (long number in numbers)
- {
- try {
- result = Convert.ToInt32(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Int32 type.");
- }
- }
- // The example displays the following output:
- // The Int64 value -9223372036854775808 is outside the range of the Int32 type.
- // Converted the Int64 value -1 to the Int32 value -1.
- // Converted the Int64 value 0 to the Int32 value 0.
- // Converted the Int64 value 121 to the Int32 value 121.
- // Converted the Int64 value 340 to the Int32 value 340.
- // The Int64 value 9223372036854775807 is outside the range of the Int32 type.
- //
- }
-
- private static void ConvertObject()
- {
- //
- object[] values = { true, -12, 163, 935, 'x', new DateTime(2009, 5, 12),
- "104", "103.0", "-1",
- "1.00e2", "One", 1.00e2, 16.3e42};
- int result;
-
- foreach (object value in values)
- {
- try {
- result = Convert.ToInt32(value);
- Console.WriteLine($"Converted the {value.GetType().Name} value {value} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"The {value.GetType().Name} value {value} is outside the range of the Int32 type.");
- }
- catch (FormatException) {
- Console.WriteLine($"The {value.GetType().Name} value {value} is not in a recognizable format.");
- }
- catch (InvalidCastException) {
- Console.WriteLine($"No conversion to an Int32 exists for the {value.GetType().Name} value {value}.");
- }
- }
- // The example displays the following output:
- // Converted the Boolean value True to the Int32 value 1.
- // Converted the Int32 value -12 to the Int32 value -12.
- // Converted the Int32 value 163 to the Int32 value 163.
- // Converted the Int32 value 935 to the Int32 value 935.
- // Converted the Char value x to the Int32 value 120.
- // No conversion to an Int32 exists for the DateTime value 5/12/2009 12:00:00 AM.
- // Converted the String value 104 to the Int32 value 104.
- // The String value 103.0 is not in a recognizable format.
- // Converted the String value -1 to the Int32 value -1.
- // The String value 1.00e2 is not in a recognizable format.
- // The String value One is not in a recognizable format.
- // Converted the Double value 100 to the Int32 value 100.
- // The Double value 1.63E+43 is outside the range of the Int32 type.
- //
- }
-
- private static void ConvertSByte()
- {
- //
- sbyte[] numbers = { SByte.MinValue, -1, 0, 10, SByte.MaxValue };
- int result;
-
- foreach (sbyte number in numbers)
- {
- result = Convert.ToInt32(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- // The example displays the following output:
- // Converted the SByte value -128 to the Int32 value -128.
- // Converted the SByte value -1 to the Int32 value -1.
- // Converted the SByte value 0 to the Int32 value 0.
- // Converted the SByte value 10 to the Int32 value 10.
- // Converted the SByte value 127 to the Int32 value 127.
- //
- }
-
- private static void ConvertSingle()
- {
- //
- float[] values= { Single.MinValue, -1.38e10f, -1023.299f, -12.98f,
- 0f, 9.113e-16f, 103.919f, 17834.191f, Single.MaxValue };
- int result;
-
- foreach (float value in values)
- {
- try {
- result = Convert.ToInt32(value);
- Console.WriteLine($"Converted the {value.GetType().Name} value {value} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"{value} is outside the range of the Int32 type.");
- }
- }
- // The example displays the following output:
- // -3.40282346638529E+38 is outside the range of the Int32 type.
- // -13799999488 is outside the range of the Int32 type.
- // Converted the Double value -1023.29901123047 to the Int32 value -1023.
- // Converted the Double value -12.9799995422363 to the Int32 value -13.
- // Converted the Double value 0 to the Int32 value 0.
- // Converted the Double value 9.11299983940444E-16 to the Int32 value 0.
- // Converted the Double value 103.918998718262 to the Int32 value 104.
- // Converted the Double value 17834.19140625 to the Int32 value 17834.
- // 3.40282346638529E+38 is outside the range of the Int32 type.
- //
- }
-
- private static void ConvertString()
- {
- //
- string[] values = { "One", "1.34e28", "-26.87", "-18", "-6.00",
- " 0", "137", "1601.9", Int32.MaxValue.ToString() };
- int result;
-
- foreach (string value in values)
- {
- try {
- result = Convert.ToInt32(value);
- Console.WriteLine($"Converted the {value.GetType().Name} value '{value}' to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"{value} is outside the range of the Int32 type.");
- }
- catch (FormatException) {
- Console.WriteLine($"The {value.GetType().Name} value '{value}' is not in a recognizable format.");
- }
- }
- // The example displays the following output:
- // The String value 'One' is not in a recognizable format.
- // The String value '1.34e28' is not in a recognizable format.
- // The String value '-26.87' is not in a recognizable format.
- // Converted the String value '-18' to the Int32 value -18.
- // The String value '-6.00' is not in a recognizable format.
- // Converted the String value ' 0' to the Int32 value 0.
- // Converted the String value '137' to the Int32 value 137.
- // The String value '1601.9' is not in a recognizable format.
- // Converted the String value '2147483647' to the Int32 value 2147483647.
- //
- }
-
- private static void ConvertUInt16()
- {
- //
- ushort[] numbers = { UInt16.MinValue, 121, 340, UInt16.MaxValue };
- int result;
- foreach (ushort number in numbers)
- {
- try {
- result = Convert.ToInt32(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Int32 type.");
- }
- }
- // The example displays the following output:
- // Converted the UInt16 value 0 to the Int32 value 0.
- // Converted the UInt16 value 121 to the Int32 value 121.
- // Converted the UInt16 value 340 to the Int32 value 340.
- // Converted the UInt16 value 65535 to the Int32 value 65535.
- //
- }
-
- private static void ConvertUInt32()
- {
- //
- uint[] numbers = { UInt32.MinValue, 121, 340, UInt32.MaxValue };
- int result;
- foreach (uint number in numbers)
- {
- try {
- result = Convert.ToInt32(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Int32 type.");
- }
- }
- // The example displays the following output:
- // Converted the UInt32 value 0 to the Int32 value 0.
- // Converted the UInt32 value 121 to the Int32 value 121.
- // Converted the UInt32 value 340 to the Int32 value 340.
- // The UInt32 value 4294967295 is outside the range of the Int32 type.
- //
- }
-
- private static void ConvertUInt64()
- {
- //
- ulong[] numbers = { UInt64.MinValue, 121, 340, UInt64.MaxValue };
- int result;
- foreach (ulong number in numbers)
- {
- try {
- result = Convert.ToInt32(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to a {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Int32 type.");
- }
- }
- // The example displays the following output:
- // Converted the UInt64 value 0 to a Int32 value 0.
- // Converted the UInt64 value 121 to a Int32 value 121.
- // Converted the UInt64 value 340 to a Int32 value 340.
- // The UInt64 value 18446744073709551615 is outside the range of the Int32 type.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/csharp/toint64_1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/csharp/toint64_1.cs
deleted file mode 100644
index 2e0b517ad28bb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/csharp/toint64_1.cs
+++ /dev/null
@@ -1,377 +0,0 @@
-using System;
-
-public class Example
-{
- public static void Main()
- {
- ConvertBoolean();
- Console.WriteLine("-----");
- ConvertByte();
- Console.WriteLine("-----");
- ConvertChar();
- Console.WriteLine("-----");
- ConvertDecimal();
- Console.WriteLine("-----");
- ConvertDouble();
- Console.WriteLine("-----");
- ConvertInt16();
- Console.WriteLine("-----");
- ConvertInt32();
- Console.WriteLine("-----");
- ConvertObject();
- Console.WriteLine("-----");
- ConvertSByte();
- Console.WriteLine("-----");
- ConvertSingle();
- Console.WriteLine("----");
- ConvertString();
- Console.WriteLine("-----");
- ConvertUInt16();
- Console.WriteLine("-----");
- ConvertUInt32();
- Console.WriteLine("-----");
- ConvertUInt64();
- }
-
- private static void ConvertBoolean()
- {
- //
- bool falseFlag = false;
- bool trueFlag = true;
-
- Console.WriteLine($"{falseFlag} converts to {Convert.ToInt64(falseFlag)}.");
- Console.WriteLine($"{trueFlag} converts to {Convert.ToInt64(trueFlag)}.");
- // The example displays the following output:
- // False converts to 0.
- // True converts to 1.
- //
- }
-
- private static void ConvertByte()
- {
- //
- byte[] bytes = { Byte.MinValue, 14, 122, Byte.MaxValue};
- long result;
-
- foreach (byte byteValue in bytes)
- {
- result = Convert.ToInt64(byteValue);
- Console.WriteLine($"Converted the {byteValue.GetType().Name} value {byteValue} to the {result.GetType().Name} value {result}.");
- }
- // The example displays the following output:
- // Converted the Byte value 0 to the Int64 value 0.
- // Converted the Byte value 14 to the Int64 value 14.
- // Converted the Byte value 122 to the Int64 value 122.
- // Converted the Byte value 255 to the Int64 value 255.
- //
- }
-
- private static void ConvertChar()
- {
- //
- char[] chars = { 'a', 'z', '\u0007', '\u03FF',
- '\u7FFF', '\uFFFE' };
- long result;
-
- foreach (char ch in chars)
- {
- result = Convert.ToInt64(ch);
- Console.WriteLine($"Converted the {ch.GetType().Name} value '{ch}' to the {result.GetType().Name} value {result}.");
- }
- // The example displays the following output:
- // Converted the Char value 'a' to the Int64 value 97.
- // Converted the Char value 'z' to the Int64 value 122.
- // Converted the Char value '' to the Int64 value 7.
- // Converted the Char value 'Ͽ' to the Int64 value 1023.
- // Converted the Char value '翿' to the Int64 value 32767.
- // Converted the Char value '' to the Int64 value 65534.
- //
- }
-
- private static void ConvertDecimal()
- {
- //
- decimal[] values= { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
- 199.55m, 9214.16m, Decimal.MaxValue };
- long result;
-
- foreach (decimal value in values)
- {
- try {
- result = Convert.ToInt64(value);
- Console.WriteLine($"Converted the {value.GetType().Name} value '{value}' to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"{value} is outside the range of the Int64 type.");
- }
- }
- // The example displays the following output:
- // -79228162514264337593543950335 is outside the range of the Int64 type.
- // Converted the Decimal value '-1034.23' to the Int64 value -1034.
- // Converted the Decimal value '-12' to the Int64 value -12.
- // Converted the Decimal value '0' to the Int64 value 0.
- // Converted the Decimal value '147' to the Int64 value 147.
- // Converted the Decimal value '199.55' to the Int64 value 200.
- // Converted the Decimal value '9214.16' to the Int64 value 9214.
- // 79228162514264337593543950335 is outside the range of the Int64 type.
- //
- }
-
- private static void ConvertDouble()
- {
- //
- double[] values= { Double.MinValue, -1.38e10, -1023.299, -12.98,
- 0, 9.113e-16, 103.919, 17834.191, Double.MaxValue };
- long result;
-
- foreach (double value in values)
- {
- try {
- result = Convert.ToInt64(value);
- Console.WriteLine($"Converted the {value.GetType().Name} value '{value}' to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"{value} is outside the range of the Int64 type.");
- }
- }
- // -1.7976931348623157E+308 is outside the range of the Int64 type.
- // Converted the Double value '-13800000000' to the Int64 value -13800000000.
- // Converted the Double value '-1023.299' to the Int64 value -1023.
- // Converted the Double value '-12.98' to the Int64 value -13.
- // Converted the Double value '0' to the Int64 value 0.
- // Converted the Double value '9.113E-16' to the Int64 value 0.
- // Converted the Double value '103.919' to the Int64 value 104.
- // Converted the Double value '17834.191' to the Int64 value 17834.
- // 1.7976931348623157E+308 is outside the range of the Int64 type.
- //
- }
-
- private static void ConvertInt16()
- {
- //
- short[] numbers= { Int16.MinValue, -1, 0, 121, 340, Int16.MaxValue };
- long result;
-
- foreach (short number in numbers)
- {
- result = Convert.ToInt64(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to a {result.GetType().Name} value {result}.");
- }
- // The example displays the following output:
- // Converted the Int16 value -32768 to a Int32 value -32768.
- // Converted the Int16 value -1 to a Int32 value -1.
- // Converted the Int16 value 0 to a Int32 value 0.
- // Converted the Int16 value 121 to a Int32 value 121.
- // Converted the Int16 value 340 to a Int32 value 340.
- // Converted the Int16 value 32767 to a Int32 value 32767.
- //
- }
-
- private static void ConvertInt32()
- {
- //
- int[] numbers = { Int32.MinValue, -1, 0, 121, 340, Int32.MaxValue };
- long result;
- foreach (int number in numbers)
- {
- result = Convert.ToInt64(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- // The example displays the following output:
- // Converted the Int32 value -2147483648 to the Int64 value -2147483648.
- // Converted the Int32 value -1 to the Int64 value -1.
- // Converted the Int32 value 0 to the Int64 value 0.
- // Converted the Int32 value 121 to the Int64 value 121.
- // Converted the Int32 value 340 to the Int64 value 340.
- // Converted the Int32 value 2147483647 to the Int64 value 2147483647.
- //
- }
-
- private static void ConvertObject()
- {
- //
- object[] values = { true, -12, 163, 935, 'x', new DateTime(2009, 5, 12),
- "104", "103.0", "-1",
- "1.00e2", "One", 1.00e2, 16.3e42};
- long result;
-
- foreach (object value in values)
- {
- try {
- result = Convert.ToInt64(value);
- Console.WriteLine($"Converted the {value.GetType().Name} value {value} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"The {value.GetType().Name} value {value} is outside the range of the Int64 type.");
- }
- catch (FormatException) {
- Console.WriteLine($"The {value.GetType().Name} value {value} is not in a recognizable format.");
- }
- catch (InvalidCastException) {
- Console.WriteLine($"No conversion to an Int64 exists for the {value.GetType().Name} value {value}.");
- }
- }
- // The example displays the following output:
- // Converted the Boolean value True to the Int64 value 1.
- // Converted the Int32 value -12 to the Int64 value -12.
- // Converted the Int32 value 163 to the Int64 value 163.
- // Converted the Int32 value 935 to the Int64 value 935.
- // Converted the Char value x to the Int64 value 120.
- // No conversion to an Int64 exists for the DateTime value 5/12/2009 12:00:00 AM.
- // Converted the String value 104 to the Int64 value 104.
- // The String value 103.0 is not in a recognizable format.
- // Converted the String value -1 to the Int64 value -1.
- // The String value 1.00e2 is not in a recognizable format.
- // The String value One is not in a recognizable format.
- // Converted the Double value 100 to the Int64 value 100.
- // The Double value 1.63E+43 is outside the range of the Int64 type.
- //
- }
-
- private static void ConvertSByte()
- {
- //
- sbyte[] numbers = { SByte.MinValue, -1, 0, 10, SByte.MaxValue };
- long result;
-
- foreach (sbyte number in numbers)
- {
- result = Convert.ToInt64(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- // The example displays the following output:
- // Converted the SByte value -128 to the Int64 value -128.
- // Converted the SByte value -1 to the Int64 value -1.
- // Converted the SByte value 0 to the Int64 value 0.
- // Converted the SByte value 10 to the Int64 value 10.
- // Converted the SByte value 127 to the Int64 value 127.
- //
- }
-
- private static void ConvertSingle()
- {
- //
- float[] values= { Single.MinValue, -1.38e10f, -1023.299f, -12.98f,
- 0f, 9.113e-16f, 103.919f, 17834.191f, Single.MaxValue };
- long result;
-
- foreach (float value in values)
- {
- try {
- result = Convert.ToInt64(value);
- Console.WriteLine($"Converted the {value.GetType().Name} value {value} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"{value} is outside the range of the Int64 type.");
- }
- }
- // The example displays the following output:
- // -3.4028235E+38 is outside the range of the Int64 type.
- // Converted the Single value -1.38E+10 to the Int64 value -13799999488.
- // Converted the Single value -1023.299 to the Int64 value -1023.
- // Converted the Single value -12.98 to the Int64 value -13.
- // Converted the Single value 0 to the Int64 value 0.
- // Converted the Single value 9.113E-16 to the Int64 value 0.
- // Converted the Single value 103.919 to the Int64 value 104.
- // Converted the Single value 17834.191 to the Int64 value 17834.
- // 3.4028235E+38 is outside the range of the Int64 type.
- //
- }
-
- private static void ConvertString()
- {
- //
- string[] values = { "One", "1.34e28", "-26.87", "-18", "-6.00",
- " 0", "137", "1601.9", Int32.MaxValue.ToString() };
- long result;
-
- foreach (string value in values)
- {
- try {
- result = Convert.ToInt64(value);
- Console.WriteLine($"Converted the {value.GetType().Name} value '{value}' to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"{value} is outside the range of the Int64 type.");
- }
- catch (FormatException) {
- Console.WriteLine($"The {value.GetType().Name} value '{value}' is not in a recognizable format.");
- }
- }
- // The example displays the following output:
- // The String value 'One' is not in a recognizable format.
- // The String value '1.34e28' is not in a recognizable format.
- // The String value '-26.87' is not in a recognizable format.
- // Converted the String value '-18' to the Int64 value -18.
- // The String value '-6.00' is not in a recognizable format.
- // Converted the String value ' 0' to the Int64 value 0.
- // Converted the String value '137' to the Int64 value 137.
- // The String value '1601.9' is not in a recognizable format.
- // Converted the String value '2147483647' to the Int64 value 2147483647.
- //
- }
-
- private static void ConvertUInt16()
- {
- //
- ushort[] numbers = { UInt16.MinValue, 121, 340, UInt16.MaxValue };
- long result;
- foreach (ushort number in numbers)
- {
- try {
- result = Convert.ToInt64(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Int64 type.");
- }
- }
- // The example displays the following output:
- // Converted the UInt16 value 0 to the Int64 value 0.
- // Converted the UInt16 value 121 to the Int64 value 121.
- // Converted the UInt16 value 340 to the Int64 value 340.
- // Converted the UInt16 value 65535 to the Int64 value 65535.
- //
- }
-
- private static void ConvertUInt32()
- {
- //
- uint[] numbers = { UInt32.MinValue, 121, 340, UInt32.MaxValue };
- long result;
- foreach (uint number in numbers)
- {
- result = Convert.ToInt64(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number:N0} to the {result.GetType().Name} value {result:N0}.");
- }
- // The example displays the following output:
- // Converted the UInt32 value 0 to the Int64 value 0.
- // Converted the UInt32 value 121 to the Int64 value 121.
- // Converted the UInt32 value 340 to the Int64 value 340.
- // Converted the UInt32 value 4,294,967,295 to the Int64 value 4,294,967,295.
- //
- }
-
- private static void ConvertUInt64()
- {
- //
- ulong[] numbers = { UInt64.MinValue, 121, 340, UInt64.MaxValue };
- long result;
- foreach (ulong number in numbers)
- {
- try {
- result = Convert.ToInt64(number);
- Console.WriteLine($"Converted the {number.GetType().Name} value {number} to a {result.GetType().Name} value {result}.");
- }
- catch (OverflowException) {
- Console.WriteLine($"The {number.GetType().Name} value {number} is outside the range of the Int64 type.");
- }
- }
- // The example displays the following output:
- // Converted the UInt64 value 0 to a Int32 value 0.
- // Converted the UInt64 value 121 to a Int32 value 121.
- // Converted the UInt64 value 340 to a Int32 value 340.
- // The UInt64 value 18446744073709551615 is outside the range of the Int64 type.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/fsharp/formatting1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/fsharp/formatting1.fs
deleted file mode 100644
index be5580ca798b0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/fsharp/formatting1.fs
+++ /dev/null
@@ -1,53 +0,0 @@
-open System
-
-let callToString () =
- //
- let numbers = [| -1403L; 0L; 169L; 1483104L |]
- for number in numbers do
- // Display value using default formatting.
- printf $"{number.ToString(),-8} --> "
- // Display value with 3 digits and leading zeros.
- printf $"{number,8:D3}"
- // Display value with 1 decimal digit.
- printf $"{number,13:N1}"
- // Display value as hexadecimal.
- printf $"{number,18:X2}"
- // Display value with eight hexadecimal digits.
- printfn $"{number,18:X8}"
-
- // The example displays the following output:
- // -1403 --> -1403 -1,403.0 FFFFFFFFFFFFFA85 FFFFFFFFFFFFFA85
- // 0 --> 000 0.0 00 00000000
- // 169 --> 169 169.0 A9 000000A9
- // 1483104 --> 1483104 1,483,104.0 16A160 0016A160
- //
-
-let callConvert () =
- //
- let numbers = [| -146L; 11043L; 2781913L |]
- for number in numbers do
- printfn $"{number} (Base 10):"
- printfn $" Binary: {Convert.ToString(number, 2)}"
- printfn $" Octal: {Convert.ToString(number, 8)}"
- printfn $" Hex: {Convert.ToString(number, 16)}\n"
-
- // The example displays the following output:
- // -146 (Base 10):
- // Binary: 1111111111111111111111111111111111111111111111111111111101101110
- // Octal: 1777777777777777777556
- // Hex: ffffffffffffff6e
- //
- // 11043 (Base 10):
- // Binary: 10101100100011
- // Octal: 25443
- // Hex: 2b23
- //
- // 2781913 (Base 10):
- // Binary: 1010100111001011011001
- // Octal: 12471331
- // Hex: 2a72d9
- //
-
-callToString ()
-printfn "-----"
-callConvert ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/fsharp/toint64_1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/fsharp/toint64_1.fs
deleted file mode 100644
index 4e9e3f9e195ca..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Convert/ToInt64/fsharp/toint64_1.fs
+++ /dev/null
@@ -1,310 +0,0 @@
-open System
-
-let convertBoolean () =
- //
- let falseFlag = false
- let trueFlag = true
-
- printfn $"{falseFlag} converts to {Convert.ToInt64 falseFlag}."
- printfn $"{trueFlag} converts to {Convert.ToInt64 trueFlag}."
-
- // The example displays the following output:
- // False converts to 0.
- // True converts to 1.
- //
-
-let convertByte () =
- //
- let bytes = [| Byte.MinValue; 14uy; 122uy; Byte.MaxValue |]
-
- for byteValue in bytes do
- let result = Convert.ToInt64 byteValue
- printfn $"Converted the {byteValue.GetType().Name} value {byteValue} to the {result.GetType().Name} value {result}."
-
- // The example displays the following output:
- // Converted the Byte value 0 to the Int64 value 0.
- // Converted the Byte value 14 to the Int64 value 14.
- // Converted the Byte value 122 to the Int64 value 122.
- // Converted the Byte value 255 to the Int64 value 255.
- //
-
-let convertChar () =
- //
- let chars = [| 'a'; 'z'; '\u0007'; '\u03FF'; '\u7FFF'; '\uFFFE' |]
-
- for ch in chars do
- let result = Convert.ToInt64 ch
- printfn $"Converted the {ch.GetType().Name} value '{ch}' to the {result.GetType().Name} value {result}."
-
-
- // The example displays the following output:
- // Converted the Char value 'a' to the Int64 value 97.
- // Converted the Char value 'z' to the Int64 value 122.
- // Converted the Char value '' to the Int64 value 7.
- // Converted the Char value 'Ͽ' to the Int64 value 1023.
- // Converted the Char value '翿' to the Int64 value 32767.
- // Converted the Char value '' to the Int64 value 65534.
- //
-
-let convertDecimal () =
- //
- let values=
- [| Decimal.MinValue; -1034.23M; -12M; 0M; 147M
- 199.55M; 9214.16M; Decimal.MaxValue |]
-
- for value in values do
- try
- let result = Convert.ToInt64 value
- printfn $"Converted the {value.GetType().Name} value '{value}' to the {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"{value} is outside the range of the Int64 type."
-
- // The example displays the following output:
- // -79228162514264337593543950335 is outside the range of the Int64 type.
- // Converted the Decimal value '-1034.23' to the Int64 value -1034.
- // Converted the Decimal value '-12' to the Int64 value -12.
- // Converted the Decimal value '0' to the Int64 value 0.
- // Converted the Decimal value '147' to the Int64 value 147.
- // Converted the Decimal value '199.55' to the Int64 value 200.
- // Converted the Decimal value '9214.16' to the Int64 value 9214.
- // 79228162514264337593543950335 is outside the range of the Int64 type.
- //
-
-
-let convertDouble () =
- //
- let values= [| Double.MinValue; -1.38e10; -1023.299; -12.98
- 0; 9.113e-16; 103.919; 17834.191; Double.MaxValue |]
-
- for value in values do
- try
- let result = Convert.ToInt64 value
- printfn $"Converted the {value.GetType().Name} value '{value}' to the {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"{value} is outside the range of the Int64 type."
-
- // -1.7976931348623157E+308 is outside the range of the Int64 type.
- // Converted the Double value '-13800000000' to the Int64 value -13800000000.
- // Converted the Double value '-1023.299' to the Int64 value -1023.
- // Converted the Double value '-12.98' to the Int64 value -13.
- // Converted the Double value '0' to the Int64 value 0.
- // Converted the Double value '9.113E-16' to the Int64 value 0.
- // Converted the Double value '103.919' to the Int64 value 104.
- // Converted the Double value '17834.191' to the Int64 value 17834.
- // 1.7976931348623157E+308 is outside the range of the Int64 type.
- //
-
-let convertInt16 () =
- //
- let numbers = [| Int16.MinValue; -1s; 0s; 121s; 340s; Int16.MaxValue |]
-
- for number in numbers do
- let result = Convert.ToInt64 number
- printfn $"Converted the {number.GetType().Name} value {number} to a {result.GetType().Name} value {result}."
-
- // The example displays the following output:
- // Converted the Int16 value -32768 to a Int32 value -32768.
- // Converted the Int16 value -1 to a Int32 value -1.
- // Converted the Int16 value 0 to a Int32 value 0.
- // Converted the Int16 value 121 to a Int32 value 121.
- // Converted the Int16 value 340 to a Int32 value 340.
- // Converted the Int16 value 32767 to a Int32 value 32767.
- //
-
-let convertInt32 () =
- //
- let numbers = [| Int32.MinValue; -1; 0; 121; 340; Int32.MaxValue |]
-
- for number in numbers do
- let result = Convert.ToInt64 number
- printfn $"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}."
-
- // The example displays the following output:
- // Converted the Int32 value -2147483648 to the Int64 value -2147483648.
- // Converted the Int32 value -1 to the Int64 value -1.
- // Converted the Int32 value 0 to the Int64 value 0.
- // Converted the Int32 value 121 to the Int64 value 121.
- // Converted the Int32 value 340 to the Int64 value 340.
- // Converted the Int32 value 2147483647 to the Int64 value 2147483647.
- //
-
-let convertObject () =
- //
- let values: obj [] =
- [| true; -12; 163; 935; 'x'; DateTime(2009, 5, 12); "104"
- "103.0"; "-1"; "1.00e2"; "One"; 1.00e2; 16.3e42 |]
-
- for value in values do
- try
- let result = Convert.ToInt64 value
- printfn $"Converted the {value.GetType().Name} value {value} to the {result.GetType().Name} value {result}."
- with
- | :? OverflowException ->
- printfn $"The {value.GetType().Name} value {value} is outside the range of the Int64 type."
- | :? FormatException ->
- printfn $"The {value.GetType().Name} value {value} is not in a recognizable format."
- | :? InvalidCastException ->
- printfn $"No conversion to an Int64 exists for the {value.GetType().Name} value {value}."
-
- // The example displays the following output:
- // Converted the Boolean value True to the Int64 value 1.
- // Converted the Int32 value -12 to the Int64 value -12.
- // Converted the Int32 value 163 to the Int64 value 163.
- // Converted the Int32 value 935 to the Int64 value 935.
- // Converted the Char value x to the Int64 value 120.
- // No conversion to an Int64 exists for the DateTime value 5/12/2009 12:00:00 AM.
- // Converted the String value 104 to the Int64 value 104.
- // The String value 103.0 is not in a recognizable format.
- // Converted the String value -1 to the Int64 value -1.
- // The String value 1.00e2 is not in a recognizable format.
- // The String value One is not in a recognizable format.
- // Converted the Double value 100 to the Int64 value 100.
- // The Double value 1.63E+43 is outside the range of the Int64 type.
- //
-
-let convertSByte () =
- //
- let numbers = [| SByte.MinValue; -1y; 0y; 10y; SByte.MaxValue |]
-
- for number in numbers do
- let result = Convert.ToInt64 number
- printfn $"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}."
-
- // The example displays the following output:
- // Converted the SByte value -128 to the Int64 value -128.
- // Converted the SByte value -1 to the Int64 value -1.
- // Converted the SByte value 0 to the Int64 value 0.
- // Converted the SByte value 10 to the Int64 value 10.
- // Converted the SByte value 127 to the Int64 value 127.
- //
-
-let convertSingle () =
- //
- let values = [| Single.MinValue; -1.38e10f; -1023.299f; -12.98f
- 0f; 9.113e-16f; 103.919f; 17834.191f; Single.MaxValue |]
-
- for value in values do
- try
- let result = Convert.ToInt64 value
- printfn $"Converted the {value.GetType().Name} value '{value}' to the {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"{value} is outside the range of the Int64 type."
-
- // The example displays the following output:
- // -3.4028235E+38 is outside the range of the Int64 type.
- // Converted the Single value -1.38E+10 to the Int64 value -13799999488.
- // Converted the Single value -1023.299 to the Int64 value -1023.
- // Converted the Single value -12.98 to the Int64 value -13.
- // Converted the Single value 0 to the Int64 value 0.
- // Converted the Single value 9.113E-16 to the Int64 value 0.
- // Converted the Single value 103.919 to the Int64 value 104.
- // Converted the Single value 17834.191 to the Int64 value 17834.
- // 3.4028235E+38 is outside the range of the Int64 type.
- //
-
-let convertString () =
- //
- let values =
- [| "One"; "1.34e28"; "-26.87"; "-18"; "-6.00"
- " 0"; "137"; "1601.9"; string Int32.MaxValue |]
-
- for value in values do
- try
- let result = Convert.ToInt64 value
- printfn $"Converted the {value.GetType().Name} value {value} to the {result.GetType().Name} value {result}."
- with
- | :? OverflowException ->
- printfn $"The {value.GetType().Name} value {value} is outside the range of the Int64 type."
- | :? FormatException ->
- printfn $"The {value.GetType().Name} value {value} is not in a recognizable format."
-
- // The example displays the following output:
- // The String value 'One' is not in a recognizable format.
- // The String value '1.34e28' is not in a recognizable format.
- // The String value '-26.87' is not in a recognizable format.
- // Converted the String value '-18' to the Int64 value -18.
- // The String value '-6.00' is not in a recognizable format.
- // Converted the String value ' 0' to the Int64 value 0.
- // Converted the String value '137' to the Int64 value 137.
- // The String value '1601.9' is not in a recognizable format.
- // Converted the String value '2147483647' to the Int64 value 2147483647.
- //
-
-let convertUInt16 () =
- //
- let numbers = [| UInt16.MinValue; 121us; 340us; UInt16.MaxValue |]
-
- for value in numbers do
- try
- let result = Convert.ToInt64 value
- printfn $"Converted the {value.GetType().Name} value {value} to the {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"The {value.GetType().Name} value {value} is outside the range of the Int64 type."
-
- // The example displays the following output:
- // Converted the UInt16 value 0 to the Int64 value 0.
- // Converted the UInt16 value 121 to the Int64 value 121.
- // Converted the UInt16 value 340 to the Int64 value 340.
- // Converted the UInt16 value 65535 to the Int64 value 65535.
- //
-
-let convertUInt32 () =
- //
- let numbers = [| UInt32.MinValue; 121u; 340u; UInt32.MaxValue |]
-
- for number in numbers do
- let result = Convert.ToInt64 number
- printfn $"Converted the {number.GetType().Name} value {number:N0} to the {result.GetType().Name} value {result:N0}."
-
- // The example displays the following output:
- // Converted the UInt32 value 0 to the Int64 value 0.
- // Converted the UInt32 value 121 to the Int64 value 121.
- // Converted the UInt32 value 340 to the Int64 value 340.
- // Converted the UInt32 value 4,294,967,295 to the Int64 value 4,294,967,295.
- //
-
-let convertUInt64 () =
- //
- let numbers = [| UInt64.MinValue; 121uL; 340uL; UInt64.MaxValue |]
-
- for number in numbers do
- try
- let result = Convert.ToInt64 number
- printfn $"Converted the {number.GetType().Name} value {number} to a {result.GetType().Name} value {result}."
- with :? OverflowException ->
- printfn $"The {number.GetType().Name} value {number} is outside the range of the Int64 type."
-
- // The example displays the following output:
- // Converted the UInt64 value 0 to a Int32 value 0.
- // Converted the UInt64 value 121 to a Int32 value 121.
- // Converted the UInt64 value 340 to a Int32 value 340.
- // The UInt64 value 18446744073709551615 is outside the range of the Int64 type.
- // s
-
-convertBoolean ()
-printfn "-----"
-convertByte ()
-printfn "-----"
-convertChar ()
-printfn "-----"
-convertDecimal ()
-printfn "-----"
-convertDouble ()
-printfn "-----"
-convertInt16 ()
-printfn "-----"
-convertInt32 ()
-printfn "-----"
-convertObject ()
-printfn "-----"
-convertSByte ()
-printfn "-----"
-convertSingle ()
-printfn "----"
-convertString ()
-printfn "-----"
-convertUInt16 ()
-printfn "-----"
-convertUInt32 ()
-printfn "-----"
-convertUInt64 ()
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/csharp/frombinary1.cs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/csharp/frombinary1.cs
deleted file mode 100644
index 7a1e3c7fe5812..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/csharp/frombinary1.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-using System;
-
-public class Example
-{
- public static void Main()
- {
- DateTime localDate = new DateTime(2010, 3, 14, 2, 30, 0, DateTimeKind.Local);
- long binLocal = localDate.ToBinary();
- if (TimeZoneInfo.Local.IsInvalidTime(localDate))
- Console.WriteLine($"{localDate} is an invalid time in the {TimeZoneInfo.Local.StandardName} zone.");
-
- DateTime localDate2 = DateTime.FromBinary(binLocal);
- Console.WriteLine($"{localDate} = {localDate2}: {localDate.Equals(localDate2)}");
- }
-}
-// The example displays the following output:
-// 3/14/2010 2:30:00 AM is an invalid time in the Pacific Standard Time zone.
-// 3/14/2010 2:30:00 AM = 3/14/2010 3:30:00 AM: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/fsharp/frombinary1.fs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/fsharp/frombinary1.fs
deleted file mode 100644
index 2a6c752eda83b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/fsharp/frombinary1.fs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-open System
-
-let localDate = DateTime(2010, 3, 14, 2, 30, 0, DateTimeKind.Local)
-let binLocal = localDate.ToBinary()
-if TimeZoneInfo.Local.IsInvalidTime localDate then
- printfn $"{localDate} is an invalid time in the {TimeZoneInfo.Local.StandardName} zone."
-
-let localDate2 = DateTime.FromBinary binLocal
-printfn $"{localDate} = {localDate2}: {localDate.Equals localDate2}"
-
-// The example displays the following output:
-// 3/14/2010 2:30:00 AM is an invalid time in the Pacific Standard Time zone.
-// 3/14/2010 2:30:00 AM = 3/14/2010 3:30:00 AM: False
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/vb/frombinary1.vb b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/vb/frombinary1.vb
deleted file mode 100644
index 1f0f3e918e793..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/FromBinary/vb/frombinary1.vb
+++ /dev/null
@@ -1,22 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- Dim localDate As Date = DateTime.SpecifyKind(#03/14/2010 2:30AM#, DateTimeKind.Local)
- Dim binLocal As Long = localDate.ToBinary()
- If TimeZoneInfo.Local.IsInvalidTime(localDate) Then
- Console.WriteLine("{0} is an invalid time in the {1} zone.", _
- localDate, _
- TimeZoneInfo.Local.StandardName)
- End If
- Dim localDate2 As Date = DateTime.FromBinary(binLocal)
- Console.WriteLine("{0} = {1}: {2}", _
- localDate, localDate2, localDate.Equals(localDate2))
- End Sub
-End Module
-' The example displays the following output:
-' 3/14/2010 2:30:00 AM is an invalid time in the Pacific Standard Time zone.
-' 3/14/2010 2:30:00 AM = 3/14/2010 3:30:00 AM: False
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Calendar.cs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Calendar.cs
deleted file mode 100644
index 09845d5232857..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Calendar.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-using System;
-
-namespace SystemDateTimeReference
-{
- public static class CalendarSamples
- {
- public static void Snippets()
- {
- ThaiBuddistEra();
- ThaiBuddhistEraParse();
- InstantiateCalendar();
- CalendarFields();
- CalculateWeeks();
- }
-
- private static void ThaiBuddistEra()
- {
- //
- var thTH = new System.Globalization.CultureInfo("th-TH");
- var value = new DateTime(2016, 5, 28);
-
- Console.WriteLine(value.ToString(thTH));
-
- thTH.DateTimeFormat.Calendar = new System.Globalization.GregorianCalendar();
- Console.WriteLine(value.ToString(thTH));
- // The example displays the following output:
- // 28/5/2559 0:00:00
- // 28/5/2016 0:00:00
- //
- }
-
- private static void ThaiBuddhistEraParse()
- {
- //
- var thTH = new System.Globalization.CultureInfo("th-TH");
- var value = DateTime.Parse("28/05/2559", thTH);
- Console.WriteLine(value.ToString(thTH));
-
- thTH.DateTimeFormat.Calendar = new System.Globalization.GregorianCalendar();
- Console.WriteLine(value.ToString(thTH));
- // The example displays the following output:
- // 28/5/2559 0:00:00
- // 28/5/2016 0:00:00
- //
- }
-
- private static void InstantiateCalendar()
- {
- //
- var thTH = new System.Globalization.CultureInfo("th-TH");
- var dat = new DateTime(2559, 5, 28, thTH.DateTimeFormat.Calendar);
- Console.WriteLine($"Thai Buddhist era date: {dat.ToString("d", thTH)}");
- Console.WriteLine($"Gregorian date: {dat:d}");
- // The example displays the following output:
- // Thai Buddhist Era Date: 28/5/2559
- // Gregorian Date: 28/05/2016
- //
- }
-
- private static void CalendarFields()
- {
- //
- var thTH = new System.Globalization.CultureInfo("th-TH");
- var cal = thTH.DateTimeFormat.Calendar;
- var dat = new DateTime(2559, 5, 28, cal);
- Console.WriteLine("Using the Thai Buddhist Era calendar:");
- Console.WriteLine($"Date: {dat.ToString("d", thTH)}");
- Console.WriteLine($"Year: {cal.GetYear(dat)}");
- Console.WriteLine($"Leap year: {cal.IsLeapYear(cal.GetYear(dat))}\n");
-
- Console.WriteLine("Using the Gregorian calendar:");
- Console.WriteLine($"Date: {dat:d}");
- Console.WriteLine($"Year: {dat.Year}");
- Console.WriteLine($"Leap year: {DateTime.IsLeapYear(dat.Year)}");
- // The example displays the following output:
- // Using the Thai Buddhist Era calendar
- // Date : 28/5/2559
- // Year: 2559
- // Leap year : True
- //
- // Using the Gregorian calendar
- // Date : 28/05/2016
- // Year: 2016
- // Leap year : True
- //
- }
-
- private static void CalculateWeeks()
- {
- //
- var thTH = new System.Globalization.CultureInfo("th-TH");
- var thCalendar = thTH.DateTimeFormat.Calendar;
- var dat = new DateTime(1395, 8, 18, thCalendar);
- Console.WriteLine("Using the Thai Buddhist Era calendar:");
- Console.WriteLine($"Date: {dat.ToString("d", thTH)}");
- Console.WriteLine($"Day of Week: {thCalendar.GetDayOfWeek(dat)}");
- Console.WriteLine($"Week of year: {thCalendar.GetWeekOfYear(dat, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Sunday)}\n");
-
- var greg = new System.Globalization.GregorianCalendar();
- Console.WriteLine("Using the Gregorian calendar:");
- Console.WriteLine($"Date: {dat:d}");
- Console.WriteLine($"Day of Week: {dat.DayOfWeek}");
- Console.WriteLine($"Week of year: {greg.GetWeekOfYear(dat, System.Globalization.CalendarWeekRule.FirstDay,DayOfWeek.Sunday)}");
- // The example displays the following output:
- // Using the Thai Buddhist Era calendar
- // Date : 18/8/1395
- // Day of Week: Sunday
- // Week of year: 34
- //
- // Using the Gregorian calendar
- // Date : 18/08/0852
- // Day of Week: Sunday
- // Week of year: 34
- //
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/DateTimeComparisons.cs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/DateTimeComparisons.cs
deleted file mode 100644
index b7342dbee5672..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/DateTimeComparisons.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace SystemDateTimeReference
-{
- public static class DateTimeComparisons
- {
- public static void Snippets()
- {
- TestRoughlyEquals();
- }
-
- //
- public static bool RoughlyEquals(DateTime time, DateTime timeWithWindow, int windowInSeconds, int frequencyInSeconds)
- {
- long delta = (long)((TimeSpan)(timeWithWindow - time)).TotalSeconds % frequencyInSeconds;
- delta = delta > windowInSeconds ? frequencyInSeconds - delta : delta;
- return Math.Abs(delta) < windowInSeconds;
- }
-
- public static void TestRoughlyEquals()
- {
- int window = 10;
- int freq = 60 * 60 * 2; // 2 hours;
-
- DateTime d1 = DateTime.Now;
-
- DateTime d2 = d1.AddSeconds(2 * window);
- DateTime d3 = d1.AddSeconds(-2 * window);
- DateTime d4 = d1.AddSeconds(window / 2);
- DateTime d5 = d1.AddSeconds(-window / 2);
-
- DateTime d6 = (d1.AddHours(2)).AddSeconds(2 * window);
- DateTime d7 = (d1.AddHours(2)).AddSeconds(-2 * window);
- DateTime d8 = (d1.AddHours(2)).AddSeconds(window / 2);
- DateTime d9 = (d1.AddHours(2)).AddSeconds(-window / 2);
-
- Console.WriteLine($"d1 ({d1}) ~= d1 ({d1}): {RoughlyEquals(d1, d1, window, freq)}");
- Console.WriteLine($"d1 ({d1}) ~= d2 ({d2}): {RoughlyEquals(d1, d2, window, freq)}");
- Console.WriteLine($"d1 ({d1}) ~= d3 ({d3}): {RoughlyEquals(d1, d3, window, freq)}");
- Console.WriteLine($"d1 ({d1}) ~= d4 ({d4}): {RoughlyEquals(d1, d4, window, freq)}");
- Console.WriteLine($"d1 ({d1}) ~= d5 ({d5}): {RoughlyEquals(d1, d5, window, freq)}");
-
- Console.WriteLine($"d1 ({d1}) ~= d6 ({d6}): {RoughlyEquals(d1, d6, window, freq)}");
- Console.WriteLine($"d1 ({d1}) ~= d7 ({d7}): {RoughlyEquals(d1, d7, window, freq)}");
- Console.WriteLine($"d1 ({d1}) ~= d8 ({d8}): {RoughlyEquals(d1, d8, window, freq)}");
- Console.WriteLine($"d1 ({d1}) ~= d9 ({d9}): {RoughlyEquals(d1, d9, window, freq)}");
- }
- // The example displays output similar to the following:
- // d1 (1/28/2010 9:01:26 PM) ~= d1 (1/28/2010 9:01:26 PM): True
- // d1 (1/28/2010 9:01:26 PM) ~= d2 (1/28/2010 9:01:46 PM): False
- // d1 (1/28/2010 9:01:26 PM) ~= d3 (1/28/2010 9:01:06 PM): False
- // d1 (1/28/2010 9:01:26 PM) ~= d4 (1/28/2010 9:01:31 PM): True
- // d1 (1/28/2010 9:01:26 PM) ~= d5 (1/28/2010 9:01:21 PM): True
- // d1 (1/28/2010 9:01:26 PM) ~= d6 (1/28/2010 11:01:46 PM): False
- // d1 (1/28/2010 9:01:26 PM) ~= d7 (1/28/2010 11:01:06 PM): False
- // d1 (1/28/2010 9:01:26 PM) ~= d8 (1/28/2010 11:01:31 PM): True
- // d1 (1/28/2010 9:01:26 PM) ~= d9 (1/28/2010 11:01:21 PM): True
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Instantiation.cs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Instantiation.cs
deleted file mode 100644
index 0b83383053228..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Instantiation.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-
-namespace SystemDateTimeReference
-{
- public static class Instantiation
- {
- public static void Snippets()
- {
- InstantiateWithConstructor();
- InstantiateWithReturnValue();
- InstantiateFromString();
- InstantiateUsingDftCtor();
- }
-
- private static void InstantiateWithConstructor()
- {
- //
- var date1 = new DateTime(2008, 5, 1, 8, 30, 52);
- Console.WriteLine(date1);
- //
- }
-
- private static void InstantiateWithReturnValue()
- {
- //
- DateTime date1 = DateTime.Now;
- DateTime date2 = DateTime.UtcNow;
- DateTime date3 = DateTime.Today;
- //
- }
-
- private static void InstantiateFromString()
- {
- //
- var dateString = "5/1/2008 8:30:52 AM";
- DateTime date1 = DateTime.Parse(dateString,
- System.Globalization.CultureInfo.InvariantCulture);
- var iso8601String = "20080501T08:30:52Z";
- DateTime dateISO8602 = DateTime.ParseExact(iso8601String, "yyyyMMddTHH:mm:ssZ",
- System.Globalization.CultureInfo.InvariantCulture);
- //
- }
-
- private static void InstantiateUsingDftCtor()
- {
- //
- var dat1 = new DateTime();
- // The following method call displays 1/1/0001 12:00:00 AM.
- Console.WriteLine(dat1.ToString(System.Globalization.CultureInfo.InvariantCulture));
- // The following method call displays True.
- Console.WriteLine(dat1.Equals(DateTime.MinValue));
- //
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Parsing.cs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Parsing.cs
deleted file mode 100644
index d202ca61f61df..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Parsing.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace SystemDateTimeReference
-{
- public static class Parsing
- {
- public static void Snippets()
- {
- ParseStandardFormats();
- ParseCustomFormats();
- ParseISO8601();
- }
-
- private static void ParseStandardFormats()
- {
- //
- System.Threading.Thread.CurrentThread.CurrentCulture =
- System.Globalization.CultureInfo.CreateSpecificCulture("en-GB");
-
- var date1 = new DateTime(2013, 6, 1, 12, 32, 30);
- var badFormats = new List();
-
- Console.WriteLine($"{"Date String",-37} {"Date",-19}\n");
- foreach (var dateString in date1.GetDateTimeFormats())
- {
- DateTime parsedDate;
- if (DateTime.TryParse(dateString, out parsedDate))
- Console.WriteLine($"{dateString,-37} {DateTime.Parse(dateString),-19}");
- else
- badFormats.Add(dateString);
- }
-
- // Display strings that could not be parsed.
- if (badFormats.Count > 0)
- {
- Console.WriteLine("\nStrings that could not be parsed: ");
- foreach (var badFormat in badFormats)
- Console.WriteLine($" {badFormat}");
- }
- // Press "Run" to see the output.
- //
- }
-
- private static void ParseCustomFormats()
- {
- //
- string[] formats = { "yyyyMMdd", "HHmmss" };
- string[] dateStrings = { "20130816", "20131608", " 20130816 ",
- "115216", "521116", " 115216 " };
- DateTime parsedDate;
-
- foreach (var dateString in dateStrings)
- {
- if (DateTime.TryParseExact(dateString, formats, null,
- System.Globalization.DateTimeStyles.AllowWhiteSpaces |
- System.Globalization.DateTimeStyles.AdjustToUniversal,
- out parsedDate))
- Console.WriteLine($"{dateString} --> {parsedDate:g}");
- else
- Console.WriteLine($"Cannot convert {dateString}");
- }
- // The example displays the following output:
- // 20130816 --> 8/16/2013 12:00 AM
- // Cannot convert 20131608
- // 20130816 --> 8/16/2013 12:00 AM
- // 115216 --> 4/22/2013 11:52 AM
- // Cannot convert 521116
- // 115216 --> 4/22/2013 11:52 AM
- //
- }
- private static void ParseISO8601()
- {
- //
- var iso8601String = "20080501T08:30:52Z";
- DateTime dateISO8602 = DateTime.ParseExact(iso8601String, "yyyyMMddTHH:mm:ssZ",
- System.Globalization.CultureInfo.InvariantCulture);
- Console.WriteLine($"{iso8601String} --> {dateISO8602:g}");
- //
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Persistence.cs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Persistence.cs
deleted file mode 100644
index 954339cd52531..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Persistence.cs
+++ /dev/null
@@ -1,345 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Threading;
-using System.Xml.Serialization;
-
-namespace SystemDateTimeReference
-{
- public static class Persistence
- {
- private const string filenameTxt = @".\BadDates.txt";
-
- public static void Snippets()
- {
- File.Delete(filenameTxt);
- PersistAsLocalStrings();
- File.Delete(filenameTxt);
- PersistAsInvariantStrings();
- File.Delete(filenameTxt);
-
- File.Delete(filenameInts);
- PersistAsIntegers();
- File.Delete(filenameInts);
-
- File.Delete(filenameXml);
- PersistAsXML();
- File.Delete(filenameXml);
- }
-
- //
- public static void PersistAsLocalStrings()
- {
- SaveLocalDatesAsString();
- RestoreLocalDatesFromString();
- }
-
- private static void SaveLocalDatesAsString()
- {
- DateTime[] dates = { new DateTime(2014, 6, 14, 6, 32, 0),
- new DateTime(2014, 7, 10, 23, 49, 0),
- new DateTime(2015, 1, 10, 1, 16, 0),
- new DateTime(2014, 12, 20, 21, 45, 0),
- new DateTime(2014, 6, 2, 15, 14, 0) };
- string? output = null;
-
- Console.WriteLine($"Current Time Zone: {TimeZoneInfo.Local.DisplayName}");
- Console.WriteLine($"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:");
- for (int ctr = 0; ctr < dates.Length; ctr++)
- {
- Console.WriteLine(dates[ctr].ToString("f"));
- output += dates[ctr].ToString() + (ctr != dates.Length - 1 ? "|" : "");
- }
- var sw = new StreamWriter(filenameTxt);
- sw.Write(output);
- sw.Close();
- Console.WriteLine("Saved dates...");
- }
-
- private static void RestoreLocalDatesFromString()
- {
- TimeZoneInfo.ClearCachedData();
- Console.WriteLine($"Current Time Zone: {TimeZoneInfo.Local.DisplayName}");
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB");
- StreamReader sr = new StreamReader(filenameTxt);
- string[] inputValues = sr.ReadToEnd().Split(new char[] { '|' },
- StringSplitOptions.RemoveEmptyEntries);
- sr.Close();
- Console.WriteLine($"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:");
- foreach (var inputValue in inputValues)
- {
- DateTime dateValue;
- if (DateTime.TryParse(inputValue, out dateValue))
- {
- Console.WriteLine($"'{inputValue}' --> {dateValue:f}");
- }
- else
- {
- Console.WriteLine($"Cannot parse '{inputValue}'");
- }
- }
- Console.WriteLine("Restored dates...");
- }
- // When saved on an en-US system, the example displays the following output:
- // Current Time Zone: (UTC-08:00) Pacific Time (US & Canada)
- // The dates on an en-US system:
- // Saturday, June 14, 2014 6:32 AM
- // Thursday, July 10, 2014 11:49 PM
- // Saturday, January 10, 2015 1:16 AM
- // Saturday, December 20, 2014 9:45 PM
- // Monday, June 02, 2014 3:14 PM
- // Saved dates...
- //
- // When restored on an en-GB system, the example displays the following output:
- // Current Time Zone: (UTC) Dublin, Edinburgh, Lisbon, London
- // The dates on an en-GB system:
- // Cannot parse //6/14/2014 6:32:00 AM//
- // //7/10/2014 11:49:00 PM// --> 07 October 2014 23:49
- // //1/10/2015 1:16:00 AM// --> 01 October 2015 01:16
- // Cannot parse //12/20/2014 9:45:00 PM//
- // //6/2/2014 3:14:00 PM// --> 06 February 2014 15:14
- // Restored dates...
- //
-
- //
- public static void PersistAsInvariantStrings()
- {
- SaveDatesAsInvariantStrings();
- RestoreDatesAsInvariantStrings();
- }
-
- private static void SaveDatesAsInvariantStrings()
- {
- DateTime[] dates = { new DateTime(2014, 6, 14, 6, 32, 0),
- new DateTime(2014, 7, 10, 23, 49, 0),
- new DateTime(2015, 1, 10, 1, 16, 0),
- new DateTime(2014, 12, 20, 21, 45, 0),
- new DateTime(2014, 6, 2, 15, 14, 0) };
- string? output = null;
-
- Console.WriteLine($"Current Time Zone: {TimeZoneInfo.Local.DisplayName}");
- Console.WriteLine($"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:");
- for (int ctr = 0; ctr < dates.Length; ctr++)
- {
- Console.WriteLine(dates[ctr].ToString("f"));
- output += dates[ctr].ToUniversalTime().ToString("O", CultureInfo.InvariantCulture)
- + (ctr != dates.Length - 1 ? "|" : "");
- }
- var sw = new StreamWriter(filenameTxt);
- sw.Write(output);
- sw.Close();
- Console.WriteLine("Saved dates...");
- }
-
- private static void RestoreDatesAsInvariantStrings()
- {
- TimeZoneInfo.ClearCachedData();
- Console.WriteLine($"Current Time Zone: {TimeZoneInfo.Local.DisplayName}");
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB");
- StreamReader sr = new StreamReader(filenameTxt);
- string[] inputValues = sr.ReadToEnd().Split(new char[] { '|' },
- StringSplitOptions.RemoveEmptyEntries);
- sr.Close();
- Console.WriteLine($"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:");
- foreach (var inputValue in inputValues)
- {
- DateTime dateValue;
- if (DateTime.TryParseExact(inputValue, "O", CultureInfo.InvariantCulture,
- DateTimeStyles.RoundtripKind, out dateValue))
- {
- Console.WriteLine($"'{inputValue}' --> {dateValue.ToLocalTime():f}");
- }
- else
- {
- Console.WriteLine($"Cannot parse '{inputValue}'");
- }
- }
- Console.WriteLine("Restored dates...");
- }
- // When saved on an en-US system, the example displays the following output:
- // Current Time Zone: (UTC-08:00) Pacific Time (US & Canada)
- // The dates on an en-US system:
- // Saturday, June 14, 2014 6:32 AM
- // Thursday, July 10, 2014 11:49 PM
- // Saturday, January 10, 2015 1:16 AM
- // Saturday, December 20, 2014 9:45 PM
- // Monday, June 02, 2014 3:14 PM
- // Saved dates...
- //
- // When restored on an en-GB system, the example displays the following output:
- // Current Time Zone: (UTC) Dublin, Edinburgh, Lisbon, London
- // The dates on an en-GB system:
- // '2014-06-14T13:32:00.0000000Z' --> 14 June 2014 14:32
- // '2014-07-11T06:49:00.0000000Z' --> 11 July 2014 07:49
- // '2015-01-10T09:16:00.0000000Z' --> 10 January 2015 09:16
- // '2014-12-21T05:45:00.0000000Z' --> 21 December 2014 05:45
- // '2014-06-02T22:14:00.0000000Z' --> 02 June 2014 23:14
- // Restored dates...
- //
-
- private const string filenameInts = @".\IntDates.bin";
-
- //
- public static void PersistAsIntegers()
- {
- SaveDatesAsInts();
- RestoreDatesAsInts();
- }
-
- private static void SaveDatesAsInts()
- {
- DateTime[] dates = { new DateTime(2014, 6, 14, 6, 32, 0),
- new DateTime(2014, 7, 10, 23, 49, 0),
- new DateTime(2015, 1, 10, 1, 16, 0),
- new DateTime(2014, 12, 20, 21, 45, 0),
- new DateTime(2014, 6, 2, 15, 14, 0) };
-
- Console.WriteLine($"Current Time Zone: {TimeZoneInfo.Local.DisplayName}");
- Console.WriteLine($"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:");
- var ticks = new long[dates.Length];
- for (int ctr = 0; ctr < dates.Length; ctr++)
- {
- Console.WriteLine(dates[ctr].ToString("f"));
- ticks[ctr] = dates[ctr].ToUniversalTime().Ticks;
- }
- var fs = new FileStream(filenameInts, FileMode.Create);
- var bw = new BinaryWriter(fs);
- bw.Write(ticks.Length);
- foreach (var tick in ticks)
- bw.Write(tick);
-
- bw.Close();
- Console.WriteLine("Saved dates...");
- }
-
- private static void RestoreDatesAsInts()
- {
- TimeZoneInfo.ClearCachedData();
- Console.WriteLine($"Current Time Zone: {TimeZoneInfo.Local.DisplayName}");
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB");
- FileStream fs = new FileStream(filenameInts, FileMode.Open);
- BinaryReader br = new BinaryReader(fs);
- int items;
- DateTime[] dates;
-
- try
- {
- items = br.ReadInt32();
- dates = new DateTime[items];
-
- for (int ctr = 0; ctr < items; ctr++)
- {
- long ticks = br.ReadInt64();
- dates[ctr] = new DateTime(ticks).ToLocalTime();
- }
- }
- catch (EndOfStreamException)
- {
- Console.WriteLine("File corruption detected. Unable to restore data...");
- return;
- }
- catch (IOException)
- {
- Console.WriteLine("Unspecified I/O error. Unable to restore data...");
- return;
- }
- // Thrown during array initialization.
- catch (OutOfMemoryException)
- {
- Console.WriteLine("File corruption detected. Unable to restore data...");
- return;
- }
- finally
- {
- br.Close();
- }
-
- Console.WriteLine($"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:");
- foreach (var value in dates)
- Console.WriteLine(value.ToString("f"));
-
- Console.WriteLine("Restored dates...");
- }
- // When saved on an en-US system, the example displays the following output:
- // Current Time Zone: (UTC-08:00) Pacific Time (US & Canada)
- // The dates on an en-US system:
- // Saturday, June 14, 2014 6:32 AM
- // Thursday, July 10, 2014 11:49 PM
- // Saturday, January 10, 2015 1:16 AM
- // Saturday, December 20, 2014 9:45 PM
- // Monday, June 02, 2014 3:14 PM
- // Saved dates...
- //
- // When restored on an en-GB system, the example displays the following output:
- // Current Time Zone: (UTC) Dublin, Edinburgh, Lisbon, London
- // The dates on an en-GB system:
- // 14 June 2014 14:32
- // 11 July 2014 07:49
- // 10 January 2015 09:16
- // 21 December 2014 05:45
- // 02 June 2014 23:14
- // Restored dates...
- //
-
- private const string filenameXml = @".\LeapYears.xml";
-
- //
- public static void PersistAsXML()
- {
- // Serialize the data.
- var leapYears = new List();
- for (int year = 2000; year <= 2100; year += 4)
- {
- if (DateTime.IsLeapYear(year))
- leapYears.Add(new DateTime(year, 2, 29));
- }
- DateTime[] dateArray = leapYears.ToArray();
-
- var serializer = new XmlSerializer(dateArray.GetType());
- TextWriter sw = new StreamWriter(filenameXml);
-
- try
- {
- serializer.Serialize(sw, dateArray);
- }
- catch (InvalidOperationException e)
- {
- Console.WriteLine(e.InnerException?.Message);
- }
- finally
- {
- if (sw != null) sw.Close();
- }
-
- // Deserialize the data.
- DateTime[]? deserializedDates;
- using (var fs = new FileStream(filenameXml, FileMode.Open))
- {
- deserializedDates = (DateTime[]?)serializer.Deserialize(fs);
- }
-
- // Display the dates.
- Console.WriteLine($"Leap year days from 2000-2100 on an {Thread.CurrentThread.CurrentCulture.Name} system:");
- int nItems = 0;
- if (deserializedDates is not null)
- {
- foreach (var dat in deserializedDates)
- {
- Console.Write($" {dat:d} ");
- nItems++;
- if (nItems % 5 == 0)
- Console.WriteLine();
- }
- }
- }
- // The example displays the following output:
- // Leap year days from 2000-2100 on an en-GB system:
- // 29/02/2000 29/02/2004 29/02/2008 29/02/2012 29/02/2016
- // 29/02/2020 29/02/2024 29/02/2028 29/02/2032 29/02/2036
- // 29/02/2040 29/02/2044 29/02/2048 29/02/2052 29/02/2056
- // 29/02/2060 29/02/2064 29/02/2068 29/02/2072 29/02/2076
- // 29/02/2080 29/02/2084 29/02/2088 29/02/2092 29/02/2096
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Resolution.cs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Resolution.cs
deleted file mode 100644
index 987c52284cf52..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Resolution.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-
-namespace SystemDateTimeReference
-{
- public static class Resolution
- {
- public static void Snippets()
- {
- DemonstrateResolution();
- }
-
- private static void DemonstrateResolution()
- {
- //
- string output = "";
- for (int ctr = 0; ctr <= 20; ctr++)
- {
- output += String.Format($"{DateTime.Now.Millisecond}\n");
- // Introduce a delay loop.
- for (int delay = 0; delay <= 1000; delay++)
- { }
-
- if (ctr == 10)
- {
- output += "Thread.Sleep called...\n";
- System.Threading.Thread.Sleep(5);
- }
- }
- Console.WriteLine(output);
- // Press "Run" to see the output.
- //
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/StringFormat.cs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/StringFormat.cs
deleted file mode 100644
index 32f0b52c8f32b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/StringFormat.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-
-namespace SystemDateTimeReference
-{
- public static class StringFormat
- {
- public static void Snippets()
- {
- ShowDefaultToString();
- ShowCultureSpecificToString();
- ShowDefaultFullDateAndTime();
- ShowCultureSpecificFullDateAndTime();
- ShowIso8601Format();
- }
-
- private static void ShowDefaultToString()
- {
- //
- var date1 = new DateTime(2008, 3, 1, 7, 0, 0);
- Console.WriteLine(date1.ToString());
- // For en-US culture, displays 3/1/2008 7:00:00 AM
- //
- }
-
- private static void ShowCultureSpecificToString()
- {
- //
- var date1 = new DateTime(2008, 3, 1, 7, 0, 0);
- Console.WriteLine(date1.ToString(System.Globalization.CultureInfo.CreateSpecificCulture("fr-FR")));
- // Displays 01/03/2008 07:00:00
- //
- }
-
- private static void ShowDefaultFullDateAndTime()
- {
- //
- var date1 = new DateTime(2008, 3, 1, 7, 0, 0);
- Console.WriteLine(date1.ToString("F"));
- // Displays Saturday, March 01, 2008 7:00:00 AM
- //
- }
-
- private static void ShowCultureSpecificFullDateAndTime()
- {
- //
- var date1 = new DateTime(2008, 3, 1, 7, 0, 0);
- Console.WriteLine(date1.ToString("F", new System.Globalization.CultureInfo("fr-FR")));
- // Displays samedi 1 mars 2008 07:00:00
- //
- }
-
- private static void ShowIso8601Format()
- {
- //
- var date1 = new DateTime(2008, 3, 1, 7, 0, 0, DateTimeKind.Utc);
- Console.WriteLine(date1.ToString("yyyy-MM-ddTHH:mm:sszzz", System.Globalization.CultureInfo.InvariantCulture));
- // Displays 2008-03-01T07:00:00+00:00
- //
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Calendar.fs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Calendar.fs
deleted file mode 100644
index 34ad331aa26db..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Calendar.fs
+++ /dev/null
@@ -1,108 +0,0 @@
-module Calender
-
-open System
-
-let thaiBuddistEra () =
- //
- let thTH = System.Globalization.CultureInfo "th-TH"
- let value = DateTime(2016, 5, 28)
-
- printfn $"{value.ToString thTH}"
-
- thTH.DateTimeFormat.Calendar <- System.Globalization.GregorianCalendar()
-
- printfn $"{value.ToString thTH}"
-
- // The example displays the following output:
- // 28/5/2559 0:00:00
- // 28/5/2016 0:00:00
- //
-
-let thaiBuddhistEraParse () =
- //
- let thTH = System.Globalization.CultureInfo "th-TH"
- let value = DateTime.Parse("28/05/2559", thTH)
- printfn $"{value.ToString thTH}"
-
- thTH.DateTimeFormat.Calendar <- System.Globalization.GregorianCalendar()
- printfn $"{value.ToString thTH}"
-
- // The example displays the following output:
- // 28/5/2559 0:00:00
- // 28/5/2016 0:00:00
- //
-
-let instantiateCalendar () =
- //
- let thTH = System.Globalization.CultureInfo "th-TH"
- let dat = DateTime(2559, 5, 28, thTH.DateTimeFormat.Calendar)
-
- printfn $"""Thai Buddhist era date: {dat.ToString("d", thTH)}"""
- printfn $"Gregorian date: {dat:d}"
-
- // The example displays the following output:
- // Thai Buddhist Era Date: 28/5/2559
- // Gregorian Date: 28/05/2016
- //
-
-let calendarFields () =
- //
- let thTH = System.Globalization.CultureInfo "th-TH"
- let cal = thTH.DateTimeFormat.Calendar
- let dat = DateTime(2559, 5, 28, cal)
- printfn "Using the Thai Buddhist Era calendar:"
- printfn $"""Date: {dat.ToString("d", thTH)}"""
- printfn $"Year: {cal.GetYear dat}"
- printfn $"Leap year: {cal.IsLeapYear(cal.GetYear dat)}\n"
-
- printfn "Using the Gregorian calendar:"
- printfn $"Date: {dat:d}"
- printfn $"Year: {dat.Year}"
- printfn $"Leap year: {DateTime.IsLeapYear dat.Year}"
-
- // The example displays the following output:
- // Using the Thai Buddhist Era calendar
- // Date : 28/5/2559
- // Year: 2559
- // Leap year : True
- //
- // Using the Gregorian calendar
- // Date : 28/05/2016
- // Year: 2016
- // Leap year : True
- //
-
-let calculateWeeks () =
- //
- let thTH = System.Globalization.CultureInfo "th-TH"
- let thCalendar = thTH.DateTimeFormat.Calendar
- let dat = DateTime(1395, 8, 18, thCalendar)
- printfn "Using the Thai Buddhist Era calendar:"
- printfn $"""Date: {dat.ToString("d", thTH)}"""
- printfn $"Day of Week: {thCalendar.GetDayOfWeek dat}"
- printfn $"Week of year: {thCalendar.GetWeekOfYear(dat, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Sunday)}\n"
-
- let greg = System.Globalization.GregorianCalendar()
- printfn "Using the Gregorian calendar:"
- printfn $"Date: {dat:d}"
- printfn $"Day of Week: {dat.DayOfWeek}"
- printfn $"Week of year: {greg.GetWeekOfYear(dat, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Sunday)}"
-
- // The example displays the following output:
- // Using the Thai Buddhist Era calendar
- // Date : 18/8/1395
- // Day of Week: Sunday
- // Week of year: 34
- //
- // Using the Gregorian calendar
- // Date : 18/08/0852
- // Day of Week: Sunday
- // Week of year: 34
- //
-
-
-thaiBuddistEra ()
-thaiBuddhistEraParse ()
-instantiateCalendar ()
-calendarFields ()
-calculateWeeks ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/DateTimeComparisons.fs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/DateTimeComparisons.fs
deleted file mode 100644
index 0ad8d7bcc88de..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/DateTimeComparisons.fs
+++ /dev/null
@@ -1,53 +0,0 @@
-module DateTimeComparisons
-
-open System
-open System.Text
-
-//
-let roughlyEquals (time: DateTime) (timeWithWindow: DateTime) windowInSeconds frequencyInSeconds =
- let delta =
- int64 (timeWithWindow - time).TotalSeconds % frequencyInSeconds
-
- let delta = if delta > windowInSeconds then frequencyInSeconds - delta else delta
- abs delta < windowInSeconds
-
-let testRoughlyEquals () =
- let window = 10
- let window' = 10.
- let freq = 60 * 60 * 2 // 2 hours
-
- let d1 = DateTime.Now
-
- let d2 = d1.AddSeconds(2. * window')
- let d3 = d1.AddSeconds(-2. * window')
- let d4 = d1.AddSeconds(window' / 2.)
- let d5 = d1.AddSeconds(-window' / 2.)
-
- let d6 = (d1.AddHours 2).AddSeconds(2. * window')
- let d7 = (d1.AddHours 2).AddSeconds(-2. * window')
- let d8 = (d1.AddHours 2).AddSeconds(window' / 2.)
- let d9 = (d1.AddHours 2).AddSeconds(-window' / 2.)
-
- printfn $"d1 ({d1}) ~= d1 ({d1}): {roughlyEquals d1 d1 window freq}"
- printfn $"d1 ({d1}) ~= d2 ({d2}): {roughlyEquals d1 d2 window freq}"
- printfn $"d1 ({d1}) ~= d3 ({d3}): {roughlyEquals d1 d3 window freq}"
- printfn $"d1 ({d1}) ~= d4 ({d4}): {roughlyEquals d1 d4 window freq}"
- printfn $"d1 ({d1}) ~= d5 ({d5}): {roughlyEquals d1 d5 window freq}"
-
- printfn $"d1 ({d1}) ~= d6 ({d6}): {roughlyEquals d1 d6 window freq}"
- printfn $"d1 ({d1}) ~= d7 ({d7}): {roughlyEquals d1 d7 window freq}"
- printfn $"d1 ({d1}) ~= d8 ({d8}): {roughlyEquals d1 d8 window freq}"
- printfn $"d1 ({d1}) ~= d9 ({d9}): {roughlyEquals d1 d9 window freq}"
-
-// The example displays output similar to the following:
-// d1 (1/28/2010 9:01:26 PM) ~= d1 (1/28/2010 9:01:26 PM): True
-// d1 (1/28/2010 9:01:26 PM) ~= d2 (1/28/2010 9:01:46 PM): False
-// d1 (1/28/2010 9:01:26 PM) ~= d3 (1/28/2010 9:01:06 PM): False
-// d1 (1/28/2010 9:01:26 PM) ~= d4 (1/28/2010 9:01:31 PM): True
-// d1 (1/28/2010 9:01:26 PM) ~= d5 (1/28/2010 9:01:21 PM): True
-// d1 (1/28/2010 9:01:26 PM) ~= d6 (1/28/2010 11:01:46 PM): False
-// d1 (1/28/2010 9:01:26 PM) ~= d7 (1/28/2010 11:01:06 PM): False
-// d1 (1/28/2010 9:01:26 PM) ~= d8 (1/28/2010 11:01:31 PM): True
-// d1 (1/28/2010 9:01:26 PM) ~= d9 (1/28/2010 11:01:21 PM): True
-//
-testRoughlyEquals ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Instantiation.fs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Instantiation.fs
deleted file mode 100644
index b2414a9b60d30..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Instantiation.fs
+++ /dev/null
@@ -1,42 +0,0 @@
-module Instantiation
-
-open System
-
-let instantiateWithConstructor () =
- //
- let date1 = DateTime(2008, 5, 1, 8, 30, 52)
- printfn $"{date1}"
- //
-
-let instantiateWithReturnValue () =
- //
- let date1 = DateTime.Now
- let date2 = DateTime.UtcNow
- let date3 = DateTime.Today
- //
- ()
-
-let instantiateFromString () =
- //
- let dateString = "5/1/2008 8:30:52 AM"
- let date1 = DateTime.Parse(dateString, System.Globalization.CultureInfo.InvariantCulture)
- let iso8601String = "20080501T08:30:52Z"
- let dateISO8602 = DateTime.ParseExact(iso8601String, "yyyyMMddTHH:mm:ssZ", System.Globalization.CultureInfo.InvariantCulture)
- //
- ()
-
-let instantiateUsingDftCtor () =
- //
- let dat1 = DateTime()
-
- // The following method call displays 1/1/0001 12:00:00 AM.
- printfn $"{dat1.ToString System.Globalization.CultureInfo.InvariantCulture}"
-
- // The following method call displays True.
- printfn $"{dat1.Equals DateTime.MinValue}"
- //
-
-instantiateWithConstructor ()
-instantiateWithReturnValue ()
-instantiateFromString ()
-instantiateUsingDftCtor ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Parsing.fs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Parsing.fs
deleted file mode 100644
index 65ea361045da8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Parsing.fs
+++ /dev/null
@@ -1,64 +0,0 @@
-module Parsing
-
-open System
-
-let parseStandardFormats () =
- //
- System.Threading.Thread.CurrentThread.CurrentCulture <-
- System.Globalization.CultureInfo.CreateSpecificCulture "en-GB"
-
- let date1 = DateTime(2013, 6, 1, 12, 32, 30)
- let badFormats = ResizeArray()
-
- printfn "%-37s %-19s\n" "Date String" "Date"
- for dateString in date1.GetDateTimeFormats() do
- match DateTime.TryParse dateString with
- | true, parsedDate ->
- printfn $"%-37s{dateString} %-19O{parsedDate}\n"
- | _ ->
- badFormats.Add dateString
-
- // Display strings that could not be parsed.
- if badFormats.Count > 0 then
- printfn "\nStrings that could not be parsed: "
- for badFormat in badFormats do
- printfn $" {badFormat}"
- // Press "Run" to see the output.
- //
-
-let parseCustomFormats () =
- //
- let formats = [| "yyyyMMdd"; "HHmmss" |]
- let dateStrings =
- [ "20130816"; "20131608"; " 20130816 "
- "115216"; "521116"; " 115216 " ]
-
- for dateString in dateStrings do
- match DateTime.TryParseExact(dateString, formats, null,
- System.Globalization.DateTimeStyles.AllowWhiteSpaces |||
- System.Globalization.DateTimeStyles.AdjustToUniversal) with
- | true, parsedDate ->
- printfn $"{dateString} --> {parsedDate:g}"
- | _ ->
- printfn $"Cannot convert {dateString}"
-
- // The example displays the following output:
- // 20130816 --> 8/16/2013 12:00 AM
- // Cannot convert 20131608
- // 20130816 --> 8/16/2013 12:00 AM
- // 115216 --> 4/22/2013 11:52 AM
- // Cannot convert 521116
- // 115216 --> 4/22/2013 11:52 AM
- //
-
-let parseISO8601 () =
- //
- let iso8601String = "20080501T08:30:52Z"
- let dateISO8602 = DateTime.ParseExact(iso8601String, "yyyyMMddTHH:mm:ssZ", System.Globalization.CultureInfo.InvariantCulture)
-
- printfn $"{iso8601String} --> {dateISO8602:g}"
- //
-
-parseStandardFormats ()
-parseCustomFormats ()
-parseISO8601 ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Persistence.fs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Persistence.fs
deleted file mode 100644
index b42f0e2a46674..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Persistence.fs
+++ /dev/null
@@ -1,284 +0,0 @@
-module Persistence
-
-open System
-open System.Collections.Generic
-open System.Globalization
-open System.IO
-open System.Runtime.Serialization
-open System.Runtime.Serialization.Formatters.Binary
-open System.Threading
-open System.Xml.Serialization
-open DateTimeExtensions
-
-let filenameTxt = @".\BadDates.txt"
-
-//
-let saveLocalDatesAsString () =
- let dates =
- [ DateTime(2014, 6, 14, 6, 32, 0)
- DateTime(2014, 7, 10, 23, 49, 0)
- DateTime(2015, 1, 10, 1, 16, 0)
- DateTime(2014, 12, 20, 21, 45, 0)
- DateTime(2014, 6, 2, 15, 14, 0) ]
-
- printfn $"Current Time Zone: {TimeZoneInfo.Local.DisplayName}"
- printfn $"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:"
-
- let output =
- [ for date in dates do
- printfn $"{date}"
- string date ]
- |> String.concat "|"
-
- use sw = new StreamWriter(filenameTxt)
- sw.Write output
- printfn "Saved dates..."
-
-let restoreLocalDatesFromString () =
- TimeZoneInfo.ClearCachedData()
- printfn $"Current Time Zone: {TimeZoneInfo.Local.DisplayName}"
- Thread.CurrentThread.CurrentCulture <- CultureInfo.CreateSpecificCulture "en-GB"
-
- use sr = new StreamReader(filenameTxt)
- let inputValues =
- sr.ReadToEnd().Split('|', StringSplitOptions.RemoveEmptyEntries)
-
- printfn $"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:"
-
- for inputValue in inputValues do
- match DateTime.TryParse inputValue with
- | true, dateValue ->
- printfn $"'{inputValue}' --> {dateValue:f}"
- | _ ->
- printfn $"Cannot parse '{inputValue}'"
-
- printfn "Restored dates..."
-
-let persistAsLocalStrings () =
- saveLocalDatesAsString ()
- restoreLocalDatesFromString ()
-
-// When saved on an en-US system, the example displays the following output:
-// Current Time Zone: (UTC-08:00) Pacific Time (US & Canada)
-// The dates on an en-US system:
-// Saturday, June 14, 2014 6:32 AM
-// Thursday, July 10, 2014 11:49 PM
-// Saturday, January 10, 2015 1:16 AM
-// Saturday, December 20, 2014 9:45 PM
-// Monday, June 02, 2014 3:14 PM
-// Saved dates...
-//
-// When restored on an en-GB system, the example displays the following output:
-// Current Time Zone: (UTC) Dublin, Edinburgh, Lisbon, London
-// The dates on an en-GB system:
-// Cannot parse //6/14/2014 6:32:00 AM//
-// //7/10/2014 11:49:00 PM// --> 07 October 2014 23:49
-// //1/10/2015 1:16:00 AM// --> 01 October 2015 01:16
-// Cannot parse //12/20/2014 9:45:00 PM//
-// //6/2/2014 3:14:00 PM// --> 06 February 2014 15:14
-// Restored dates...
-//
-
-//
-let saveDatesAsInvariantStrings () =
- let dates =
- [ DateTime(2014, 6, 14, 6, 32, 0)
- DateTime(2014, 7, 10, 23, 49, 0)
- DateTime(2015, 1, 10, 1, 16, 0)
- DateTime(2014, 12, 20, 21, 45, 0)
- DateTime(2014, 6, 2, 15, 14, 0) ]
-
- printfn $"Current Time Zone: {TimeZoneInfo.Local.DisplayName}"
- printfn $"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:"
-
- let output =
- [ for date in dates do
- printfn $"{date:f}"
- date.ToUniversalTime().ToString("O", CultureInfo.InvariantCulture) ]
- |> String.concat "|"
-
- use sw = new StreamWriter(filenameTxt)
- sw.Write output
- printfn "Saved dates..."
-
-let restoreDatesAsInvariantStrings () =
- TimeZoneInfo.ClearCachedData()
- printfn $"Current Time Zone: {TimeZoneInfo.Local.DisplayName}"
- Thread.CurrentThread.CurrentCulture <- CultureInfo.CreateSpecificCulture "en-GB"
-
- use sr = new StreamReader(filenameTxt)
- let inputValues =
- sr.ReadToEnd().Split('|', StringSplitOptions.RemoveEmptyEntries)
-
- printfn $"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:"
-
- for inputValue in inputValues do
- match DateTime.TryParseExact(inputValue, "O", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind) with
- | true, dateValue ->
- printfn $"'{inputValue}' --> {dateValue.ToLocalTime():f}"
- | _ ->
- printfn $"Cannot parse '{inputValue}'"
-
- printfn "Restored dates..."
-
-let persistAsInvariantStrings () =
- saveDatesAsInvariantStrings ()
- restoreDatesAsInvariantStrings ()
-
-// When saved on an en-US system, the example displays the following output:
-// Current Time Zone: (UTC-08:00) Pacific Time (US & Canada)
-// The dates on an en-US system:
-// Saturday, June 14, 2014 6:32 AM
-// Thursday, July 10, 2014 11:49 PM
-// Saturday, January 10, 2015 1:16 AM
-// Saturday, December 20, 2014 9:45 PM
-// Monday, June 02, 2014 3:14 PM
-// Saved dates...
-//
-// When restored on an en-GB system, the example displays the following output:
-// Current Time Zone: (UTC) Dublin, Edinburgh, Lisbon, London
-// The dates on an en-GB system:
-// '2014-06-14T13:32:00.0000000Z' --> 14 June 2014 14:32
-// '2014-07-11T06:49:00.0000000Z' --> 11 July 2014 07:49
-// '2015-01-10T09:16:00.0000000Z' --> 10 January 2015 09:16
-// '2014-12-21T05:45:00.0000000Z' --> 21 December 2014 05:45
-// '2014-06-02T22:14:00.0000000Z' --> 02 June 2014 23:14
-// Restored dates...
-//
-
-let filenameInts = @".\IntDates.bin"
-
-//
-let saveDatesAsInts () =
- let dates =
- [ DateTime(2014, 6, 14, 6, 32, 0)
- DateTime(2014, 7, 10, 23, 49, 0)
- DateTime(2015, 1, 10, 1, 16, 0)
- DateTime(2014, 12, 20, 21, 45, 0)
- DateTime(2014, 6, 2, 15, 14, 0) ]
-
- printfn $"Current Time Zone: {TimeZoneInfo.Local.DisplayName}"
- printfn $"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:"
- let ticks =
- [| for date in dates do
- printfn $"{date:f}"
- date.ToUniversalTime().Ticks |]
- use fs = new FileStream(filenameInts, FileMode.Create)
- use bw = new BinaryWriter(fs)
- bw.Write ticks.Length
-
- for tick in ticks do
- bw.Write tick
-
- printfn "Saved dates..."
-
-let restoreDatesAsInts () =
- TimeZoneInfo.ClearCachedData()
- printfn $"Current Time Zone: {TimeZoneInfo.Local.DisplayName}"
- Thread.CurrentThread.CurrentCulture <- CultureInfo.CreateSpecificCulture "en-GB"
- use fs = new FileStream(filenameInts, FileMode.Open)
- use br = new BinaryReader(fs)
-
- try
- let items = br.ReadInt32()
- let dates =
- [| for _ in 0..items do
- let ticks = br.ReadInt64()
- DateTime(ticks).ToLocalTime() |]
-
- printfn $"The dates on an {Thread.CurrentThread.CurrentCulture.Name} system:"
- for value in dates do
- printfn $"{value:f}"
- with
- | :? EndOfStreamException ->
- printfn "File corruption detected. Unable to restore data..."
- | :? IOException ->
- printfn "Unspecified I/O error. Unable to restore data..."
- // Thrown during array initialization.
- | :? OutOfMemoryException ->
- printfn"File corruption detected. Unable to restore data..."
-
- printfn "Restored dates..."
-
-let persistAsIntegers () =
- saveDatesAsInts ()
- restoreDatesAsInts ()
-
-// When saved on an en-US system, the example displays the following output:
-// Current Time Zone: (UTC-08:00) Pacific Time (US & Canada)
-// The dates on an en-US system:
-// Saturday, June 14, 2014 6:32 AM
-// Thursday, July 10, 2014 11:49 PM
-// Saturday, January 10, 2015 1:16 AM
-// Saturday, December 20, 2014 9:45 PM
-// Monday, June 02, 2014 3:14 PM
-// Saved dates...
-//
-// When restored on an en-GB system, the example displays the following output:
-// Current Time Zone: (UTC) Dublin, Edinburgh, Lisbon, London
-// The dates on an en-GB system:
-// 14 June 2014 14:32
-// 11 July 2014 07:49
-// 10 January 2015 09:16
-// 21 December 2014 05:45
-// 02 June 2014 23:14
-// Restored dates...
-//
-
-let filenameXml = @".\LeapYears.xml"
-
-//
-let persistAsXML () =
- // Serialize the data.
- let leapYears =
- [| for year in 2000..4..2100 do
- if DateTime.IsLeapYear year then
- DateTime(year, 2, 29) |]
-
- let serializer = XmlSerializer(leapYears.GetType())
- use sw = new StreamWriter(filenameXml)
-
- try
- serializer.Serialize(sw, leapYears)
- with :? InvalidOperationException as e ->
- printfn $"{e.InnerException.Message}"
-
- // Deserialize the data.
- use fs = new FileStream(filenameXml, FileMode.Open)
-
- let deserializedDates = serializer.Deserialize fs :?> DateTime []
-
- // Display the dates.
- printfn $"Leap year days from 2000-2100 on an {Thread.CurrentThread.CurrentCulture.Name} system:"
-
- let mutable nItems = 0
- for dat in deserializedDates do
- printf $" {dat:d} "
- nItems <- nItems + 1
- if nItems % 5 = 0 then
- printfn ""
-
-// The example displays the following output:
-// Leap year days from 2000-2100 on an en-GB system:
-// 29/02/2000 29/02/2004 29/02/2008 29/02/2012 29/02/2016
-// 29/02/2020 29/02/2024 29/02/2028 29/02/2032 29/02/2036
-// 29/02/2040 29/02/2044 29/02/2048 29/02/2052 29/02/2056
-// 29/02/2060 29/02/2064 29/02/2068 29/02/2072 29/02/2076
-// 29/02/2080 29/02/2084 29/02/2088 29/02/2092 29/02/2096
-//
-
-let filenameBin = @".\Dates.bin"
-
-File.Delete filenameTxt
-persistAsLocalStrings ()
-File.Delete filenameTxt
-persistAsInvariantStrings ()
-File.Delete filenameTxt
-
-File.Delete filenameInts
-persistAsIntegers ()
-File.Delete filenameInts
-
-File.Delete filenameXml
-persistAsXML ()
-File.Delete filenameXml
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Resolution.fs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Resolution.fs
deleted file mode 100644
index 0edf94059e01b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/Resolution.fs
+++ /dev/null
@@ -1,19 +0,0 @@
-module Resolution
-
-open System
-
-let demonstrateResolution () =
- //
- let mutable output = ""
- for i = 0 to 20 do
- output <- output + $"{DateTime.Now.Millisecond}\n"
- // Introduce a delay loop.
- for _ = 0 to 1000 do ()
-
- if i = 10 then
- output <- output + "Thread.Sleep called...\n"
- System.Threading.Thread.Sleep 5
-
- printfn $"{output}"
- // Press "Run" to see the output.
- //
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/StringFormat.fs b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/StringFormat.fs
deleted file mode 100644
index 928aaee498112..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/fsharp/StringFormat.fs
+++ /dev/null
@@ -1,44 +0,0 @@
-module StringFormat
-
-open System
-
-let showDefaultToString () =
- //
- let date1 = DateTime(2008, 3, 1, 7, 0, 0)
- printfn $"{date1.ToString()}"
- // For en-US culture, displays 3/1/2008 7:00:00 AM
- //
-
-let showCultureSpecificToString () =
- //
- let date1 = DateTime(2008, 3, 1, 7, 0, 0)
- printfn $"""{date1.ToString(System.Globalization.CultureInfo.CreateSpecificCulture "fr-FR")}"""
- // Displays 01/03/2008 07:00:00
- //
-
-let showDefaultFullDateAndTime () =
- //
- let date1 = DateTime(2008, 3, 1, 7, 0, 0)
- printfn $"""{date1.ToString "F"}"""
- // Displays Saturday, March 01, 2008 7:00:00 AM
- //
-
-let showCultureSpecificFullDateAndTime () =
- //
- let date1 = DateTime(2008, 3, 1, 7, 0, 0)
- printfn $"""{date1.ToString("F", new System.Globalization.CultureInfo "fr-FR")}"""
- // Displays samedi 1 mars 2008 07:00:00
- //
-
-let showIso8601Format () =
- //
- let date1 = DateTime(2008, 3, 1, 7, 0, 0, DateTimeKind.Utc)
- printfn $"""{date1.ToString("yyyy-MM-ddTHH:mm:sszzz", System.Globalization.CultureInfo.InvariantCulture)}"""
- // Displays 2008-03-01T07:00:00+00:00
- //
-
-showDefaultToString ()
-showCultureSpecificToString ()
-showDefaultFullDateAndTime ()
-showCultureSpecificFullDateAndTime ()
-showIso8601Format ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Calendar.vb b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Calendar.vb
deleted file mode 100644
index 23346c6863cb1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Calendar.vb
+++ /dev/null
@@ -1,110 +0,0 @@
-Imports System.Globalization
-
-Module CalendarSamples
- Public Sub Snippets()
- ThaiBuddhistEra()
- ThaiBuddhistEraParse()
- InstantiateCalendar()
- CalendarFields()
- CalculateWeeks()
- End Sub
-
- Private Sub ThaiBuddhistEra()
- '
- Dim thTH As New CultureInfo("th-TH")
- Dim value As New DateTime(2016, 5, 28)
-
- Console.WriteLine(value.ToString(thTH))
-
- thTH.DateTimeFormat.Calendar = New GregorianCalendar()
- Console.WriteLine(value.ToString(thTH))
- ' The example displays the following output:
- ' 28/5/2559 0:00:00
- ' 28/5/2016 0:00:00
- '
- End Sub
-
- '
- Private Sub ThaiBuddhistEraParse()
- Dim thTH As New CultureInfo("th-TH")
- Dim value As DateTime = DateTime.Parse("28/5/2559", thTH)
- Console.WriteLine(value.ToString(thTH))
-
- thTH.DateTimeFormat.Calendar = New GregorianCalendar()
- Console.WriteLine(value.ToString(thTH))
- ' The example displays the following output:
- ' 28/5/2559 0:00:00
- ' 28/5/2016 0:00:00
- End Sub
- '
-
- Private Sub InstantiateCalendar()
- '
- Dim thTH As New CultureInfo("th-TH")
- Dim dat As New DateTime(2559, 5, 28, thTH.DateTimeFormat.Calendar)
- Console.WriteLine($"Thai Buddhist Era date: {dat.ToString("d", thTH)}")
- Console.WriteLine($"Gregorian date: {dat:d}")
- ' The example displays the following output:
- ' Thai Buddhist Era Date: 28/5/2559
- ' Gregorian Date: 28/05/2016
- '
- End Sub
-
- Private Sub CalendarFields()
- '
- Dim thTH As New CultureInfo("th-TH")
- Dim cal As Calendar = thTH.DateTimeFormat.Calendar
- Dim dat As New DateTime(2559, 5, 28, cal)
- Console.WriteLine("Using the Thai Buddhist Era calendar:")
- Console.WriteLine($"Date: {dat.ToString("d", thTH)}")
- Console.WriteLine($"Year: {cal.GetYear(dat)}")
- Console.WriteLine($"Leap year: {cal.IsLeapYear(cal.GetYear(dat))}")
- Console.WriteLine()
-
- Console.WriteLine("Using the Gregorian calendar:")
- Console.WriteLine($"Date: {dat:d}")
- Console.WriteLine($"Year: {dat.Year}")
- Console.WriteLine($"Leap year: {DateTime.IsLeapYear(dat.Year)}")
- ' The example displays the following output:
- ' Using the Thai Buddhist Era calendar
- ' Date : 28/5/2559
- ' Year: 2559
- ' Leap year : True
- '
- ' Using the Gregorian calendar
- ' Date : 28/05/2016
- ' Year: 2016
- ' Leap year : True
- '
- End Sub
-
- Private Sub CalculateWeeks()
- '
- Dim thTH As New CultureInfo("th-TH")
- Dim thCalendar As Calendar = thTH.DateTimeFormat.Calendar
- Dim dat As New DateTime(1395, 8, 18, thCalendar)
- Console.WriteLine("Using the Thai Buddhist Era calendar:")
- Console.WriteLine($"Date: {dat.ToString("d", thTH)}")
- Console.WriteLine($"Day of Week: {thCalendar.GetDayOfWeek(dat)}")
- Console.WriteLine($"Week of year: {thCalendar.GetWeekOfYear(dat, CalendarWeekRule.FirstDay, DayOfWeek.Sunday)}")
- Console.WriteLine()
-
- Dim greg As Calendar = New GregorianCalendar()
- Console.WriteLine("Using the Gregorian calendar:")
- Console.WriteLine($"Date: {dat:d}")
- Console.WriteLine($"Day of Week: {dat.DayOfWeek}")
- Console.WriteLine($"Week of year: {greg.GetWeekOfYear(dat, CalendarWeekRule.FirstDay, DayOfWeek.Sunday)}")
- ' The example displays the following output:
- ' Using the Thai Buddhist Era calendar
- ' Date : 18/8/1395
- ' Day of Week: Sunday
- ' Week of year: 34
- '
- ' Using the Gregorian calendar
- ' Date : 18/08/0852
- ' Day of Week: Sunday
- ' Week of year: 34
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/DateTimeComparisons.vb b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/DateTimeComparisons.vb
deleted file mode 100644
index aee488bf948c7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/DateTimeComparisons.vb
+++ /dev/null
@@ -1,58 +0,0 @@
-Class DateTimeComparisons
- Public Shared Sub Snippets()
- TestRoughlyEquals()
- End Sub
-
- '
- Public Shared Function RoughlyEquals(time As DateTime, timeWithWindow As DateTime,
- windowInSeconds As Integer,
- frequencyInSeconds As Integer) As Boolean
- Dim delta As Long = (timeWithWindow.Subtract(time)).TotalSeconds _
- Mod frequencyInSeconds
-
- If delta > windowInSeconds Then
- delta = frequencyInSeconds - delta
- End If
-
- Return Math.Abs(delta) < windowInSeconds
- End Function
-
- Public Shared Sub TestRoughlyEquals()
- Dim window As Integer = 10
- Dim freq As Integer = 60 * 60 * 2 ' 2 hours;
- Dim d1 As DateTime = DateTime.Now
-
- Dim d2 As DateTime = d1.AddSeconds(2 * window)
- Dim d3 As DateTime = d1.AddSeconds(-2 * window)
- Dim d4 As DateTime = d1.AddSeconds(window / 2)
- Dim d5 As DateTime = d1.AddSeconds(-window / 2)
-
- Dim d6 As DateTime = d1.AddHours(2).AddSeconds(2 * window)
- Dim d7 As DateTime = d1.AddHours(2).AddSeconds(-2 * window)
- Dim d8 As DateTime = d1.AddHours(2).AddSeconds(window / 2)
- Dim d9 As DateTime = d1.AddHours(2).AddSeconds(-window / 2)
-
- Console.WriteLine($"d1 ({d1}) ~= d1 ({d1}): {RoughlyEquals(d1, d1, window, freq)}")
- Console.WriteLine($"d1 ({d1}) ~= d2 ({d2}): {RoughlyEquals(d1, d2, window, freq)}")
- Console.WriteLine($"d1 ({d1}) ~= d3 ({d3}): {RoughlyEquals(d1, d3, window, freq)}")
- Console.WriteLine($"d1 ({d1}) ~= d4 ({d4}): {RoughlyEquals(d1, d4, window, freq)}")
- Console.WriteLine($"d1 ({d1}) ~= d5 ({d5}): {RoughlyEquals(d1, d5, window, freq)}")
-
- Console.WriteLine($"d1 ({d1}) ~= d6 ({d6}): {RoughlyEquals(d1, d6, window, freq)}")
- Console.WriteLine($"d1 ({d1}) ~= d7 ({d7}): {RoughlyEquals(d1, d7, window, freq)}")
- Console.WriteLine($"d1 ({d1}) ~= d8 ({d8}): {RoughlyEquals(d1, d8, window, freq)}")
- Console.WriteLine($"d1 ({d1}) ~= d9 ({d9}): {RoughlyEquals(d1, d9, window, freq)}")
- End Sub
- ' The example displays output similar to the following:
- ' d1 (1/28/2010 9:01:26 PM) ~= d1 (1/28/2010 9:01:26 PM): True
- ' d1 (1/28/2010 9:01:26 PM) ~= d2 (1/28/2010 9:01:46 PM): False
- ' d1 (1/28/2010 9:01:26 PM) ~= d3 (1/28/2010 9:01:06 PM): False
- ' d1 (1/28/2010 9:01:26 PM) ~= d4 (1/28/2010 9:01:31 PM): True
- ' d1 (1/28/2010 9:01:26 PM) ~= d5 (1/28/2010 9:01:21 PM): True
- ' d1 (1/28/2010 9:01:26 PM) ~= d6 (1/28/2010 11:01:46 PM): False
- ' d1 (1/28/2010 9:01:26 PM) ~= d7 (1/28/2010 11:01:06 PM): False
- ' d1 (1/28/2010 9:01:26 PM) ~= d8 (1/28/2010 11:01:31 PM): True
- ' d1 (1/28/2010 9:01:26 PM) ~= d9 (1/28/2010 11:01:21 PM): True
- '
-
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Instantiation.vb b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Instantiation.vb
deleted file mode 100644
index b4612342cd931..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Instantiation.vb
+++ /dev/null
@@ -1,61 +0,0 @@
-Module Instantiation
-
- Public Sub Snippets()
- InstantiateWithConstructor()
- InstantiateWithCompilerSyntax()
- InstantiateWithReturnValue()
- InstantiateFromString()
- InstantiateUsingDftCtor()
- End Sub
-
- Private Sub InstantiateWithConstructor()
- '
- Dim date1 As New Date(2008, 5, 1, 8, 30, 52)
- '
- End Sub
-
- Private Sub InstantiateWithCompilerSyntax()
- '
- Dim date1 As Date = #5/1/2008 8:30:52AM#
- '
- End Sub
-
- Private Sub InstantiateWithReturnValue()
- '
- Dim date1 As Date = Date.Now
- Dim date2 As Date = Date.UtcNow
- Dim date3 As Date = Date.Today
- '
- End Sub
-
- Private Sub InstantiateFromString()
- '
- Dim dateString As String = "5/1/2008 8:30:52 AM"
- Dim date1 As Date = Date.Parse(dateString,
- System.Globalization.CultureInfo.InvariantCulture)
- Dim iso8601String As String = "20080501T08:30:52Z"
- Dim dateISO8602 As Date = DateTime.ParseExact(iso8601String, "yyyyMMddTHH:mm:ssZ",
- System.Globalization.CultureInfo.InvariantCulture)
- Console.WriteLine(dateISO8602)
-
- '
- Console.WriteLine(date1)
- End Sub
-
- Private Sub InstantiateUsingDftCtor()
- '
- Dim dat1 As DateTime
- ' The following method call displays 1/1/0001 12:00:00 AM.
- Console.WriteLine(dat1.ToString(System.Globalization.CultureInfo.InvariantCulture))
- ' The following method call displays True.
- Console.WriteLine(dat1.Equals(Date.MinValue))
-
- Dim dat2 As New DateTime()
- ' The following method call displays 1/1/0001 12:00:00 AM.
- Console.WriteLine(dat2.ToString(System.Globalization.CultureInfo.InvariantCulture))
- ' The following method call displays True.
- Console.WriteLine(dat2.Equals(Date.MinValue))
- '
- End Sub
-
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Parsing.vb b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Parsing.vb
deleted file mode 100644
index 4cfe6eecb6c2c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Parsing.vb
+++ /dev/null
@@ -1,166 +0,0 @@
-Imports System.Globalization
-Imports System.Threading
-
-Module Parsing
- Public Sub Snippets()
- ParseStandardFormats()
- End Sub
-
- Private Sub ParseStandardFormats()
- '
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB")
-
- Dim date1 As New DateTime(2013, 6, 1, 12, 32, 30)
- Dim badFormats As New List(Of String)
-
- Console.WriteLine($"{"Date String",-37} {"Date",-19}")
- Console.WriteLine()
- For Each dateString As String In date1.GetDateTimeFormats()
- Dim parsedDate As DateTime
- If DateTime.TryParse(dateString, parsedDate) Then
- Console.WriteLine($"{dateString,-37} {DateTime.Parse(dateString),-19:g}")
- Else
- badFormats.Add(dateString)
- End If
- Next
-
- ' Display strings that could not be parsed.
- If badFormats.Count > 0 Then
- Console.WriteLine()
- Console.WriteLine("Strings that could not be parsed: ")
- For Each badFormat In badFormats
- Console.WriteLine($" {badFormat}")
- Next
- End If
- ' The example displays the following output:
- ' Date String Date
- '
- ' 01/06/2013 01/06/2013 00:00:00
- ' 01/06/13 01/06/2013 00:00:00
- ' 1/6/13 01/06/2013 00:00:00
- ' 1.6.13 01/06/2013 00:00:00
- ' 2013-06-01 01/06/2013 00:00:00
- ' 01 June 2013 01/06/2013 00:00:00
- ' 1 June 2013 01/06/2013 00:00:00
- ' 01 June 2013 12:32 01/06/2013 12:32:00
- ' 01 June 2013 12:32 01/06/2013 12:32:00
- ' 01 June 2013 12:32 PM 01/06/2013 12:32:00
- ' 01 June 2013 12:32 PM 01/06/2013 12:32:00
- ' 1 June 2013 12:32 01/06/2013 12:32:00
- ' 1 June 2013 12:32 01/06/2013 12:32:00
- ' 1 June 2013 12:32 PM 01/06/2013 12:32:00
- ' 1 June 2013 12:32 PM 01/06/2013 12:32:00
- ' 01 June 2013 12:32:30 01/06/2013 12:32:30
- ' 01 June 2013 12:32:30 01/06/2013 12:32:30
- ' 01 June 2013 12:32:30 PM 01/06/2013 12:32:30
- ' 01 June 2013 12:32:30 PM 01/06/2013 12:32:30
- ' 1 June 2013 12:32:30 01/06/2013 12:32:30
- ' 1 June 2013 12:32:30 01/06/2013 12:32:30
- ' 1 June 2013 12:32:30 PM 01/06/2013 12:32:30
- ' 1 June 2013 12:32:30 PM 01/06/2013 12:32:30
- ' 01/06/2013 12:32 01/06/2013 12:32:00
- ' 01/06/2013 12:32 01/06/2013 12:32:00
- ' 01/06/2013 12:32 PM 01/06/2013 12:32:00
- ' 01/06/2013 12:32 PM 01/06/2013 12:32:00
- ' 01/06/13 12:32 01/06/2013 12:32:00
- ' 01/06/13 12:32 01/06/2013 12:32:00
- ' 01/06/13 12:32 PM 01/06/2013 12:32:00
- ' 01/06/13 12:32 PM 01/06/2013 12:32:00
- ' 1/6/13 12:32 01/06/2013 12:32:00
- ' 1/6/13 12:32 01/06/2013 12:32:00
- ' 1/6/13 12:32 PM 01/06/2013 12:32:00
- ' 1/6/13 12:32 PM 01/06/2013 12:32:00
- ' 1.6.13 12:32 01/06/2013 12:32:00
- ' 1.6.13 12:32 01/06/2013 12:32:00
- ' 1.6.13 12:32 PM 01/06/2013 12:32:00
- ' 1.6.13 12:32 PM 01/06/2013 12:32:00
- ' 2013-06-01 12:32 01/06/2013 12:32:00
- ' 2013-06-01 12:32 01/06/2013 12:32:00
- ' 2013-06-01 12:32 PM 01/06/2013 12:32:00
- ' 2013-06-01 12:32 PM 01/06/2013 12:32:00
- ' 01/06/2013 12:32:30 01/06/2013 12:32:30
- ' 01/06/2013 12:32:30 01/06/2013 12:32:30
- ' 01/06/2013 12:32:30 PM 01/06/2013 12:32:30
- ' 01/06/2013 12:32:30 PM 01/06/2013 12:32:30
- ' 01/06/13 12:32:30 01/06/2013 12:32:30
- ' 01/06/13 12:32:30 01/06/2013 12:32:30
- ' 01/06/13 12:32:30 PM 01/06/2013 12:32:30
- ' 01/06/13 12:32:30 PM 01/06/2013 12:32:30
- ' 1/6/13 12:32:30 01/06/2013 12:32:30
- ' 1/6/13 12:32:30 01/06/2013 12:32:30
- ' 1/6/13 12:32:30 PM 01/06/2013 12:32:30
- ' 1/6/13 12:32:30 PM 01/06/2013 12:32:30
- ' 1.6.13 12:32:30 01/06/2013 12:32:30
- ' 1.6.13 12:32:30 01/06/2013 12:32:30
- ' 1.6.13 12:32:30 PM 01/06/2013 12:32:30
- ' 1.6.13 12:32:30 PM 01/06/2013 12:32:30
- ' 2013-06-01 12:32:30 01/06/2013 12:32:30
- ' 2013-06-01 12:32:30 01/06/2013 12:32:30
- ' 2013-06-01 12:32:30 PM 01/06/2013 12:32:30
- ' 2013-06-01 12:32:30 PM 01/06/2013 12:32:30
- ' 01 June 01/06/2013 00:00:00
- ' 01 June 01/06/2013 00:00:00
- ' 2013-06-01T12:32:30.0000000 01/06/2013 12:32:30
- ' 2013-06-01T12:32:30.0000000 01/06/2013 12:32:30
- ' Sat, 01 Jun 2013 12:32:30 GMT 01/06/2013 05:32:30
- ' Sat, 01 Jun 2013 12:32:30 GMT 01/06/2013 05:32:30
- ' 2013-06-01T12:32:30 01/06/2013 12:32:30
- ' 12:32 22/04/2013 12:32:00
- ' 12:32 22/04/2013 12:32:00
- ' 12:32 PM 22/04/2013 12:32:00
- ' 12:32 PM 22/04/2013 12:32:00
- ' 12:32:30 22/04/2013 12:32:30
- ' 12:32:30 22/04/2013 12:32:30
- ' 12:32:30 PM 22/04/2013 12:32:30
- ' 12:32:30 PM 22/04/2013 12:32:30
- ' 2013-06-01 12:32:30Z 01/06/2013 05:32:30
- ' 01 June 2013 19:32:30 01/06/2013 19:32:30
- ' 01 June 2013 19:32:30 01/06/2013 19:32:30
- ' 01 June 2013 07:32:30 PM 01/06/2013 19:32:30
- ' 01 June 2013 7:32:30 PM 01/06/2013 19:32:30
- ' 1 June 2013 19:32:30 01/06/2013 19:32:30
- ' 1 June 2013 19:32:30 01/06/2013 19:32:30
- ' 1 June 2013 07:32:30 PM 01/06/2013 19:32:30
- ' 1 June 2013 7:32:30 PM 01/06/2013 19:32:30
- ' June 2013 01/06/2013 00:00:00
- ' June 2013 01/06/2013 00:00:00
- '
- End Sub
-
- Private Sub ParseCustomFormats()
- '
- Dim formats() As String = {"yyyyMMdd", "HHmmss"}
- Dim dateStrings() As String = {"20130816", "20131608",
- " 20130816 ", "115216",
- "521116", " 115216 "}
- Dim parsedDate As DateTime
-
- For Each dateString As String In dateStrings
- If DateTime.TryParseExact(dateString, formats, Nothing,
- DateTimeStyles.AllowWhiteSpaces Or
- DateTimeStyles.AdjustToUniversal,
- parsedDate) Then
- Console.WriteLine($"{dateString} --> {parsedDate:g}")
- Else
- Console.WriteLine($"Cannot convert {dateString}")
- End If
- Next
- ' The example displays the following output:
- ' 20130816 --> 8/16/2013 12:00 AM
- ' Cannot convert 20131608
- ' 20130816 --> 8/16/2013 12:00 AM
- ' 115216 --> 4/22/2013 11:52 AM
- ' Cannot convert 521116
- ' 115216 --> 4/22/2013 11:52 AM
- '
- End Sub
-
- Private Sub ParseISO8601()
- '
- Dim iso8601String As String = "20080501T08:30:52Z"
- Dim dateISO8602 As DateTime = DateTime.ParseExact(iso8601String, "yyyyMMddTHH:mm:ssZ", CultureInfo.InvariantCulture)
- Console.WriteLine($"{iso8601String} --> {dateISO8602:g}")
- '
-
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Resolution.vb b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Resolution.vb
deleted file mode 100644
index a317d56fe09b6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/Resolution.vb
+++ /dev/null
@@ -1,50 +0,0 @@
-Imports System.Threading
-
-Module Resolution
-
- Public Sub Snippets()
- DemonstrateResolution()
- End Sub
-
- Private Sub DemonstrateResolution()
- '
- Dim output As String = ""
- For ctr As Integer = 0 To 20
- output += Date.Now.Millisecond.ToString() + vbCrLf
- ' Introduce a delay loop.
- For delay As Integer = 0 To 1000
- Next
-
- If ctr = 10 Then
- output += "Thread.Sleep called..." + vbCrLf
- Thread.Sleep(5)
- End If
- Next
- Console.WriteLine(output)
- ' The example displays output like the following:
- ' 111
- ' 111
- ' 111
- ' 111
- ' 111
- ' 111
- ' 111
- ' 111
- ' 111
- ' 111
- ' 111
- ' Thread.Sleep called...
- ' 143
- ' 143
- ' 143
- ' 143
- ' 143
- ' 143
- ' 143
- ' 143
- ' 143
- ' 143
- '
-
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/StringFormat.vb b/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/StringFormat.vb
deleted file mode 100644
index 9d488e4f41f82..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/vb/StringFormat.vb
+++ /dev/null
@@ -1,50 +0,0 @@
-Module StringFormat
- Public Sub Snippets()
- ShowDefaultToString()
- ShowCultureSpecificToString()
- ShowDefaultFullDateAndTime()
- ShowCultureSpecificFullDateAndTime()
- ShowIsoDateTime()
- End Sub
-
- Private Sub ShowDefaultToString()
- '
- Dim date1 As Date = #3/1/2008 7:00AM#
- Console.WriteLine(date1.ToString())
- ' For en-US culture, displays 3/1/2008 7:00:00 AM
- '
- End Sub
-
- Private Sub ShowCultureSpecificToString()
- '
- Dim date1 As Date = #3/1/2008 7:00AM#
- Console.WriteLine(date1.ToString(System.Globalization.CultureInfo.CreateSpecificCulture("fr-FR")))
- ' Displays 01/03/2008 07:00:00
- '
- End Sub
-
- Private Sub ShowDefaultFullDateAndTime()
- '
- Dim date1 As Date = #3/1/2008 7:00AM#
- Console.WriteLine(date1.ToString("F"))
- ' Displays Saturday, March 01, 2008 7:00:00 AM
- '
- End Sub
-
- Private Sub ShowCultureSpecificFullDateAndTime()
- '
- Dim date1 As Date = #3/1/2008 7:00AM#
- Console.WriteLine(date1.ToString("F", New System.Globalization.CultureInfo("fr-FR")))
- ' Displays samedi 1 mars 2008 07:00:00
- '
- End Sub
-
- Private Sub ShowIsoDateTime()
- '
- Dim date1 As DateTime = New DateTime(2008, 3, 1, 7, 0, 0, DateTimeKind.Utc)
- Console.WriteLine(date1.ToString("yyyy-MM-ddTHH:mm:sszzz", System.Globalization.CultureInfo.InvariantCulture))
- ' Displays 2008-03-01T07:00:00+00:00
- '
- End Sub
-
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/csharp/DecimalDivision_46630_1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/csharp/DecimalDivision_46630_1.cs
deleted file mode 100644
index e3fa0a83ba858..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/csharp/DecimalDivision_46630_1.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;
-
-public class Class1
-{
- public static void Main()
- {
- DivideWithoutRounding();
- DivideWithRounding();
- }
-
- private static void DivideWithoutRounding()
- {
- Console.WriteLine("DivideWithoutRounding");
- //
- decimal dividend = Decimal.One;
- decimal divisor = 3;
- // The following displays 0.9999999999999999999999999999 to the console
- Console.WriteLine(dividend/divisor * divisor);
- //
- }
-
- private static void DivideWithRounding()
- {
- Console.WriteLine("DivideWithRounding");
- //
- decimal dividend = Decimal.One;
- decimal divisor = 3;
- // The following displays 1.00 to the console
- Console.WriteLine(Math.Round(dividend/divisor * divisor, 2));
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/csharp/source.cs
deleted file mode 100644
index f8ff53bea39db..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/csharp/source.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-using System;
-
-namespace Snippets
-{
- class Launcher {
- static void Main(string[] args)
- {
- PiggyBank pb = new PiggyBank();
-
- for(int i=0; i<378; i++) {
- pb.AddPenny();
- }
-
- Console.WriteLine(pb);
-
- Console.ReadLine();
- }
- }
-
- //
- ///
- /// Keeping my fortune in Decimals to avoid the round-off errors.
- ///
- class PiggyBank {
- protected decimal MyFortune;
-
- public void AddPenny() {
- MyFortune = Decimal.Add(MyFortune, .01m);
- }
-
- public decimal Capacity {
- get {
- return Decimal.MaxValue;
- }
- }
-
- public decimal Dollars {
- get {
- return Decimal.Floor(MyFortune);
- }
- }
-
- public decimal Cents {
- get {
- return Decimal.Subtract(MyFortune, Decimal.Floor(MyFortune));
- }
- }
-
- public override string ToString() {
- return MyFortune.ToString("C")+" in piggy bank";
- }
- }
- //
-}
-
-namespace Snippets2 {
- //
- class PiggyBank {
- public decimal Capacity {
- get {
- return Decimal.MaxValue;
- }
- }
-
- protected decimal MyFortune;
-
- public void AddPenny() {
- MyFortune += .01m;
- }
- }
- //
-}
-
-namespace Snippets3 {
- //
- class PiggyBank {
- public decimal Dollars {
- get {
- return Decimal.Floor(MyFortune);
- }
- }
-
- protected decimal MyFortune;
-
- public void AddPenny() {
- MyFortune += .01m;
- }
- }
- //
-}
-
-namespace Snippets4 {
- //
- class PiggyBank {
- public decimal Cents {
- get {
- return Decimal.Subtract(MyFortune, Decimal.Floor(MyFortune));
- }
- }
-
- protected decimal MyFortune;
-
- public void AddPenny() {
- MyFortune += .01m;
- }
- }
- //
-}
-
-namespace Snippets5 {
- //
- class PiggyBank {
- public void AddPenny() {
- MyFortune = Decimal.Add(MyFortune, .01m);
- }
-
- public override string ToString() {
- return MyFortune.ToString("C")+" in piggy bank";
- }
-
- protected decimal MyFortune;
- }
- //
-}
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/fsharp/DecimalDivision_46630_1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/fsharp/DecimalDivision_46630_1.fs
deleted file mode 100644
index 8c95a3d5e51fb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/fsharp/DecimalDivision_46630_1.fs
+++ /dev/null
@@ -1,22 +0,0 @@
-module DecimalDivision_46630_1
-
-open System
-
-let divideWithoutRounding () =
- //
- let dividend = Decimal.One
- let divisor = 3m
- // The following displays 0.9999999999999999999999999999 to the console
- printfn $"{dividend/divisor * divisor}"
- //
-
-let divideWithRounding () =
- //
- let dividend = Decimal.One
- let divisor = 3m
- // The following displays 1.00 to the console
- printfn $"{Math.Round(dividend/divisor * divisor, 2)}"
- //
-
-divideWithoutRounding ()
-divideWithRounding ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/fsharp/source.fs b/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/fsharp/source.fs
deleted file mode 100644
index 105f475288e3c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/fsharp/source.fs
+++ /dev/null
@@ -1,73 +0,0 @@
-module snippets
-
-open System
-
-module snippet1 =
- //
- /// Keeping my fortune in Decimals to avoid the round-off errors.
- type PiggyBank() =
- let mutable myFortune = 0m
-
- member _.AddPenny() =
- myFortune <- Decimal.Add(myFortune, 0.01m)
-
- member _.Capacity =
- Decimal.MaxValue
-
- member _.Dollars =
- Decimal.Floor myFortune
-
- member _.Cents =
- Decimal.Subtract(myFortune, Decimal.Floor myFortune)
-
- override _.ToString() =
- $"{myFortune:C} in piggy bank"
- //
-
-module snippet2 =
- //
- type PiggyBank() =
- let mutable myFortune = 0m
-
- member _.Capacity =
- Decimal.MaxValue
-
- member _.AddPenny() =
- myFortune <- myFortune + 0.01m
- //
-
-module snippet3 =
- //
- type PiggyBank() =
- let mutable myFortune = 0m
-
- member _.Dollars =
- Decimal.Floor myFortune
-
- member _.AddPenny() =
- myFortune <- myFortune + 0.01m
- //
-
-module snippet4 =
- //
- type PiggyBank() =
- let mutable myFortune = 0m
-
- member _.Cents =
- Decimal.Subtract(myFortune, Decimal.Floor myFortune)
-
- member _.AddPenny() =
- myFortune <- myFortune + 0.01m
- //
-
-module snippet5 =
- //
- type PiggyBank() =
- let mutable myFortune = 0m
-
- member _.AddPenny() =
- myFortune <- Decimal.Add(myFortune, 0.01m)
-
- override _.ToString() =
- $"{myFortune:C} in piggy bank"
- //
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/vb/DecimalDivision_46630_1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/vb/DecimalDivision_46630_1.vb
deleted file mode 100644
index 4adba2f5bbc24..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/vb/DecimalDivision_46630_1.vb
+++ /dev/null
@@ -1,47 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module modMain
-
- Public Sub Main()
- DivideWithSingles()
- DivideWithDoubles()
- DivideWithoutRounding()
- DivideWithRounding()
- End Sub
-
- Private Sub DivideWithoutRounding()
- Console.WriteLine("DivideWithoutRounding")
- '
- Dim dividend As Decimal = Decimal.One
- Dim divisor As Decimal = 3
- ' The following displays 0.9999999999999999999999999999 to the console
- Console.WriteLine(dividend/divisor * divisor)
- '
- End Sub
-
- Private Sub DivideWithRounding()
- Console.WriteLine("DivideWithRounding")
- '
- Dim dividend As Decimal = Decimal.One
- Dim divisor As Decimal = 3
- ' The following displays 1.00 to the console
- Console.WriteLine(Math.Round(dividend/divisor * divisor, 2))
- '
- End Sub
-
- Private Sub DivideWithSingles()
- Console.WriteLine("DivideWithSingles")
- Dim dividend As Single = 1
- Dim divisor As Single = 3
- Console.WriteLine(dividend/divisor * divisor)
- End Sub
-
- Private Sub DivideWithDoubles()
- Console.WriteLine("DivideWithDoubles")
- Dim dividend As Double = 1
- Dim divisor As Double = 3
- Console.WriteLine(dividend/divisor * divisor)
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/vb/source.vb
deleted file mode 100644
index 59430b7e607dd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Decimal/Overview/vb/source.vb
+++ /dev/null
@@ -1,122 +0,0 @@
-Namespace Snippets
- Class Launcher
- 'Entry point which delegates to C-style main Private Function
- Public Overloads Shared Sub Main()
- Dim pb As New PiggyBank()
-
- Dim i As Integer
- For i = 0 To 377
- pb.AddPenny()
- Next i
-
- Console.WriteLine(pb)
-
- Console.ReadLine()
- End Sub
- End Class
-
- '
- ' Keeping my fortune in Decimals to avoid the round-off errors.
- Class PiggyBank
- Protected MyFortune As Decimal
-
- Public Sub AddPenny()
- MyFortune = [Decimal].Add(MyFortune, 0.01D)
- End Sub
-
- Public ReadOnly Property Capacity() As Decimal
- Get
- Return [Decimal].MaxValue
- End Get
- End Property
-
- Public ReadOnly Property Dollars() As Decimal
- Get
- Return [Decimal].Floor(MyFortune)
- End Get
- End Property
-
- Public ReadOnly Property Cents() As Decimal
- Get
- Return [Decimal].Subtract(MyFortune, [Decimal].Floor(MyFortune))
- End Get
- End Property
-
- Public Overrides Function ToString() As String
- Return MyFortune.ToString("C") + " in piggy bank"
- End Function
- End Class
- '
-End Namespace
-
-Namespace Snippets2
- '
- Class PiggyBank
- Public ReadOnly Property Capacity() As Decimal
- Get
- Return [Decimal].MaxValue
- End Get
- End Property
-
- Protected MyFortune As Decimal
-
- Public Sub AddPenny()
- MyFortune += 0.01D
- End Sub
- End Class
- '
-End Namespace
-
-Namespace Snippets3
- '
- Class PiggyBank
- Public ReadOnly Property Dollars() As Decimal
- Get
- Return [Decimal].Floor(MyFortune)
- End Get
- End Property
-
- Protected MyFortune As Decimal
-
- Public Sub AddPenny()
- MyFortune += 0.01D
- End Sub
- End Class
- '
-End Namespace
-
-Namespace Snippets4
- _
- '
- Class PiggyBank
- Public ReadOnly Property Cents() As Decimal
- Get
- Return [Decimal].Subtract(MyFortune, [Decimal].Floor(MyFortune))
- End Get
- End Property
-
- Protected MyFortune As Decimal
-
- Public Sub AddPenny()
- MyFortune += 0.01D
- End Sub
- End Class
- '
-End Namespace
-
-Namespace Snippets5
- '
- Class PiggyBank
-
- Public Sub AddPenny()
- MyFortune = [Decimal].Add(MyFortune, 0.01D)
- End Sub
-
- Public Overrides Function ToString() As String
- Return MyFortune.ToString("C") + " in piggy bank"
- End Function
-
- Protected MyFortune As Decimal
- End Class
- '
-End Namespace
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/openClosedOver.cs b/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/openClosedOver.cs
deleted file mode 100644
index 41d6b617f5774..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/openClosedOver.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-// All four permutations of instance/static with open/closed.
-//
-//
-using System;
-using System.Reflection;
-
-// Declare three delegate types for demonstrating the combinations
-// of static versus instance methods and open versus closed
-// delegates.
-//
-public delegate void D1(C c, string s);
-public delegate void D2(string s);
-public delegate void D3();
-
-// A sample class with an instance method and a static method.
-//
-public class C
-{
- private int id;
- public C(int id) { this.id = id; }
-
- public void M1(string s)
- {
- Console.WriteLine("Instance method M1 on C: id = {0}, s = {1}",
- this.id, s);
- }
-
- public static void M2(string s)
- {
- Console.WriteLine($"Static method M2 on C: s = {s}");
- }
-}
-
-public class Example2
-{
- public static void Main()
- {
- C c1 = new C(42);
-
- // Get a MethodInfo for each method.
- //
- MethodInfo mi1 = typeof(C).GetMethod("M1",
- BindingFlags.Public | BindingFlags.Instance);
- MethodInfo mi2 = typeof(C).GetMethod("M2",
- BindingFlags.Public | BindingFlags.Static);
-
- D1 d1;
- D2 d2;
- D3 d3;
-
- Console.WriteLine("\nAn instance method closed over C.");
- // In this case, the delegate and the
- // method must have the same list of argument types; use
- // delegate type D2 with instance method M1.
- //
- Delegate test =
- Delegate.CreateDelegate(typeof(D2), c1, mi1, false);
-
- // Because false was specified for throwOnBindFailure
- // in the call to CreateDelegate, the variable 'test'
- // contains null if the method fails to bind (for
- // example, if mi1 happened to represent a method of
- // some class other than C).
- //
- if (test != null)
- {
- d2 = (D2)test;
-
- // The same instance of C is used every time the
- // delegate is invoked.
- d2("Hello, World!");
- d2("Hi, Mom!");
- }
-
- Console.WriteLine("\nAn open instance method.");
- // In this case, the delegate has one more
- // argument than the instance method; this argument comes
- // at the beginning, and represents the hidden instance
- // argument of the instance method. Use delegate type D1
- // with instance method M1.
- //
- d1 = (D1)Delegate.CreateDelegate(typeof(D1), null, mi1);
-
- // An instance of C must be passed in each time the
- // delegate is invoked.
- //
- d1(c1, "Hello, World!");
- d1(new C(5280), "Hi, Mom!");
-
- Console.WriteLine("\nAn open static method.");
- // In this case, the delegate and the method must
- // have the same list of argument types; use delegate type
- // D2 with static method M2.
- //
- d2 = (D2)Delegate.CreateDelegate(typeof(D2), null, mi2);
-
- // No instances of C are involved, because this is a static
- // method.
- //
- d2("Hello, World!");
- d2("Hi, Mom!");
-
- Console.WriteLine("\nA static method closed over the first argument (String).");
- // The delegate must omit the first argument of the method.
- // A string is passed as the firstArgument parameter, and
- // the delegate is bound to this string. Use delegate type
- // D3 with static method M2.
- //
- d3 = (D3)Delegate.CreateDelegate(typeof(D3),
- "Hello, World!", mi2);
-
- // Each time the delegate is invoked, the same string is
- // used.
- d3();
- }
-}
-
-/* This code example produces the following output:
-
-An instance method closed over C.
-Instance method M1 on C: id = 42, s = Hello, World!
-Instance method M1 on C: id = 42, s = Hi, Mom!
-
-An open instance method.
-Instance method M1 on C: id = 42, s = Hello, World!
-Instance method M1 on C: id = 5280, s = Hi, Mom!
-
-An open static method.
-Static method M2 on C: s = Hello, World!
-Static method M2 on C: s = Hi, Mom!
-
-A static method closed over the first argument (String).
-Static method M2 on C: s = Hello, World!
- */
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/source.cs
deleted file mode 100644
index 715f8658cad22..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/source.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-// Showing all the things D(A) can bind to.
-//
-//
-using System;
-using System.Reflection;
-
-// Declare a delegate type. The object of this code example
-// is to show all the methods this delegate can bind to.
-//
-public delegate void D(C1 c);
-
-// Declare two sample classes, C1 and F. Class C1 has an ID
-// property so instances can be identified.
-//
-public class C1
-{
- private int id;
- public int ID { get { return id; } }
- public C1(int id) { this.id = id; }
-
- public void M1(C1 c)
- {
- Console.WriteLine("Instance method M1(C1 c) on C1: this.id = {0}, c.ID = {1}",
- this.id, c.ID);
- }
-
- public void M2()
- {
- Console.WriteLine($"Instance method M2() on C1: this.id = {this.id}");
- }
-
- public static void M3(C1 c)
- {
- Console.WriteLine($"Static method M3(C1 c) on C1: c.ID = {c.ID}");
- }
-
- public static void M4(C1 c1, C1 c2)
- {
- Console.WriteLine("Static method M4(C1 c1, C1 c2) on C1: c1.ID = {0}, c2.ID = {1}",
- c1.ID, c2.ID);
- }
-}
-
-public class F
-{
- public void M1(C1 c)
- {
- Console.WriteLine($"Instance method M1(C1 c) on F: c.ID = {c.ID}");
- }
-
- public static void M3(C1 c)
- {
- Console.WriteLine($"Static method M3(C1 c) on F: c.ID = {c.ID}");
- }
-
- public static void M4(F f, C1 c)
- {
- Console.WriteLine($"Static method M4(F f, C1 c) on F: c.ID = {c.ID}");
- }
-}
-
-public class Example
-{
- public static void Main()
- {
- C1 c1 = new C1(42);
- C1 c2 = new C1(1491);
- F f1 = new F();
-
- D d;
-
- // Instance method with one argument of type C1.
- MethodInfo cmi1 = typeof(C1).GetMethod("M1");
- // Instance method with no arguments.
- MethodInfo cmi2 = typeof(C1).GetMethod("M2");
- // Static method with one argument of type C1.
- MethodInfo cmi3 = typeof(C1).GetMethod("M3");
- // Static method with two arguments of type C1.
- MethodInfo cmi4 = typeof(C1).GetMethod("M4");
-
- // Instance method with one argument of type C1.
- MethodInfo fmi1 = typeof(F).GetMethod("M1");
- // Static method with one argument of type C1.
- MethodInfo fmi3 = typeof(F).GetMethod("M3");
- // Static method with an argument of type F and an argument
- // of type C1.
- MethodInfo fmi4 = typeof(F).GetMethod("M4");
-
- Console.WriteLine("\nAn instance method on any type, with an argument of type C1.");
- // D can represent any instance method that exactly matches its
- // signature. Methods on C1 and F are shown here.
- //
- d = (D)Delegate.CreateDelegate(typeof(D), c1, cmi1);
- d(c2);
- d = (D)Delegate.CreateDelegate(typeof(D), f1, fmi1);
- d(c2);
-
- Console.WriteLine("\nAn instance method on C1 with no arguments.");
- // D can represent an instance method on C1 that has no arguments;
- // in this case, the argument of D represents the hidden first
- // argument of any instance method. The delegate acts like a
- // static method, and an instance of C1 must be passed each time
- // it is invoked.
- //
- d = (D)Delegate.CreateDelegate(typeof(D), null, cmi2);
- d(c1);
-
- Console.WriteLine("\nA static method on any type, with an argument of type C1.");
- // D can represent any static method with the same signature.
- // Methods on F and C1 are shown here.
- //
- d = (D)Delegate.CreateDelegate(typeof(D), null, cmi3);
- d(c1);
- d = (D)Delegate.CreateDelegate(typeof(D), null, fmi3);
- d(c1);
-
- Console.WriteLine("\nA static method on any type, with an argument of");
- Console.WriteLine(" that type and an argument of type C1.");
- // D can represent any static method with one argument of the
- // type the method belongs and a second argument of type C1.
- // In this case, the method is closed over the instance of
- // supplied for the its first argument, and acts like an instance
- // method. Methods on F and C1 are shown here.
- //
- d = (D)Delegate.CreateDelegate(typeof(D), c1, cmi4);
- d(c2);
- Delegate test =
- Delegate.CreateDelegate(typeof(D), f1, fmi4, false);
-
- // This final example specifies false for throwOnBindFailure
- // in the call to CreateDelegate, so the variable 'test'
- // contains Nothing if the method fails to bind (for
- // example, if fmi4 happened to represent a method of
- // some class other than F).
- //
- if (test != null)
- {
- d = (D)test;
- d(c2);
- }
- }
-}
-
-/* This code example produces the following output:
-
-An instance method on any type, with an argument of type C1.
-Instance method M1(C1 c) on C1: this.id = 42, c.ID = 1491
-Instance method M1(C1 c) on F: c.ID = 1491
-
-An instance method on C1 with no arguments.
-Instance method M2() on C1: this.id = 42
-
-A static method on any type, with an argument of type C1.
-Static method M3(C1 c) on C1: c.ID = 42
-Static method M3(C1 c) on F: c.ID = 42
-
-A static method on any type, with an argument of
- that type and an argument of type C1.
-Static method M4(C1 c1, C1 c2) on C1: c1.ID = 42, c2.ID = 1491
-Static method M4(F f, C1 c) on F: c.ID = 1491
-*/
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/source1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/source1.cs
deleted file mode 100644
index c6879c35ef5af..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/csharp/source1.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-using System;
-using System.Reflection;
-
-// Define two classes to use in the demonstration, a base class and
-// a class that derives from it.
-//
-public class Base { }
-
-public class Derived : Base
-{
- // Define a static method to use in the demonstration. The method
- // takes an instance of Base and returns an instance of Derived.
- // For the purposes of the demonstration, it is not necessary for
- // the method to do anything useful.
- //
- public static Derived MyMethod(Base arg)
- {
- Base dummy = arg;
- return new Derived();
- }
-}
-
-// Define a delegate that takes an instance of Derived and returns an
-// instance of Base.
-//
-public delegate Base Example5(Derived arg);
-
-class Test
-{
- public static void Main()
- {
- // The binding flags needed to retrieve MyMethod.
- BindingFlags flags = BindingFlags.Public | BindingFlags.Static;
-
- // Get a MethodInfo that represents MyMethod.
- MethodInfo minfo = typeof(Derived).GetMethod("MyMethod", flags);
-
- // Demonstrate contravariance of parameter types and covariance
- // of return types by using the delegate Example5 to represent
- // MyMethod. The delegate binds to the method because the
- // parameter of the delegate is more restrictive than the
- // parameter of the method (that is, the delegate accepts an
- // instance of Derived, which can always be safely passed to
- // a parameter of type Base), and the return type of MyMethod
- // is more restrictive than the return type of Example5 (that
- // is, the method returns an instance of Derived, which can
- // always be safely cast to type Base).
- //
- Example5 ex =
- (Example5)Delegate.CreateDelegate(typeof(Example5), minfo);
-
- // Execute MyMethod using the delegate Example5.
- //
- Base b = ex(new Derived());
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/fsharp/openClosedOver.fs b/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/fsharp/openClosedOver.fs
deleted file mode 100644
index 9ed094ca96af1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/fsharp/openClosedOver.fs
+++ /dev/null
@@ -1,101 +0,0 @@
-module openClosedOver
-
-// All four permutations of instance/static with open/closed.
-//
-//
-open System
-open System.Reflection
-
-// A sample class with an instance method and a static method.
-type C(id) =
- member _.M1(s) =
- printfn $"Instance method M1 on C: id = %i{id}, s = %s{s}"
-
- static member M2(s) =
- printfn $"Static method M2 on C: s = %s{s}"
-
-// Declare three delegate types for demonstrating the combinations
-// of static versus instance methods and open versus closed
-// delegates.
-type D1 = delegate of C * string -> unit
-type D2 = delegate of string -> unit
-type D3 = delegate of unit -> unit
-
-let c1 = C 42
-
-// Get a MethodInfo for each method.
-//
-let mi1 = typeof.GetMethod("M1", BindingFlags.Public ||| BindingFlags.Instance)
-let mi2 = typeof.GetMethod("M2", BindingFlags.Public ||| BindingFlags.Static)
-
-printfn "\nAn instance method closed over C."
-
-// In this case, the delegate and the
-// method must have the same list of argument types use
-// delegate type D2 with instance method M1.
-let test = Delegate.CreateDelegate(typeof, c1, mi1, false)
-
-// Because false was specified for throwOnBindFailure
-// in the call to CreateDelegate, the variable 'test'
-// contains null if the method fails to bind (for
-// example, if mi1 happened to represent a method of
-// some class other than C).
-if test <> null then
- let d2 = test :?> D2
-
- // The same instance of C is used every time the
- // delegate is invoked.
- d2.Invoke "Hello, World!"
- d2.Invoke "Hi, Mom!"
-
-printfn "\nAn open instance method."
-
-// In this case, the delegate has one more
-// argument than the instance method this argument comes
-// at the beginning, and represents the hidden instance
-// argument of the instance method. Use delegate type D1
-// with instance method M1.
-let d1 = Delegate.CreateDelegate(typeof, null, mi1) :?> D1
-
-// An instance of C must be passed in each time the
-// delegate is invoked.
-d1.Invoke(c1, "Hello, World!")
-d1.Invoke(C 5280, "Hi, Mom!")
-
-printfn "\nAn open static method."
-// In this case, the delegate and the method must
-// have the same list of argument types use delegate type
-// D2 with static method M2.
-let d2 = Delegate.CreateDelegate(typeof, null, mi2) :?> D2
-
-// No instances of C are involved, because this is a static
-// method.
-d2.Invoke "Hello, World!"
-d2.Invoke "Hi, Mom!"
-
-printfn "\nA static method closed over the first argument (String)."
-// The delegate must omit the first argument of the method.
-// A string is passed as the firstArgument parameter, and
-// the delegate is bound to this string. Use delegate type
-// D3 with static method M2.
-let d3 = Delegate.CreateDelegate(typeof, "Hello, World!", mi2) :?> D3
-
-// Each time the delegate is invoked, the same string is used.
-d3.Invoke()
-
-// This code example produces the following output:
-// An instance method closed over C.
-// Instance method M1 on C: id = 42, s = Hello, World!
-// Instance method M1 on C: id = 42, s = Hi, Mom!
-//
-// An open instance method.
-// Instance method M1 on C: id = 42, s = Hello, World!
-// Instance method M1 on C: id = 5280, s = Hi, Mom!
-//
-// An open static method.
-// Static method M2 on C: s = Hello, World!
-// Static method M2 on C: s = Hi, Mom!
-//
-// A static method closed over the first argument (String).
-// Static method M2 on C: s = Hello, World!
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/fsharp/source.fs b/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/fsharp/source.fs
deleted file mode 100644
index 529381000b427..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/fsharp/source.fs
+++ /dev/null
@@ -1,126 +0,0 @@
-module source
-
-// Showing all the things D(A) can bind to.
-//
-open System
-
-// Declare two sample classes, C and F. Class C has an ID
-// property so instances can be identified.
-type C(id) =
- member _.ID = id
-
- member _.M1(c: C) =
- printfn $"Instance method M1(C c) on C: this.id = {id}, c.ID = {c.ID}"
-
- member _.M2() =
- printfn $"Instance method M2() on C: this.id = {id}"
-
- static member M3(c: C) =
- printfn $"Static method M3(C c) on C: c.ID = {c.ID}"
-
- static member M4(c1: C, c2: C) =
- printfn $"Static method M4(C c1, C c2) on C: c1.ID = {c1.ID}, c2.ID = {c2.ID}"
-
-// Declare a delegate type. The object of this code example
-// is to show all the methods this delegate can bind to.
-type D = delegate of C -> unit
-
-
-type F() =
- member _.M1(c: C) =
- printfn $"Instance method M1(C c) on F: c.ID = {c.ID}"
-
- member _.M3(c: C) =
- printfn $"Static method M3(C c) on F: c.ID = {c.ID}"
-
- member _.M4(f: F, c: C) =
- printfn $"Static method M4(F f, C c) on F: c.ID = {c.ID}"
-
-[]
-let main _ =
- let c1 = C 42
- let c2 = C 1491
- let f1 = F()
-
- // Instance method with one argument of type C.
- let cmi1 = typeof.GetMethod "M1"
- // Instance method with no arguments.
- let cmi2 = typeof.GetMethod "M2"
- // Static method with one argument of type C.
- let cmi3 = typeof.GetMethod "M3"
- // Static method with two arguments of type C.
- let cmi4 = typeof.GetMethod "M4"
-
- // Instance method with one argument of type C.
- let fmi1 = typeof.GetMethod "M1"
- // Static method with one argument of type C.
- let fmi3 = typeof.GetMethod "M3"
- // Static method with an argument of type F and an argument
- // of type C.
- let fmi4 = typeof.GetMethod "M4"
-
- printfn "\nAn instance method on any type, with an argument of type C."
- // D can represent any instance method that exactly matches its
- // signature. Methods on C and F are shown here.
- let d = Delegate.CreateDelegate(typeof, c1, cmi1) :?> D
- d.Invoke c2
- let d = Delegate.CreateDelegate(typeof, f1, fmi1) :?> D
- d.Invoke c2
-
- Console.WriteLine("\nAn instance method on C with no arguments.")
- // D can represent an instance method on C that has no arguments
- // in this case, the argument of D represents the hidden first
- // argument of any instance method. The delegate acts like a
- // static method, and an instance of C must be passed each time
- // it is invoked.
- let d = Delegate.CreateDelegate(typeof, null, cmi2) :?> D
- d.Invoke c1
-
- printfn "\nA static method on any type, with an argument of type C."
- // D can represent any static method with the same signature.
- // Methods on F and C are shown here.
- let d = Delegate.CreateDelegate(typeof, null, cmi3) :?> D
- d.Invoke c1
- let d = Delegate.CreateDelegate(typeof, null, fmi3) :?> D
- d.Invoke c1
-
- printfn "\nA static method on any type, with an argument of"
- printfn " that type and an argument of type C."
- // D can represent any static method with one argument of the
- // type the method belongs and a second argument of type C.
- // In this case, the method is closed over the instance of
- // supplied for the its first argument, and acts like an instance
- // method. Methods on F and C are shown here.
- let d = Delegate.CreateDelegate(typeof, c1, cmi4) :?> D
- d.Invoke c2
- let test =
- Delegate.CreateDelegate(typeof, f1, fmi4, false)
-
- // This final example specifies false for throwOnBindFailure
- // in the call to CreateDelegate, so the variable 'test'
- // contains Nothing if the method fails to bind (for
- // example, if fmi4 happened to represent a method of
- // some class other than F).
- match test with
- | :? D as d ->
- d.Invoke c2
- | _ -> ()
- 0
-
-// This code example produces the following output:
-// An instance method on any type, with an argument of type C.
-// Instance method M1(C c) on C: this.id = 42, c.ID = 1491
-// Instance method M1(C c) on F: c.ID = 1491
-//
-// An instance method on C with no arguments.
-// Instance method M2() on C: this.id = 42
-//
-// A static method on any type, with an argument of type C.
-// Static method M3(C c) on C: c.ID = 42
-// Static method M3(C c) on F: c.ID = 42
-//
-// A static method on any type, with an argument of
-// that type and an argument of type C.
-// Static method M4(C c1, C c2) on C: c1.ID = 42, c2.ID = 1491
-// Static method M4(F f, C c) on F: c.ID = 1491
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/fsharp/source1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/fsharp/source1.fs
deleted file mode 100644
index fc02c8ebe287e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/fsharp/source1.fs
+++ /dev/null
@@ -1,45 +0,0 @@
-module source1
-
-//
-open System
-open System.Reflection
-
-// Define two classes to use in the demonstration, a base class and
-// a class that derives from it.
-type Base() = class end
-
-type Derived() =
- inherit Base()
-
- // Define a static method to use in the demonstration. The method
- // takes an instance of Base and returns an instance of Derived.
- // For the purposes of the demonstration, it is not necessary for
- // the method to do anything useful.
- static member MyMethod(arg: Base) =
- Derived()
-
-// Define a delegate that takes an instance of Derived and returns an
-// instance of Base.
-type Example = delegate of Derived -> Base
-
-// The binding flags needed to retrieve MyMethod.
-let flags = BindingFlags.Public ||| BindingFlags.Static
-
-// Get a MethodInfo that represents MyMethod.
-let minfo = typeof.GetMethod("MyMethod", flags)
-
-// Demonstrate contravariance of parameter types and covariance
-// of return types by using the delegate Example to represent
-// MyMethod. The delegate binds to the method because the
-// parameter of the delegate is more restrictive than the
-// parameter of the method (that is, the delegate accepts an
-// instance of Derived, which can always be safely passed to
-// a parameter of type Base), and the return type of MyMethod
-// is more restrictive than the return type of Example (that
-// is, the method returns an instance of Derived, which can
-// always be safely cast to type Base).
-let ex = Delegate.CreateDelegate(typeof, minfo) :?> Example
-
-// Execute MyMethod using the delegate Example.
-let b = Derived() |> ex.Invoke
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/openClosedOver.vb b/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/openClosedOver.vb
deleted file mode 100644
index 797ff36a1e14d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/openClosedOver.vb
+++ /dev/null
@@ -1,137 +0,0 @@
-' All four permutations of instance/Shared with open/closed.
-'
-'
-Imports System.Reflection
-Imports System.Security.Permissions
-
-' Declare three delegate types for demonstrating the combinations
-' of Shared versus instance methods and open versus closed
-' delegates.
-'
-Public Delegate Sub D1(ByVal c As C2, ByVal s As String)
-Public Delegate Sub D2(ByVal s As String)
-Public Delegate Sub D3()
-
-' A sample class with an instance method and a Shared method.
-'
-Public Class C2
- Private id As Integer
- Public Sub New(ByVal id As Integer)
- Me.id = id
- End Sub
-
- Public Sub M1(ByVal s As String)
- Console.WriteLine("Instance method M1 on C2: id = {0}, s = {1}",
- Me.id, s)
- End Sub
-
- Public Shared Sub M2(ByVal s As String)
- Console.WriteLine("Shared method M2 on C2: s = {0}", s)
- End Sub
-End Class
-
-Public Class Example2
-
- Public Shared Sub Main()
-
- Dim c1 As New C2(42)
-
- ' Get a MethodInfo for each method.
- '
- Dim mi1 As MethodInfo = GetType(C2).GetMethod("M1",
- BindingFlags.Public Or BindingFlags.Instance)
- Dim mi2 As MethodInfo = GetType(C2).GetMethod("M2",
- BindingFlags.Public Or BindingFlags.Static)
-
- Dim d1 As D1
- Dim d2 As D2
- Dim d3 As D3
-
-
- Console.WriteLine(vbLf & "An instance method closed over C2.")
- ' In this case, the delegate and the
- ' method must have the same list of argument types; use
- ' delegate type D2 with instance method M1.
- '
- Dim test As [Delegate] =
- [Delegate].CreateDelegate(GetType(D2), c1, mi1, False)
-
- ' Because False was specified for throwOnBindFailure
- ' in the call to CreateDelegate, the variable 'test'
- ' contains Nothing if the method fails to bind (for
- ' example, if mi1 happened to represent a method of
- ' some class other than C2).
- '
- If test IsNot Nothing Then
- d2 = CType(test, D2)
-
- ' The same instance of C2 is used every time the
- ' delegate is invoked.
- d2("Hello, World!")
- d2("Hi, Mom!")
- End If
-
-
- Console.WriteLine(vbLf & "An open instance method.")
- ' In this case, the delegate has one more
- ' argument than the instance method; this argument comes
- ' at the beginning, and represents the hidden instance
- ' argument of the instance method. Use delegate type D1
- ' with instance method M1.
- '
- d1 = CType([Delegate].CreateDelegate(GetType(D1), Nothing, mi1), D1)
-
- ' An instance of C2 must be passed in each time the
- ' delegate is invoked.
- '
- d1(c1, "Hello, World!")
- d1(New C2(5280), "Hi, Mom!")
-
-
- Console.WriteLine(vbLf & "An open Shared method.")
- ' In this case, the delegate and the method must
- ' have the same list of argument types; use delegate type
- ' D2 with Shared method M2.
- '
- d2 = CType([Delegate].CreateDelegate(GetType(D2), Nothing, mi2), D2)
-
- ' No instances of C2 are involved, because this is a Shared
- ' method.
- '
- d2("Hello, World!")
- d2("Hi, Mom!")
-
-
- Console.WriteLine(vbLf & "A Shared method closed over the first argument (String).")
- ' The delegate must omit the first argument of the method.
- ' A string is passed as the firstArgument parameter, and
- ' the delegate is bound to this string. Use delegate type
- ' D3 with Shared method M2.
- '
- d3 = CType([Delegate].CreateDelegate(GetType(D3), "Hello, World!", mi2), D3)
-
- ' Each time the delegate is invoked, the same string is
- ' used.
- d3()
-
- End Sub
-End Class
-
-' This code example produces the following output:
-'
-'An instance method closed over C2.
-'Instance method M1 on C2: id = 42, s = Hello, World!
-'Instance method M1 on C2: id = 42, s = Hi, Mom!
-'
-'An open instance method.
-'Instance method M1 on C2: id = 42, s = Hello, World!
-'Instance method M1 on C2: id = 5280, s = Hi, Mom!
-'
-'An open Shared method.
-'Shared method M2 on C2: s = Hello, World!
-'Shared method M2 on C2: s = Hi, Mom!
-'
-'A Shared method closed over the first argument (String).
-'Shared method M2 on C2: s = Hello, World!
-'
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/source.vb
deleted file mode 100644
index 9964550f1d317..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/source.vb
+++ /dev/null
@@ -1,63 +0,0 @@
-'
-Imports System.Reflection
-
-' Define two classes to use in the demonstration, a base class and
-' a class that derives from it.
-'
-Public Class Base
-End Class
-
-Public Class Derived
- Inherits Base
-
- ' Define a Shared method to use in the demonstration. The method
- ' takes an instance of Base and returns an instance of Derived.
- ' For the purposes of the demonstration, it is not necessary for
- ' the method to do anything useful.
- '
- Public Shared Function MyMethod(ByVal arg As Base) As Derived
- Dim dummy As Base = arg
- Return New Derived()
- End Function
-
-End Class
-
-' Define a delegate that takes an instance of Derived and returns an
-' instance of Base.
-'
-Public Delegate Function Example(ByVal arg As Derived) As Base
-
-Module Test
-
- Sub Main()
-
- ' The binding flags needed to retrieve MyMethod.
- Dim flags As BindingFlags = _
- BindingFlags.Public Or BindingFlags.Static
-
- ' Get a MethodInfo that represents MyMethod.
- Dim minfo As MethodInfo = _
- GetType(Derived).GetMethod("MyMethod", flags)
-
- ' Demonstrate contravariance of parameter types and covariance
- ' of return types by using the delegate Example to represent
- ' MyMethod. The delegate binds to the method because the
- ' parameter of the delegate is more restrictive than the
- ' parameter of the method (that is, the delegate accepts an
- ' instance of Derived, which can always be safely passed to
- ' a parameter of type Base), and the return type of MyMethod
- ' is more restrictive than the return type of Example (that
- ' is, the method returns an instance of Derived, which can
- ' always be safely cast to type Base).
- '
- Dim ex As Example = CType( _
- [Delegate].CreateDelegate(GetType(Example), minfo), _
- Example _
- )
-
- ' Execute MyMethod using the delegate Example.
- '
- Dim b As Base = ex(New Derived())
- End Sub
-End Module
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/source1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/source1.vb
deleted file mode 100644
index a9600807d5f30..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Delegate/CreateDelegate/vb/source1.vb
+++ /dev/null
@@ -1,164 +0,0 @@
-' Showing all the things D(A) can bind to.
-'
-'
-Imports System.Reflection
-Imports System.Security.Permissions
-
-' Declare a delegate type. The object of this code example
-' is to show all the methods this delegate can bind to.
-'
-Public Delegate Sub D(ByVal c As C)
-
-' Declare two sample classes, C and F. Class C has an ID
-' property so instances can be identified.
-'
-Public Class C
-
- Private _id As Integer
-
- Public ReadOnly Property ID() As Integer
- Get
- Return _id
- End Get
- End Property
-
- Public Sub New(ByVal newId As Integer)
- Me._id = newId
- End Sub
-
- Public Sub M1(ByVal c As C)
- Console.WriteLine("Instance method M1(c As C) on C: this.id = {0}, c.ID = {1}", _
- Me.id, c.ID)
- End Sub
-
- Public Sub M2()
- Console.WriteLine("Instance method M2() on C: this.id = {0}", Me.id)
- End Sub
-
- Public Shared Sub M3(ByVal c As C)
- Console.WriteLine("Shared method M3(c As C) on C: c.ID = {0}", c.ID)
- End Sub
-
- Public Shared Sub M4(ByVal c1 As C, ByVal c2 As C)
- Console.WriteLine("Shared method M4(c1 As C, c2 As C) on C: c1.ID = {0}, c2.ID = {1}", _
- c1.ID, c2.ID)
- End Sub
-End Class
-
-
-Public Class F
-
- Public Sub M1(ByVal c As C)
- Console.WriteLine("Instance method M1(c As C) on F: c.ID = {0}", c.ID)
- End Sub
-
- Public Shared Sub M3(ByVal c As C)
- Console.WriteLine("Shared method M3(c As C) on F: c.ID = {0}", c.ID)
- End Sub
-
- Public Shared Sub M4(ByVal f As F, ByVal c As C)
- Console.WriteLine("Shared method M4(f As F, c As C) on F: c.ID = {0}", c.ID)
- End Sub
-End Class
-
-Public Class Example5
-
- Public Shared Sub Main()
-
- Dim c1 As New C(42)
- Dim c2 As New C(1491)
- Dim f1 As New F()
-
- Dim d As D
-
- ' Instance method with one argument of type C.
- Dim cmi1 As MethodInfo = GetType(C).GetMethod("M1")
- ' Instance method with no arguments.
- Dim cmi2 As MethodInfo = GetType(C).GetMethod("M2")
- ' Shared method with one argument of type C.
- Dim cmi3 As MethodInfo = GetType(C).GetMethod("M3")
- ' Shared method with two arguments of type C.
- Dim cmi4 As MethodInfo = GetType(C).GetMethod("M4")
-
- ' Instance method with one argument of type C.
- Dim fmi1 As MethodInfo = GetType(F).GetMethod("M1")
- ' Shared method with one argument of type C.
- Dim fmi3 As MethodInfo = GetType(F).GetMethod("M3")
- ' Shared method with an argument of type F and an
- ' argument of type C.
- Dim fmi4 As MethodInfo = GetType(F).GetMethod("M4")
-
- Console.WriteLine(vbLf & "An instance method on any type, with an argument of type C.")
- ' D can represent any instance method that exactly matches its
- ' signature. Methods on C and F are shown here.
- '
- d = CType([Delegate].CreateDelegate(GetType(D), c1, cmi1), D)
- d(c2)
- d = CType([Delegate].CreateDelegate(GetType(D), f1, fmi1), D)
- d(c2)
-
- Console.WriteLine(vbLf & "An instance method on C with no arguments.")
- ' D can represent an instance method on C that has no arguments;
- ' in this case, the argument of D represents the hidden first
- ' argument of any instance method. The delegate acts like a
- ' Shared method, and an instance of C must be passed each time
- ' it is invoked.
- '
- d = CType([Delegate].CreateDelegate(GetType(D), Nothing, cmi2), D)
- d(c1)
-
- Console.WriteLine(vbLf & "A Shared method on any type, with an argument of type C.")
- ' D can represent any Shared method with the same signature.
- ' Methods on F and C are shown here.
- '
- d = CType([Delegate].CreateDelegate(GetType(D), Nothing, cmi3), D)
- d(c1)
- d = CType([Delegate].CreateDelegate(GetType(D), Nothing, fmi3), D)
- d(c1)
-
- Console.WriteLine(vbLf & "A Shared method on any type, with an argument of")
- Console.WriteLine(" that type and an argument of type C.")
- ' D can represent any Shared method with one argument of the
- ' type the method belongs and a second argument of type C.
- ' In this case, the method is closed over the instance of
- ' supplied for the its first argument, and acts like an instance
- ' method. Methods on F and C are shown here.
- '
- d = CType([Delegate].CreateDelegate(GetType(D), c1, cmi4), D)
- d(c2)
- Dim test As [Delegate] =
- [Delegate].CreateDelegate(GetType(D), f1, fmi4, False)
-
- ' This final example specifies False for throwOnBindFailure
- ' in the call to CreateDelegate, so the variable 'test'
- ' contains Nothing if the method fails to bind (for
- ' example, if fmi4 happened to represent a method of
- ' some class other than F).
- '
- If test IsNot Nothing Then
- d = CType(test, D)
- d(c2)
- End If
-
- End Sub
-End Class
-
-' This code example produces the following output:
-'
-'An instance method on any type, with an argument of type C.
-'Instance method M1(c As C) on C: this.id = 42, c.ID = 1491
-'Instance method M1(c As C) on F: c.ID = 1491
-'
-'An instance method on C with no arguments.
-'Instance method M2() on C: this.id = 42
-'
-'A Shared method on any type, with an argument of type C.
-'Shared method M3(c As C) on C: c.ID = 42
-'Shared method M3(c As C) on F: c.ID = 42
-'
-'A Shared method on any type, with an argument of
-' that type and an argument of type C.
-'Shared method M4(c1 As C, c2 As C) on C: c1.ID = 42, c2.ID = 1491
-'Shared method M4(f As F, c As C) on F: c.ID = 1491
-'
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/csharp/compareto2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/csharp/compareto2.cs
deleted file mode 100644
index 10a113fd4bcbf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/csharp/compareto2.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-using System;
-
-public class Example
-{
- public static void Main()
- {
- double value1 = 6.185;
- double value2 = value1 * .1 / .1;
- Console.WriteLine($"Comparing {value1} and {value2}: {value1.CompareTo(value2)}{Environment.NewLine}");
- Console.WriteLine($"Comparing {value1:R} and {value2:R}: {value1.CompareTo(value2)}");
- }
-}
-// The example displays the following output:
-// Comparing 6.185 and 6.185: -1
-//
-// Comparing 6.185 and 6.1850000000000005: -1
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/csharp/compareto3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/csharp/compareto3.cs
deleted file mode 100644
index 7ceb735d23e4a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/csharp/compareto3.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-using System;
-
-public class Example3
-{
- public static void Main()
- {
- double value1 = 6.185;
- object value2 = value1 * .1 / .1;
- Console.WriteLine($"Comparing {value1} and {value2}: {value1.CompareTo(value2)}{Environment.NewLine}");
- Console.WriteLine($"Comparing {value1:R} and {value2:R}: {value1.CompareTo(value2)}");
- }
-}
-// The example displays the following output:
-// Comparing 6.185 and 6.185: -1
-//
-// Comparing 6.185 and 6.1850000000000005: -1
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/fsharp/compareto2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/fsharp/compareto2.fs
deleted file mode 100644
index 7da23de2bace7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/fsharp/compareto2.fs
+++ /dev/null
@@ -1,12 +0,0 @@
-module compareto2
-
-//
-let value1 = 6.185
-let value2 = value1 * 0.1 / 0.1
-printfn $"Comparing {value1} and {value2}: {value1.CompareTo value2}\n"
-printfn $"Comparing {value1:R} and {value2:R}: {value1.CompareTo value2}"
-// The example displays the following output:
-// Comparing 6.185 and 6.185: -1
-//
-// Comparing 6.185 and 6.1850000000000005: -1
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/fsharp/compareto3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/fsharp/compareto3.fs
deleted file mode 100644
index 62f5503a469f6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/fsharp/compareto3.fs
+++ /dev/null
@@ -1,12 +0,0 @@
-module compareto3
-
-//
-let value1 = 6.185
-let value2 = value1 * 0.1 / 0.1 |> box
-printfn $"Comparing {value1} and {value2}: {value1.CompareTo value2}\n"
-printfn $"Comparing {value1:R} and {value2:R}: {value1.CompareTo value2}"
-// The example displays the following output:
-// Comparing 6.185 and 6.185: -1
-//
-// Comparing 6.185 and 6.1850000000000005: -1
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/vb/compareto2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/vb/compareto2.vb
deleted file mode 100644
index abffb304b54e3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/vb/compareto2.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- Dim value1 As Double = 6.185
- Dim value2 As Double = value1 * .1 / .1
- Console.WriteLine("Comparing {0} and {1}: {2}",
- value1, value2, value1.CompareTo(value2))
- Console.WriteLine()
- Console.WriteLine("Comparing {0:R} and {1:R}: {2}",
- value1, value2, value1.CompareTo(value2))
- End Sub
-End Module
-' The example displays the following output:
-' Comparing 6.185 and 6.185: -1
-'
-' Comparing 6.185 and 6.1850000000000005: -1
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/vb/compareto3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/vb/compareto3.vb
deleted file mode 100644
index 73823f71ad8ec..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/CompareTo/vb/compareto3.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example2
- Public Sub Main()
- Dim value1 As Double = 6.185
- Dim value2 As Object = value1 * .1 / .1
- Console.WriteLine("Comparing {0} and {1}: {2}",
- value1, value2, value1.CompareTo(value2))
- Console.WriteLine()
- Console.WriteLine("Comparing {0:R} and {1:R}: {2}",
- value1, value2, value1.CompareTo(value2))
- End Sub
-End Module
-' The example displays the following output:
-' Comparing 6.185 and 6.185: -1
-'
-' Comparing 6.185 and 6.1850000000000005: -1
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/Equals_25051.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/Equals_25051.cs
deleted file mode 100644
index a1f4800204d7a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/Equals_25051.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using System;
-
-public class Class1
-{
- public static void Main()
- {
- CompareUsingEquals();
- Console.WriteLine();
- CompareApproximateValues();
- Console.WriteLine();
- CompareObjectsUsingEquals();
- Console.WriteLine();
- CompareApproximateObjectValues();
- }
-
- private static void CompareUsingEquals()
- {
- //
- // Initialize two doubles with apparently identical values
- double double1 = .33333;
- double double2 = (double) 1/3;
- // Compare them for equality
- Console.WriteLine(double1.Equals(double2)); // displays false
- //
- }
-
- private static void CompareApproximateValues()
- {
- Console.WriteLine("Snippet2");
- //
- // Initialize two doubles with apparently identical values
- double double1 = .333333;
- double double2 = (double) 1/3;
- // Define the tolerance for variation in their values
- double difference = Math.Abs(double1 * .00001);
-
- // Compare the values
- // The output to the console indicates that the two values are equal
- if (Math.Abs(double1 - double2) <= difference)
- Console.WriteLine("double1 and double2 are equal.");
- else
- Console.WriteLine("double1 and double2 are unequal.");
- //
- }
-
- private static void CompareObjectsUsingEquals()
- {
- //
- // Initialize two doubles with apparently identical values
- double double1 = .33333;
- object double2 = (double) 1/3;
- // Compare them for equality
- Console.WriteLine(double1.Equals(double2)); // displays false
- //
- }
-
- private static void CompareApproximateObjectValues()
- {
- //
- // Initialize two doubles with apparently identical values
- double double1 = .33333;
- object double2 = (double) 1/3;
- // Define the tolerance for variation in their values
- double difference = Math.Abs(double1 * .0001);
-
- // Compare the values
- // The output to the console indicates that the two values are equal
- if (Math.Abs(double1 - (double) double2) <= difference)
- Console.WriteLine("double1 and double2 are equal.");
- else
- Console.WriteLine("double1 and double2 are unequal.");
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/epsilon.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/epsilon.cs
deleted file mode 100644
index 4cc778bc8545d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/epsilon.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-using System;
-
-public class Example
-{
- public static void Main()
- {
- double[] values = { 0, Double.Epsilon, Double.Epsilon * .5 };
-
- for (int ctr = 0; ctr <= values.Length - 2; ctr++)
- {
- for (int ctr2 = ctr + 1; ctr2 <= values.Length - 1; ctr2++)
- {
- Console.WriteLine($"{values[ctr]:r} = {values[ctr2]:r}: {values[ctr].Equals(values[ctr2])}");
- }
- Console.WriteLine();
- }
- }
-}
-// The example displays the following output:
-// 0 = 4.94065645841247E-324: False
-// 0 = 0: True
-//
-// 4.94065645841247E-324 = 0: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/epsilon1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/epsilon1.cs
deleted file mode 100644
index 20687107010e6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/csharp/epsilon1.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-using System;
-
-public class Example1
-{
- public static void Main()
- {
- double[] values = { 0.0, Double.Epsilon };
- foreach (var value in values)
- {
- Console.WriteLine(GetComponentParts(value));
- Console.WriteLine();
- }
- }
-
- private static string GetComponentParts(double value)
- {
- string result = String.Format("{0:R}: ", value);
- int indent = result.Length;
-
- // Convert the double to an 8-byte array.
- byte[] bytes = BitConverter.GetBytes(value);
- // Get the sign bit (byte 7, bit 7).
- result += String.Format("Sign: {0}\n",
- (bytes[7] & 0x80) == 0x80 ? "1 (-)" : "0 (+)");
-
- // Get the exponent (byte 6 bits 4-7 to byte 7, bits 0-6)
- int exponent = (bytes[7] & 0x07F) << 4;
- exponent = exponent | ((bytes[6] & 0xF0) >> 4);
- int adjustment = exponent != 0 ? 1023 : 1022;
- result += String.Format("{0}Exponent: 0x{1:X4} ({1})\n", new String(' ', indent), exponent - adjustment);
-
- // Get the significand (bits 0-51)
- long significand = ((bytes[6] & 0x0F) << 48);
- significand = significand | ((long)bytes[5] << 40);
- significand = significand | ((long)bytes[4] << 32);
- significand = significand | ((long)bytes[3] << 24);
- significand = significand | ((long)bytes[2] << 16);
- significand = significand | ((long)bytes[1] << 8);
- significand = significand | bytes[0];
- result += String.Format("{0}Mantissa: 0x{1:X13}\n", new String(' ', indent), significand);
-
- return result;
- }
-}
-// // The example displays the following output:
-// 0: Sign: 0 (+)
-// Exponent: 0xFFFFFC02 (-1022)
-// Mantissa: 0x0000000000000
-//
-//
-// 4.94065645841247E-324: Sign: 0 (+)
-// Exponent: 0xFFFFFC02 (-1022)
-// Mantissa: 0x0000000000001
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/fsharp/Equals_25051.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/fsharp/Equals_25051.fs
deleted file mode 100644
index 64ae534b1d244..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/fsharp/Equals_25051.fs
+++ /dev/null
@@ -1,59 +0,0 @@
-module Equals_25051
-
-let compareUsingEquals () =
- //
- // Initialize two doubles with apparently identical values
- let double1 = 0.33333
- let double2 = double (1 / 3)
- // Compare them for equality
- printfn $"{double1.Equals double2}" // displays false
- //
-
-let compareApproximateValues () =
- //
- // Initialize two doubles with apparently identical values
- let double1 = 0.333333
- let double2 = double (1 / 3)
- // Define the tolerance for variation in their values
- let difference = abs (double1 * 0.00001)
-
- // Compare the values
- // The output to the console indicates that the two values are equal
- if abs (double1 - double2) <= difference then
- printfn "double1 and double2 are equal."
- else
- printfn "double1 and double2 are unequal."
- //
-
-let compareObjectsUsingEquals () =
- //
- // Initialize two doubles with apparently identical values
- let double1 = 0.33333
- let double2 = double (1 / 3) |> box
- // Compare them for equality
- printfn $"{double1.Equals double2}" // displays false
- //
-
-let compareApproximateObjectValues () =
- //
- // Initialize two doubles with apparently identical values
- let double1 = 0.33333
- let double2 = double (1 / 3) |> box
- // Define the tolerance for variation in their values
- let difference = abs (double1 * 0.0001)
-
- // Compare the values
- // The output to the console indicates that the two values are equal
- if abs(double1 - (double2 :?> double)) <= difference then
- printfn "double1 and double2 are equal."
- else
- printfn "double1 and double2 are unequal."
- //
-
-compareUsingEquals ()
-printfn ""
-compareApproximateValues ()
-printfn ""
-compareObjectsUsingEquals ()
-printfn ""
-compareApproximateObjectValues ()
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/fsharp/epsilon.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/fsharp/epsilon.fs
deleted file mode 100644
index 650b9d3ae6ebd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/fsharp/epsilon.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module epsilon
-
-//
-open System
-
-let values = [| 0.; Double.Epsilon; Double.Epsilon * 0.5 |]
-
-for i = 0 to values.Length - 2 do
- for i2 = i + 1 to values.Length - 1 do
- printfn $"{values[i]:r} = {values[i2]:r}: {values[i].Equals values[i2]}"
- printfn ""
-// The example displays the following output:
-// 0 = 4.94065645841247E-324: False
-// 0 = 0: True
-//
-// 4.94065645841247E-324 = 0: False
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/fsharp/epsilon1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/fsharp/epsilon1.fs
deleted file mode 100644
index 8126fb46251f2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/fsharp/epsilon1.fs
+++ /dev/null
@@ -1,46 +0,0 @@
-module epsilon1
-
-//
-open System
-
-let getComponentParts (value: double) =
- let result = $"{value:R}: "
- let indent = result.Length
-
- // Convert the double to an 8-byte array.
- let bytes = BitConverter.GetBytes value
- // Get the sign bit (byte 7, bit 7).
- let result = result + $"""Sign: {if (bytes[7] &&& 0x80uy) = 0x80uy then "1 (-)" else "0 (+)"}\n"""
-
- // Get the exponent (byte 6 bits 4-7 to byte 7, bits 0-6)
- let exponent = (bytes[7] &&& 0x07Fuy) <<< 4
- let exponent = exponent ||| ((bytes[6] &&& 0xF0uy) >>> 4)
- let adjustment = if exponent <> 0uy then 1022 else 1023
- let result = result + $"{String(' ', indent)}Exponent: 0x{int exponent - adjustment:X4} ({int exponent - adjustment})\n"
-
- // Get the significand (bits 0-51)
- let significand = (bytes[6] &&& 0x0Fuy) <<< 48
- let significand = significand ||| byte (int64 bytes[5] <<< 40)
- let significand = significand ||| byte (int64 bytes[4] <<< 32)
- let significand = significand ||| byte (int64 bytes[3] <<< 24)
- let significand = significand ||| byte (int64 bytes[2] <<< 16)
- let significand = significand ||| byte (int64 bytes[1] <<< 8)
- let significand = significand ||| bytes[0]
- result + $"{String(' ', indent)}Mantissa: 0x{significand:X13}\n"
-
-let values = [| 0.; Double.Epsilon |]
-for value in values do
- printfn $"{getComponentParts value}"
- printfn ""
-
-
-// // The example displays the following output:
-// 0: Sign: 0 (+)
-// Exponent: 0xFFFFFC02 (-1022)
-// Mantissa: 0x0000000000000
-//
-//
-// 4.94065645841247E-324: Sign: 0 (+)
-// Exponent: 0xFFFFFC02 (-1022)
-// Mantissa: 0x0000000000001
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/Equals_25051.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/Equals_25051.vb
deleted file mode 100644
index c0bd944424f36..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/Equals_25051.vb
+++ /dev/null
@@ -1,73 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module modMain
-
- Public Sub Main()
- CompareUsingEquals()
- Console.WRiteLine()
- CompareApproximateValues()
- Console.WriteLIne()
- CompareObjectsUsingEquals()
- Console.WRiteLine()
- CompareApproximateObjectValues()
- Console.WriteLIne()
- End Sub
-
- Private Sub CompareUsingEquals()
- '
- ' Initialize two doubles with apparently identical values
- Dim double1 As Double = .33333
- Dim double2 As Double = 1/3
- ' Compare them for equality
- Console.WriteLine(double1.Equals(double2)) ' displays False
- '
- End Sub
-
- Private Sub CompareApproximateValues()
- '
- ' Initialize two doubles with apparently identical values
- Dim double1 As Double = .33333
- Dim double2 As Double = 1/3
- ' Define the tolerance for variation in their values
- Dim difference As Double = Math.Abs(double1 * .00001)
-
- ' Compare the values
- ' The output to the console indicates that the two values are equal
- If Math.Abs(double1 - double2) <= difference Then
- Console.WriteLine("double1 and double2 are equal.")
- Else
- Console.WriteLine("double1 and double2 are unequal.")
- End If
- '
- End Sub
-
- Private Sub CompareObjectsUsingEquals()
- '
- ' Initialize two doubles with apparently identical values
- Dim double1 As Double = .33333
- Dim double2 As Object = 1/3
- ' Compare them for equality
- Console.WriteLine(double1.Equals(double2)) ' displays False
- '
- End Sub
-
- Private Sub CompareApproximateObjectValues()
- '
- ' Initialize two doubles with apparently identical values
- Dim double1 As Double = .33333
- Dim double2 As Object = 1/3
- ' Define the tolerance for variation in their values
- Dim difference As Double = Math.Abs(double1 * .0001)
-
- ' Compare the values
- ' The output to the console indicates that the two values are equal
- If Math.Abs(double1 - CDbl(double2)) <= difference Then
- Console.WriteLine("double1 and double2 are equal.")
- Else
- Console.WriteLine("double1 and double2 are unequal.")
- End If
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/epsilon.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/epsilon.vb
deleted file mode 100644
index 2d849282e5582..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/epsilon.vb
+++ /dev/null
@@ -1,24 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- Dim values() As Double = { 0, Double.Epsilon, Double.Epsilon * .5 }
-
- For ctr As Integer = 0 To values.Length - 2
- For ctr2 As Integer = ctr + 1 To values.Length - 1
- Console.WriteLine("{0:r} = {1:r}: {2}", _
- values(ctr), values(ctr2), _
- values(ctr).Equals(values(ctr2)))
- Next
- Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 0 = 4.94065645841247E-324: False
-' 0 = 0: True
-'
-' 4.94065645841247E-324 = 0: False
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/epsilon1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/epsilon1.vb
deleted file mode 100644
index 93bdd09434314..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Epsilon/vb/epsilon1.vb
+++ /dev/null
@@ -1,57 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example1
- Public Sub Main()
- Dim values() As Double = { 0.0, Double.Epsilon }
- For Each value In values
- Console.WriteLine(GetComponentParts(value))
- Console.WriteLine()
- Next
- End Sub
-
- Private Function GetComponentParts(value As Double) As String
- Dim result As String = String.Format("{0:R}: ", value)
- Dim indent As Integer = result.Length
-
- ' Convert the double to an 8-byte array.
- Dim bytes() As Byte = BitConverter.GetBytes(value)
- ' Get the sign bit (byte 7, bit 7).
- result += String.Format("Sign: {0}{1}",
- If((bytes(7) And &H80) = &H80, "1 (-)", "0 (+)"),
- vbCrLf)
-
- ' Get the exponent (byte 6 bits 4-7 to byte 7, bits 0-6)
- Dim exponent As Integer = (bytes(7) And &H07F) << 4
- exponent = exponent Or ((bytes(6) And &HF0) >> 4)
- Dim adjustment As Integer = If(exponent <> 0, 1023, 1022)
- result += String.Format("{0}Exponent: 0x{1:X4} ({1}){2}",
- New String(" "c, indent), exponent - adjustment,
- vbCrLf)
-
- ' Get the significand (bits 0-51)
- Dim significand As Long = ((bytes(6) And &H0F) << 48)
- significand = significand Or (bytes(5) << 40)
- significand = significand Or (bytes(4) << 32)
- significand = significand Or (bytes(3) << 24)
- significand = significand Or (bytes(2) << 16)
- significand = significand Or (bytes(1) << 8)
- significand = significand Or bytes(0)
- result += String.Format("{0}Mantissa: 0x{1:X13}{2}",
- New String(" "c, indent), significand, vbCrLf)
-
- Return result
- End Function
-End Module
-' The example displays the following output:
-' 0: Sign: 0 (+)
-' Exponent: 0xFFFFFC02 (-1022)
-' Mantissa: 0x0000000000000
-'
-'
-' 4.94065645841247E-324: Sign: 0 (+)
-' Exponent: 0xFFFFFC02 (-1022)
-' Mantissa: 0x0000000000001
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/csharp/equalsabs1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/csharp/equalsabs1.cs
deleted file mode 100644
index c80cdbe87e98c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/csharp/equalsabs1.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-
-public class Example
-{
- //
- public static void Main()
- {
- // Initialize the values.
- double value1 = .1 * 10;
- double value2 = 0;
- for (int ctr = 0; ctr < 10; ctr++)
- value2 += .1;
-
- Console.WriteLine($"{value1:R} = {value2:R}: " +
- $"{HasMinimalDifference(value1, value2, 1)}");
- }
-
- public static bool HasMinimalDifference(
- double value1,
- double value2,
- int allowableDifference
- )
- {
- // Convert the double values to long values.
- long lValue1 = BitConverter.DoubleToInt64Bits(value1);
- long lValue2 = BitConverter.DoubleToInt64Bits(value2);
-
- // If the signs are different, return false except for +0 and -0.
- if ((lValue1 >> 63) != (lValue2 >> 63))
- {
- if (value1 == value2)
- return true;
-
- return false;
- }
-
- // Calculate the number of possible
- // floating-point values in the difference.
- long diff = Math.Abs(lValue1 - lValue2);
-
- if (diff <= allowableDifference)
- return true;
-
- return false;
- }
- // The example displays the following output:
- //
- // 1 = 0.99999999999999989: True
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/fsharp/equalsabs1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/fsharp/equalsabs1.fs
deleted file mode 100644
index 59f4047a639d6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/fsharp/equalsabs1.fs
+++ /dev/null
@@ -1,28 +0,0 @@
-module equalsabs
-
-//
-open System
-
-let hasMinimalDifference (value1: double) (value2: double) (units: int) =
- let lValue1 = BitConverter.DoubleToInt64Bits value1
- let lValue2 = BitConverter.DoubleToInt64Bits value2
-
- // If the signs are different, return false except for +0 and -0.
- if (lValue1 >>> 63) <> (lValue2 >>> 63) then
- value1 = value2
- else
- let diff = abs (lValue1 - lValue2)
-
- diff <= int64 units
-
-let value1 = 0.1 * 10.
-let mutable value2 = 0.
-for _ = 0 to 9 do
- value2 <- value2 + 0.1
-
-printfn $"{value1:R} = {value2:R}: {hasMinimalDifference value1 value2 1}"
-
-
-// The example displays the following output:
-// 1 = 0.99999999999999989: True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/vb/equalsabs1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/vb/equalsabs1.vb
deleted file mode 100644
index 0551459c5a6ca..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Equals/vb/equalsabs1.vb
+++ /dev/null
@@ -1,41 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- Dim value1 As Double = .1 * 10
- Dim value2 As Double = 0
- For ctr As Integer = 0 To 9
- value2 += .1
- Next
-
- Console.WriteLine("{0:R} = {1:R}: {2}", value1, value2,
- HasMinimalDifference(value1, value2, 1))
- End Sub
-
- Public Function HasMinimalDifference(value1 As Double, value2 As Double, units As Integer) As Boolean
- Dim lValue1 As long = BitConverter.DoubleToInt64Bits(value1)
- Dim lValue2 As long = BitConverter.DoubleToInt64Bits(value2)
-
- ' If the signs are different, Return False except for +0 and -0.
- If ((lValue1 >> 63) <> (lValue2 >> 63)) Then
- If value1 = value2 Then
- Return True
- End If
- Return False
- End If
-
- Dim diff As Long = Math.Abs(lValue1 - lValue2)
-
- If diff <= units Then
- Return True
- End If
-
- Return False
- End Function
-End Module
-' The example displays the following output:
-' 1 = 0.99999999999999989: True
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/Program.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/Program.cs
deleted file mode 100644
index 92a6d0b62f4f0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/Program.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-class Program
-{
- static void Main(string[] args)
- {
- //Example1.Main();
- //Example2.Main();
- //Example3.Main();
- //Example4.Main();
- //Example5.Main();
- //Example6.Main();
- //Example7.Main();
- //Example8.Main();
- //Example9.Main();
- //Example10.Main();
- Example11.Main();
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/Project.csproj
deleted file mode 100644
index 3e363434650ea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Exe
- net9.0
- Program
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/comparison1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/comparison1.cs
deleted file mode 100644
index 39c0d36f90011..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/comparison1.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-using System;
-
-public class Example
-{
- public static void Main()
- {
- double value1 = .333333333333333;
- double value2 = 1.0/3;
- Console.WriteLine($"{value1} = {value2}: {value1.Equals(value2)}");
- }
-}
-// The example displays the following output:
-// 0.333333333333333 = 0.33333333333333331: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/comparison3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/comparison3.cs
deleted file mode 100644
index 2c548a3ae9862..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/comparison3.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-
-public class Example2
-{
- public static void Main()
- {
- //
- double value1 = .333333333333333;
- double value2 = 1.0 / 3;
- int precision = 7;
- value1 = Math.Round(value1, precision);
- value2 = Math.Round(value2, precision);
- Console.WriteLine($"{value1} = {value2}: {value1.Equals(value2)}");
-
- // The example displays the following output:
- // 0.3333333 = 0.3333333: True
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/comparison4.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/comparison4.cs
deleted file mode 100644
index 577ba93083fcd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/comparison4.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-using System;
-
-public class Example3
-{
- public static void Main()
- {
- double one1 = .1 * 10;
- double one2 = 0;
- for (int ctr = 1; ctr <= 10; ctr++)
- one2 += .1;
-
- Console.WriteLine($"{one1} = {one2}: {one1.Equals(one2)}");
- Console.WriteLine($"{one1} is approximately equal to {one2}: {IsApproximatelyEqual(one1, one2, .000000001)}");
- }
-
- static bool IsApproximatelyEqual(double value1, double value2, double epsilon)
- {
- // If they are equal anyway, just return True.
- if (value1.Equals(value2))
- return true;
-
- // Handle NaN, Infinity.
- if (Double.IsInfinity(value1) | Double.IsNaN(value1))
- return value1.Equals(value2);
- else if (Double.IsInfinity(value2) | Double.IsNaN(value2))
- return value1.Equals(value2);
-
- // Handle zero to avoid division by zero
- double divisor = Math.Max(value1, value2);
- if (divisor.Equals(0))
- divisor = Math.Min(value1, value2);
-
- return Math.Abs((value1 - value2) / divisor) <= epsilon;
- }
-}
-
-// The example displays the following output:
-// 1 = 0.99999999999999989: False
-// 1 is approximately equal to 0.99999999999999989: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/convert1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/convert1.cs
deleted file mode 100644
index dee3e3e473f07..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/convert1.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;
-
-public class Example4
-{
- public static void Main()
- {
- //
- dynamic[] values = { Byte.MinValue, Byte.MaxValue, Decimal.MinValue,
- Decimal.MaxValue, Int16.MinValue, Int16.MaxValue,
- Int32.MinValue, Int32.MaxValue, Int64.MinValue,
- Int64.MaxValue, SByte.MinValue, SByte.MaxValue,
- Single.MinValue, Single.MaxValue, UInt16.MinValue,
- UInt16.MaxValue, UInt32.MinValue, UInt32.MaxValue,
- UInt64.MinValue, UInt64.MaxValue };
- double dblValue;
- foreach (dynamic value in values)
- {
- if (value.GetType() == typeof(decimal))
- dblValue = (double)value;
- else
- dblValue = value;
- Console.WriteLine($"{value} ({value.GetType().Name}) --> " +
- $"{dblValue:R} ({dblValue.GetType().Name})");
- }
-
- // The example displays the following output:
- // 0 (Byte) --> 0 (Double)
- // 255 (Byte) --> 255 (Double)
- // -79228162514264337593543950335 (Decimal) --> -7.9228162514264338E+28 (Double)
- // 79228162514264337593543950335 (Decimal) --> 7.9228162514264338E+28 (Double)
- // -32768 (Int16) --> -32768 (Double)
- // 32767 (Int16) --> 32767 (Double)
- // -2147483648 (Int32) --> -2147483648 (Double)
- // 2147483647 (Int32) --> 2147483647 (Double)
- // -9223372036854775808 (Int64) --> -9.2233720368547758E+18 (Double)
- // 9223372036854775807 (Int64) --> 9.2233720368547758E+18 (Double)
- // -128 (SByte) --> -128 (Double)
- // 127 (SByte) --> 127 (Double)
- // -3.402823E+38 (Single) --> -3.4028234663852886E+38 (Double)
- // 3.402823E+38 (Single) --> 3.4028234663852886E+38 (Double)
- // 0 (UInt16) --> 0 (Double)
- // 65535 (UInt16) --> 65535 (Double)
- // 0 (UInt32) --> 0 (Double)
- // 4294967295 (UInt32) --> 4294967295 (Double)
- // 0 (UInt64) --> 0 (Double)
- // 18446744073709551615 (UInt64) --> 1.8446744073709552E+19 (Double)
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/convert2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/convert2.cs
deleted file mode 100644
index efd4c149833ee..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/convert2.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-using System;
-
-public class Example5
-{
- public static void Main()
- {
- Double[] values = { Double.MinValue, -67890.1234, -12345.6789,
- 12345.6789, 67890.1234, Double.MaxValue,
- Double.NaN, Double.PositiveInfinity,
- Double.NegativeInfinity };
- checked
- {
- foreach (var value in values)
- {
- try
- {
- Int64 lValue = (long)value;
- Console.WriteLine($"{value} ({value.GetType().Name}) --> {lValue} (0x{lValue:X16}) ({lValue.GetType().Name})");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"Unable to convert {value} to Int64.");
- }
- try
- {
- UInt64 ulValue = (ulong)value;
- Console.WriteLine($"{value} ({value.GetType().Name}) --> {ulValue} (0x{ulValue:X16}) ({ulValue.GetType().Name})");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"Unable to convert {value} to UInt64.");
- }
- try
- {
- Decimal dValue = (decimal)value;
- Console.WriteLine($"{value} ({value.GetType().Name}) --> {dValue} ({dValue.GetType().Name})");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"Unable to convert {value} to Decimal.");
- }
- try
- {
- Single sValue = (float)value;
- Console.WriteLine($"{value} ({value.GetType().Name}) --> {sValue} ({sValue.GetType().Name})");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"Unable to convert {value} to Single.");
- }
- Console.WriteLine();
- }
- }
- }
-}
-// The example displays the following output for conversions performed
-// in a checked context:
-// Unable to convert -1.79769313486232E+308 to Int64.
-// Unable to convert -1.79769313486232E+308 to UInt64.
-// Unable to convert -1.79769313486232E+308 to Decimal.
-// -1.79769313486232E+308 (Double) --> -Infinity (Single)
-//
-// -67890.1234 (Double) --> -67890 (0xFFFFFFFFFFFEF6CE) (Int64)
-// Unable to convert -67890.1234 to UInt64.
-// -67890.1234 (Double) --> -67890.1234 (Decimal)
-// -67890.1234 (Double) --> -67890.13 (Single)
-//
-// -12345.6789 (Double) --> -12345 (0xFFFFFFFFFFFFCFC7) (Int64)
-// Unable to convert -12345.6789 to UInt64.
-// -12345.6789 (Double) --> -12345.6789 (Decimal)
-// -12345.6789 (Double) --> -12345.68 (Single)
-//
-// 12345.6789 (Double) --> 12345 (0x0000000000003039) (Int64)
-// 12345.6789 (Double) --> 12345 (0x0000000000003039) (UInt64)
-// 12345.6789 (Double) --> 12345.6789 (Decimal)
-// 12345.6789 (Double) --> 12345.68 (Single)
-//
-// 67890.1234 (Double) --> 67890 (0x0000000000010932) (Int64)
-// 67890.1234 (Double) --> 67890 (0x0000000000010932) (UInt64)
-// 67890.1234 (Double) --> 67890.1234 (Decimal)
-// 67890.1234 (Double) --> 67890.13 (Single)
-//
-// Unable to convert 1.79769313486232E+308 to Int64.
-// Unable to convert 1.79769313486232E+308 to UInt64.
-// Unable to convert 1.79769313486232E+308 to Decimal.
-// 1.79769313486232E+308 (Double) --> Infinity (Single)
-//
-// Unable to convert NaN to Int64.
-// Unable to convert NaN to UInt64.
-// Unable to convert NaN to Decimal.
-// NaN (Double) --> NaN (Single)
-//
-// Unable to convert Infinity to Int64.
-// Unable to convert Infinity to UInt64.
-// Unable to convert Infinity to Decimal.
-// Infinity (Double) --> Infinity (Single)
-//
-// Unable to convert -Infinity to Int64.
-// Unable to convert -Infinity to UInt64.
-// Unable to convert -Infinity to Decimal.
-// -Infinity (Double) --> -Infinity (Single)
-// The example displays the following output for conversions performed
-// in an unchecked context:
-// -1.79769313486232E+308 (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-// -1.79769313486232E+308 (Double) --> 9223372036854775808 (0x8000000000000000) (UInt64)
-// Unable to convert -1.79769313486232E+308 to Decimal.
-// -1.79769313486232E+308 (Double) --> -Infinity (Single)
-//
-// -67890.1234 (Double) --> -67890 (0xFFFFFFFFFFFEF6CE) (Int64)
-// -67890.1234 (Double) --> 18446744073709483726 (0xFFFFFFFFFFFEF6CE) (UInt64)
-// -67890.1234 (Double) --> -67890.1234 (Decimal)
-// -67890.1234 (Double) --> -67890.13 (Single)
-//
-// -12345.6789 (Double) --> -12345 (0xFFFFFFFFFFFFCFC7) (Int64)
-// -12345.6789 (Double) --> 18446744073709539271 (0xFFFFFFFFFFFFCFC7) (UInt64)
-// -12345.6789 (Double) --> -12345.6789 (Decimal)
-// -12345.6789 (Double) --> -12345.68 (Single)
-//
-// 12345.6789 (Double) --> 12345 (0x0000000000003039) (Int64)
-// 12345.6789 (Double) --> 12345 (0x0000000000003039) (UInt64)
-// 12345.6789 (Double) --> 12345.6789 (Decimal)
-// 12345.6789 (Double) --> 12345.68 (Single)
-//
-// 67890.1234 (Double) --> 67890 (0x0000000000010932) (Int64)
-// 67890.1234 (Double) --> 67890 (0x0000000000010932) (UInt64)
-// 67890.1234 (Double) --> 67890.1234 (Decimal)
-// 67890.1234 (Double) --> 67890.13 (Single)
-//
-// 1.79769313486232E+308 (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-// 1.79769313486232E+308 (Double) --> 0 (0x0000000000000000) (UInt64)
-// Unable to convert 1.79769313486232E+308 to Decimal.
-// 1.79769313486232E+308 (Double) --> Infinity (Single)
-//
-// NaN (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-// NaN (Double) --> 0 (0x0000000000000000) (UInt64)
-// Unable to convert NaN to Decimal.
-// NaN (Double) --> NaN (Single)
-//
-// Infinity (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-// Infinity (Double) --> 0 (0x0000000000000000) (UInt64)
-// Unable to convert Infinity to Decimal.
-// Infinity (Double) --> Infinity (Single)
-//
-// -Infinity (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-// -Infinity (Double) --> 9223372036854775808 (0x8000000000000000) (UInt64)
-// Unable to convert -Infinity to Decimal.
-// -Infinity (Double) --> -Infinity (Single)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/exceptional1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/exceptional1.cs
deleted file mode 100644
index 73330fc6ca42a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/exceptional1.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-using System;
-
-public class Example6
-{
- public static void Main()
- {
- Double value1 = 1.1632875981534209e-225;
- Double value2 = 9.1642346778e-175;
- Double result = value1 * value2;
- Console.WriteLine($"{value1} * {value2} = {result}");
- Console.WriteLine($"{result} = 0: {result.Equals(0.0)}");
- }
-}
-// The example displays the following output:
-// 1.16328759815342E-225 * 9.1642346778E-175 = 0
-// 0 = 0: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/exceptional2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/exceptional2.cs
deleted file mode 100644
index 68e1e4b4cb504..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/exceptional2.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-using System;
-
-public class Example7
-{
- public static void Main()
- {
- Double value1 = 4.565e153;
- Double value2 = 6.9375e172;
- Double result = value1 * value2;
- Console.WriteLine($"PositiveInfinity: {Double.IsPositiveInfinity(result)}");
- Console.WriteLine($"NegativeInfinity: {Double.IsNegativeInfinity(result)}{Environment.NewLine}");
-
- value1 = -value1;
- result = value1 * value2;
- Console.WriteLine($"PositiveInfinity: {Double.IsPositiveInfinity(result)}");
- Console.WriteLine($"NegativeInfinity: {Double.IsNegativeInfinity(result)}");
- }
-}
-
-// The example displays the following output:
-// PositiveInfinity: True
-// NegativeInfinity: False
-//
-// PositiveInfinity: False
-// NegativeInfinity: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precision1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precision1.cs
deleted file mode 100644
index 6a5ccb5f06733..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precision1.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-
-public class Example8
-{
- public static void Main()
- {
- //
- double value = -4.42330604244772E-305;
-
- double fromLiteral = -4.42330604244772E-305;
- double fromVariable = value;
- double fromParse = Double.Parse("-4.42330604244772E-305");
-
- Console.WriteLine("Double value from literal: {0,29:R}", fromLiteral);
- Console.WriteLine("Double value from variable: {0,28:R}", fromVariable);
- Console.WriteLine("Double value from Parse method: {0,24:R}", fromParse);
- // On 32-bit versions of the .NET Framework, the output is:
- // Double value from literal: -4.42330604244772E-305
- // Double value from variable: -4.42330604244772E-305
- // Double value from Parse method: -4.42330604244772E-305
- //
- // On other versions of the .NET Framework, the output is:
- // Double value from literal: -4.4233060424477198E-305
- // Double value from variable: -4.4233060424477198E-305
- // Double value from Parse method: -4.42330604244772E-305
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precisionlist1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precisionlist1.cs
deleted file mode 100644
index f76727e6cb899..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precisionlist1.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-using System;
-
-public class Example9
-{
- public static void Main()
- {
- Double value1 = 1 / 3.0;
- Single sValue2 = 1 / 3.0f;
- Double value2 = (Double)sValue2;
- Console.WriteLine($"{value1:R} = {value2:R}: {value1.Equals(value2)}");
- }
-}
-// The example displays the following output:
-// 0.33333333333333331 = 0.3333333432674408: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precisionlist3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precisionlist3.cs
deleted file mode 100644
index 11e92c872245c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precisionlist3.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-using System;
-
-public class Example10
-{
- public static void Main()
- {
- Double[] values = { 10.0, 2.88, 2.88, 2.88, 9.0 };
- Double result = 27.64;
- Double total = 0;
- foreach (var value in values)
- total += value;
-
- if (total.Equals(result))
- Console.WriteLine("The sum of the values equals the total.");
- else
- Console.WriteLine($"The sum of the values ({total}) does not equal the total ({result}).");
- }
-}
-// The example displays the following output:
-// The sum of the values (36.64) does not equal the total (36.64).
-//
-// If the index items in the Console.WriteLine statement are changed to {0:R},
-// the example displays the following output:
-// The sum of the values (27.639999999999997) does not equal the total (27.64).
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precisionlist4.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precisionlist4.cs
deleted file mode 100644
index d804ac08c6c44..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/precisionlist4.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.IO;
-
-public class Example11
-{
- public static void Main()
- {
- //
- StreamWriter sw = new(@"./Doubles.dat");
- double[] values = [2.2 / 1.01, 1.0 / 3, Math.PI];
- for (int ctr = 0; ctr < values.Length; ctr++)
- {
- sw.Write(values[ctr].ToString());
- if (ctr != values.Length - 1)
- sw.Write("|");
- }
- sw.Close();
-
- double[] restoredValues = new double[values.Length];
- StreamReader sr = new(@"./Doubles.dat");
- string temp = sr.ReadToEnd();
- string[] tempStrings = temp.Split('|');
- for (int ctr = 0; ctr < tempStrings.Length; ctr++)
- restoredValues[ctr] = double.Parse(tempStrings[ctr]);
-
- for (int ctr = 0; ctr < values.Length; ctr++)
- Console.WriteLine($"{values[ctr]} {(values[ctr].Equals(restoredValues[ctr]) ? "=" : "<>")} {restoredValues[ctr]}");
-
- // For .NET Framework only, the example displays the following output:
- // 2.17821782178218 <> 2.17821782178218
- // 0.333333333333333 <> 0.333333333333333
- // 3.14159265358979 <> 3.14159265358979
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/representation1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/representation1.cs
deleted file mode 100644
index 52b1d272ab169..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/representation1.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-
-public class Example13
-{
- public static void Main()
- {
- Double value = .1;
- Double result1 = value * 10;
- Double result2 = 0;
- for (int ctr = 1; ctr <= 10; ctr++)
- result2 += value;
-
- Console.WriteLine($".1 * 10: {result1:R}");
- Console.WriteLine($".1 Added 10 times: {result2:R}");
- }
-}
-// The example displays the following output:
-// .1 * 10: 1
-// .1 Added 10 times: 0.99999999999999989
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/representation2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/representation2.cs
deleted file mode 100644
index d4ab7b394b68b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/representation2.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-using System;
-
-public class Example14
-{
- public static void Main()
- {
- Double value = 123456789012.34567;
- Double additional = Double.Epsilon * 1e15;
- Console.WriteLine($"{value} + {additional} = {value + additional}");
- }
-}
-// The example displays the following output:
-// 123456789012.346 + 4.94065645841247E-309 = 123456789012.346
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/source.cs
deleted file mode 100644
index 709b8021499c1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/csharp/source.cs
+++ /dev/null
@@ -1,391 +0,0 @@
-using System;
-using System.Globalization;
-
-namespace Snippets {
- class Launcher {
- static void Main(string[] args)
- {
- Temperature t1 = Temperature.Parse("20'F", NumberStyles.Float, null);
- Console.WriteLine( t1.ToString("F", null) );
-
- string str1 = t1.ToString("C", null);
- Console.WriteLine( str1 );
-
- Temperature t2 = Temperature.Parse(str1, NumberStyles.Float, null);
- Console.WriteLine( t2.ToString("F", null) );
-
- Console.WriteLine( t1.CompareTo(t2) );
-
- Temperature t3 = Temperature.Parse("20'C", NumberStyles.Float, null);
- Console.WriteLine( t3.ToString("F", null) );
-
- Console.WriteLine( t1.CompareTo(t3) );
- }
- }
- //
- // The Temperature class stores the temperature as a Double
- // and delegates most of the functionality to the Double
- // implementation.
- public class Temperature : IComparable, IFormattable
- {
- // IComparable.CompareTo implementation.
- public int CompareTo(object obj) {
- if (obj == null) return 1;
-
- Temperature temp = obj as Temperature;
- if (obj != null)
- return m_value.CompareTo(temp.m_value);
- else
- throw new ArgumentException("object is not a Temperature");
- }
-
- // IFormattable.ToString implementation.
- public string ToString(string format, IFormatProvider provider) {
- if( format != null ) {
- if( format.Equals("F") ) {
- return String.Format("{0}'F", this.Value.ToString());
- }
- if( format.Equals("C") ) {
- return String.Format("{0}'C", this.Celsius.ToString());
- }
- }
-
- return m_value.ToString(format, provider);
- }
-
- // Parses the temperature from a string in the form
- // [ws][sign]digits['F|'C][ws]
- public static Temperature Parse(string s, NumberStyles styles, IFormatProvider provider) {
- Temperature temp = new Temperature();
-
- if( s.TrimEnd(null).EndsWith("'F") ) {
- temp.Value = Double.Parse( s.Remove(s.LastIndexOf('\''), 2), styles, provider);
- }
- else if( s.TrimEnd(null).EndsWith("'C") ) {
- temp.Celsius = Double.Parse( s.Remove(s.LastIndexOf('\''), 2), styles, provider);
- }
- else {
- temp.Value = Double.Parse(s, styles, provider);
- }
-
- return temp;
- }
-
- // The value holder
- protected double m_value;
-
- public double Value {
- get {
- return m_value;
- }
- set {
- m_value = value;
- }
- }
-
- public double Celsius {
- get {
- return (m_value-32.0)/1.8;
- }
- set {
- m_value = 1.8*value+32.0;
- }
- }
- }
- //
-}
-
-namespace Snippets2 {
- //
- public class Temperature {
- public static double MinValue {
- get {
- return Double.MinValue;
- }
- }
-
- public static double MaxValue {
- get {
- return Double.MaxValue;
- }
- }
-
- // The value holder
- protected double m_value;
-
- public double Value {
- get {
- return m_value;
- }
- set {
- m_value = value;
- }
- }
-
- public double Celsius {
- get {
- return (m_value-32.0)/1.8;
- }
- set {
- m_value = 1.8*value+32.0;
- }
- }
- }
- //
-}
-
-namespace Snippets3 {
- //
- public class Temperature : IComparable
- {
- // IComparable.CompareTo implementation.
- public int CompareTo(object obj) {
- if (obj == null) return 1;
-
- Temperature temp = obj as Temperature;
- if (obj != null)
- return m_value.CompareTo(temp.m_value);
- else
- throw new ArgumentException("object is not a Temperature");
- }
-
- // The value holder
- protected double m_value;
-
- public double Value {
- get {
- return m_value;
- }
- set {
- m_value = value;
- }
- }
-
- public double Celsius {
- get {
- return (m_value-32.0)/1.8;
- }
- set {
- m_value = 1.8*value+32.0;
- }
- }
- }
- //
-}
-
-namespace Snippets4 {
- //
- public class Temperature : IFormattable {
- // IFormattable.ToString implementation.
- public string ToString(string format, IFormatProvider provider) {
- if( format != null ) {
- if( format.Equals("F") ) {
- return String.Format("{0}'F", this.Value.ToString());
- }
- if( format.Equals("C") ) {
- return String.Format("{0}'C", this.Celsius.ToString());
- }
- }
-
- return m_value.ToString(format, provider);
- }
-
- // The value holder
- protected double m_value;
-
- public double Value {
- get {
- return m_value;
- }
- set {
- m_value = value;
- }
- }
-
- public double Celsius {
- get {
- return (m_value-32.0)/1.8;
- }
- set {
- m_value = 1.8*value+32.0;
- }
- }
- }
- //
-}
-namespace Snippets5 {
- //
- public class Temperature {
- // Parses the temperature from a string in form
- // [ws][sign]digits['F|'C][ws]
- public static Temperature Parse(string s) {
- Temperature temp = new Temperature();
-
- if( s.TrimEnd(null).EndsWith("'F") ) {
- temp.Value = Double.Parse( s.Remove(s.LastIndexOf('\''), 2) );
- }
- else if( s.TrimEnd(null).EndsWith("'C") ) {
- temp.Celsius = Double.Parse( s.Remove(s.LastIndexOf('\''), 2) );
- }
- else {
- temp.Value = Double.Parse(s);
- }
-
- return temp;
- }
-
- // The value holder
- protected double m_value;
-
- public double Value {
- get {
- return m_value;
- }
- set {
- m_value = value;
- }
- }
-
- public double Celsius {
- get {
- return (m_value-32.0)/1.8;
- }
- set {
- m_value = 1.8*value+32.0;
- }
- }
- }
- //
-}
-namespace Snippets6 {
- //
- public class Temperature {
- // Parses the temperature from a string in form
- // [ws][sign]digits['F|'C][ws]
- public static Temperature Parse(string s, IFormatProvider provider) {
- Temperature temp = new Temperature();
-
- if( s.TrimEnd(null).EndsWith("'F") ) {
- temp.Value = Double.Parse( s.Remove(s.LastIndexOf('\''), 2), provider);
- }
- else if( s.TrimEnd(null).EndsWith("'C") ) {
- temp.Celsius = Double.Parse( s.Remove(s.LastIndexOf('\''), 2), provider);
- }
- else {
- temp.Value = Double.Parse(s, provider);
- }
-
- return temp;
- }
-
- // The value holder
- protected double m_value;
-
- public double Value {
- get {
- return m_value;
- }
- set {
- m_value = value;
- }
- }
-
- public double Celsius {
- get {
- return (m_value-32.0)/1.8;
- }
- set {
- m_value = 1.8*value+32.0;
- }
- }
- }
- //
-}
-namespace Snippets7 {
- //
- public class Temperature {
- // Parses the temperature from a string in form
- // [ws][sign]digits['F|'C][ws]
- public static Temperature Parse(string s, NumberStyles styles) {
- Temperature temp = new Temperature();
-
- if( s.TrimEnd(null).EndsWith("'F") ) {
- temp.Value = Double.Parse( s.Remove(s.LastIndexOf('\''), 2), styles);
- }
- else if( s.TrimEnd(null).EndsWith("'C") ) {
- temp.Celsius = Double.Parse( s.Remove(s.LastIndexOf('\''), 2), styles);
- }
- else {
- temp.Value = Double.Parse(s, styles);
- }
-
- return temp;
- }
-
- // The value holder
- protected double m_value;
-
- public double Value {
- get {
- return m_value;
- }
- set {
- m_value = value;
- }
- }
-
- public double Celsius {
- get {
- return (m_value-32.0)/1.8;
- }
- set {
- m_value = 1.8*value+32.0;
- }
- }
- }
- //
-}
-namespace Snippets8 {
- //
- public class Temperature {
- // Parses the temperature from a string in form
- // [ws][sign]digits['F|'C][ws]
- public static Temperature Parse(string s, NumberStyles styles, IFormatProvider provider) {
- Temperature temp = new Temperature();
-
- if( s.TrimEnd(null).EndsWith("'F") ) {
- temp.Value = Double.Parse( s.Remove(s.LastIndexOf('\''), 2), styles, provider);
- }
- else if( s.TrimEnd(null).EndsWith("'C") ) {
- temp.Celsius = Double.Parse( s.Remove(s.LastIndexOf('\''), 2), styles, provider);
- }
- else {
- temp.Value = Double.Parse(s, styles, provider);
- }
-
- return temp;
- }
-
- // The value holder
- protected double m_value;
-
- public double Value {
- get {
- return m_value;
- }
- set {
- m_value = value;
- }
- }
-
- public double Celsius {
- get {
- return (m_value-32.0)/1.8;
- }
- set {
- m_value = 1.8*value+32.0;
- }
- }
- }
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/Project.fsproj b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/Project.fsproj
deleted file mode 100644
index 3154099aec4ec..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/Project.fsproj
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/comparison1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/comparison1.fs
deleted file mode 100644
index 579c3a34cb217..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/comparison1.fs
+++ /dev/null
@@ -1,12 +0,0 @@
-module comparison1
-
-//
-open System
-
-let value1 = 0.333333333333333
-let value2 = 1. / 3.
-printfn $"{value1} = {value2}: {value1.Equals value2}"
-
-// The example displays the following output:
-// 0.333333333333333 = 0.33333333333333331: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/comparison3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/comparison3.fs
deleted file mode 100644
index 8c58cd01d1738..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/comparison3.fs
+++ /dev/null
@@ -1,15 +0,0 @@
-module comparison3
-
-//
-open System
-
-let v1 = 0.333333333333333
-let v2 = 1. / 3.
-let precision = 7
-let value1 = Math.Round(v1, precision)
-let value2 = Math.Round(v2, precision)
-printfn $"{value1} = {value2}: {value1.Equals value2}"
-
-// The example displays the following output:
-// 0.3333333 = 0.3333333: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/comparison4.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/comparison4.fs
deleted file mode 100644
index 29502a935a89e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/comparison4.fs
+++ /dev/null
@@ -1,37 +0,0 @@
-module comparison4
-
-//
-open System
-
-let isApproximatelyEqual (value1: double) (value2: double) (epsilon: double) =
- // If they are equal anyway, just return True.
- if value1.Equals value2 then
- true
- else
- // Handle NaN, Infinity.
- if Double.IsInfinity value1 || Double.IsNaN value1 then
- value1.Equals value2
- elif Double.IsInfinity value2 || Double.IsNaN value2 then
- value1.Equals value2
- else
- // Handle zero to avoid division by zero
- let divisor = max value1 value2
- let divisor =
- if divisor.Equals 0 then
- min value1 value2
- else
- divisor
- abs ((value1 - value2) / divisor) <= epsilon
-
-let one1 = 0.1 * 10.
-let mutable one2 = 0.
-for _ = 1 to 10 do
- one2 <- one2 + 0.1
-
-printfn $"{one1} = {one2}: {one1.Equals one2}"
-printfn $"{one1} is approximately equal to {one2}: {isApproximatelyEqual one1 one2 0.000000001}"
-
-// The example displays the following output:
-// 1 = 0.99999999999999989: False
-// 1 is approximately equal to 0.99999999999999989: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/convert1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/convert1.fs
deleted file mode 100644
index 8c6c8cfc6c845..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/convert1.fs
+++ /dev/null
@@ -1,39 +0,0 @@
-module convert1
-
-//
-open System
-
-let values: obj[] =
- [| Byte.MinValue; Byte.MaxValue; Decimal.MinValue
- Decimal.MaxValue; Int16.MinValue; Int16.MaxValue
- Int32.MinValue; Int32.MaxValue; Int64.MinValue
- Int64.MaxValue; SByte.MinValue; SByte.MaxValue
- Single.MinValue; Single.MaxValue; UInt16.MinValue
- UInt16.MaxValue; UInt32.MinValue, UInt32.MaxValue
- UInt64.MinValue; UInt64.MaxValue |]
-
-for value in values do
- let dblValue = value :?> double
- printfn $"{value} ({value.GetType().Name}) --> {dblValue:R} ({dblValue.GetType().Name})"
-// The example displays the following output:
-// 0 (Byte) --> 0 (Double)
-// 255 (Byte) --> 255 (Double)
-// -79228162514264337593543950335 (Decimal) --> -7.9228162514264338E+28 (Double)
-// 79228162514264337593543950335 (Decimal) --> 7.9228162514264338E+28 (Double)
-// -32768 (Int16) --> -32768 (Double)
-// 32767 (Int16) --> 32767 (Double)
-// -2147483648 (Int32) --> -2147483648 (Double)
-// 2147483647 (Int32) --> 2147483647 (Double)
-// -9223372036854775808 (Int64) --> -9.2233720368547758E+18 (Double)
-// 9223372036854775807 (Int64) --> 9.2233720368547758E+18 (Double)
-// -128 (SByte) --> -128 (Double)
-// 127 (SByte) --> 127 (Double)
-// -3.402823E+38 (Single) --> -3.4028234663852886E+38 (Double)
-// 3.402823E+38 (Single) --> 3.4028234663852886E+38 (Double)
-// 0 (UInt16) --> 0 (Double)
-// 65535 (UInt16) --> 65535 (Double)
-// 0 (UInt32) --> 0 (Double)
-// 4294967295 (UInt32) --> 4294967295 (Double)
-// 0 (UInt64) --> 0 (Double)
-// 18446744073709551615 (UInt64) --> 1.8446744073709552E+19 (Double)
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/convert2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/convert2.fs
deleted file mode 100644
index 6ba8d1f91e361..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/convert2.fs
+++ /dev/null
@@ -1,127 +0,0 @@
-module convert2
-
-//
-open System
-open Checked
-
-let values =
- [| Double.MinValue; -67890.1234; -12345.6789
- 12345.6789; 67890.1234; Double.MaxValue
- Double.NaN; Double.PositiveInfinity;
- Double.NegativeInfinity |]
-
-for value in values do
- try
- let lValue = int64 value
- printfn $"{value} ({value.GetType().Name}) --> {lValue} (0x{lValue:X16}) ({lValue.GetType().Name})"
- with :? OverflowException ->
- printfn $"Unable to convert {value} to Int64."
- try
- let ulValue = uint64 value
- printfn $"{value} ({value.GetType().Name}) --> {ulValue} (0x{ulValue:X16}) ({ulValue.GetType().Name})"
- with :? OverflowException ->
- printfn $"Unable to convert {value} to UInt64."
- try
- let dValue = decimal value
- printfn $"{value} ({value.GetType().Name}) --> {dValue} ({dValue.GetType().Name})"
- with :? OverflowException ->
- printfn $"Unable to convert {value} to Decimal."
- try
- let sValue = float32 value
- printfn $"{value} ({value.GetType().Name}) --> {sValue} ({sValue.GetType().Name})"
- with :? OverflowException ->
- printfn $"Unable to convert {value} to Single."
- printfn ""
-// The example displays the following output for conversions performed
-// in a checked context:
-// Unable to convert -1.79769313486232E+308 to Int64.
-// Unable to convert -1.79769313486232E+308 to UInt64.
-// Unable to convert -1.79769313486232E+308 to Decimal.
-// -1.79769313486232E+308 (Double) --> -Infinity (Single)
-//
-// -67890.1234 (Double) --> -67890 (0xFFFFFFFFFFFEF6CE) (Int64)
-// Unable to convert -67890.1234 to UInt64.
-// -67890.1234 (Double) --> -67890.1234 (Decimal)
-// -67890.1234 (Double) --> -67890.13 (Single)
-//
-// -12345.6789 (Double) --> -12345 (0xFFFFFFFFFFFFCFC7) (Int64)
-// Unable to convert -12345.6789 to UInt64.
-// -12345.6789 (Double) --> -12345.6789 (Decimal)
-// -12345.6789 (Double) --> -12345.68 (Single)
-//
-// 12345.6789 (Double) --> 12345 (0x0000000000003039) (Int64)
-// 12345.6789 (Double) --> 12345 (0x0000000000003039) (UInt64)
-// 12345.6789 (Double) --> 12345.6789 (Decimal)
-// 12345.6789 (Double) --> 12345.68 (Single)
-//
-// 67890.1234 (Double) --> 67890 (0x0000000000010932) (Int64)
-// 67890.1234 (Double) --> 67890 (0x0000000000010932) (UInt64)
-// 67890.1234 (Double) --> 67890.1234 (Decimal)
-// 67890.1234 (Double) --> 67890.13 (Single)
-//
-// Unable to convert 1.79769313486232E+308 to Int64.
-// Unable to convert 1.79769313486232E+308 to UInt64.
-// Unable to convert 1.79769313486232E+308 to Decimal.
-// 1.79769313486232E+308 (Double) --> Infinity (Single)
-//
-// Unable to convert NaN to Int64.
-// Unable to convert NaN to UInt64.
-// Unable to convert NaN to Decimal.
-// NaN (Double) --> NaN (Single)
-//
-// Unable to convert Infinity to Int64.
-// Unable to convert Infinity to UInt64.
-// Unable to convert Infinity to Decimal.
-// Infinity (Double) --> Infinity (Single)
-//
-// Unable to convert -Infinity to Int64.
-// Unable to convert -Infinity to UInt64.
-// Unable to convert -Infinity to Decimal.
-// -Infinity (Double) --> -Infinity (Single)
-// The example displays the following output for conversions performed
-// in an unchecked context:
-// -1.79769313486232E+308 (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-// -1.79769313486232E+308 (Double) --> 9223372036854775808 (0x8000000000000000) (UInt64)
-// Unable to convert -1.79769313486232E+308 to Decimal.
-// -1.79769313486232E+308 (Double) --> -Infinity (Single)
-//
-// -67890.1234 (Double) --> -67890 (0xFFFFFFFFFFFEF6CE) (Int64)
-// -67890.1234 (Double) --> 18446744073709483726 (0xFFFFFFFFFFFEF6CE) (UInt64)
-// -67890.1234 (Double) --> -67890.1234 (Decimal)
-// -67890.1234 (Double) --> -67890.13 (Single)
-//
-// -12345.6789 (Double) --> -12345 (0xFFFFFFFFFFFFCFC7) (Int64)
-// -12345.6789 (Double) --> 18446744073709539271 (0xFFFFFFFFFFFFCFC7) (UInt64)
-// -12345.6789 (Double) --> -12345.6789 (Decimal)
-// -12345.6789 (Double) --> -12345.68 (Single)
-//
-// 12345.6789 (Double) --> 12345 (0x0000000000003039) (Int64)
-// 12345.6789 (Double) --> 12345 (0x0000000000003039) (UInt64)
-// 12345.6789 (Double) --> 12345.6789 (Decimal)
-// 12345.6789 (Double) --> 12345.68 (Single)
-//
-// 67890.1234 (Double) --> 67890 (0x0000000000010932) (Int64)
-// 67890.1234 (Double) --> 67890 (0x0000000000010932) (UInt64)
-// 67890.1234 (Double) --> 67890.1234 (Decimal)
-// 67890.1234 (Double) --> 67890.13 (Single)
-//
-// 1.79769313486232E+308 (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-// 1.79769313486232E+308 (Double) --> 0 (0x0000000000000000) (UInt64)
-// Unable to convert 1.79769313486232E+308 to Decimal.
-// 1.79769313486232E+308 (Double) --> Infinity (Single)
-//
-// NaN (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-// NaN (Double) --> 0 (0x0000000000000000) (UInt64)
-// Unable to convert NaN to Decimal.
-// NaN (Double) --> NaN (Single)
-//
-// Infinity (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-// Infinity (Double) --> 0 (0x0000000000000000) (UInt64)
-// Unable to convert Infinity to Decimal.
-// Infinity (Double) --> Infinity (Single)
-//
-// -Infinity (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-// -Infinity (Double) --> 9223372036854775808 (0x8000000000000000) (UInt64)
-// Unable to convert -Infinity to Decimal.
-// -Infinity (Double) --> -Infinity (Single)
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/exceptional1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/exceptional1.fs
deleted file mode 100644
index 2c90f85f4cd96..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/exceptional1.fs
+++ /dev/null
@@ -1,12 +0,0 @@
-module exceptional1
-
-//
-let value1 = 1.1632875981534209e-225
-let value2 = 9.1642346778e-175
-let result = value1 * value2
-printfn $"{value1} * {value2} = {result}"
-printfn $"{result} = 0: {result.Equals 0.0}"
-// The example displays the following output:
-// 1.16328759815342E-225 * 9.1642346778E-175 = 0
-// 0 = 0: True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/exceptional2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/exceptional2.fs
deleted file mode 100644
index 836cfc1d44b07..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/exceptional2.fs
+++ /dev/null
@@ -1,23 +0,0 @@
-module exceptional2
-
-//
-open System
-
-let value1 = 4.565e153
-let value2 = 6.9375e172
-let result = value1 * value2
-printfn $"PositiveInfinity: {Double.IsPositiveInfinity result}"
-printfn $"NegativeInfinity: {Double.IsNegativeInfinity result}\n"
-
-let value3 = - value1
-let result2 = value2 * value3
-printfn $"PositiveInfinity: {Double.IsPositiveInfinity result2}"
-printfn $"NegativeInfinity: {Double.IsNegativeInfinity result2}"
-
-// The example displays the following output:
-// PositiveInfinity: True
-// NegativeInfinity: False
-//
-// PositiveInfinity: False
-// NegativeInfinity: True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precision1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precision1.fs
deleted file mode 100644
index 7af7fc844d396..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precision1.fs
+++ /dev/null
@@ -1,24 +0,0 @@
-module precision1
-
-open System
-
-//
-let value = -4.42330604244772E-305
-
-let fromLiteral = -4.42330604244772E-305
-let fromVariable = value
-let fromParse = Double.Parse "-4.42330604244772E-305"
-
-printfn $"Double value from literal: {fromLiteral,29:R}"
-printfn $"Double value from variable: {fromVariable,28:R}"
-printfn $"Double value from Parse method: {fromParse,24:R}"
-// On 32-bit versions of the .NET Framework, the output is:
-// Double value from literal: -4.42330604244772E-305
-// Double value from variable: -4.42330604244772E-305
-// Double value from Parse method: -4.42330604244772E-305
-//
-// On other versions of the .NET Framework, the output is:
-// Double value from literal: -4.4233060424477198E-305
-// Double value from variable: -4.4233060424477198E-305
-// Double value from Parse method: -4.42330604244772E-305
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precisionlist1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precisionlist1.fs
deleted file mode 100644
index f03b6f4f7e04a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precisionlist1.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module precisionlist1
-
-//
-open System
-
-let value1 = 1. / 3.
-let sValue2 = 1f /3f
-
-let value2 = double sValue2
-printfn $"{value1:R} = {value2:R}: {value1.Equals value2}"
-// The example displays the following output:
-// 0.33333333333333331 = 0.3333333432674408: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precisionlist3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precisionlist3.fs
deleted file mode 100644
index a1275ed112100..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precisionlist3.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module precisionlist3
-
-//
-let values = [ 10.0; 2.88; 2.88; 2.88; 9.0 ]
-let result = 27.64
-let total = List.sum values
-
-if total.Equals result then
- printfn "The sum of the values equals the total."
-else
- printfn $"The sum of the values ({total}) does not equal the total ({result})."
-// The example displays the following output:
-// The sum of the values (36.64) does not equal the total (36.64).
-//
-// If the index items in the Console.WriteLine statement are changed to {0:R},
-// the example displays the following output:
-// The sum of the values (27.639999999999997) does not equal the total (27.64).
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precisionlist4.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precisionlist4.fs
deleted file mode 100644
index 9a129fa54a2c4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/precisionlist4.fs
+++ /dev/null
@@ -1,30 +0,0 @@
-module precisionlist4
-
-//
-open System
-open System.IO
-
-let values = [ 2.2 / 1.01; 1. / 3.; Math.PI ]
-
-using (new StreamWriter(@".\Doubles.dat")) (fun sw ->
- for i = 0 to values.Length - 1 do
- sw.Write(string values[i])
- if i <> values.Length - 1 then
- sw.Write "|")
-
-using (new StreamReader(@".\Doubles.dat")) (fun sr ->
- let temp = sr.ReadToEnd()
- let tempStrings = temp.Split '|'
-
- let restoredValues =
- [ for i = 0 to tempStrings.Length - 1 do
- Double.Parse tempStrings[i] ]
-
- for i = 0 to values.Length - 1 do
- printfn $"""{values[i]} {if values[ i ].Equals restoredValues[i] then "=" else "<>"} {restoredValues[i]}""")
-
-// The example displays the following output:
-// 2.17821782178218 <> 2.17821782178218
-// 0.333333333333333 <> 0.333333333333333
-// 3.14159265358979 <> 3.14159265358979
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/representation1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/representation1.fs
deleted file mode 100644
index 0497a46cbdb37..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/representation1.fs
+++ /dev/null
@@ -1,15 +0,0 @@
-module representation1
-
-//
-let value = 0.1
-let result1 = value * 10.
-let mutable result2 = 0.
-for i = 1 to 10 do
- result2 <- result2 + value
-
-printfn $".1 * 10: {result1:R}"
-printfn $".1 Added 10 times: {result2:R}"
-// The example displays the following output:
-// .1 * 10: 1
-// .1 Added 10 times: 0.99999999999999989
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/representation2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/representation2.fs
deleted file mode 100644
index 558694d05ffc9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/representation2.fs
+++ /dev/null
@@ -1,11 +0,0 @@
-module representation2
-
-//
-open System
-
-let value = 123456789012.34567
-let additional = Double.Epsilon * 1e15
-printfn $"{value} + {additional} = {value + additional}"
-// The example displays the following output:
-// 123456789012.346 + 4.94065645841247E-309 = 123456789012.346
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/source.fs b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/source.fs
deleted file mode 100644
index 5b90d8b675869..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/fsharp/source.fs
+++ /dev/null
@@ -1,230 +0,0 @@
-namespace snippet1
-open System
-open System.Globalization
-
-//
-// The Temperature class stores the temperature as a Double
-// and delegates most of the functionality to the Double
-// implementation.
-type Temperature() =
- member val Value = 0. with get, set
-
- member this.Celsius
- with get () = (this.Value - 32.) / 1.8
- and set (value) =
- this.Value <- 1.8 * value + 32.
-
- // Parses the temperature from a string in the form
- // [ws][sign]digits['F|'C][ws]
- static member Parse(s: string, styles: NumberStyles, provider: IFormatProvider) =
- let temp = Temperature()
-
- if s.TrimEnd(null).EndsWith "'F" then
- temp.Value <- Double.Parse(s.Remove(s.LastIndexOf '\'', 2), styles, provider)
- elif s.TrimEnd(null).EndsWith "'C" then
- temp.Celsius <- Double.Parse(s.Remove(s.LastIndexOf '\'', 2), styles, provider)
- else
- temp.Value <- Double.Parse(s, styles, provider)
- temp
-
- interface IComparable with
- // IComparable.CompareTo implementation.
- member this.CompareTo(obj: obj) =
- match obj with
- | null -> 1
- | :? Temperature as temp ->
- this.Value.CompareTo temp.Value
- | _ ->
- invalidArg "obj" "object is not a Temperature"
-
- interface IFormattable with
- // IFormattable.ToString implementation.
- member this.ToString(format: string, provider: IFormatProvider) =
- match format with
- | "F" ->
- $"{this.Value}'F"
- | "C" ->
- $"{this.Celsius}'C"
- | _ ->
- this.Value.ToString(format, provider)
-//
-
-namespace snippet2
-open System
-
-//
-type Temperature() =
- static member MinValue =
- Double.MinValue
-
- static member MaxValue =
- Double.MaxValue
-
- member val Value = 0. with get, set
-
- member this.Celsius
- with get () =
- (this.Value - 32.) / 1.8
- and set (value) =
- this.Value <- 1.8 * value + 32.
-//
-
-namespace snippet3
-open System
-
-//
-type Temperature() =
- member val Value = 0. with get, set
-
- member this.Celsius
- with get () =
- (this.Value - 32.) / 1.8
- and set (value) =
- this.Value <- 1.8 * value + 32.
-
- // IComparable.CompareTo implementation.
- interface IComparable with
- member this.CompareTo(obj: obj) =
- match obj with
- | null -> 1
- | :? Temperature as temp ->
- this.Value.CompareTo temp.Value
- | _ ->
- invalidArg "obj" "object is not a Temperature"
-//
-
-namespace snippet4
-open System
-
-//
-type Temperature() =
- member val Value = 0. with get, set
-
- member this.Celsius
- with get () =
- (this.Value - 32.) / 1.8
- and set (value) =
- this.Value <- 1.8 * value + 32.
-
- // IFormattable.ToString implementation.
- interface IFormattable with
- // IFormattable.ToString implementation.
- member this.ToString(format: string, provider: IFormatProvider) =
- match format with
- | "F" ->
- $"{this.Value}'F"
- | "C" ->
- $"{this.Celsius}'C"
- | _ ->
- this.Value.ToString(format, provider)
-//
-
-namespace snippet5
-open System
-
-//
-type Temperature() =
- // Parses the temperature from a string in form
- // [ws][sign]digits['F|'C][ws]
- static member Parse(s: string) =
- let temp = Temperature()
-
- if s.TrimEnd(null).EndsWith "'F" then
- temp.Value <- Double.Parse(s.Remove(s.LastIndexOf '\'', 2) )
- elif s.TrimEnd(null).EndsWith "'C" then
- temp.Celsius <- Double.Parse(s.Remove(s.LastIndexOf '\'', 2) )
- else
- temp.Value <- Double.Parse s
- temp
-
- member val Value = 0. with get, set
-
- member this.Celsius
- with get () =
- (this.Value - 32.) / 1.8
- and set (value) =
- this.Value <- 1.8 * value + 32.
-//
-
-namespace snippet6
-open System
-
-//
-type Temperature() =
- // Parses the temperature from a string in form
- // [ws][sign]digits['F|'C][ws]
- static member Parse(s: string, provider: IFormatProvider) =
- let temp = new Temperature()
-
- if s.TrimEnd(null).EndsWith "'F" then
- temp.Value <- Double.Parse(s.Remove(s.LastIndexOf '\'', 2), provider)
- elif s.TrimEnd(null).EndsWith "'C" then
- temp.Celsius <- Double.Parse(s.Remove(s.LastIndexOf '\'', 2), provider)
- else
- temp.Value <- Double.Parse(s, provider)
- temp
-
- member val Value = 0. with get, set
-
- member this.Celsius
- with get () =
- (this.Value - 32.) / 1.8
- and set (value) =
- this.Value <- 1.8 * value + 32.
-//
-
-namespace snippet7
-open System
-open System.Globalization
-
-//
-type Temperature() =
- // Parses the temperature from a string in form
- // [ws][sign]digits['F|'C][ws]
- static member Parse(s: string, styles: NumberStyles) =
- let temp = Temperature()
-
- if s.TrimEnd(null).EndsWith "'F" then
- temp.Value <- Double.Parse(s.Remove(s.LastIndexOf '\'', 2), styles)
- elif s.TrimEnd(null).EndsWith "'C" then
- temp.Celsius <- Double.Parse(s.Remove(s.LastIndexOf '\'', 2), styles)
- else
- temp.Value <- Double.Parse(s, styles)
- temp
-
- member val Value = 0. with get, set
-
- member this.Celsius
- with get () =
- (this.Value - 32.) / 1.8
- and set (value) =
- this.Value <- 1.8 * value + 32.
-//
-
-namespace snippet8
-open System
-open System.Globalization
-
-//
-type Temperature() =
- // Parses the temperature from a string in form
- // [ws][sign]digits['F|'C][ws]
- static member Parse(s: string, styles: NumberStyles, provider: IFormatProvider) =
- let temp = Temperature()
-
- if s.TrimEnd(null).EndsWith "'F" then
- temp.Value <- Double.Parse(s.Remove(s.LastIndexOf '\'', 2), styles, provider)
- elif s.TrimEnd(null).EndsWith "'C" then
- temp.Celsius <- Double.Parse(s.Remove(s.LastIndexOf '\'', 2), styles, provider)
- else
- temp.Value <- Double.Parse(s, styles, provider)
- temp
-
- member val Value = 0. with get, set
-
- member this.Celsius
- with get () =
- (this.Value - 32.) / 1.8
- and set (value) =
- this.Value <- 1.8 * value + 32.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/comparison1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/comparison1.vb
deleted file mode 100644
index 99826e6fd34cd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/comparison1.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example1
- Public Sub Main()
- Dim value1 As Double = 0.333333333333333
- Dim value2 As Double = 1 / 3
- Console.WriteLine("{0} = {1}: {2}", value1, value2, value1.Equals(value2))
- End Sub
-End Module
-
-' The example displays the following output:
-' 0.333333333333333 = 0.33333333333333331: False
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/comparison3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/comparison3.vb
deleted file mode 100644
index 3060e3e01d7e9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/comparison3.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example3
- Public Sub Main()
- Dim value1 As Double = 0.333333333333333
- Dim value2 As Double = 1 / 3
- Dim precision As Integer = 7
- value1 = Math.Round(value1, precision)
- value2 = Math.Round(value2, precision)
- Console.WriteLine("{0} = {1}: {2}", value1, value2, value1.Equals(value2))
- End Sub
-End Module
-
-' The example displays the following output:
-' 0.3333333 = 0.3333333: True
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/comparison4.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/comparison4.vb
deleted file mode 100644
index 67a96bacfc517..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/comparison4.vb
+++ /dev/null
@@ -1,43 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example4
- Public Sub Main()
- Dim one1 As Double = 0.1 * 10
- Dim one2 As Double = 0
- For ctr As Integer = 1 To 10
- one2 += 0.1
- Next
- Console.WriteLine("{0} = {1}: {2}", one1, one2, one1.Equals(one2))
- Console.WriteLine("{0} is approximately equal to {1}: {2}",
- one1, one2,
- IsApproximatelyEqual(one1, one2, 0.000000001))
- End Sub
-
- Function IsApproximatelyEqual(value1 As Double, value2 As Double,
- epsilon As Double) As Boolean
- ' If they are equal anyway, just return True.
- If value1.Equals(value2) Then Return True
-
- ' Handle NaN, Infinity.
- If Double.IsInfinity(value1) Or Double.IsNaN(value1) Then
- Return value1.Equals(value2)
- ElseIf Double.IsInfinity(value2) Or Double.IsNaN(value2) Then
- Return value1.Equals(value2)
- End If
-
- ' Handle zero to avoid division by zero
- Dim divisor As Double = Math.Max(value1, value2)
- If divisor.Equals(0) Then
- divisor = Math.Min(value1, value2)
- End If
-
- Return Math.Abs((value1 - value2) / divisor) <= epsilon
- End Function
-End Module
-
-' The example displays the following output:
-' 1 = 0.99999999999999989: False
-' 1 is approximately equal to 0.99999999999999989: True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/convert1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/convert1.vb
deleted file mode 100644
index cfe2f6d2a56e2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/convert1.vb
+++ /dev/null
@@ -1,45 +0,0 @@
-' Visual Basic .NET Document
-'Option Strict On
-
-'
-Module Example5
- Public Sub Main()
- Dim values() As Object = {Byte.MinValue, Byte.MaxValue, Decimal.MinValue,
- Decimal.MaxValue, Int16.MinValue, Int16.MaxValue,
- Int32.MinValue, Int32.MaxValue, Int64.MinValue,
- Int64.MaxValue, SByte.MinValue, SByte.MaxValue,
- Single.MinValue, Single.MaxValue, UInt16.MinValue,
- UInt16.MaxValue, UInt32.MinValue, UInt32.MaxValue,
- UInt64.MinValue, UInt64.MaxValue}
- Dim dblValue As Double
- For Each value In values
- dblValue = value
- Console.WriteLine("{0} ({1}) --> {2:R} ({3})",
- value, value.GetType().Name,
- dblValue, dblValue.GetType().Name)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 0 (Byte) --> 0 (Double)
-' 255 (Byte) --> 255 (Double)
-' -79228162514264337593543950335 (Decimal) --> -7.9228162514264338E+28 (Double)
-' 79228162514264337593543950335 (Decimal) --> 7.9228162514264338E+28 (Double)
-' -32768 (Int16) --> -32768 (Double)
-' 32767 (Int16) --> 32767 (Double)
-' -2147483648 (Int32) --> -2147483648 (Double)
-' 2147483647 (Int32) --> 2147483647 (Double)
-' -9223372036854775808 (Int64) --> -9.2233720368547758E+18 (Double)
-' 9223372036854775807 (Int64) --> 9.2233720368547758E+18 (Double)
-' -128 (SByte) --> -128 (Double)
-' 127 (SByte) --> 127 (Double)
-' -3.402823E+38 (Single) --> -3.4028234663852886E+38 (Double)
-' 3.402823E+38 (Single) --> 3.4028234663852886E+38 (Double)
-' 0 (UInt16) --> 0 (Double)
-' 65535 (UInt16) --> 65535 (Double)
-' 0 (UInt32) --> 0 (Double)
-' 4294967295 (UInt32) --> 4294967295 (Double)
-' 0 (UInt64) --> 0 (Double)
-' 18446744073709551615 (UInt64) --> 1.8446744073709552E+19 (Double)
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/convert2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/convert2.vb
deleted file mode 100644
index 236059544ead4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/convert2.vb
+++ /dev/null
@@ -1,140 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example6
- Public Sub Main()
- Dim values() As Double = {Double.MinValue, -67890.1234, -12345.6789,
- 12345.6789, 67890.1234, Double.MaxValue,
- Double.NaN, Double.PositiveInfinity,
- Double.NegativeInfinity}
- For Each value In values
- Try
- Dim lValue As Int64 = CLng(value)
- Console.WriteLine("{0} ({1}) --> {2} (0x{2:X16}) ({3})",
- value, value.GetType().Name,
- lValue, lValue.GetType().Name)
- Catch e As OverflowException
- Console.WriteLine("Unable to convert {0} to Int64.", value)
- End Try
- Try
- Dim ulValue As UInt64 = CULng(value)
- Console.WriteLine("{0} ({1}) --> {2} (0x{2:X16}) ({3})",
- value, value.GetType().Name,
- ulValue, ulValue.GetType().Name)
- Catch e As OverflowException
- Console.WriteLine("Unable to convert {0} to UInt64.", value)
- End Try
- Try
- Dim dValue As Decimal = CDec(value)
- Console.WriteLine("{0} ({1}) --> {2} ({3})",
- value, value.GetType().Name,
- dValue, dValue.GetType().Name)
- Catch e As OverflowException
- Console.WriteLine("Unable to convert {0} to Decimal.", value)
- End Try
- Try
- Dim sValue As Single = CSng(value)
- Console.WriteLine("{0} ({1}) --> {2} ({3})",
- value, value.GetType().Name,
- sValue, sValue.GetType().Name)
- Catch e As OverflowException
- Console.WriteLine("Unable to convert {0} to Single.", value)
- End Try
- Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays the following output for conversions performed
-' in a checked context:
-' Unable to convert -1.79769313486232E+308 to Int64.
-' Unable to convert -1.79769313486232E+308 to UInt64.
-' Unable to convert -1.79769313486232E+308 to Decimal.
-' -1.79769313486232E+308 (Double) --> -Infinity (Single)
-'
-' -67890.1234 (Double) --> -67890 (0xFFFFFFFFFFFEF6CE) (Int64)
-' Unable to convert -67890.1234 to UInt64.
-' -67890.1234 (Double) --> -67890.1234 (Decimal)
-' -67890.1234 (Double) --> -67890.13 (Single)
-'
-' -12345.6789 (Double) --> -12346 (0xFFFFFFFFFFFFCFC6) (Int64)
-' Unable to convert -12345.6789 to UInt64.
-' -12345.6789 (Double) --> -12345.6789 (Decimal)
-' -12345.6789 (Double) --> -12345.68 (Single)
-'
-' 12345.6789 (Double) --> 12346 (0x000000000000303A) (Int64)
-' 12345.6789 (Double) --> 12346 (0x000000000000303A) (UInt64)
-' 12345.6789 (Double) --> 12345.6789 (Decimal)
-' 12345.6789 (Double) --> 12345.68 (Single)
-'
-' 67890.1234 (Double) --> 67890 (0x0000000000010932) (Int64)
-' 67890.1234 (Double) --> 67890 (0x0000000000010932) (UInt64)
-' 67890.1234 (Double) --> 67890.1234 (Decimal)
-' 67890.1234 (Double) --> 67890.13 (Single)
-'
-' Unable to convert 1.79769313486232E+308 to Int64.
-' Unable to convert 1.79769313486232E+308 to UInt64.
-' Unable to convert 1.79769313486232E+308 to Decimal.
-' 1.79769313486232E+308 (Double) --> Infinity (Single)
-'
-' Unable to convert NaN to Int64.
-' Unable to convert NaN to UInt64.
-' Unable to convert NaN to Decimal.
-' NaN (Double) --> NaN (Single)
-'
-' Unable to convert Infinity to Int64.
-' Unable to convert Infinity to UInt64.
-' Unable to convert Infinity to Decimal.
-' Infinity (Double) --> Infinity (Single)
-'
-' Unable to convert -Infinity to Int64.
-' Unable to convert -Infinity to UInt64.
-' Unable to convert -Infinity to Decimal.
-' -Infinity (Double) --> -Infinity (Single)
-' The example displays the following output for conversions performed
-' in an unchecked context:
-' -1.79769313486232E+308 (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-' -1.79769313486232E+308 (Double) --> 9223372036854775808 (0x8000000000000000) (UInt64)
-' Unable to convert -1.79769313486232E+308 to Decimal.
-' -1.79769313486232E+308 (Double) --> -Infinity (Single)
-'
-' -67890.1234 (Double) --> -67890 (0xFFFFFFFFFFFEF6CE) (Int64)
-' -67890.1234 (Double) --> 18446744073709483726 (0xFFFFFFFFFFFEF6CE) (UInt64)
-' -67890.1234 (Double) --> -67890.1234 (Decimal)
-' -67890.1234 (Double) --> -67890.13 (Single)
-'
-' -12345.6789 (Double) --> -12346 (0xFFFFFFFFFFFFCFC6) (Int64)
-' -12345.6789 (Double) --> 18446744073709539270 (0xFFFFFFFFFFFFCFC6) (UInt64)
-' -12345.6789 (Double) --> -12345.6789 (Decimal)
-' -12345.6789 (Double) --> -12345.68 (Single)
-'
-' 12345.6789 (Double) --> 12346 (0x000000000000303A) (Int64)
-' 12345.6789 (Double) --> 12346 (0x000000000000303A) (UInt64)
-' 12345.6789 (Double) --> 12345.6789 (Decimal)
-' 12345.6789 (Double) --> 12345.68 (Single)
-'
-' 67890.1234 (Double) --> 67890 (0x0000000000010932) (Int64)
-' 67890.1234 (Double) --> 67890 (0x0000000000010932) (UInt64)
-' 67890.1234 (Double) --> 67890.1234 (Decimal)
-' 67890.1234 (Double) --> 67890.13 (Single)
-'
-' 1.79769313486232E+308 (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-' 1.79769313486232E+308 (Double) --> 0 (0x0000000000000000) (UInt64)
-' Unable to convert 1.79769313486232E+308 to Decimal.
-' 1.79769313486232E+308 (Double) --> Infinity (Single)
-'
-' NaN (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-' NaN (Double) --> 0 (0x0000000000000000) (UInt64)
-' Unable to convert NaN to Decimal.
-' NaN (Double) --> NaN (Single)
-'
-' Infinity (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-' Infinity (Double) --> 0 (0x0000000000000000) (UInt64)
-' Unable to convert Infinity to Decimal.
-' Infinity (Double) --> Infinity (Single)
-'
-' -Infinity (Double) --> -9223372036854775808 (0x8000000000000000) (Int64)
-' -Infinity (Double) --> 9223372036854775808 (0x8000000000000000) (UInt64)
-' Unable to convert -Infinity to Decimal.
-' -Infinity (Double) --> -Infinity (Single)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/exceptional1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/exceptional1.vb
deleted file mode 100644
index eadbd5337e5ab..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/exceptional1.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example7
- Public Sub Main()
- Dim value1 As Double = 1.1632875981534209E-225
- Dim value2 As Double = 9.1642346778E-175
- Dim result As Double = value1 * value2
- Console.WriteLine("{0} * {1} = {2}", value1, value2, result)
- Console.WriteLine("{0} = 0: {1}", result, result.Equals(0.0))
- End Sub
-End Module
-' The example displays the following output:
-' 1.16328759815342E-225 * 9.1642346778E-175 = 0
-' 0 = 0: True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/exceptional2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/exceptional2.vb
deleted file mode 100644
index ea7b486413cf4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/exceptional2.vb
+++ /dev/null
@@ -1,29 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example8
- Public Sub Main()
- Dim value1 As Double = 4.565E+153
- Dim value2 As Double = 6.9375E+172
- Dim result As Double = value1 * value2
- Console.WriteLine("PositiveInfinity: {0}",
- Double.IsPositiveInfinity(result))
- Console.WriteLine("NegativeInfinity: {0}",
- Double.IsNegativeInfinity(result))
- Console.WriteLine()
- value1 = -value1
- result = value1 * value2
- Console.WriteLine("PositiveInfinity: {0}",
- Double.IsPositiveInfinity(result))
- Console.WriteLine("NegativeInfinity: {0}",
- Double.IsNegativeInfinity(result))
- End Sub
-End Module
-' The example displays the following output:
-' PositiveInfinity: True
-' NegativeInfinity: False
-'
-' PositiveInfinity: False
-' NegativeInfinity: True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precision1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precision1.vb
deleted file mode 100644
index 9268a4b9e96c4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precision1.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example9
- Public Sub Main()
- '
- Dim value As Double = -4.4233060424477198E-305
-
- Dim fromLiteral As Double = -4.4233060424477198E-305
- Dim fromVariable As Double = value
- Dim fromParse As Double = Double.Parse("-4.42330604244772E-305")
-
- Console.WriteLine("Double value from literal: {0,29:R}", fromLiteral)
- Console.WriteLine("Double value from variable: {0,28:R}", fromVariable)
- Console.WriteLine("Double value from Parse method: {0,24:R}", fromParse)
- ' On 32-bit versions of the .NET Framework, the output is:
- ' Double value from literal: -4.42330604244772E-305
- ' Double value from variable: -4.42330604244772E-305
- ' Double value from Parse method: -4.42330604244772E-305
- '
- ' On other versions of the .NET Framework, the output is:
- ' Double value from literal: -4.4233060424477198E-305
- ' Double value from variable: -4.4233060424477198E-305
- ' Double value from Parse method: -4.42330604244772E-305
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist1.vb
deleted file mode 100644
index a503ee35971cd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist1.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example10
- Public Sub Main()
- Dim value1 As Double = 1 / 3
- Dim sValue2 As Single = 1 / 3
- Dim value2 As Double = CDbl(sValue2)
- Console.WriteLine("{0} = {1}: {2}", value1, value2, value1.Equals(value2))
- End Sub
-End Module
-' The example displays the following output:
-' 0.33333333333333331 = 0.3333333432674408: False
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist3.vb
deleted file mode 100644
index cc4856cf3280a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist3.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example11
- Public Sub Main()
- Dim values() As Double = {10.0, 2.88, 2.88, 2.88, 9.0}
- Dim result As Double = 27.64
- Dim total As Double
- For Each value In values
- total += value
- Next
- If total.Equals(result) Then
- Console.WriteLine("The sum of the values equals the total.")
- Else
- Console.WriteLine("The sum of the values ({0}) does not equal the total ({1}).",
- total, result)
- End If
- End Sub
-End Module
-' The example displays the following output:
-' The sum of the values (36.64) does not equal the total (36.64).
-'
-' If the index items in the Console.WriteLine statement are changed to {0:R},
-' the example displays the following output:
-' The sum of the values (27.639999999999997) does not equal the total (27.64).
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist4.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist4.vb
deleted file mode 100644
index b894f64b4f1bc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist4.vb
+++ /dev/null
@@ -1,36 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-
-Module Example12
- Public Sub Main()
- Dim sw As New StreamWriter(".\Doubles.dat")
- Dim values() As Double = {2.2 / 1.01, 1.0 / 3, Math.PI}
- For ctr As Integer = 0 To values.Length - 1
- sw.Write(values(ctr).ToString())
- If ctr <> values.Length - 1 Then sw.Write("|")
- Next
- sw.Close()
-
- Dim restoredValues(values.Length - 1) As Double
- Dim sr As New StreamReader(".\Doubles.dat")
- Dim temp As String = sr.ReadToEnd()
- Dim tempStrings() As String = temp.Split("|"c)
- For ctr As Integer = 0 To tempStrings.Length - 1
- restoredValues(ctr) = Double.Parse(tempStrings(ctr))
- Next
-
- For ctr As Integer = 0 To values.Length - 1
- Console.WriteLine("{0} {2} {1}", values(ctr),
- restoredValues(ctr),
- If(values(ctr).Equals(restoredValues(ctr)), "=", "<>"))
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 2.17821782178218 <> 2.17821782178218
-' 0.333333333333333 <> 0.333333333333333
-' 3.14159265358979 <> 3.14159265358979
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist5.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist5.vb
deleted file mode 100644
index 45fe98d372d12..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/precisionlist5.vb
+++ /dev/null
@@ -1,36 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-
-Module Example13
- Public Sub Main()
- Dim sw As New StreamWriter(".\Doubles.dat")
- Dim values() As Double = {2.2 / 1.01, 1.0 / 3, Math.PI}
- For ctr As Integer = 0 To values.Length - 1
- sw.Write("{0:G17}{1}", values(ctr),
- If(ctr < values.Length - 1, "|", ""))
- Next
- sw.Close()
-
- Dim restoredValues(values.Length - 1) As Double
- Dim sr As New StreamReader(".\Doubles.dat")
- Dim temp As String = sr.ReadToEnd()
- Dim tempStrings() As String = temp.Split("|"c)
- For ctr As Integer = 0 To tempStrings.Length - 1
- restoredValues(ctr) = Double.Parse(tempStrings(ctr))
- Next
-
- For ctr As Integer = 0 To values.Length - 1
- Console.WriteLine("{0} {2} {1}", values(ctr),
- restoredValues(ctr),
- If(values(ctr).Equals(restoredValues(ctr)), "=", "<>"))
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 2.17821782178218 = 2.17821782178218
-' 0.333333333333333 = 0.333333333333333
-' 3.14159265358979 = 3.14159265358979
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/representation1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/representation1.vb
deleted file mode 100644
index c68e1c5369123..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/representation1.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example14
- Public Sub Main()
- Dim value As Double = 0.1
- Dim result1 As Double = value * 10
- Dim result2 As Double
- For ctr As Integer = 1 To 10
- result2 += value
- Next
- Console.WriteLine(".1 * 10: {0:R}", result1)
- Console.WriteLine(".1 Added 10 times: {0:R}", result2)
- End Sub
-End Module
-' The example displays the following output:
-' .1 * 10: 1
-' .1 Added 10 times: 0.99999999999999989
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/representation2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/representation2.vb
deleted file mode 100644
index 01765b6591a3c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/representation2.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example15
- Public Sub Main()
- Dim value As Double = 123456789012.34567
- Dim additional As Double = Double.Epsilon * 1.0E+15
- Console.WriteLine("{0} + {1} = {2}", value, additional,
- value + additional)
- End Sub
-End Module
-' The example displays the following output:
-' 123456789012.346 + 4.94065645841247E-309 = 123456789012.346
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/source.vb
deleted file mode 100644
index 975120e98396e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Double/Overview/vb/source.vb
+++ /dev/null
@@ -1,399 +0,0 @@
-Imports System.Globalization
-
-Namespace Snippets
- Class Launcher
- Public Overloads Shared Sub Main()
- Dim t1 As Temperature = Temperature.Parse("20'F", NumberStyles.Float, Nothing)
- Console.WriteLine(t1.ToString("F", Nothing))
-
- Dim str1 As String = t1.ToString("C", Nothing)
- Console.WriteLine(str1)
-
- Dim t2 As Temperature = Temperature.Parse(str1, NumberStyles.Float, Nothing)
- Console.WriteLine(t2.ToString("F", Nothing))
-
- Console.WriteLine(t1.CompareTo(t2))
-
- Dim t3 As Temperature = Temperature.Parse("20'C", NumberStyles.Float, Nothing)
- Console.WriteLine(t3.ToString("F", Nothing))
-
- Console.WriteLine(t1.CompareTo(t3))
-
- Console.ReadLine()
- End Sub
- End Class
- '
- ' Temperature class stores the value as Double
- ' and delegates most of the functionality
- ' to the Double implementation.
- Public Class Temperature
- Implements IComparable, IFormattable
-
- Public Overloads Function CompareTo(ByVal obj As Object) As Integer _
- Implements IComparable.CompareTo
-
- If TypeOf obj Is Temperature Then
- Dim temp As Temperature = CType(obj, Temperature)
-
- Return m_value.CompareTo(temp.m_value)
- End If
-
- Throw New ArgumentException("object is not a Temperature")
- End Function
-
- Public Overloads Function ToString(ByVal format As String, ByVal provider As IFormatProvider) As String _
- Implements IFormattable.ToString
-
- If Not (format Is Nothing) Then
- If format.Equals("F") Then
- Return [String].Format("{0}'F", Me.Value.ToString())
- End If
- If format.Equals("C") Then
- Return [String].Format("{0}'C", Me.Celsius.ToString())
- End If
- End If
-
- Return m_value.ToString(format, provider)
- End Function
-
- ' Parses the temperature from a string in form
- ' [ws][sign]digits['F|'C][ws]
- Public Shared Function Parse(ByVal s As String, ByVal styles As NumberStyles, ByVal provider As IFormatProvider) As Temperature
- Dim temp As New Temperature()
-
- If s.TrimEnd().EndsWith("'F") Then
- temp.Value = Double.Parse(s.Remove(s.LastIndexOf("'"c), 2), styles, provider)
- Else
- If s.TrimEnd().EndsWith("'C") Then
- temp.Celsius = Double.Parse(s.Remove(s.LastIndexOf("'"c), 2), styles, provider)
- Else
- temp.Value = Double.Parse(s, styles, provider)
- End If
- End If
- Return temp
- End Function
-
- ' The value holder
- Protected m_value As Double
-
- Public Property Value() As Double
- Get
- Return m_value
- End Get
- Set(ByVal Value As Double)
- m_value = Value
- End Set
- End Property
-
- Public Property Celsius() As Double
- Get
- Return (m_value - 32) / 1.8
- End Get
- Set(ByVal Value As Double)
- m_value = Value * 1.8 + 32
- End Set
- End Property
- End Class
- '
-End Namespace
-
-Namespace Snippets2
- '
- Public Class Temperature
-
- Public Shared ReadOnly Property MinValue() As Double
- Get
- Return Double.MinValue
- End Get
- End Property
-
- Public Shared ReadOnly Property MaxValue() As Double
- Get
- Return Double.MaxValue
- End Get
- End Property
-
- ' The value holder
- Protected m_value As Double
-
- Public Property Value() As Double
- Get
- Return m_value
- End Get
- Set(ByVal Value As Double)
- m_value = Value
- End Set
- End Property
-
- Public Property Celsius() As Double
- Get
- Return (m_value - 32) / 1.8
- End Get
- Set(ByVal Value As Double)
- m_value = Value * 1.8 + 32
- End Set
- End Property
- End Class
- '
-End Namespace
-
-Namespace Snippets3
- '
- Public Class Temperature
- Implements IComparable
-
- Public Overloads Function CompareTo(ByVal obj As Object) As Integer _
- Implements IComparable.CompareTo
-
- If TypeOf obj Is Temperature Then
- Dim temp As Temperature = CType(obj, Temperature)
-
- Return m_value.CompareTo(temp.m_value)
- End If
-
- Throw New ArgumentException("object is not a Temperature")
- End Function
-
- ' The value holder
- Protected m_value As Double
-
- Public Property Value() As Double
- Get
- Return m_value
- End Get
- Set(ByVal Value As Double)
- m_value = Value
- End Set
- End Property
-
- Public Property Celsius() As Double
- Get
- Return (m_value - 32) / 1.8
- End Get
- Set(ByVal Value As Double)
- m_value = Value * 1.8 + 32
- End Set
- End Property
- End Class
- '
-End Namespace
-
-Namespace Snippets4
- '
- Public Class Temperature
- Implements IFormattable
-
- Public Overloads Function ToString(ByVal format As String, ByVal provider As IFormatProvider) As String _
- Implements IFormattable.ToString
-
- If Not (format Is Nothing) Then
- If format.Equals("F") Then
- Return [String].Format("{0}'F", Me.Value.ToString())
- End If
- If format.Equals("C") Then
- Return [String].Format("{0}'C", Me.Celsius.ToString())
- End If
- End If
-
- Return m_value.ToString(format, provider)
- End Function
-
- ' The value holder
- Protected m_value As Double
-
- Public Property Value() As Double
- Get
- Return m_value
- End Get
- Set(ByVal Value As Double)
- m_value = Value
- End Set
- End Property
-
- Public Property Celsius() As Double
- Get
- Return (m_value - 32) / 1.8
- End Get
- Set(ByVal Value As Double)
- m_value = Value * 1.8 + 32
- End Set
- End Property
- End Class
- '
-End Namespace
-
-Namespace Snippets5
- '
- Public Class Temperature
- ' Parses the temperature from a string in form
- ' [ws][sign]digits['F|'C][ws]
- Public Shared Function Parse(ByVal s As String) As Temperature
- Dim temp As New Temperature()
-
- If s.TrimEnd().EndsWith("'F") Then
- temp.Value = Double.Parse(s.Remove(s.LastIndexOf("'"c), 2))
- Else
- If s.TrimEnd().EndsWith("'C") Then
- temp.Celsius = Double.Parse(s.Remove(s.LastIndexOf("'"c), 2))
- Else
- temp.Value = Double.Parse(s)
- End If
- End If
- Return temp
- End Function 'Parse
-
- ' The value holder
- Protected m_value As Double
-
- Public Property Value() As Double
- Get
- Return m_value
- End Get
- Set(ByVal Value As Double)
- m_value = Value
- End Set
- End Property
-
- Public Property Celsius() As Double
- Get
- Return (m_value - 32) / 1.8
- End Get
- Set(ByVal Value As Double)
- m_value = Value * 1.8 + 32
- End Set
- End Property
- End Class
- '
-End Namespace
-
-Namespace Snippets6
- '
- Public Class Temperature
- ' Parses the temperature from a string in form
- ' [ws][sign]digits['F|'C][ws]
- Public Shared Function Parse(ByVal s As String, ByVal provider As IFormatProvider) As Temperature
- Dim temp As New Temperature()
-
- If s.TrimEnd().EndsWith("'F") Then
- temp.Value = Double.Parse(s.Remove(s.LastIndexOf("'"c), 2), provider)
- Else
- If s.TrimEnd().EndsWith("'C") Then
- temp.Celsius = Double.Parse(s.Remove(s.LastIndexOf("'"c), 2), provider)
- Else
- temp.Value = Double.Parse(s, provider)
- End If
- End If
- Return temp
- End Function 'Parse
-
- ' The value holder
- Protected m_value As Double
-
- Public Property Value() As Double
- Get
- Return m_value
- End Get
- Set(ByVal Value As Double)
- m_value = Value
- End Set
- End Property
-
- Public Property Celsius() As Double
- Get
- Return (m_value - 32) / 1.8
- End Get
- Set(ByVal Value As Double)
- m_value = Value * 1.8 + 32
- End Set
- End Property
- End Class
- '
-End Namespace
-
-Namespace Snippets7
- '
- Public Class Temperature
- ' Parses the temperature from a string in form
- ' [ws][sign]digits['F|'C][ws]
- Public Shared Function Parse(ByVal s As String, ByVal styles As NumberStyles) As Temperature
- Dim temp As New Temperature()
-
- If s.TrimEnd().EndsWith("'F") Then
- temp.Value = Double.Parse(s.Remove(s.LastIndexOf("'"c), 2), styles)
- Else
- If s.TrimEnd().EndsWith("'C") Then
- temp.Celsius = Double.Parse(s.Remove(s.LastIndexOf("'"c), 2), styles)
- Else
- temp.Value = Double.Parse(s, styles)
- End If
- End If
- Return temp
- End Function
-
- ' The value holder
- Protected m_value As Double
-
- Public Property Value() As Double
- Get
- Return m_value
- End Get
- Set(ByVal Value As Double)
- m_value = Value
- End Set
- End Property
-
- Public Property Celsius() As Double
- Get
- Return (m_value - 32) / 1.8
- End Get
- Set(ByVal Value As Double)
- m_value = Value * 1.8 + 32
- End Set
- End Property
- End Class
- '
-End Namespace
-
-Namespace Snippets8
- '
- Public Class Temperature
- ' Parses the temperature from a string in form
- ' [ws][sign]digits['F|'C][ws]
- Public Shared Function Parse(ByVal s As String, ByVal styles As NumberStyles, ByVal provider As IFormatProvider) As Temperature
- Dim temp As New Temperature()
-
- If s.TrimEnd().EndsWith("'F") Then
- temp.Value = Double.Parse(s.Remove(s.LastIndexOf("'"c), 2), styles, provider)
- Else
- If s.TrimEnd().EndsWith("'C") Then
- temp.Celsius = Double.Parse(s.Remove(s.LastIndexOf("'"c), 2), styles, provider)
- Else
- temp.Value = Double.Parse(s, styles, provider)
- End If
- End If
- Return temp
- End Function
-
- ' The value holder
- Protected m_value As Double
-
- Public Property Value() As Double
- Get
- Return m_value
- End Get
- Set(ByVal Value As Double)
- m_value = Value
- End Set
- End Property
-
- Public Property Celsius() As Double
- Get
- Return (m_value - 32) / 1.8
- End Get
- Set(ByVal Value As Double)
- m_value = Value * 1.8 + 32
- End Set
- End Property
- End Class
- '
-End Namespace
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/EnumMain.cs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/EnumMain.cs
deleted file mode 100644
index 11ea8acf442a2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/EnumMain.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-using System;
-
-public class EnumTest {
- enum Days { Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday };
- enum BoilingPoints { Celsius = 100, Fahrenheit = 212 };
- [Flags]
- enum Colors { Red = 1, Green = 2, Blue = 4, Yellow = 8 };
-
- public static void Main() {
-
- Type weekdays = typeof(Days);
- Type boiling = typeof(BoilingPoints);
-
- Console.WriteLine("The days of the week, and their corresponding values in the Days Enum are:");
-
- foreach ( string s in Enum.GetNames(weekdays) )
- Console.WriteLine( "{0,-11}= {1}", s, Enum.Format( weekdays, Enum.Parse(weekdays, s), "d"));
-
- Console.WriteLine();
- Console.WriteLine("Enums can also be created which have values that represent some meaningful amount.");
- Console.WriteLine("The BoilingPoints Enum defines the following items, and corresponding values:");
-
- foreach ( string s in Enum.GetNames(boiling) )
- Console.WriteLine( "{0,-11}= {1}", s, Enum.Format(boiling, Enum.Parse(boiling, s), "d"));
-
- Colors myColors = Colors.Red | Colors.Blue | Colors.Yellow;
- Console.WriteLine();
- Console.WriteLine($"myColors holds a combination of colors. Namely: {myColors}");
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/Extensions.cs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/Extensions.cs
deleted file mode 100644
index 39b41c6f3caed..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/Extensions.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-using System;
-
-// Define an enumeration to represent student grades.
-public enum Grades { F = 0, D = 1, C = 2, B = 3, A = 4 };
-
-// Define an extension method for the Grades enumeration.
-public static class Extensions
-{
- public static Grades minPassing = Grades.D;
-
- public static bool Passing(this Grades grade)
- {
- return grade >= minPassing;
- }
-}
-
-class Example8
-{
- static void Main()
- {
- Grades g1 = Grades.D;
- Grades g2 = Grades.F;
- Console.WriteLine($"{g1} {(g1.Passing() ? "is" : "is not")} a passing grade.");
- Console.WriteLine($"{g2} {(g2.Passing() ? "is" : "is not")} a passing grade.");
-
- Extensions.minPassing = Grades.C;
- Console.WriteLine("\nRaising the bar!\n");
- Console.WriteLine($"{g1} {(g1.Passing() ? "is" : "is not")} a passing grade.");
- Console.WriteLine($"{g2} {(g2.Passing() ? "is" : "is not")} a passing grade.");
- }
-}
-// The exmaple displays the following output:
-// D is a passing grade.
-// F is not a passing grade.
-//
-// Raising the bar!
-//
-// D is not a passing grade.
-// F is not a passing grade.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/class1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/class1.cs
deleted file mode 100644
index d0dc14f938725..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/class1.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-
-//
-public enum ArrivalStatus { Unknown=-3, Late=-1, OnTime=0, Early=1 };
-//
-
-//
-public class Example
-{
- public static void Main()
- {
- ArrivalStatus status = ArrivalStatus.OnTime;
- Console.WriteLine($"Arrival Status: {status} ({status:D})");
- }
-}
-// The example displays the following output:
-// Arrival Status: OnTime (0)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/class2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/class2.cs
deleted file mode 100644
index 0e3d0d01c4c0c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/class2.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-
-public class Example1
-{
- public static void Main()
- {
- //
- ArrivalStatus status1 = new ArrivalStatus();
- Console.WriteLine($"Arrival Status: {status1} ({status1:D})");
- // The example displays the following output:
- // Arrival Status: OnTime (0)
- //
-
- //
- ArrivalStatus status2 = (ArrivalStatus)1;
- Console.WriteLine($"Arrival Status: {status2} ({status2:D})");
- // The example displays the following output:
- // Arrival Status: Early (1)
- //
-
- //
- int value3 = 2;
- ArrivalStatus status3 = (ArrivalStatus)value3;
-
- int value4 = (int)status3;
- //
-
- //
- int number = -1;
- ArrivalStatus arrived = (ArrivalStatus)ArrivalStatus.ToObject(typeof(ArrivalStatus), number);
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classbitwise1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classbitwise1.cs
deleted file mode 100644
index ed2365a2484d3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classbitwise1.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System;
-
-//
-[Flags]
-public enum Pets
-{
- None = 0, Dog = 1, Cat = 2, Bird = 4, Rodent = 8,
- Reptile = 16, Other = 32
-};
-
-//
-
-public class Example2
-{
- public static void Main()
- {
- //
- Pets familyPets = Pets.Dog | Pets.Cat;
- Console.WriteLine($"Pets: {familyPets:G} ({familyPets:D})");
- // The example displays the following output:
- // Pets: Dog, Cat (3)
- //
-
- ShowHasFlag();
- ShowIfSet();
- TestForNone();
- }
-
- private static void ShowHasFlag()
- {
- //
- Pets familyPets = Pets.Dog | Pets.Cat;
- if (familyPets.HasFlag(Pets.Dog))
- Console.WriteLine("The family has a dog.");
- // The example displays the following output:
- // The family has a dog.
- //
- }
-
- private static void ShowIfSet()
- {
- //
- Pets familyPets = Pets.Dog | Pets.Cat;
- if ((familyPets & Pets.Dog) == Pets.Dog)
- Console.WriteLine("The family has a dog.");
- // The example displays the following output:
- // The family has a dog.
- //
- }
-
- private static void TestForNone()
- {
- //
- Pets familyPets = Pets.Dog | Pets.Cat;
- if (familyPets == Pets.None)
- Console.WriteLine("The family has no pets.");
- else
- Console.WriteLine("The family has pets.");
- // The example displays the following output:
- // The family has pets.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classconversion1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classconversion1.cs
deleted file mode 100644
index 0165fd21373cb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classconversion1.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-using System;
-
-public class Example3
-{
- public static void Main()
- {
- int[] values = { -3, -1, 0, 1, 5, Int32.MaxValue };
- foreach (var value in values)
- {
- ArrivalStatus status;
- if (Enum.IsDefined(typeof(ArrivalStatus), value))
- status = (ArrivalStatus)value;
- else
- status = ArrivalStatus.Unknown;
- Console.WriteLine($"Converted {value:N0} to {status}");
- }
- }
-}
-// The example displays the following output:
-// Converted -3 to Unknown
-// Converted -1 to Late
-// Converted 0 to OnTime
-// Converted 1 to Early
-// Converted 5 to Unknown
-// Converted 2,147,483,647 to Unknown
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classconversion2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classconversion2.cs
deleted file mode 100644
index 0ecfe35cc3647..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classconversion2.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-public class Example4
-{
- public static void Main()
- {
- //
- ArrivalStatus status = ArrivalStatus.Early;
- var number = Convert.ChangeType(status, Enum.GetUnderlyingType(typeof(ArrivalStatus)));
- Console.WriteLine($"Converted {status} to {number}");
- // The example displays the following output:
- // Converted Early to 1
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classformat1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classformat1.cs
deleted file mode 100644
index b621d0f931d55..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classformat1.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-public class Example5
-{
- public static void Main()
- {
- //
- string[] formats = { "G", "F", "D", "X" };
- ArrivalStatus status = ArrivalStatus.Late;
- foreach (var fmt in formats)
- Console.WriteLine(status.ToString(fmt));
-
- // The example displays the following output:
- // Late
- // Late
- // -1
- // FFFFFFFF
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classiterate.cs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classiterate.cs
deleted file mode 100644
index f9c3667b299b6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classiterate.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;
-
-public class Example6
-{
- public static void Main()
- {
- GetEnumByName();
- Console.WriteLine("-----");
- GetEnumByValue();
- }
-
- private static void GetEnumByName()
- {
- //
- string[] names = Enum.GetNames(typeof(ArrivalStatus));
- Console.WriteLine($"Members of {typeof(ArrivalStatus).Name}:");
- Array.Sort(names);
- foreach (var name in names)
- {
- ArrivalStatus status = (ArrivalStatus)Enum.Parse(typeof(ArrivalStatus), name);
- Console.WriteLine($" {status} ({status:D})");
- }
- // The example displays the following output:
- // Members of ArrivalStatus:
- // Early (1)
- // Late (-1)
- // OnTime (0)
- // Unknown (-3)
- //
- }
-
- private static void GetEnumByValue()
- {
- //
- var values = Enum.GetValues(typeof(ArrivalStatus));
- Console.WriteLine($"Members of {typeof(ArrivalStatus).Name}:");
- foreach (ArrivalStatus status in values)
- {
- Console.WriteLine($" {status} ({status:D})");
- }
- // The example displays the following output:
- // Members of ArrivalStatus:
- // OnTime (0)
- // Early (1)
- // Unknown (-3)
- // Late (-1)
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classparse1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classparse1.cs
deleted file mode 100644
index 4f7f447f7475b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/csharp/classparse1.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-
-public class Example7
-{
- public static void Main()
- {
- //
- string number = "-1";
- string name = "Early";
-
- try
- {
- ArrivalStatus status1 = (ArrivalStatus)Enum.Parse(typeof(ArrivalStatus), number);
- if (!(Enum.IsDefined(typeof(ArrivalStatus), status1)))
- status1 = ArrivalStatus.Unknown;
- Console.WriteLine($"Converted '{number}' to {status1}");
- }
- catch (FormatException)
- {
- Console.WriteLine($"Unable to convert '{number}' to an ArrivalStatus value.");
- }
-
- ArrivalStatus status2;
- if (Enum.TryParse(name, out status2))
- {
- if (!(Enum.IsDefined(typeof(ArrivalStatus), status2)))
- status2 = ArrivalStatus.Unknown;
- Console.WriteLine($"Converted '{name}' to {status2}");
- }
- else
- {
- Console.WriteLine($"Unable to convert '{number}' to an ArrivalStatus value.");
- }
- // The example displays the following output:
- // Converted '-1' to Late
- // Converted 'Early' to Early
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/EnumMain.fs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/EnumMain.fs
deleted file mode 100644
index 5f0424cc3fb2f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/EnumMain.fs
+++ /dev/null
@@ -1,42 +0,0 @@
-module EnumMain
-
-//
-open System
-
-type Days =
- | Saturday = 0
- | Sunday = 1
- | Monday = 2
- | Tuesday = 3
- | Wednesday = 4
- | Thursday = 5
- | Friday = 6
-
-type BoilingPoints =
- | Celsius = 100
- | Fahrenheit = 212
-
-[]
-type Colors =
- | Red = 1
- | Green = 2
- | Blue = 4
- | Yellow = 8
-
-let weekdays = typeof
-let boiling = typeof
-
-printfn "The days of the week, and their corresponding values in the Days Enum are:"
-
-for s in Enum.GetNames weekdays do
- printfn $"""{s,-11}= {Enum.Format(weekdays, Enum.Parse(weekdays, s), "d")}"""
-
-printfn "\nEnums can also be created which have values that represent some meaningful amount."
-printfn "The BoilingPoints Enum defines the following items, and corresponding values:"
-
-for s in Enum.GetNames boiling do
- printfn $"""{s,-11}= {Enum.Format(boiling, Enum.Parse(boiling, s), "d")}"""
-
-let myColors = Colors.Red ||| Colors.Blue ||| Colors.Yellow
-printfn $"\nmyColors holds a combination of colors. Namely: {myColors}"
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/Extensions.fs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/Extensions.fs
deleted file mode 100644
index 8d9c1ba6dc106..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/Extensions.fs
+++ /dev/null
@@ -1,39 +0,0 @@
-module Extensions
-
-//
-open System
-open System.Runtime.CompilerServices
-// Define an enumeration to represent student grades.
-type Grades =
- | F = 0
- | D = 1
- | C = 2
- | B = 3
- | A = 4
-
-let mutable minPassing = Grades.D
-
-// Define an extension method for the Grades enumeration.
-[]
-type Extensions =
- []
- static member Passing(grade) = grade >= minPassing
-
-let g1 = Grades.D
-let g2 = Grades.F
-printfn $"""{g1} {if g1.Passing() then "is" else "is not"} a passing grade."""
-printfn $"""{g2} {if g2.Passing() then "is" else "is not"} a passing grade."""
-
-minPassing <- Grades.C
-printfn "\nRaising the bar!\n"
-printfn $"""{g1} {if g1.Passing() then "is" else "is not"} a passing grade."""
-printfn $"""{g2} {if g2.Passing() then "is" else "is not"} a passing grade."""
-// The exmaple displays the following output:
-// D is a passing grade.
-// F is not a passing grade.
-//
-// Raising the bar!
-//
-// D is not a passing grade.
-// F is not a passing grade.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/class1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/class1.fs
deleted file mode 100644
index 2287c437cade2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/class1.fs
+++ /dev/null
@@ -1,15 +0,0 @@
-module class1
-
-//
-type ArrivalStatus =
- | Late = -1
- | OnTime = 0
- | Early = 1
-//
-
-//
-let status = ArrivalStatus.OnTime
-printfn $"Arrival Status: {status} ({status:D})"
-// The example displays the following output:
-// Arrival Status: OnTime (0)
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/class2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/class2.fs
deleted file mode 100644
index d1e5cb86d7d0a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/class2.fs
+++ /dev/null
@@ -1,32 +0,0 @@
-module class2
-
-type ArrivalStatus =
- | Late = -1
- | OnTime = 0
- | Early = 1
-
-//
-let status1 = ArrivalStatus()
-printfn $"Arrival Status: {status1} ({status1:D})"
-// The example displays the following output:
-// Arrival Status: OnTime (0)
-//
-
-//
-let status2 = enum 1
-printfn $"Arrival Status: {status2} ({status2:D})"
-// The example displays the following output:
-// Arrival Status: Early (1)
-//
-
-//
-let value3 = 2
-let status3 = enum value3
-
-let value4 = int status3
-//
-
-//
-let number = -1
-let arrived = ArrivalStatus.ToObject(typeof, number) :?> ArrivalStatus
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classbitwise1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classbitwise1.fs
deleted file mode 100644
index 19c04d8e0607d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classbitwise1.fs
+++ /dev/null
@@ -1,55 +0,0 @@
-module classbitwise1
-
-open System
-
-//
-[]
-type Pets =
- | None = 0
- | Dog = 1
- | Cat = 2
- | Bird = 4
- | Rodent = 8
- | Reptile = 16
- | Other = 32
-//
-
-//
-let familyPets = Pets.Dog ||| Pets.Cat
-printfn $"Pets: {familyPets:G} ({familyPets:D})"
-// The example displays the following output:
-// Pets: Dog, Cat (3)
-//
-
-let showHasFlag () =
- //
- let familyPets = Pets.Dog ||| Pets.Cat
- if familyPets.HasFlag Pets.Dog then
- printfn "The family has a dog."
- // The example displays the following output:
- // The family has a dog.
- //
-
-let showIfSet () =
- //
- let familyPets = Pets.Dog ||| Pets.Cat
- if (familyPets &&& Pets.Dog) = Pets.Dog then
- printfn "The family has a dog."
- // The example displays the following output:
- // The family has a dog.
- //
-
-let testForNone () =
- //
- let familyPets = Pets.Dog ||| Pets.Cat
- if familyPets = Pets.None then
- printfn "The family has no pets."
- else
- printfn "The family has pets."
- // The example displays the following output:
- // The family has pets.
- //
-
-showHasFlag ()
-showIfSet ()
-testForNone ()
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classconversion1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classconversion1.fs
deleted file mode 100644
index f1725e566210a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classconversion1.fs
+++ /dev/null
@@ -1,27 +0,0 @@
-module classconversion1
-
-//
-open System
-
-type ArrivalStatus =
- | Unknown = -3
- | Late = -1
- | OnTime = 0
- | Early = 1
-
-let values = [ -3; -1; 0; 1; 5; Int32.MaxValue ]
-for value in values do
- let status =
- if Enum.IsDefined(typeof, value) then
- enum value
- else
- ArrivalStatus.Unknown
- printfn $"Converted {value:N0} to {status}"
-// The example displays the following output:
-// Converted -3 to Unknown
-// Converted -1 to Late
-// Converted 0 to OnTime
-// Converted 1 to Early
-// Converted 5 to Unknown
-// Converted 2,147,483,647 to Unknown
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classconversion2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classconversion2.fs
deleted file mode 100644
index 6ec9b0b11f77e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classconversion2.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module classconversion2
-
-open System
-
-type ArrivalStatus =
- | Unknown = -3
- | Late = -1
- | OnTime = 0
- | Early = 1
-
-//
-let status = ArrivalStatus.Early
-let number = Convert.ChangeType(status, Enum.GetUnderlyingType typeof)
-printfn $"Converted {status} to {number}"
-// The example displays the following output:
-// Converted Early to 1
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classformat1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classformat1.fs
deleted file mode 100644
index 2f9ddb3923b45..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classformat1.fs
+++ /dev/null
@@ -1,22 +0,0 @@
-module classformat1
-
-open System
-
-type ArrivalStatus =
- | Unknown = -3
- | Late = -1
- | OnTime = 0
- | Early = 1
-
-//
-let formats = [ "G"; "F"; "D"; "X" ]
-let status = ArrivalStatus.Late
-for fmt in formats do
- printfn $"{status.ToString fmt}"
-
-// The example displays the following output:
-// Late
-// Late
-// -1
-// FFFFFFFF
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classiterate.fs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classiterate.fs
deleted file mode 100644
index 291674b018b61..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classiterate.fs
+++ /dev/null
@@ -1,43 +0,0 @@
-module classinterate
-
-open System
-
-type ArrivalStatus =
- | Unknown = -3
- | Late = -1
- | OnTime = 0
- | Early = 1
-
-let getEnumByName () =
- //
- let names = Enum.GetNames typeof
- printfn $"Members of {nameof ArrivalStatus}:"
- let names = Array.sort names
- for name in names do
- let status = Enum.Parse(typeof, name) :?> ArrivalStatus
- printfn $" {status} ({status:D})"
- // The example displays the following output:
- // Members of ArrivalStatus:
- // Early (1)
- // Late (-1)
- // OnTime (0)
- // Unknown (-3)
- //
-
-let getEnumByValue () =
- //
- let values = Enum.GetValues typeof
- printfn $"Members of {nameof ArrivalStatus}:"
- for status in values do
- printfn $" {status} ({status:D})"
- // The example displays the following output:
- // Members of ArrivalStatus:
- // OnTime (0)
- // Early (1)
- // Unknown (-3)
- // Late (-1)
- //
-
-getEnumByName ()
-printfn "-----"
-getEnumByValue ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classparse1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classparse1.fs
deleted file mode 100644
index a976f5e5c4e76..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/fsharp/classparse1.fs
+++ /dev/null
@@ -1,40 +0,0 @@
-module classparse1
-
-open System
-
-type ArrivalStatus =
- | Unknown = -3
- | Late = -1
- | OnTime = 0
- | Early = 1
-
-//
-let number = "-1"
-let name = "Early"
-
-try
- let status1 = Enum.Parse(typeof, number) :?> ArrivalStatus
- let status1 =
- if not (Enum.IsDefined(typeof, status1) ) then
- ArrivalStatus.Unknown
- else
- status1
-
- printfn $"Converted '{number}' to {status1}"
-with :? FormatException ->
- printfn $"Unable to convert '{number}' to an ArrivalStatus value."
-
-match Enum.TryParse name with
-| true, status2 ->
- let status2 =
- if not (Enum.IsDefined(typeof, status2) ) then
- ArrivalStatus.Unknown
- else
- status2
- printfn $"Converted '{name}' to {status2}"
-| _ ->
- printfn $"Unable to convert '{number}' to an ArrivalStatus value."
-// The example displays the following output:
-// Converted '-1' to Late
-// Converted 'Early' to Early
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/EnumMain.vb b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/EnumMain.vb
deleted file mode 100644
index c13d32be19fea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/EnumMain.vb
+++ /dev/null
@@ -1,50 +0,0 @@
-'
-Public Class EnumTest
- Enum Days
- Saturday
- Sunday
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- End Enum
-
- Enum BoilingPoints
- Celsius = 100
- Fahrenheit = 212
- End Enum
-
- _
- Enum Colors
- Red = 1
- Green = 2
- Blue = 4
- Yellow = 8
- End Enum
-
- Public Shared Sub Main()
- Dim weekdays As Type = GetType(Days)
- Dim boiling As Type = GetType(BoilingPoints)
-
- Console.WriteLine("The days of the week, and their corresponding values in the Days Enum are:")
-
- Dim s As String
- For Each s In [Enum].GetNames(weekdays)
- Console.WriteLine("{0,-11} = {1}", s, [Enum].Format(weekdays, [Enum].Parse(weekdays, s), "d"))
-
- Next s
- Console.WriteLine()
- Console.WriteLine("Enums can also be created which have values that represent some meaningful amount.")
- Console.WriteLine("The BoilingPoints Enum defines the following items, and corresponding values:")
-
- For Each s In [Enum].GetNames(boiling)
- Console.WriteLine("{0,-11} = {1}", s, [Enum].Format(boiling, [Enum].Parse(boiling, s), "d"))
- Next s
-
- Dim myColors As Colors = Colors.Red Or Colors.Blue Or Colors.Yellow
- Console.WriteLine()
- Console.WriteLine("myColors holds a combination of colors. Namely: {0}", myColors)
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/Extensions.vb b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/Extensions.vb
deleted file mode 100644
index 630ba26b30f05..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/Extensions.vb
+++ /dev/null
@@ -1,52 +0,0 @@
-'
-Imports System.Runtime.CompilerServices
-
-' Define an enumeration to represent student grades.
-Public Enum Grades As Integer
- F = 0
- D = 1
- C = 2
- B = 3
- A = 4
-End Enum
-
-' Define an extension method for the Grades enumeration.
-Public Module Extensions
- Public minPassing As Grades = Grades.D
-
-
- Public Function Passing(grade As Grades) As Boolean
- Return grade >= minPassing
- End Function
-End Module
-
-Public Module Example
- Public Sub Main()
- Dim g1 As Grades = Grades.D
- Dim g2 As Grades = Grades.F
- Console.WriteLine("{0} {1} a passing grade.",
- g1, If(g1.Passing(), "is", "is not"))
- Console.WriteLine("{0} {1} a passing grade.",
- g2, If(g2.Passing(), "is", "is not"))
- Console.WriteLine()
-
- Extensions.minPassing = Grades.C
- Console.WriteLine("Raising the bar!")
- Console.WriteLine()
- Console.WriteLine("{0} {1} a passing grade.",
- g1, If(g1.Passing(), "is", "is not"))
- Console.WriteLine("{0} {1} a passing grade.",
- g2, If(g2.Passing(), "is", "is not"))
- End Sub
-End Module
-' The exmaple displays the following output:
-' D is a passing grade.
-' F is not a passing grade.
-'
-' Raising the bar!
-'
-' D is not a passing grade.
-' F is not a passing grade.
-'
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/class1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/class1.vb
deleted file mode 100644
index 7d20b0f123661..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/class1.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Enum ArrivalStatus1 As Integer
- Late = -1
- OnTime = 0
- Early = 1
-End Enum
-'
-
-'
-Public Module Example1
- Public Sub Main()
- Dim status As ArrivalStatus1 = ArrivalStatus1.OnTime
- Console.WriteLine("Arrival Status: {0} ({0:D})", status)
- End Sub
-End Module
-' The example displays the following output:
-' Arrival Status: OnTime (0)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/class2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/class2.vb
deleted file mode 100644
index 502d2a09753e3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/class2.vb
+++ /dev/null
@@ -1,38 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Public Enum ArrivalStatus2 As Integer
- Late = -1
- OnTime = 0
- Early = 1
-End Enum
-
-Public Module Example2
- Public Sub Main()
- '
- Dim status1 As New ArrivalStatus2()
- Console.WriteLine("Arrival Status: {0} ({0:D})", status1)
- ' The example displays the following output:
- ' Arrival Status: OnTime (0)
- '
-
- '
- Dim status2 As ArrivalStatus2 = CType(1, ArrivalStatus2)
- Console.WriteLine("Arrival Status: {0} ({0:D})", status2)
- ' The example displays the following output:
- ' Arrival Status: Early (1)
- '
-
- '
- Dim value3 As Integer = 2
- Dim status3 As ArrivalStatus2 = CType(value3, ArrivalStatus2)
-
- Dim value4 As Integer = CInt(status3)
- '
-
- '
- Dim number As Integer = -1
- Dim arrived As ArrivalStatus2 = CType(ArrivalStatus2.ToObject(GetType(ArrivalStatus2), number), ArrivalStatus2)
- '
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classbitwise1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classbitwise1.vb
deleted file mode 100644
index be06a7128f5c9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classbitwise1.vb
+++ /dev/null
@@ -1,65 +0,0 @@
-' Visual Basic .NET Document
-'Option Strict On
-
-'
- Public Enum Pets As Integer
- None = 0
- Dog = 1
- Cat = 2
- Bird = 4
- Rodent = 8
- Reptile = 16
- Other = 32
-End Enum
-'
-
-Module Example3
- Public Sub Main()
- '
- Dim familyPets As Pets = Pets.Dog Or Pets.Cat
- Console.WriteLine("Pets: {0:G} ({0:D})", familyPets)
- ' The example displays the following output:
- ' Pets: Dog, Cat (3)
- '
-
- ShowHasFlag()
- ShowIfSet()
- TestForNone()
- End Sub
-
- Private Sub ShowHasFlag()
- '
- Dim familyPets As Pets = Pets.Dog Or Pets.Cat
- If familyPets.HasFlag(Pets.Dog) Then
- Console.WriteLine("The family has a dog.")
- End If
- ' The example displays the following output:
- ' The family has a dog.
- '
- End Sub
-
- Private Sub ShowIfSet()
- '
- Dim familyPets As Pets = Pets.Dog Or Pets.Cat
- If familyPets And Pets.Dog = Pets.Dog Then
- Console.WriteLine("The family has a dog.")
- End If
- ' The example displays the following output:
- ' The family has a dog.
- '
- End Sub
-
- Private Sub TestForNone()
- '
- Dim familyPets As Pets = Pets.Dog Or Pets.Cat
- If familyPets = Pets.None Then
- Console.WriteLine("The family has no pets.")
- Else
- Console.WriteLine("The family has pets.")
- End If
- ' The example displays the following output:
- ' The family has pets.
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classconversion1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classconversion1.vb
deleted file mode 100644
index 92ddf702d3517..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classconversion1.vb
+++ /dev/null
@@ -1,35 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-Option Infer On
-
-'
-Public Enum ArrivalStatus4 As Integer
- Unknown = -3
- Late = -1
- OnTime = 0
- Early = 1
-End Enum
-
-Module Example4
- Public Sub Main()
- Dim values() As Integer = {-3, -1, 0, 1, 5, Int32.MaxValue}
- For Each value In values
- Dim status As ArrivalStatus4
- If [Enum].IsDefined(GetType(ArrivalStatus4), value) Then
- status = CType(value, ArrivalStatus4)
- Else
- status = ArrivalStatus4.Unknown
- End If
- Console.WriteLine("Converted {0:N0} to {1}", value, status)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Converted -3 to Unknown
-' Converted -1 to Late
-' Converted 0 to OnTime
-' Converted 1 to Early
-' Converted 5 to Unknown
-' Converted 2,147,483,647 to Unknown
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classconversion2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classconversion2.vb
deleted file mode 100644
index a11e32e0e0400..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classconversion2.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-Option Infer On
-
-Public Enum ArrivalStatus5 As Integer
- Unknown = -3
- Late = -1
- OnTime = 0
- Early = 1
-End Enum
-
-Module Example5
- Public Sub Main()
- '
- Dim status As ArrivalStatus5 = ArrivalStatus5.Early
- Dim number = Convert.ChangeType(status, [Enum].GetUnderlyingType(GetType(ArrivalStatus5)))
- Console.WriteLine("Converted {0} to {1}", status, number)
- ' The example displays the following output:
- ' Converted Early to 1
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classformat1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classformat1.vb
deleted file mode 100644
index 62716176bb6c9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classformat1.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Public Enum ArrivalStatus6 As Integer
- Unknown = -3
- Late = -1
- OnTime = 0
- Early = 1
-End Enum
-
-Module Example6
- Public Sub Main()
- '
- Dim formats() As String = {"G", "F", "D", "X"}
- Dim status As ArrivalStatus6 = ArrivalStatus6.Late
- For Each fmt As String In formats
- Console.WriteLine(status.ToString(fmt))
- Next
- ' The example displays the following output:
- ' Late
- ' Late
- ' -1
- ' FFFFFFFF
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classiterate.vb b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classiterate.vb
deleted file mode 100644
index d4f5c5313d25a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classiterate.vb
+++ /dev/null
@@ -1,56 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-Option Infer On
-
-Public Enum ArrivalStatus7 As Integer
- Unknown = -3
- Late = -1
- OnTime = 0
- Early = 1
-End Enum
-
-Module Example7
- Public Sub Main()
- GetEnumByName()
- Console.WriteLine("-----")
- GetEnumByValue()
- End Sub
-
- Private Sub GetEnumByName()
- '
- Dim names() As String = [Enum].GetNames(GetType(ArrivalStatus7))
- Console.WriteLine("Members of {0}:", GetType(ArrivalStatus7).Name)
- Array.Sort(names)
- For Each name In names
- Dim status As ArrivalStatus7 = CType([Enum].Parse(GetType(ArrivalStatus7), name),
- ArrivalStatus7)
- Console.WriteLine(" {0} ({0:D})", status)
- Next
- ' The example displays the following output:
- ' Members of ArrivalStatus7:
- ' Early (1)
- ' Late (-1)
- ' OnTime (0)
- ' Unknown (-3)
- '
- End Sub
-
- Private Sub GetEnumByValue()
- '
- Dim values = [Enum].GetValues(GetType(ArrivalStatus7))
- Console.WriteLine("Members of {0}:", GetType(ArrivalStatus7).Name)
- For Each value In values
- Dim status As ArrivalStatus7 = CType([Enum].ToObject(GetType(ArrivalStatus7), value),
- ArrivalStatus7)
- Console.WriteLine(" {0} ({0:D})", status)
- Next
- ' The example displays the following output:
- ' Members of ArrivalStatus7:
- ' OnTime (0)
- ' Early (1)
- ' Unknown (-3)
- ' Late (-1)
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classparse1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classparse1.vb
deleted file mode 100644
index dfc231b8f40cd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Enum/Overview/vb/classparse1.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-Option Infer On
-
-Public Enum ArrivalStatus8 As Integer
- Unknown = -3
- Late = -1
- OnTime = 0
- Early = 1
-End Enum
-
-Module Example8
- Public Sub Main()
- '
- Dim number As String = "-1"
- Dim name As String = "Early"
- Dim invalid As String = "32"
-
- Try
- Dim status1 As ArrivalStatus8 = CType([Enum].Parse(GetType(ArrivalStatus8), number), ArrivalStatus8)
- If Not [Enum].IsDefined(GetType(ArrivalStatus8), status1) Then status1 = ArrivalStatus8.Unknown
- Console.WriteLine("Converted '{0}' to {1}", number, status1)
- Catch e As FormatException
- Console.WriteLine("Unable to convert '{0}' to an ArrivalStatus8 value.",
- number)
- End Try
-
- Dim status2 As ArrivalStatus8
- If [Enum].TryParse(Of ArrivalStatus8)(name, status2) Then
- If Not [Enum].IsDefined(GetType(ArrivalStatus8), status2) Then status2 = ArrivalStatus8.Unknown
- Console.WriteLine("Converted '{0}' to {1}", name, status2)
- Else
- Console.WriteLine("Unable to convert '{0}' to an ArrivalStatus8 value.",
- number)
- End If
- ' The example displays the following output:
- ' Converted '-1' to Late
- ' Converted 'Early' to Early
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/csharp/properties.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/csharp/properties.cs
deleted file mode 100644
index e30c08c7ee82e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/csharp/properties.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-using System;
-
-namespace NDP_UE_CS
-{
- // Derive an exception; the constructor sets the HelpLink and
- // Source properties.
- class LogTableOverflowException : Exception
- {
- const string overflowMessage = "The log table has overflowed.";
-
- public LogTableOverflowException(
- string auxMessage, Exception inner) :
- base(String.Format("{0} - {1}",
- overflowMessage, auxMessage), inner)
- {
- this.HelpLink = "https://learn.microsoft.com";
- this.Source = "Exception_Class_Samples";
- }
- }
-
- class LogTable
- {
- public LogTable(int numElements)
- {
- logArea = new string[numElements];
- elemInUse = 0;
- }
-
- protected string[] logArea;
- protected int elemInUse;
-
- // The AddRecord method throws a derived exception if
- // the array bounds exception is caught.
- public int AddRecord(string newRecord)
- {
- try
- {
- logArea[elemInUse] = newRecord;
- return elemInUse++;
- }
- catch (Exception e)
- {
- throw new LogTableOverflowException(
- String.Format("Record \"{0}\" was not logged.",
- newRecord), e);
- }
- }
- }
-
- class OverflowDemo
- {
- // Create a log table and force an overflow.
- public static void Main()
- {
- LogTable log = new LogTable(4);
-
- Console.WriteLine(
- "This example of \n Exception.Message, \n" +
- " Exception.HelpLink, \n Exception.Source, \n" +
- " Exception.StackTrace, and \n Exception." +
- "TargetSite \ngenerates the following output.");
-
- try
- {
- for (int count = 1; ; count++)
- {
- log.AddRecord(
- String.Format(
- "Log record number {0}", count));
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine($"{Environment.NewLine}Message ---{Environment.NewLine}{ex.Message}");
- Console.WriteLine($"{Environment.NewLine}HelpLink ---{Environment.NewLine}{ex.HelpLink}");
- Console.WriteLine($"{Environment.NewLine}Source ---{Environment.NewLine}{ex.Source}");
- Console.WriteLine($"{Environment.NewLine}StackTrace ---{Environment.NewLine}{ex.StackTrace}");
- Console.WriteLine($"{Environment.NewLine}TargetSite ---{Environment.NewLine}{ex.TargetSite}");
- }
- }
- }
-}
-
-/*
-This example of
- Exception.Message,
- Exception.HelpLink,
- Exception.Source,
- Exception.StackTrace, and
- Exception.TargetSite
-generates the following output.
-
-Message ---
-The log table has overflowed. - Record "Log record number 5" was not logged.
-
-HelpLink ---
-https://learn.microsoft.com
-
-Source ---
-Exception_Class_Samples
-
-StackTrace ---
- at NDP_UE_CS.LogTable.AddRecord(String newRecord)
- at NDP_UE_CS.OverflowDemo.Main()
-
-TargetSite ---
-Int32 AddRecord(System.String)
-*/
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/fsharp/properties.fs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/fsharp/properties.fs
deleted file mode 100644
index 62b2b9ec96660..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/fsharp/properties.fs
+++ /dev/null
@@ -1,79 +0,0 @@
-module NDP_UE_FS
-
-//
-// Example for the Exception.HelpLink, Exception.Source,
-// Exception.StackTrace, and Exception.TargetSite properties.
-open System
-
-let overflowMessage = "The log table has overflowed."
-
-// Derive an exception; the constructor sets the HelpLink and
-// Source properties.
-type LogTableOverflowException(auxMessage, inner) as this =
- inherit Exception($"%s{overflowMessage} - %s{auxMessage}", inner)
-
- do
- this.HelpLink <- "https://docs.microsoft.com"
- this.Source <- "Exception_Class_Samples"
-
-type LogTable(numElements) =
- let logArea = Array.zeroCreate numElements
- let mutable elemInUse = 0
-
- // The AddRecord method throws a derived exception if
- // the array bounds exception is caught.
- member this.AddRecord(newRecord) =
- try
- logArea[elemInUse] <- newRecord
- elemInUse <- elemInUse + 1
- elemInUse - 1
- with e ->
- raise (LogTableOverflowException($"Record \"{newRecord}\" was not logged.", e) )
-
-// Create a log table and force an overflow.
-let log = LogTable 4
-
-printfn
- """This example of
- Exception.Message,
- Exception.HelpLink,
- Exception.Source,
- Exception.StackTrace, and
- Exception.TargetSite
- generates the following output."""
-
-try
- for count = 1 to 1000000 do
- log.AddRecord $"Log record number {count}"
- |> ignore
-with ex ->
- printfn $"\nMessage ---\n{ex.Message}"
- printfn $"\nHelpLink ---\n{ex.HelpLink}"
- printfn $"\nSource ---\n{ex.Source}"
- printfn $"\nStackTrace ---\n{ex.StackTrace}"
- printfn $"\nTargetSite ---\n{ex.TargetSite}"
-
-// This example of
-// Exception.Message,
-// Exception.HelpLink,
-// Exception.Source,
-// Exception.StackTrace, and
-// Exception.TargetSite
-// generates the following output.
-
-// Message ---
-// The log table has overflowed. - Record "Log record number 5" was not logged.
-
-// HelpLink ---
-// https://docs.microsoft.com
-
-// Source ---
-// Exception_Class_Samples
-
-// StackTrace ---
-// at NDP_UE_FS.LogTable.AddRecord(String newRecord)
-// at .$NDP_UE_FS.main@()
-
-// TargetSite ---
-// Int32 AddRecord(System.String)
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/vb/properties.vb b/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/vb/properties.vb
deleted file mode 100644
index d22256103fed6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/HelpLink/vb/properties.vb
+++ /dev/null
@@ -1,115 +0,0 @@
-'
-' Example for the Exception.HelpLink, Exception.Source,
-' Exception.StackTrace, and Exception.TargetSite properties.
-Namespace NDP_UE_VB
-
- ' Derive an exception; the constructor sets the HelpLink and
- ' Source properties.
- Class LogTableOverflowException
- Inherits Exception
-
- Private Const overflowMessage As String = _
- "The log table has overflowed."
-
- Public Sub New( auxMessage As String, inner As Exception )
- MyBase.New( String.Format( "{0} - {1}", _
- overflowMessage, auxMessage ), inner )
-
- Me.HelpLink = "https://docs.microsoft.com"
- Me.Source = "Exception_Class_Samples"
-
- End Sub
- End Class
-
- Class LogTable
-
- Public Sub New(numElements As Integer)
- logArea = New String(numElements) {}
- elemInUse = 0
- End Sub
-
- Protected logArea() As String
- Protected elemInUse As Integer
-
- ' The AddRecord method throws a derived exception if
- ' the array bounds exception is caught.
- Public Function AddRecord( newRecord As String ) As Integer
-
- Try
- Dim curElement as Integer = elemInUse
- logArea( elemInUse ) = newRecord
- elemInUse += 1
- Return curElement
-
- Catch ex As Exception
- Throw New LogTableOverflowException( _
- String.Format( "Record ""{0}"" was not logged.", _
- newRecord ), ex )
- End Try
- End Function ' AddRecord
- End Class
-
- Module OverflowDemo
-
- ' Create a log table and force an overflow.
- Sub Main( )
- Dim log As New LogTable( 4 )
-
- Console.WriteLine( "This example of " & vbCrLf & _
- " Exception.Message, " & vbCrLf & _
- " Exception.HelpLink, " & vbCrLf & _
- " Exception.Source, " & vbCrLf & _
- " Exception.StackTrace, and " & vbCrLf & _
- " Exception.TargetSite " & vbCrLf & _
- "generates the following output." )
-
- Try
- Dim count As Integer = 0
-
- Do
- log.AddRecord( _
- String.Format( "Log record number {0}", count ) )
- count += 1
- Loop
-
- Catch ex As Exception
- Console.WriteLine( vbCrLf & _
- "Message ---" & vbCrLf & ex.Message )
- Console.WriteLine( vbCrLf & _
- "HelpLink ---" & vbCrLf & ex.HelpLink )
- Console.WriteLine( vbCrLf & _
- "Source ---" & vbCrLf & ex.Source )
- Console.WriteLine( vbCrLf & _
- "StackTrace ---" & vbCrLf & ex.StackTrace )
- Console.WriteLine( vbCrLf & "TargetSite ---" & _
- vbCrLf & ex.TargetSite.ToString( ) )
- End Try
- End Sub
-
- End Module ' OverflowDemo
-End Namespace ' NDP_UE_VB
-
-' This example of
-' Exception.Message,
-' Exception.HelpLink,
-' Exception.Source,
-' Exception.StackTrace, and
-' Exception.TargetSite
-' generates the following output.
-'
-' Message ---
-' The log table has overflowed. - Record "Log record number 5" was not logged.
-'
-' HelpLink ---
-' https://docs.microsoft.com
-'
-' Source ---
-' Exception_Class_Samples
-'
-' StackTrace ---
-' at NDP_UE_VB.LogTable.AddRecord(String newRecord)
-' at NDP_UE_VB.OverflowDemo.Main()
-'
-' TargetSite ---
-' Int32 AddRecord(System.String)
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/ToString2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/ToString2.cs
deleted file mode 100644
index d24d38c4c4f44..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/ToString2.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-using System;
-
-public class ToStringEx
-{
- public static void Main()
- {
- object value = 12;
- string s = value.ToString();
- Console.WriteLine(s);
- }
-}
-// The example displays the following output:
-// 12
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/basetoderived1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/basetoderived1.cs
deleted file mode 100644
index ff589249a2cb4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/basetoderived1.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-using System;
-
-public class Person
-{
- String _name;
-
- public String Name
- {
- get { return _name; }
- set { _name = value; }
- }
-}
-
-public class PersonWithId : Person
-{
- String _id;
-
- public string Id
- {
- get { return _id; }
- set { _id = value; }
- }
-}
-
-public class Example
-{
- public static void Main()
- {
- Person p = new Person();
- p.Name = "John";
- try {
- PersonWithId pid = (PersonWithId) p;
- Console.WriteLine("Conversion succeeded.");
- }
- catch (InvalidCastException) {
- Console.WriteLine("Conversion failed.");
- }
-
- PersonWithId pid1 = new PersonWithId();
- pid1.Name = "John";
- pid1.Id = "246";
- Person p1 = pid1;
- try {
- PersonWithId pid1a = (PersonWithId) p1;
- Console.WriteLine("Conversion succeeded.");
- }
- catch (InvalidCastException) {
- Console.WriteLine("Conversion failed.");
- }
-
- Person p2 = null;
- try {
- PersonWithId pid2 = (PersonWithId) p2;
- Console.WriteLine("Conversion succeeded.");
- }
- catch (InvalidCastException) {
- Console.WriteLine("Conversion failed.");
- }
- }
-}
-// The example displays the following output:
-// Conversion failed.
-// Conversion succeeded.
-// Conversion succeeded.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/catchexception.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/catchexception.cs
deleted file mode 100644
index cc7736bf616c3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/catchexception.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-using System;
-
-class ExceptionTestClass
-{
- public static void Main()
- {
- int x = 0;
- try
- {
- int y = 100 / x;
- }
- catch (ArithmeticException e)
- {
- Console.WriteLine($"ArithmeticException Handler: {e}");
- }
- catch (Exception e)
- {
- Console.WriteLine($"Generic Exception Handler: {e}");
- }
- }
-}
-/*
-This code example produces the following results:
-
-ArithmeticException Handler: System.DivideByZeroException: Attempted to divide by zero.
- at ExceptionTestClass.Main()
-
-*/
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/example.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/example.cs
deleted file mode 100644
index 14e295dd3f0c4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/example.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-using System;
-using System.Reflection;
-
-class Example1
-{
- public static void Main()
- {
- int limit = 10000000;
- PrimeNumberGenerator primes = new PrimeNumberGenerator(limit);
- int start = 1000001;
- try
- {
- int[] values = primes.GetPrimesFrom(start);
- Console.WriteLine($"There are {start} prime numbers from {limit} to {2}");
- }
- catch (NotPrimeException e)
- {
- Console.WriteLine($"{e.NonPrime} is not prime");
- Console.WriteLine(e);
- Console.WriteLine("--------");
- }
-
- AppDomain domain = AppDomain.CreateDomain("Domain2");
- PrimeNumberGenerator gen = (PrimeNumberGenerator)domain.CreateInstanceAndUnwrap(
- typeof(Example).Assembly.FullName,
- "PrimeNumberGenerator", true,
- BindingFlags.Default, null,
- new object[] { 1000000 }, null, null);
- try
- {
- start = 100;
- Console.WriteLine(gen.GetPrimesFrom(start));
- }
- catch (NotPrimeException e)
- {
- Console.WriteLine($"{e.NonPrime} is not prime");
- Console.WriteLine(e);
- Console.WriteLine("--------");
- }
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/iconvertible1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/iconvertible1.cs
deleted file mode 100644
index 24d9bb1223a11..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/iconvertible1.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-using System;
-
-public class IConvertibleEx
-{
- public static void Main()
- {
- bool flag = true;
- try
- {
- IConvertible conv = flag;
- Char ch = conv.ToChar(null);
- Console.WriteLine("Conversion succeeded.");
- }
- catch (InvalidCastException)
- {
- Console.WriteLine("Cannot convert a Boolean to a Char.");
- }
-
- try
- {
- Char ch = Convert.ToChar(flag);
- Console.WriteLine("Conversion succeeded.");
- }
- catch (InvalidCastException)
- {
- Console.WriteLine("Cannot convert a Boolean to a Char.");
- }
- }
-}
-// The example displays the following output:
-// Cannot convert a Boolean to a Char.
-// Cannot convert a Boolean to a Char.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/notprimeexception.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/notprimeexception.cs
deleted file mode 100644
index d3e0e6ade3949..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/notprimeexception.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-using System;
-using System.Runtime.Serialization;
-
-[Serializable()]
-public class NotPrimeException : Exception
-{
- private int notAPrime;
-
- protected NotPrimeException()
- : base()
- { }
-
- public NotPrimeException(int value) :
- base(String.Format("{0} is not a prime number.", value))
- {
- notAPrime = value;
- }
-
- public NotPrimeException(int value, string message)
- : base(message)
- {
- notAPrime = value;
- }
-
- public NotPrimeException(int value, string message, Exception innerException) :
- base(message, innerException)
- {
- notAPrime = value;
- }
-
- protected NotPrimeException(SerializationInfo info,
- StreamingContext context)
- : base(info, context)
- { }
-
- public int NonPrime
- { get { return notAPrime; } }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/primenumbergenerator.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/primenumbergenerator.cs
deleted file mode 100644
index d91516fc2d384..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/primenumbergenerator.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-[Serializable]
-public class PrimeNumberGenerator
-{
- private const int START = 2;
- private int maxUpperBound = 10000000;
- private int upperBound;
- private bool[] primeTable;
- private List primes = new List();
-
- public PrimeNumberGenerator(int upperBound)
- {
- if (upperBound > maxUpperBound)
- {
- string message = String.Format(
- "{0} exceeds the maximum upper bound of {1}.",
- upperBound, maxUpperBound);
- throw new ArgumentOutOfRangeException(message);
- }
- this.upperBound = upperBound;
- // Create array and mark 0, 1 as not prime (True).
- primeTable = new bool[upperBound + 1];
- primeTable[0] = true;
- primeTable[1] = true;
-
- // Use Sieve of Eratosthenes to determine prime numbers.
- for (int ctr = START; ctr <= (int)Math.Ceiling(Math.Sqrt(upperBound));
- ctr++)
- {
- if (primeTable[ctr]) continue;
-
- for (int multiplier = ctr; multiplier <= upperBound / ctr; multiplier++)
- if (ctr * multiplier <= upperBound) primeTable[ctr * multiplier] = true;
- }
- // Populate array with prime number information.
- int index = START;
- while (index != -1)
- {
- index = Array.FindIndex(primeTable, index, (flag) => !flag);
- if (index >= 1)
- {
- primes.Add(index);
- index++;
- }
- }
- }
-
- public int[] GetAllPrimes()
- {
- return primes.ToArray();
- }
-
- public int[] GetPrimesFrom(int prime)
- {
- int start = primes.FindIndex((value) => value == prime);
- if (start < 0)
- throw new NotPrimeException(prime, String.Format("{0} is not a prime number.", prime));
- else
- return primes.FindAll((value) => value >= prime).ToArray();
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/project.csproj
deleted file mode 100644
index f10875eb5aa0f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net481
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/rethrow1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/rethrow1.cs
deleted file mode 100644
index f8cde6813b518..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/rethrow1.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-public static class Library1
-{
- public static int[] FindOccurrences(this String s, String f)
- {
- var indexes = new List();
- int currentIndex = 0;
- try
- {
- while (currentIndex >= 0 && currentIndex < s.Length)
- {
- currentIndex = s.IndexOf(f, currentIndex);
- if (currentIndex >= 0)
- {
- indexes.Add(currentIndex);
- currentIndex++;
- }
- }
- }
- catch (ArgumentNullException)
- {
- // Perform some action here, such as logging this exception.
-
- throw;
- }
- return indexes.ToArray();
- }
-}
-//
-
-//
-public class RethrowEx1
-{
- public static void Main()
- {
- String s = "It was a cold day when...";
- int[] indexes = s.FindOccurrences("a");
- ShowOccurrences(s, "a", indexes);
- Console.WriteLine();
-
- String toFind = null;
- try
- {
- indexes = s.FindOccurrences(toFind);
- ShowOccurrences(s, toFind, indexes);
- }
- catch (ArgumentNullException e)
- {
- Console.WriteLine($"An exception ({e.GetType().Name}) occurred.");
- Console.WriteLine($"Message:{Environment.NewLine} {e.Message}{Environment.NewLine}");
- Console.WriteLine($"Stack Trace:{Environment.NewLine} {e.StackTrace}{Environment.NewLine}");
- }
- }
-
- private static void ShowOccurrences(String s, String toFind, int[] indexes)
- {
- Console.Write("'{0}' occurs at the following character positions: ",
- toFind);
- for (int ctr = 0; ctr < indexes.Length; ctr++)
- Console.Write("{0}{1}", indexes[ctr],
- ctr == indexes.Length - 1 ? "" : ", ");
-
- Console.WriteLine();
- }
-}
-// The example displays the following output:
-// 'a' occurs at the following character positions: 4, 7, 15
-//
-// An exception (ArgumentNullException) occurred.
-// Message:
-// Value cannot be null.
-// Parameter name: value
-//
-// Stack Trace:
-// at System.String.IndexOf(String value, Int32 startIndex, Int32 count, Stri
-// ngComparison comparisonType)
-// at Library.FindOccurrences(String s, String f)
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/rethrow3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/rethrow3.cs
deleted file mode 100644
index 8b4514f228b3b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/rethrow3.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-static class Library
-{
- public static int[] FindOccurrences1(this String s, String f)
- {
- var indexes = new List();
- int currentIndex = 0;
- try
- {
- while (currentIndex >= 0 && currentIndex < s.Length)
- {
- currentIndex = s.IndexOf(f, currentIndex);
- if (currentIndex >= 0)
- {
- indexes.Add(currentIndex);
- currentIndex++;
- }
- }
- }
- catch (ArgumentNullException e)
- {
- // Perform some action here, such as logging this exception.
- //
- throw new ArgumentNullException("You must supply a search string.", e);
- //
- }
- return indexes.ToArray();
- }
-}
-
-public class RethrowEx3
-{
- public static void Main()
- {
- String s = "It was a cold day when...";
- int[] indexes = s.FindOccurrences1("a");
- ShowOccurrences(s, "a", indexes);
- Console.WriteLine();
-
- String toFind = null;
- //
- try
- {
- indexes = s.FindOccurrences(toFind);
- ShowOccurrences(s, toFind, indexes);
- }
- catch (ArgumentNullException e)
- {
- Console.WriteLine($"An exception ({e.GetType().Name}) occurred.");
- Console.WriteLine($" Message:{Environment.NewLine}{e.Message}");
- Console.WriteLine($" Stack Trace:{Environment.NewLine} {e.StackTrace}");
- Exception ie = e.InnerException;
- if (ie != null)
- {
- Console.WriteLine(" The Inner Exception:");
- Console.WriteLine($" Exception Name: {ie.GetType().Name}");
- Console.WriteLine($" Message: {ie.Message}{Environment.NewLine}");
- Console.WriteLine($" Stack Trace:{Environment.NewLine} {ie.StackTrace}{Environment.NewLine}");
- }
- }
- // The example displays the following output:
- // 'a' occurs at the following character positions: 4, 7, 15
- //
- // An exception (ArgumentNullException) occurred.
- // Message: You must supply a search string.
- //
- // Stack Trace:
- // at Library.FindOccurrences(String s, String f)
- // at Example.Main()
- //
- // The Inner Exception:
- // Exception Name: ArgumentNullException
- // Message: Value cannot be null.
- // Parameter name: value
- //
- // Stack Trace:
- // at System.String.IndexOf(String value, Int32 startIndex, Int32 count, Stri
- // ngComparison comparisonType)
- // at Library.FindOccurrences(String s, String f)
- //
- }
-
- private static void ShowOccurrences(String s, String toFind, int[] indexes)
- {
- Console.Write("'{0}' occurs at the following character positions: ",
- toFind);
- for (int ctr = 0; ctr < indexes.Length; ctr++)
- Console.Write("{0}{1}", indexes[ctr],
- ctr == indexes.Length - 1 ? "" : ", ");
-
- Console.WriteLine();
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/usageerrors1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/usageerrors1.cs
deleted file mode 100644
index 6bc88ff16c56c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/usageerrors1.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-using System;
-
-public class Person1
-{
- private string _name;
-
- public string Name
- {
- get { return _name; }
- set { _name = value; }
- }
-
- public override int GetHashCode()
- {
- return this.Name.GetHashCode();
- }
-
- public override bool Equals(object obj)
- {
- // This implementation contains an error in program logic:
- // It assumes that the obj argument is not null.
- Person1 p = (Person1) obj;
- return this.Name.Equals(p.Name);
- }
-}
-
-public class UsageErrorsEx1
-{
- public static void Main()
- {
- Person1 p1 = new Person1();
- p1.Name = "John";
- Person1 p2 = null;
-
- // The following throws a NullReferenceException.
- Console.WriteLine($"p1 = p2: {p1.Equals(p2)}");
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/usageerrors2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/usageerrors2.cs
deleted file mode 100644
index 61181b1651de4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/csharp/usageerrors2.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-using System;
-
-public class Person2
-{
- private string _name;
-
- public string Name
- {
- get { return _name; }
- set { _name = value; }
- }
-
- public override int GetHashCode()
- {
- return this.Name.GetHashCode();
- }
-
- public override bool Equals(object obj)
- {
- // This implementation handles a null obj argument.
- Person2 p = obj as Person2;
- if (p == null)
- return false;
- else
- return this.Name.Equals(p.Name);
- }
-}
-
-public class UsageErrorsEx2
-{
- public static void Main()
- {
- Person2 p1 = new Person2();
- p1.Name = "John";
- Person2 p2 = null;
-
- Console.WriteLine($"p1 = p2: {p1.Equals(p2)}");
- }
-}
-// The example displays the following output:
-// p1 = p2: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/catchexception.fs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/catchexception.fs
deleted file mode 100644
index 0c4ad82ea0c20..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/catchexception.fs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-module ExceptionTestModule
-
-open System
-
-let x = 0
-try
- let y = 100 / x
- ()
-with
-| :? ArithmeticException as e ->
- printfn $"ArithmeticException Handler: {e}"
-| e ->
- printfn $"Generic Exception Handler: {e}"
-
-// This code example produces the following results:
-// ArithmeticException Handler: System.DivideByZeroException: Attempted to divide by zero.
-// at .$ExceptionTestModule.main@()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/example.fs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/example.fs
deleted file mode 100644
index 34091a6ed741e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/example.fs
+++ /dev/null
@@ -1,33 +0,0 @@
-module example
-
-//
-open System
-open System.Reflection
-
-let limit = 10000000
-let primes = PrimeNumberGenerator limit
-let start = 1000001
-try
- let values = primes.GetPrimesFrom start
- printfn $"There are {values.Length} prime numbers from {start} to {limit}"
-with :? NotPrimeException as e ->
- printfn $"{e.NonPrime} is not prime"
- printfn $"{e}"
- printfn "--------"
-
-let domain = AppDomain.CreateDomain "Domain2"
-let gen =
- domain.CreateInstanceAndUnwrap(
- typeof.Assembly.FullName,
- "PrimeNumberGenerator", true,
- BindingFlags.Default, null,
- [| box 1000000 |], null, null)
- :?> PrimeNumberGenerator
-try
- let start = 100
- printfn $"{gen.GetPrimesFrom start}"
-with :? NotPrimeException as e ->
- printfn $"{e.NonPrime} is not prime"
- printfn $"{e}"
- printfn "--------"
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/notprimeexception.fs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/notprimeexception.fs
deleted file mode 100644
index 2abd864b56884..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/notprimeexception.fs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-namespace global
-
-open System
-open System.Runtime.Serialization
-
-[]
-type NotPrimeException =
- inherit Exception
- val notAPrime: int
-
- member this.NonPrime =
- this.notAPrime
-
- new (value) =
- { inherit Exception($"%i{value} is not a prime number."); notAPrime = value }
-
- new (value, message) =
- { inherit Exception(message); notAPrime = value }
-
- new (value, message, innerException: Exception) =
- { inherit Exception(message, innerException); notAPrime = value }
-
- // F# does not support protected members
- new () =
- { inherit Exception(); notAPrime = 0 }
-
- new (info: SerializationInfo, context: StreamingContext) =
- { inherit Exception(info, context); notAPrime = 0 }
-
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/primenumbergenerator.fs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/primenumbergenerator.fs
deleted file mode 100644
index e984dca606990..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/primenumbergenerator.fs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-namespace global
-
-open System
-
-[]
-type PrimeNumberGenerator(upperBound) =
- let start = 2
- let maxUpperBound = 10000000
- let primes = ResizeArray()
- let primeTable =
- upperBound + 1
- |> Array.zeroCreate
-
- do
- if upperBound > maxUpperBound then
- let message = $"{upperBound} exceeds the maximum upper bound of {maxUpperBound}."
- raise (ArgumentOutOfRangeException message)
-
- // Create array and mark 0, 1 as not prime (True).
- primeTable[0] <- true
- primeTable[1] <- true
-
- // Use Sieve of Eratosthenes to determine prime numbers.
- for i = start to float upperBound |> sqrt |> ceil |> int do
- if not primeTable[i] then
- for multiplier = i to upperBound / i do
- if i * multiplier <= upperBound then
- primeTable[i * multiplier] <- true
-
- // Populate array with prime number information.
- let mutable index = start
- while index <> -1 do
- index <- Array.FindIndex(primeTable, index, fun flag -> not flag)
- if index >= 1 then
- primes.Add index
- index <- index + 1
-
- member _.GetAllPrimes() =
- primes.ToArray()
-
- member _.GetPrimesFrom(prime) =
- let start =
- Seq.findIndex ((=) prime) primes
-
- if start < 0 then
- raise (NotPrimeException(prime, $"{prime} is not a prime number.") )
- else
- Seq.filter ((>=) prime) primes
- |> Seq.toArray
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/rethrow1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/rethrow1.fs
deleted file mode 100644
index df59a6f6e893c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/rethrow1.fs
+++ /dev/null
@@ -1,58 +0,0 @@
-module rethrow1
-
-//
-open System
-
-module Library =
- let findOccurrences (s: string) (f: string) =
- let indexes = ResizeArray()
- let mutable currentIndex = 0
- try
- while currentIndex >= 0 && currentIndex < s.Length do
- currentIndex <- s.IndexOf(f, currentIndex)
- if currentIndex >= 0 then
- indexes.Add currentIndex
- currentIndex <- currentIndex + 1
- with :? ArgumentNullException ->
- // Perform some action here, such as logging this exception.
- reraise ()
- indexes.ToArray()
-//
-
-//
-open Library
-
-let showOccurrences toFind (indexes: int[]) =
- printf $"'{toFind}' occurs at the following character positions: "
- for i = 0 to indexes.Length - 1 do
- printf $"""{indexes[i]}{if i = indexes.Length - 1 then "" else ", "}"""
- printfn ""
-
-let s = "It was a cold day when..."
-let indexes = findOccurrences s "a"
-showOccurrences "a" indexes
-printfn ""
-
-let toFind: string = null
-try
- let indexes = findOccurrences s toFind
- showOccurrences toFind indexes
-
-with :? ArgumentNullException as e ->
- printfn $"An exception ({e.GetType().Name}) occurred."
- printfn $"Message:\n {e.Message}\n"
- printfn $"Stack Trace:\n {e.StackTrace}\n"
-
-// The example displays the following output:
-// 'a' occurs at the following character positions: 4, 7, 15
-//
-// An exception (ArgumentNullException) occurred.
-// Message:
-// Value cannot be null. (Parameter 'value')
-//
-// Stack Trace:
-// at System.String.IndexOf(String value, Int32 startIndex, Int32 count, Stri
-// ngComparison comparisonType)
-// at Library.findOccurrences(String s, String f)
-// at .main@()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/rethrow3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/rethrow3.fs
deleted file mode 100644
index b0c505c0ba40e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/rethrow3.fs
+++ /dev/null
@@ -1,46 +0,0 @@
-module rethrow3
-
-open System
-open rethrow1
-open rethrow1.Library
-
-let e = Exception()
-//
-raise (ArgumentNullException("You must supply a search string.", e) )
-//
-
-let s = "It was a cold day when..."
-//
-try
- let indexes = findOccurrences s toFind
- showOccurrences toFind indexes
-with :? ArgumentNullException as e ->
- printfn $"An exception ({e.GetType().Name}) occurred."
- printfn $" Message:\n{e.Message}"
- printfn $" Stack Trace:\n {e.StackTrace}"
- let ie = e.InnerException
- if ie <> null then
- printfn " The Inner Exception:"
- printfn $" Exception Name: {ie.GetType().Name}"
- printfn $" Message: {ie.Message}\n"
- printfn $" Stack Trace:\n {ie.StackTrace}\n"
-// The example displays the following output:
-// 'a' occurs at the following character positions: 4, 7, 15
-//
-// An exception (ArgumentNullException) occurred.
-// Message: You must supply a search string.
-//
-// Stack Trace:
-// at Library.FindOccurrences(String s, String f)
-// at Example.Main()
-//
-// The Inner Exception:
-// Exception Name: ArgumentNullException
-// Message: Value cannot be null.
-// Parameter name: value
-//
-// Stack Trace:
-// at System.String.IndexOf(String value, Int32 startIndex, Int32 count, Stri
-// ngComparison comparisonType)
-// at Library.FindOccurrences(String s, String f)
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/usageerrors1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/usageerrors1.fs
deleted file mode 100644
index dbe43af381411..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/usageerrors1.fs
+++ /dev/null
@@ -1,25 +0,0 @@
-module usageerrors1
-
-//
-// In F#, null is not a valid state for declared types
-// without 'AllowNullLiteralAttribute'
-[]
-type Person() =
- member val Name = "" with get, set
-
- override this.GetHashCode() =
- this.Name.GetHashCode()
-
- override this.Equals(obj) =
- // This implementation contains an error in program logic:
- // It assumes that the obj argument is not null.
- let p = obj :?> Person
- this.Name.Equals p.Name
-
-let p1 = Person()
-p1.Name <- "John"
-let p2: Person = null
-
-// The following throws a NullReferenceException.
-printfn $"p1 = p2: {p1.Equals p2}"
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/usageerrors2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/usageerrors2.fs
deleted file mode 100644
index 967988cb35d81..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/fsharp/usageerrors2.fs
+++ /dev/null
@@ -1,28 +0,0 @@
-module usageerrors2
-
-//
-// In F#, null is not a valid state for declared types
-// without 'AllowNullLiteralAttribute'
-[]
-type Person() =
- member val Name = "" with get, set
-
- override this.GetHashCode() =
- this.Name.GetHashCode()
-
- override this.Equals(obj) =
- // This implementation handles a null obj argument.
- match obj with
- | :? Person as p ->
- this.Name.Equals p.Name
- | _ ->
- false
-
-let p1 = Person()
-p1.Name <- "John"
-let p2: Person = null
-
-printfn $"p1 = p2: {p1.Equals p2}"
-// The example displays the following output:
-// p1 = p2: False
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/catchexception.vb b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/catchexception.vb
deleted file mode 100644
index 5c7c271bc3af9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/catchexception.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-'
-Class ExceptionTestClass
-
- Public Shared Sub Main()
- Dim x As Integer = 0
- Try
- Dim y As Integer = 100 / x
- Catch e As ArithmeticException
- Console.WriteLine("ArithmeticException Handler: {0}", e.ToString())
- Catch e As Exception
- Console.WriteLine("Generic Exception Handler: {0}", e.ToString())
- End Try
- End Sub
-End Class
-'
-'This code example produces the following results:
-'
-'ArithmeticException Handler: System.OverflowException: Arithmetic operation resulted in an overflow.
-' at ExceptionTestClass.Main()
-'
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/example.vb b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/example.vb
deleted file mode 100644
index 91ebfa1e56e8d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/example.vb
+++ /dev/null
@@ -1,48 +0,0 @@
-Option Strict Off
-
-'
-Imports System.Reflection
-
-Module Example
- Sub Main()
- Dim limit As Integer = 10000000
- Dim primes As New PrimeNumberGenerator(limit)
- Dim start As Integer = 1000001
- Try
- Dim values() As Integer = primes.GetPrimesFrom(start)
- Console.WriteLine("There are {0} prime numbers from {1} to {2}",
- start, limit)
- Catch e As NotPrimeException
- Console.WriteLine("{0} is not prime", e.NonPrime)
- Console.WriteLine(e)
- Console.WriteLine("--------")
- End Try
-
- Dim domain As AppDomain = AppDomain.CreateDomain("Domain2")
- Dim gen As PrimeNumberGenerator = domain.CreateInstanceAndUnwrap(
- GetType(Example).Assembly.FullName,
- "PrimeNumberGenerator", True,
- BindingFlags.Default, Nothing,
- {1000000}, Nothing, Nothing)
- Try
- start = 100
- Console.WriteLine(gen.GetPrimesFrom(start))
- Catch e As NotPrimeException
- Console.WriteLine("{0} is not prime", e.NonPrime)
- Console.WriteLine(e)
- Console.WriteLine("--------")
- End Try
- End Sub
-End Module
-' The example displays the following output:
-' 1000001 is not prime
-' NotPrimeException: 1000001 is not a prime number.
-' at PrimeNumberGenerator.GetPrimesFrom(Int32 prime)
-' at Example.Main()
-' --------
-' 100 is not prime
-' NotPrimeException: 100 is not a prime number.
-' at PrimeNumberGenerator.GetPrimesFrom(Int32 prime)
-' at Example.Main()
-' --------
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/notprimeexception.vb b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/notprimeexception.vb
deleted file mode 100644
index ee0d31fc20824..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/notprimeexception.vb
+++ /dev/null
@@ -1,38 +0,0 @@
-'
-Imports System.Runtime.Serialization
-
- _
-Public Class NotPrimeException : Inherits Exception
- Private notAPrime As Integer
-
- Protected Sub New()
- MyBase.New()
- End Sub
-
- Public Sub New(value As Integer)
- MyBase.New(String.Format("{0} is not a prime number.", value))
- notAPrime = value
- End Sub
-
- Public Sub New(value As Integer, message As String)
- MyBase.New(message)
- notAPrime = value
- End Sub
-
- Public Sub New(value As Integer, message As String, innerException As Exception)
- MyBase.New(message, innerException)
- notAPrime = value
- End Sub
-
- Protected Sub New(info As SerializationInfo,
- context As StreamingContext)
- MyBase.New(info, context)
- End Sub
-
- Public ReadOnly Property NonPrime As Integer
- Get
- Return notAPrime
- End Get
- End Property
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/primenumbergenerator.vb b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/primenumbergenerator.vb
deleted file mode 100644
index 1d0f191d15b26..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/primenumbergenerator.vb
+++ /dev/null
@@ -1,62 +0,0 @@
-'
-Imports System.Collections.Generic
-
- Public Class PrimeNumberGenerator
- Private Const START As Integer = 2
- Private maxUpperBound As Integer = 10000000
- Private upperBound As Integer
- Private primeTable() As Boolean
- Private primes As New List(Of Integer)
-
- Public Sub New(upperBound As Integer)
- If upperBound > maxUpperBound Then
- Dim message As String = String.Format(
- "{0} exceeds the maximum upper bound of {1}.",
- upperBound, maxUpperBound)
- Throw New ArgumentOutOfRangeException(message)
- End If
- Me.upperBound = upperBound
- ' Create array and mark 0, 1 as not prime (True).
- ReDim primeTable(upperBound)
- primeTable(0) = True
- primeTable(1) = True
-
- ' Use Sieve of Eratosthenes to determine prime numbers.
- For ctr As Integer = START To CInt(Math.Ceiling(Math.Sqrt(upperBound)))
- If primeTable(ctr) Then Continue For
-
- For multiplier As Integer = ctr To CInt(upperBound \ ctr)
- If ctr * multiplier <= upperBound Then primeTable(ctr * multiplier) = True
- Next
- Next
- ' Populate array with prime number information.
- Dim index As Integer = START
- Do While index <> -1
- index = Array.FindIndex(primeTable, index, Function(flag)
- Return Not flag
- End Function)
- If index >= 1 Then
- primes.Add(index)
- index += 1
- End If
- Loop
- End Sub
-
- Public Function GetAllPrimes() As Integer()
- Return primes.ToArray()
- End Function
-
- Public Function GetPrimesFrom(prime As Integer) As Integer()
- Dim start As Integer = primes.FindIndex(Function(value)
- Return value = prime
- End Function)
- If start < 0 Then
- Throw New NotPrimeException(prime, String.Format("{0} is not a prime number.", prime))
- Else
- Return primes.FindAll(Function(value)
- Return value >= prime
- End Function).ToArray()
- End If
- End Function
-End Class
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/rethrow1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/rethrow1.vb
deleted file mode 100644
index 03a035d95edf6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/rethrow1.vb
+++ /dev/null
@@ -1,75 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-Imports System.Runtime.CompilerServices
-
-Public Module Library
-
- Public Function FindOccurrences1(s As String, f As String) As Integer()
- Dim indexes As New List(Of Integer)
- Dim currentIndex As Integer = 0
- Try
- Do While currentIndex >= 0 And currentIndex < s.Length
- currentIndex = s.IndexOf(f, currentIndex)
- If currentIndex >= 0 Then
- indexes.Add(currentIndex)
- currentIndex += 1
- End If
- Loop
- Catch e As ArgumentNullException
- ' Perform some action here, such as logging this exception.
-
- Throw
- End Try
- Return indexes.ToArray()
- End Function
-End Module
-'
-
-'
-Module Example1
- Public Sub Main()
- Dim s As String = "It was a cold day when..."
- Dim indexes() As Integer = s.FindOccurrences1("a")
- ShowOccurrences(s, "a", indexes)
- Console.WriteLine()
-
- Dim toFind As String = Nothing
- Try
- indexes = s.FindOccurrences1(toFind)
- ShowOccurrences(s, toFind, indexes)
- Catch e As ArgumentNullException
- Console.WriteLine("An exception ({0}) occurred.",
- e.GetType().Name)
- Console.WriteLine("Message:{0} {1}{0}", vbCrLf, e.Message)
- Console.WriteLine("Stack Trace:{0} {1}{0}", vbCrLf, e.StackTrace)
- End Try
- End Sub
-
- Private Sub ShowOccurrences(s As String, toFind As String, indexes As Integer())
- Console.Write("'{0}' occurs at the following character positions: ",
- toFind)
- For ctr As Integer = 0 To indexes.Length - 1
- Console.Write("{0}{1}", indexes(ctr),
- If(ctr = indexes.Length - 1, "", ", "))
- Next
- Console.WriteLine()
- End Sub
-End Module
-' The example displays the following output:
-' 'a' occurs at the following character positions: 4, 7, 15
-'
-' An exception (ArgumentNullException) occurred.
-' Message:
-' Value cannot be null.
-' Parameter name: value
-'
-' Stack Trace:
-' at System.String.IndexOf(String value, Int32 startIndex, Int32 count, Stri
-' ngComparison comparisonType)
-' at Library.FindOccurrences(String s, String f)
-' at Example.Main()
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/rethrow3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/rethrow3.vb
deleted file mode 100644
index 07a74208c060d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/rethrow3.vb
+++ /dev/null
@@ -1,88 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Collections.Generic
-Imports System.Runtime.CompilerServices
-
-Public Module Library1
-
- Public Function FindOccurrences(s As String, f As String) As Integer()
- Dim indexes As New List(Of Integer)
- Dim currentIndex As Integer = 0
- Try
- Do While currentIndex >= 0 And currentIndex < s.Length
- currentIndex = s.IndexOf(f, currentIndex)
- If currentIndex >= 0 Then
- indexes.Add(currentIndex)
- currentIndex += 1
- End If
- Loop
- Catch e As ArgumentNullException
- ' Perform some action here, such as logging this exception.
-
- '
- Throw New ArgumentNullException("You must supply a search string.",
- e)
- '
- End Try
- Return indexes.ToArray()
- End Function
-End Module
-
-Module Example4
- Public Sub Main()
- Dim s As String = "It was a cold day when..."
- Dim indexes() As Integer = s.FindOccurrences("a")
- ShowOccurrences(s, "a", indexes)
- Console.WriteLine()
-
- Dim toFind As String = Nothing
- '
- Try
- indexes = s.FindOccurrences(toFind)
- ShowOccurrences(s, toFind, indexes)
- Catch e As ArgumentNullException
- Console.WriteLine("An exception ({0}) occurred.",
- e.GetType().Name)
- Console.WriteLine(" Message: {1}{0}", vbCrLf, e.Message)
- Console.WriteLine(" Stack Trace:{0} {1}{0}", vbCrLf, e.StackTrace)
- Dim ie As Exception = e.InnerException
- If ie IsNot Nothing Then
- Console.WriteLine(" The Inner Exception:")
- Console.WriteLine(" Exception Name: {0}", ie.GetType().Name)
- Console.WriteLine(" Message: {1}{0}", vbCrLf, ie.Message)
- Console.WriteLine(" Stack Trace:{0} {1}{0}", vbCrLf, ie.StackTrace)
- End If
- End Try
- ' The example displays the following output:
- ' 'a' occurs at the following character positions: 4, 7, 15
- '
- ' An exception (ArgumentNullException) occurred.
- ' Message: You must supply a search string.
- '
- ' Stack Trace:
- ' at Library.FindOccurrences(String s, String f)
- ' at Example.Main()
- '
- ' The Inner Exception:
- ' Exception Name: ArgumentNullException
- ' Message: Value cannot be null.
- ' Parameter name: value
- '
- ' Stack Trace:
- ' at System.String.IndexOf(String value, Int32 startIndex, Int32 count, Stri
- ' ngComparison comparisonType)
- ' at Library.FindOccurrences(String s, String f)
- '
- End Sub
-
- Private Sub ShowOccurrences(s As String, toFind As String, indexes As Integer())
- Console.Write("'{0}' occurs at the following character positions: ",
- toFind)
- For ctr As Integer = 0 To indexes.Length - 1
- Console.Write("{0}{1}", indexes(ctr),
- If(ctr = indexes.Length - 1, "", ", "))
- Next
- Console.WriteLine()
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/usageerrors1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/usageerrors1.vb
deleted file mode 100644
index 0d91c47a2fafd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/usageerrors1.vb
+++ /dev/null
@@ -1,35 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Class Person
- Private _name As String
-
- Public Property Name As String
- Get
- Return _name
- End Get
- Set
- _name = value
- End Set
- End Property
-
- Public Overrides Function Equals(obj As Object) As Boolean
- ' This implementation contains an error in program logic:
- ' It assumes that the obj argument is not null.
- Dim p As Person = CType(obj, Person)
- Return Me.Name.Equals(p.Name)
- End Function
-End Class
-
-Module Example2
- Public Sub Main()
- Dim p1 As New Person()
- p1.Name = "John"
- Dim p2 As Person = Nothing
-
- ' The following throws a NullReferenceException.
- Console.WriteLine("p1 = p2: {0}", p1.Equals(p2))
- End Sub
-End Module
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/usageerrors2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/usageerrors2.vb
deleted file mode 100644
index e6a7df307c29d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Exception/Overview/vb/usageerrors2.vb
+++ /dev/null
@@ -1,39 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Class Person2
- Private _name As String
-
- Public Property Name As String
- Get
- Return _name
- End Get
- Set
- _name = Value
- End Set
- End Property
-
- Public Overrides Function Equals(obj As Object) As Boolean
- ' This implementation handles a null obj argument.
- Dim p As Person2 = TryCast(obj, Person2)
- If p Is Nothing Then
- Return False
- Else
- Return Me.Name.Equals(p.Name)
- End If
- End Function
-End Class
-
-Module Example3
- Public Sub Main()
- Dim p1 As New Person2()
- p1.Name = "John"
- Dim p2 As Person2 = Nothing
-
- Console.WriteLine("p1 = p2: {0}", p1.Equals(p2))
- End Sub
-End Module
-' The example displays the following output:
-' p1 = p2: False
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/Program.cs b/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/Program.cs
deleted file mode 100644
index d68b2c57e4fc9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/Program.cs
+++ /dev/null
@@ -1 +0,0 @@
-Example1.Main();
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/Project.csproj
deleted file mode 100644
index f99395b4b2b39..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Exe
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/flags.cs b/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/flags.cs
deleted file mode 100644
index 24e8427a49f3b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/flags.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-using System;
-
-class Example
-{
- // Define an Enum without FlagsAttribute.
- enum SingleHue : short
- {
- None = 0,
- Black = 1,
- Red = 2,
- Green = 4,
- Blue = 8
- };
-
- // Define an Enum with FlagsAttribute.
- [Flags]
- enum MultiHue : short
- {
- None = 0,
- Black = 1,
- Red = 2,
- Green = 4,
- Blue = 8
- };
-
- static void Main()
- {
- // Display all possible combinations of values.
- Console.WriteLine(
- "All possible combinations of values without FlagsAttribute:");
- for (int val = 0; val <= 16; val++)
- Console.WriteLine("{0,3} - {1:G}", val, (SingleHue)val);
-
- // Display all combinations of values, and invalid values.
- Console.WriteLine(
- "\nAll possible combinations of values with FlagsAttribute:");
- for (int val = 0; val <= 16; val++)
- Console.WriteLine("{0,3} - {1:G}", val, (MultiHue)val);
- }
-}
-// The example displays the following output:
-// All possible combinations of values without FlagsAttribute:
-// 0 - None
-// 1 - Black
-// 2 - Red
-// 3 - 3
-// 4 - Green
-// 5 - 5
-// 6 - 6
-// 7 - 7
-// 8 - Blue
-// 9 - 9
-// 10 - 10
-// 11 - 11
-// 12 - 12
-// 13 - 13
-// 14 - 14
-// 15 - 15
-// 16 - 16
-//
-// All possible combinations of values with FlagsAttribute:
-// 0 - None
-// 1 - Black
-// 2 - Red
-// 3 - Black, Red
-// 4 - Green
-// 5 - Black, Green
-// 6 - Red, Green
-// 7 - Black, Red, Green
-// 8 - Blue
-// 9 - Black, Blue
-// 10 - Red, Blue
-// 11 - Black, Red, Blue
-// 12 - Green, Blue
-// 13 - Black, Green, Blue
-// 14 - Red, Green, Blue
-// 15 - Black, Red, Green, Blue
-// 16 - 16
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/flags1.cs b/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/flags1.cs
deleted file mode 100644
index 987dbe00bb97a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/csharp/flags1.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-using System;
-
-[Flags]
-public enum PhoneService
-{
- None = 0,
- LandLine = 1,
- Cell = 2,
- Fax = 4,
- Internet = 8,
- Other = 16
-}
-
-public class Example1
-{
- public static void Main()
- {
- // Define three variables representing the types of phone service
- // in three households.
- var household1 = PhoneService.LandLine | PhoneService.Cell |
- PhoneService.Internet;
- var household2 = PhoneService.None;
- var household3 = PhoneService.Cell | PhoneService.Internet;
-
- // Store the variables in an array for ease of access.
- PhoneService[] households = { household1, household2, household3 };
-
- // Which households have no service?
- for (int ctr = 0; ctr < households.Length; ctr++)
- Console.WriteLine($"Household {ctr + 1} has phone service:" +
- $"{(households[ctr] == PhoneService.None ? "No" : "Yes")}");
- Console.WriteLine();
-
- // Which households have cell phone service?
- for (int ctr = 0; ctr < households.Length; ctr++)
- Console.WriteLine($"Household {ctr + 1} has cell phone service: " +
- $"{((households[ctr] & PhoneService.Cell) == PhoneService.Cell ? "Yes" : "No")}");
- Console.WriteLine();
-
- // Which households have cell phones and land lines?
- var cellAndLand = PhoneService.Cell | PhoneService.LandLine;
- for (int ctr = 0; ctr < households.Length; ctr++)
- Console.WriteLine($"Household {ctr + 1} has cell and land line service: " +
- $"{((households[ctr] & cellAndLand) == cellAndLand ? "Yes" : "No")}");
- Console.WriteLine();
-
- // List all types of service of each household?//
- for (int ctr = 0; ctr < households.Length; ctr++)
- Console.WriteLine($"Household {ctr + 1} has: {households[ctr]:G}");
- Console.WriteLine();
- }
-}
-// The example displays the following output:
-// Household 1 has phone service: Yes
-// Household 2 has phone service: No
-// Household 3 has phone service: Yes
-//
-// Household 1 has cell phone service: Yes
-// Household 2 has cell phone service: No
-// Household 3 has cell phone service: Yes
-//
-// Household 1 has cell and land line service: Yes
-// Household 2 has cell and land line service: No
-// Household 3 has cell and land line service: No
-//
-// Household 1 has: LandLine, Cell, Internet
-// Household 2 has: None
-// Household 3 has: Cell, Internet
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/fsharp/flags.fs b/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/fsharp/flags.fs
deleted file mode 100644
index 4abf93d505fd0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/fsharp/flags.fs
+++ /dev/null
@@ -1,71 +0,0 @@
-module flags
-
-//
-open System
-
-// Define an Enum without FlagsAttribute.
-type SingleHue =
- | None = 0
- | Black = 1
- | Red = 2
- | Green = 4
- | Blue = 8
-
-// Define an Enum with FlagsAttribute.
-[]
-type MultiHue =
- | None = 0
- | Black = 1
- | Red = 2
- | Green = 4
- | Blue = 8
-
-// Display all possible combinations of values.
-printfn "All possible combinations of values without FlagsAttribute:"
-for i = 0 to 16 do
- printfn $"{i,3} - {enum i:G}"
-
-// Display all combinations of values, and invalid values.
-printfn "\nAll possible combinations of values with FlagsAttribute:"
-for i = 0 to 16 do
- printfn $"{i,3} - {enum i:G}"
-
-// The example displays the following output:
-// All possible combinations of values without FlagsAttribute:
-// 0 - None
-// 1 - Black
-// 2 - Red
-// 3 - 3
-// 4 - Green
-// 5 - 5
-// 6 - 6
-// 7 - 7
-// 8 - Blue
-// 9 - 9
-// 10 - 10
-// 11 - 11
-// 12 - 12
-// 13 - 13
-// 14 - 14
-// 15 - 15
-// 16 - 16
-//
-// All possible combinations of values with FlagsAttribute:
-// 0 - None
-// 1 - Black
-// 2 - Red
-// 3 - Black, Red
-// 4 - Green
-// 5 - Black, Green
-// 6 - Red, Green
-// 7 - Black, Red, Green
-// 8 - Blue
-// 9 - Black, Blue
-// 10 - Red, Blue
-// 11 - Black, Red, Blue
-// 12 - Green, Blue
-// 13 - Black, Green, Blue
-// 14 - Red, Green, Blue
-// 15 - Black, Red, Green, Blue
-// 16 - 16
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/fsharp/flags1.fs b/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/fsharp/flags1.fs
deleted file mode 100644
index cf953ad38f0af..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/fsharp/flags1.fs
+++ /dev/null
@@ -1,68 +0,0 @@
-module flags1
-
-//
-open System
-
-[]
-type PhoneService =
- | None = 0
- | LandLine = 1
- | Cell = 2
- | Fax = 4
- | Internet = 8
- | Other = 16
-
-// Define three variables representing the types of phone service
-// in three households.
-let household1 =
- PhoneService.LandLine ||| PhoneService.Cell ||| PhoneService.Internet
-
-let household2 =
- PhoneService.None
-
-let household3 =
- PhoneService.Cell ||| PhoneService.Internet
-
-// Store the variables in a list for ease of access.
-let households =
- [ household1; household2; household3 ]
-
-// Which households have no service?
-for i = 0 to households.Length - 1 do
- printfn $"""Household {i + 1} has phone service: {if households[i] = PhoneService.None then "No" else "Yes"}"""
-printfn ""
-
-// Which households have cell phone service?
-for i = 0 to households.Length - 1 do
- printfn $"""Household {i + 1} has cell phone service: {if households[i] &&& PhoneService.Cell = PhoneService.Cell then "Yes" else "No"}"""
-printfn ""
-
-// Which households have cell phones and land lines?
-let cellAndLand =
- PhoneService.Cell ||| PhoneService.LandLine
-
-for i = 0 to households.Length - 1 do
- printfn $"""Household {i + 1} has cell and land line service: {if households[i] &&& cellAndLand = cellAndLand then "Yes" else "No"}"""
-printfn ""
-
-// List all types of service of each household?//
-for i = 0 to households.Length - 1 do
- printfn $"Household {i + 1} has: {households[i]:G}"
-
-// The example displays the following output:
-// Household 1 has phone service: Yes
-// Household 2 has phone service: No
-// Household 3 has phone service: Yes
-//
-// Household 1 has cell phone service: Yes
-// Household 2 has cell phone service: No
-// Household 3 has cell phone service: Yes
-//
-// Household 1 has cell and land line service: Yes
-// Household 2 has cell and land line service: No
-// Household 3 has cell and land line service: No
-//
-// Household 1 has: LandLine, Cell, Internet
-// Household 2 has: None
-// Household 3 has: Cell, Internet
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/vb/flags.vb b/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/vb/flags.vb
deleted file mode 100644
index 805ad85c98464..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/vb/flags.vb
+++ /dev/null
@@ -1,77 +0,0 @@
-'
-Module Example
- ' Define an Enum without FlagsAttribute.
- Enum SingleHue As Short
- None = 0
- Black = 1
- Red = 2
- Green = 4
- Blue = 8
- End Enum
-
- ' Define an Enum with FlagsAttribute.
-
- Enum MultiHue As Short
- None = 0
- Black = 1
- Red = 2
- Green = 4
- Blue = 8
- End Enum
-
- Sub Main()
- ' Display all possible combinations of values.
- Console.WriteLine(
- "All possible combinations of values without FlagsAttribute:")
- For val As Integer = 0 To 16
- Console.WriteLine("{0,3} - {1:G}", val, CType(val, SingleHue))
- Next
- Console.WriteLine()
-
- ' Display all combinations of values, and invalid values.
- Console.WriteLine(
- "All possible combinations of values with FlagsAttribute:")
- For val As Integer = 0 To 16
- Console.WriteLine( "{0,3} - {1:G}", val, CType(val, MultiHue))
- Next
- End Sub
-End Module
-' The example displays the following output:
-' All possible combinations of values without FlagsAttribute:
-' 0 - None
-' 1 - Black
-' 2 - Red
-' 3 - 3
-' 4 - Green
-' 5 - 5
-' 6 - 6
-' 7 - 7
-' 8 - Blue
-' 9 - 9
-' 10 - 10
-' 11 - 11
-' 12 - 12
-' 13 - 13
-' 14 - 14
-' 15 - 15
-' 16 - 16
-'
-' All possible combinations of values with FlagsAttribute:
-' 0 - None
-' 1 - Black
-' 2 - Red
-' 3 - Black, Red
-' 4 - Green
-' 5 - Black, Green
-' 6 - Red, Green
-' 7 - Black, Red, Green
-' 8 - Blue
-' 9 - Black, Blue
-' 10 - Red, Blue
-' 11 - Black, Red, Blue
-' 12 - Green, Blue
-' 13 - Black, Green, Blue
-' 14 - Red, Green, Blue
-' 15 - Black, Red, Green, Blue
-' 16 - 16
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/vb/flags1.vb b/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/vb/flags1.vb
deleted file mode 100644
index 45a8809f17723..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FlagsAttribute/Overview/vb/flags1.vb
+++ /dev/null
@@ -1,82 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-
-Public Enum PhoneService As Integer
- None = 0
- LandLine = 1
- Cell = 2
- Fax = 4
- Internet = 8
- Other = 16
-End Enum
-
-Module Example1
- Public Sub Main()
- ' Define three variables representing the types of phone service
- ' in three households.
- Dim household1 As PhoneService = PhoneService.LandLine Or
- PhoneService.Cell Or
- PhoneService.Internet
- Dim household2 As PhoneService = PhoneService.None
- Dim household3 As PhoneService = PhoneService.Cell Or
- PhoneService.Internet
-
- ' Store the variables in an array for ease of access.
- Dim households() As PhoneService = { household1, household2,
- household3 }
-
- ' Which households have no service?
- For ctr As Integer = 0 To households.Length - 1
- Console.WriteLine("Household {0} has phone service: {1}",
- ctr + 1,
- If(households(ctr) = PhoneService.None,
- "No", "Yes"))
- Next
- Console.WriteLine()
-
- ' Which households have cell phone service?
- For ctr As Integer = 0 To households.Length - 1
- Console.WriteLine("Household {0} has cell phone service: {1}",
- ctr + 1,
- If((households(ctr) And PhoneService.Cell) = PhoneService.Cell,
- "Yes", "No"))
- Next
- Console.WriteLine()
-
- ' Which households have cell phones and land lines?
- Dim cellAndLand As PhoneService = PhoneService.Cell Or PhoneService.LandLine
- For ctr As Integer = 0 To households.Length - 1
- Console.WriteLine("Household {0} has cell and land line service: {1}",
- ctr + 1,
- If((households(ctr) And cellAndLand) = cellAndLand,
- "Yes", "No"))
- Next
- Console.WriteLine()
-
- ' List all types of service of each household?'
- For ctr As Integer = 0 To households.Length - 1
- Console.WriteLine("Household {0} has: {1:G}",
- ctr + 1, households(ctr))
- Next
- Console.WriteLine()
- End Sub
-End Module
-' The example displays the following output:
-' Household 1 has phone service: Yes
-' Household 2 has phone service: No
-' Household 3 has phone service: Yes
-'
-' Household 1 has cell phone service: Yes
-' Household 2 has cell phone service: No
-' Household 3 has cell phone service: Yes
-'
-' Household 1 has cell and land line service: Yes
-' Household 2 has cell and land line service: No
-' Household 3 has cell and land line service: No
-'
-' Household 1 has: LandLine, Cell, Internet
-' Household 2 has: None
-' Household 3 has: Cell, Internet
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/FormatExample2.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/FormatExample2.cs
deleted file mode 100644
index 925589ccda829..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/FormatExample2.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-using System;
-
-public class TestFormatter
-{
- public static void Main()
- {
- int acctNumber = 79203159;
- Console.WriteLine(String.Format(new CustomerFormatter(), "{0}", acctNumber));
- Console.WriteLine(String.Format(new CustomerFormatter(), "{0:G}", acctNumber));
- Console.WriteLine(String.Format(new CustomerFormatter(), "{0:S}", acctNumber));
- Console.WriteLine(String.Format(new CustomerFormatter(), "{0:P}", acctNumber));
- try {
- Console.WriteLine(String.Format(new CustomerFormatter(), "{0:X}", acctNumber));
- }
- catch (FormatException e) {
- Console.WriteLine(e.Message);
- }
- }
-}
-
-public class CustomerFormatter : IFormatProvider, ICustomFormatter
-{
- public object GetFormat(Type formatType)
- {
- if (formatType == typeof(ICustomFormatter))
- return this;
- else
- return null;
- }
-
- public string Format(string format,
- object arg,
- IFormatProvider formatProvider)
- {
- if (! this.Equals(formatProvider))
- {
- return null;
- }
- else
- {
- if (String.IsNullOrEmpty(format))
- format = "G";
-
- string customerString = arg.ToString();
- if (customerString.Length < 8)
- customerString = customerString.PadLeft(8, '0');
-
- format = format.ToUpper();
- switch (format)
- {
- case "G":
- return customerString.Substring(0, 1) + "-" +
- customerString.Substring(1, 5) + "-" +
- customerString.Substring(6);
- case "S":
- return customerString.Substring(0, 1) + "/" +
- customerString.Substring(1, 5) + "/" +
- customerString.Substring(6);
- case "P":
- return customerString.Substring(0, 1) + "." +
- customerString.Substring(1, 5) + "." +
- customerString.Substring(6);
- default:
- throw new FormatException(
- String.Format("The '{0}' format specifier is not supported.", format));
- }
- }
- }
-}
-// The example displays the following output:
-// 7-92031-59
-// 7-92031-59
-// 7/92031/59
-// 7.92031.59
-// The 'X' format specifier is not supported.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/formatoverload1.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/formatoverload1.cs
deleted file mode 100644
index 067922e00d752..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/formatoverload1.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-
-public class Example2
-{
- public static void Main()
- {
- //
- DateTime dat = new DateTime(2012, 1, 17, 9, 30, 0);
- string city = "Chicago";
- int temp = -16;
- string output = String.Format("At {0} in {1}, the temperature was {2} degrees.",
- dat, city, temp);
- Console.WriteLine(output);
- // The example displays output like the following:
- // At 1/17/2012 9:30:00 AM in Chicago, the temperature was -16 degrees.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/formatoverload2.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/formatoverload2.cs
deleted file mode 100644
index 9e9e5396bd606..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/formatoverload2.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-
-public class Example3
-{
- public static void Main()
- {
- //
- // Create array of 5-tuples with population data for three U.S. cities, 1940-1950.
- Tuple[] cities =
- { Tuple.Create("Los Angeles", new DateTime(1940, 1, 1), 1504277,
- new DateTime(1950, 1, 1), 1970358),
- Tuple.Create("New York", new DateTime(1940, 1, 1), 7454995,
- new DateTime(1950, 1, 1), 7891957),
- Tuple.Create("Chicago", new DateTime(1940, 1, 1), 3396808,
- new DateTime(1950, 1, 1), 3620962),
- Tuple.Create("Detroit", new DateTime(1940, 1, 1), 1623452,
- new DateTime(1950, 1, 1), 1849568) };
-
- // Display header
- var header = String.Format("{0,-12}{1,8}{2,12}{1,8}{2,12}{3,14}\n",
- "City", "Year", "Population", "Change (%)");
- Console.WriteLine(header);
- foreach (var city in cities) {
- var output = String.Format("{0,-12}{1,8:yyyy}{2,12:N0}{3,8:yyyy}{4,12:N0}{5,14:P1}",
- city.Item1, city.Item2, city.Item3, city.Item4, city.Item5,
- (city.Item5 - city.Item3)/ (double)city.Item3);
- Console.WriteLine(output);
- }
- // The example displays the following output:
- // City Year Population Year Population Change (%)
- //
- // Los Angeles 1940 1,504,277 1950 1,970,358 31.0 %
- // New York 1940 7,454,995 1950 7,891,957 5.9 %
- // Chicago 1940 3,396,808 1950 3,620,962 6.6 %
- // Detroit 1940 1,623,452 1950 1,849,568 13.9 %
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/formatsyntax1.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/formatsyntax1.cs
deleted file mode 100644
index c11ce9190e72c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/formatsyntax1.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-public class Example4
-{
- public static void Main()
- {
- //
- var value = String.Format("{0,-10:C}", 126347.89m);
- Console.WriteLine(value);
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/interceptor2.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/interceptor2.cs
deleted file mode 100644
index 1cf68478e37b3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/interceptor2.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class InterceptProvider : IFormatProvider, ICustomFormatter
-{
- public object GetFormat(Type formatType)
- {
- if (formatType == typeof(ICustomFormatter))
- return this;
- else
- return null;
- }
-
- public string Format(String format, Object obj, IFormatProvider provider)
- {
- // Display information about method call.
- string formatString = format ?? "";
- Console.WriteLine("Provider: {0}, Object: {1}, Format String: {2}",
- provider.GetType().Name, obj ?? "", formatString);
-
- if (obj == null) return String.Empty;
-
- // If this is a byte and the "R" format string, format it with Roman numerals.
- if (obj is Byte && formatString.ToUpper().Equals("R")) {
- Byte value = (Byte) obj;
- int remainder;
- int result;
- String returnString = String.Empty;
-
- // Get the hundreds digit(s)
- result = Math.DivRem(value, 100, out remainder);
- if (result > 0)
- returnString = new String('C', result);
- value = (Byte) remainder;
- // Get the 50s digit
- result = Math.DivRem(value, 50, out remainder);
- if (result == 1)
- returnString += "L";
- value = (Byte) remainder;
- // Get the tens digit.
- result = Math.DivRem(value, 10, out remainder);
- if (result > 0)
- returnString += new String('X', result);
- value = (Byte) remainder;
- // Get the fives digit.
- result = Math.DivRem(value, 5, out remainder);
- if (result > 0)
- returnString += "V";
- value = (Byte) remainder;
- // Add the ones digit.
- if (remainder > 0)
- returnString += new String('I', remainder);
-
- // Check whether we have too many X characters.
- int pos = returnString.IndexOf("XXXX");
- if (pos >= 0) {
- int xPos = returnString.IndexOf("L");
- if (xPos >= 0 & xPos == pos - 1)
- returnString = returnString.Replace("LXXXX", "XC");
- else
- returnString = returnString.Replace("XXXX", "XL");
- }
- // Check whether we have too many I characters
- pos = returnString.IndexOf("IIII");
- if (pos >= 0)
- if (returnString.IndexOf("V") >= 0)
- returnString = returnString.Replace("VIIII", "IX");
- else
- returnString = returnString.Replace("IIII", "IV");
-
- return returnString;
- }
-
- // Use default for all other formatting.
- if (obj is IFormattable)
- return ((IFormattable) obj).ToString(format, CultureInfo.CurrentCulture);
- else
- return obj.ToString();
- }
-}
-
-public class Example
-{
- public static void Main()
- {
- int n = 10;
- double value = 16.935;
- DateTime day = DateTime.Now;
- InterceptProvider provider = new InterceptProvider();
- Console.WriteLine(String.Format(provider, "{0:N0}: {1:C2} on {2:d}\n", n, value, day));
- Console.WriteLine(String.Format(provider, "{0}: {1:F}\n", "Today: ",
- (DayOfWeek) DateTime.Now.DayOfWeek));
- Console.WriteLine(String.Format(provider, "{0:X}, {1}, {2}\n",
- (Byte) 2, (Byte) 12, (Byte) 199));
- Console.WriteLine(String.Format(provider, "{0:R}, {1:R}, {2:R}\n",
- (Byte) 2, (Byte) 12, (Byte) 199));
- }
-}
-// The example displays the following output:
-// Provider: InterceptProvider, Object: 10, Format String: N0
-// Provider: InterceptProvider, Object: 16.935, Format String: C2
-// Provider: InterceptProvider, Object: 1/31/2013 6:10:28 PM, Format String: d
-// 10: $16.94 on 1/31/2013
-//
-// Provider: InterceptProvider, Object: Today: , Format String:
-// Provider: InterceptProvider, Object: Thursday, Format String: F
-// Today: : Thursday
-//
-// Provider: InterceptProvider, Object: 2, Format String: X
-// Provider: InterceptProvider, Object: 12, Format String:
-// Provider: InterceptProvider, Object: 199, Format String:
-// 2, 12, 199
-//
-// Provider: InterceptProvider, Object: 2, Format String: R
-// Provider: InterceptProvider, Object: 12, Format String: R
-// Provider: InterceptProvider, Object: 199, Format String: R
-// II, XII, CXCIX
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa-interpolated1.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa-interpolated1.cs
deleted file mode 100644
index faf264947e344..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa-interpolated1.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-
-public class Example12
-{
- public static void Main()
- {
- //
- string[] names = { "Balto", "Vanya", "Dakota", "Samuel", "Koani", "Yiska", "Yuma" };
- string output = names[0] + ", " + names[1] + ", " + names[2] + ", " +
- names[3] + ", " + names[4] + ", " + names[5] + ", " +
- names[6];
-
- output += "\n";
- var date = DateTime.Now;
- output += String.Format("It is {0:t} on {0:d}. The day of the week is {1}.",
- date, date.DayOfWeek);
- Console.WriteLine(output);
- // The example displays the following output:
- // Balto, Vanya, Dakota, Samuel, Koani, Yiska, Yuma
- // It is 10:29 AM on 1/8/2018. The day of the week is Monday.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa-interpolated2.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa-interpolated2.cs
deleted file mode 100644
index d69dc65af5a6c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa-interpolated2.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-public class Example13
-{
- public static void Main()
- {
- //
- string[] names = { "Balto", "Vanya", "Dakota", "Samuel", "Koani", "Yiska", "Yuma" };
- string output = $"{names[0]}, {names[1]}, {names[2]}, {names[3]}, {names[4]}, " +
- $"{names[5]}, {names[6]}";
-
- var date = DateTime.Now;
- output += $"\nIt is {date:t} on {date:d}. The day of the week is {date.DayOfWeek}.";
- Console.WriteLine(output);
- // The example displays the following output:
- // Balto, Vanya, Dakota, Samuel, Koani, Yiska, Yuma
- // It is 10:29 AM on 1/8/2018. The day of the week is Monday.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa11.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa11.cs
deleted file mode 100644
index 00e98be5982da..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa11.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-public class Example5
-{
- public static void Main()
- {
- //
- Random rnd = new Random();
- int[] numbers = new int[4];
- int total = 0;
- for (int ctr = 0; ctr <= 2; ctr++)
- {
- int number = rnd.Next(1001);
- numbers[ctr] = number;
- total += number;
- }
- numbers[3] = total;
- Console.WriteLine($"{numbers} + {1} + {2} = {3}");
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa21.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa21.cs
deleted file mode 100644
index 067bd5fdd036b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa21.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-public class Example6
-{
- public static void Main()
- {
- //
- Random rnd = new Random();
- int[] numbers = new int[4];
- int total = 0;
- for (int ctr = 0; ctr <= 2; ctr++)
- {
- int number = rnd.Next(1001);
- numbers[ctr] = number;
- total += number;
- }
- numbers[3] = total;
- object[] values = new object[numbers.Length];
- numbers.CopyTo(values, 0);
- Console.WriteLine($"{values} + {1} + {2} = {3}");
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa26.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa26.cs
deleted file mode 100644
index 372f13704709e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa26.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-
-public class Example7
-{
- public static void Main()
- {
- //
- object[] values = { 1603, 1794.68235, 15436.14 };
- string result;
- foreach (var value in values)
- {
- result = String.Format("{0,12:C2} {0,12:E3} {0,12:F4} {0,12:N3} {1,12:P2}\n",
- Convert.ToDouble(value), Convert.ToDouble(value) / 10000);
- Console.WriteLine(result);
- }
- // The example displays output like the following:
- // $1,603.00 1.603E+003 1603.0000 1,603.000 16.03 %
- //
- // $1,794.68 1.795E+003 1794.6824 1,794.682 17.95 %
- //
- // $15,436.14 1.544E+004 15436.1400 15,436.140 154.36 %
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa27.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa27.cs
deleted file mode 100644
index 403a9da46af2b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa27.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-
-public class Example8
-{
- public static void Main()
- {
- //
- decimal value = 16309.5436m;
- string result = String.Format("{0,12:#.00000} {0,12:0,000.00} {0,12:000.00#}",
- value);
- Console.WriteLine(result);
- // The example displays the following output:
- // 16309.54360 16,309.54 16309.544
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa28.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa28.cs
deleted file mode 100644
index acd3e99810449..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa28.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-
-public class Example9
-{
- public static void Main()
- {
- //
- int value = 16342;
- string result = String.Format("{0,18:00000000} {0,18:00000000.000} {0,18:000,0000,000.0}",
- value);
- Console.WriteLine(result);
- // The example displays the following output:
- // 00016342 00016342.000 0,000,016,342.0
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa29.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa29.cs
deleted file mode 100644
index 33faef50db8fd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa29.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-public class Example10
-{
- public static void Main()
- {
- //
- int value = 1326;
- string result = String.Format("{0,10:D6} {0,10:X8}", value);
- Console.WriteLine(result);
- // The example displays the following output:
- // 001326 0000052E
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa3.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa3.cs
deleted file mode 100644
index e37a5536a2516..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa3.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using System;
-
-public class Example11
-{
- public static void Main()
- {
- WillThrow();
- Console.WriteLine();
- WontThrow();
- Console.WriteLine();
- Recommended();
- }
-
- public static void WillThrow()
- {
- String result;
- int nOpen = 1;
- int nClose = 2;
- try
- {
- //
- result = String.Format("The text has {0} '{' characters and {1} '}' characters.",
- nOpen, nClose);
- //
- Console.WriteLine(result);
- }
- catch (FormatException)
- {
- Console.WriteLine("FormatException");
- }
- }
-
- public static void WontThrow()
- {
- //
- string result;
- int nOpen = 1;
- int nClose = 2;
- result = String.Format("The text has {0} '{{' characters and {1} '}}' characters.",
- nOpen, nClose);
- Console.WriteLine(result);
- //
- }
-
- public static void Recommended()
- {
- //
- string result;
- int nOpen = 1;
- int nClose = 2;
- result = String.Format("The text has {0} '{1}' characters and {2} '{3}' characters.",
- nOpen, "{", nClose, "}");
- Console.WriteLine(result);
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/starting1.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/starting1.cs
deleted file mode 100644
index 3e444869dc235..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/starting1.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-using System;
-using System.Text;
-
-public class Example14
-{
- public static void Main()
- {
- //
- decimal temp = 20.4m;
- string s = String.Format("The temperature is {0}°C.", temp);
- Console.WriteLine(s);
- // Displays 'The temperature is 20.4°C.'
- //
-
- Snippet31();
- Snippet32();
- Snippet34();
- }
-
- private static void Snippet31()
- {
- //
- string s = String.Format("At {0}, the temperature is {1}°C.",
- DateTime.Now, 20.4);
- Console.WriteLine(s);
- // Output similar to: 'At 4/10/2015 9:29:41 AM, the temperature is 20.4°C.'
- //
- }
-
- private static void Snippet32()
- {
- //
- string s = String.Format("It is now {0:d} at {0:t}", DateTime.Now);
- Console.WriteLine(s);
- // Output similar to: 'It is now 4/10/2015 at 10:04 AM'
- //
- }
-
- private static void Snippet34()
- {
- //
- int[] years = { 2013, 2014, 2015 };
- int[] population = { 1025632, 1105967, 1148203 };
- String s = String.Format("{0,-10} {1,-10}\n\n", "Year", "Population");
- for (int index = 0; index < years.Length; index++)
- s += String.Format("{0,-10} {1,-10:N0}\n",
- years[index], population[index]);
- Console.WriteLine($"\n{s}");
- // Result:
- // Year Population
- //
- // 2013 1,025,632
- // 2014 1,105,967
- // 2015 1,148,203
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/starting2.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/starting2.cs
deleted file mode 100644
index 1bfa720b14ded..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/starting2.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-
-public class Example15
-{
- public static void Main()
- {
- //
- Decimal pricePerOunce = 17.36m;
- String s = String.Format("The current price is {0} per ounce.",
- pricePerOunce);
- Console.WriteLine(s);
- // Result: The current price is 17.36 per ounce.
- //
- ShowFormatted();
- }
-
- private static void ShowFormatted()
- {
- //
- Decimal pricePerOunce = 17.36m;
- String s = String.Format("The current price is {0:C2} per ounce.",
- pricePerOunce);
- Console.WriteLine(s);
- // Result if current culture is en-US:
- // The current price is $17.36 per ounce.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/starting3.cs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/starting3.cs
deleted file mode 100644
index 48ef9b7f0b06a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/starting3.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using System.Text;
-
-class Example16
-{
- public static void Main()
- {
- //
- int[] years = { 2013, 2014, 2015 };
- int[] population = { 1025632, 1105967, 1148203 };
- var sb = new System.Text.StringBuilder();
- sb.Append(String.Format("{0,6} {1,15}\n\n", "Year", "Population"));
- for (int index = 0; index < years.Length; index++)
- sb.Append(String.Format("{0,6} {1,15:N0}\n", years[index], population[index]));
-
- Console.WriteLine(sb);
-
- // Result:
- // Year Population
- //
- // 2013 1,025,632
- // 2014 1,105,967
- // 2015 1,148,203
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/FormatExample2.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/FormatExample2.fs
deleted file mode 100644
index 0cf9b0f18d8ac..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/FormatExample2.fs
+++ /dev/null
@@ -1,66 +0,0 @@
-module FormatExample2
-
-//
-open System
-
-type CustomerFormatter() =
- interface IFormatProvider with
- member this.GetFormat(formatType) =
- if formatType = typeof then
- this
- else
- null
-
- interface ICustomFormatter with
- member this.Format(format, arg, formatProvider: IFormatProvider) =
- if this.Equals formatProvider |> not then
- null
- else
- let format =
- if String.IsNullOrEmpty format then "G"
- else format.ToUpper()
-
- let customerString =
- let s = string arg
- if s.Length < 8 then
- s.PadLeft(8, '0')
- else s
-
- match format with
- | "G" ->
- customerString.Substring(0, 1) + "-" +
- customerString.Substring(1, 5) + "-" +
- customerString.Substring 6
- | "S" ->
- customerString.Substring(0, 1) + "/" +
- customerString.Substring(1, 5) + "/" +
- customerString.Substring 6
- | "P" ->
- customerString.Substring(0, 1) + "." +
- customerString.Substring(1, 5) + "." +
- customerString.Substring 6
- | _ ->
- raise (FormatException $"The '{format}' format specifier is not supported.")
-
-let acctNumber = 79203159
-String.Format(CustomerFormatter(), "{0}", acctNumber)
-|> printfn "%s"
-String.Format(CustomerFormatter(), "{0:G}", acctNumber)
-|> printfn "%s"
-String.Format(CustomerFormatter(), "{0:S}", acctNumber)
-|> printfn "%s"
-String.Format(CustomerFormatter(), "{0:P}", acctNumber)
-|> printfn "%s"
-try
- String.Format(CustomerFormatter(), "{0:X}", acctNumber)
- |> printfn "%s"
-with :? FormatException as e ->
- printfn $"{e.Message}"
-
-// The example displays the following output:
-// 7-92031-59
-// 7-92031-59
-// 7/92031/59
-// 7.92031.59
-// The 'X' format specifier is not supported.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/formatoverload1.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/formatoverload1.fs
deleted file mode 100644
index 7365178fd898b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/formatoverload1.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module formatoverload1
-
-//
-open System
-
-let dat = DateTime(2012, 1, 17, 9, 30, 0)
-let city = "Chicago"
-let temp = -16
-String.Format("At {0} in {1}, the temperature was {2} degrees.", dat, city, temp)
-|> printfn "%s"
-// The example displays output like the following:
-// At 1/17/2012 9:30:00 AM in Chicago, the temperature was -16 degrees.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/formatoverload2.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/formatoverload2.fs
deleted file mode 100644
index 76ebd80b44e6c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/formatoverload2.fs
+++ /dev/null
@@ -1,29 +0,0 @@
-module formatoverload2
-
-open System
-
-//
-// Create a list of 5-tuples with population data for three U.S. cities, 1940-1950.
-let cities =
- [ "Los Angeles", DateTime(1940, 1, 1), 1504277, DateTime(1950, 1, 1), 1970358
- "New York", DateTime(1940, 1, 1), 7454995, DateTime(1950, 1, 1), 7891957
- "Chicago", DateTime(1940, 1, 1), 3396808, DateTime(1950, 1, 1), 3620962
- "Detroit", DateTime(1940, 1, 1), 1623452, DateTime(1950, 1, 1), 1849568 ]
-
-// Display header
-String.Format("{0,-12}{1,8}{2,12}{1,8}{2,12}{3,14}\n", "City", "Year", "Population", "Change (%)")
-|> printfn "%s"
-
-for name, year1, pop1, year2, pop2 in cities do
- String.Format("{0,-12}{1,8:yyyy}{2,12:N0}{3,8:yyyy}{4,12:N0}{5,14:P1}",
- name, year1, pop1, year2, pop2,
- double (pop2 - pop1) / double pop1)
- |> printfn "%s"
-// The example displays the following output:
-// City Year Population Year Population Change (%)
-//
-// Los Angeles 1940 1,504,277 1950 1,970,358 31.0 %
-// New York 1940 7,454,995 1950 7,891,957 5.9 %
-// Chicago 1940 3,396,808 1950 3,620,962 6.6 %
-// Detroit 1940 1,623,452 1950 1,849,568 13.9 %
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/formatsyntax1.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/formatsyntax1.fs
deleted file mode 100644
index a743dbc0b0de8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/formatsyntax1.fs
+++ /dev/null
@@ -1,8 +0,0 @@
-module formatsyntax1
-
-//
-open System
-
-String.Format("{0,-10:C}", 126347.89m)
-|> printfn "%s"
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/interceptor2.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/interceptor2.fs
deleted file mode 100644
index f45c4c0ea796b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/interceptor2.fs
+++ /dev/null
@@ -1,109 +0,0 @@
-module interceptor2
-
-//
-open System
-open System.Globalization
-
-type InterceptProvider() =
- interface IFormatProvider with
- member this.GetFormat(formatType) =
- if formatType = typeof then
- this
- else
- null
- interface ICustomFormatter with
- member _.Format(format, obj, provider: IFormatProvider) =
- // Display information about method call.
- let formatString =
- if format = null then "" else format
- printfn $"Provider: {provider.GetType().Name}, Object: %A{obj}, Format String: %s{formatString}"
-
- if obj = null then
- String.Empty
- else
- // If this is a byte and the "R" format string, format it with Roman numerals.
- match obj with
- | :? byte as value when formatString.ToUpper().Equals "R" ->
- let mutable returnString = String.Empty
-
- // Get the hundreds digit(s)
- let struct (result, remainder) = Math.DivRem(value, 100uy)
- if result > 0uy then
- returnString <- String('C', int result)
- let value = byte remainder
- // Get the 50s digit
- let struct (result, remainder) = Math.DivRem(value, 50uy)
- if result = 1uy then
- returnString <- returnString + "L"
- let value = byte remainder
- // Get the tens digit.
- let struct (result, remainder) = Math.DivRem(value, 10uy)
- if result > 0uy then
- returnString <- returnString + String('X', int result)
- let value = byte remainder
- // Get the fives digit.
- let struct (result, remainder) = Math.DivRem(value, 5uy)
- if result > 0uy then
- returnString <- returnString + "V"
- let value = byte remainder
- // Add the ones digit.
- if remainder > 0uy then
- returnString <- returnString + String('I', int remainder)
-
- // Check whether we have too many X characters.
- let pos = returnString.IndexOf "XXXX"
- if pos >= 0 then
- let xPos = returnString.IndexOf "L"
- returnString <-
- if xPos >= 0 && xPos = pos - 1 then
- returnString.Replace("LXXXX", "XC")
- else
- returnString.Replace("XXXX", "XL")
- // Check whether we have too many I characters
- let pos = returnString.IndexOf "IIII"
- if pos >= 0 then
- returnString <-
- if returnString.IndexOf "V" >= 0 then
- returnString.Replace("VIIII", "IX")
- else
- returnString.Replace("IIII", "IV")
- returnString
-
- // Use default for all other formatting.
- | :? IFormattable as x ->
- x.ToString(format, CultureInfo.CurrentCulture)
- | _ ->
- string obj
-
-let n = 10
-let value = 16.935
-let day = DateTime.Now
-let provider = InterceptProvider()
-String.Format(provider, "{0:N0}: {1:C2} on {2:d}\n", n, value, day)
-|> printfn "%s"
-String.Format(provider, "{0}: {1:F}\n", "Today: ", DateTime.Now.DayOfWeek)
-|> printfn "%s"
-String.Format(provider, "{0:X}, {1}, {2}\n", 2uy, 12uy, 199uy)
-|> printfn "%s"
-String.Format(provider, "{0:R}, {1:R}, {2:R}\n", 2uy, 12uy, 199uy)
-|> printfn "%s"
-// The example displays the following output:
-// Provider: InterceptProvider, Object: 10, Format String: N0
-// Provider: InterceptProvider, Object: 16.935, Format String: C2
-// Provider: InterceptProvider, Object: 1/31/2013 6:10:28 PM, Format String: d
-// 10: $16.94 on 1/31/2013
-//
-// Provider: InterceptProvider, Object: Today: , Format String:
-// Provider: InterceptProvider, Object: Thursday, Format String: F
-// Today: : Thursday
-//
-// Provider: InterceptProvider, Object: 2, Format String: X
-// Provider: InterceptProvider, Object: 12, Format String:
-// Provider: InterceptProvider, Object: 199, Format String:
-// 2, 12, 199
-//
-// Provider: InterceptProvider, Object: 2, Format String: R
-// Provider: InterceptProvider, Object: 12, Format String: R
-// Provider: InterceptProvider, Object: 199, Format String: R
-// II, XII, CXCIX
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa-interpolated1.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa-interpolated1.fs
deleted file mode 100644
index f29e8e4b14198..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa-interpolated1.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module qa_interpolated1
-
-//
-open System
-
-let names = [| "Balto"; "Vanya"; "Dakota"; "Samuel"; "Koani"; "Yiska"; "Yuma" |]
-let output =
- names[0] + ", " + names[1] + ", " + names[2] + ", " +
- names[3] + ", " + names[4] + ", " + names[5] + ", " +
- names[6] + "\n"
-
-let date = DateTime.Now
-output + String.Format("It is {0:t} on {0:d}. The day of the week is {1}.", date, date.DayOfWeek)
-|> printfn "%s"
-// The example displays the following output:
-// Balto, Vanya, Dakota, Samuel, Koani, Yiska, Yuma
-// It is 10:29 AM on 1/8/2018. The day of the week is Monday.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa-interpolated2.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa-interpolated2.fs
deleted file mode 100644
index a70413c32d756..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa-interpolated2.fs
+++ /dev/null
@@ -1,15 +0,0 @@
-module qa_interpolated2
-
-//
-open System
-
-let names = [| "Balto"; "Vanya"; "Dakota"; "Samuel"; "Koani"; "Yiska"; "Yuma" |]
-let output = $"{names[0]}, {names[1]}, {names[2]}, {names[3]}, {names[4]}, {names[5]}, {names[6]}"
-
-let date = DateTime.Now
-output + $"\nIt is {date:t} on {date:d}. The day of the week is {date.DayOfWeek}."
-|> printfn "%s"
-// The example displays the following output:
-// Balto, Vanya, Dakota, Samuel, Koani, Yiska, Yuma
-// It is 10:29 AM on 1/8/2018. The day of the week is Monday.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa11.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa11.fs
deleted file mode 100644
index 3d152075bedd1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa11.fs
+++ /dev/null
@@ -1,15 +0,0 @@
-module qa11
-
-//
-open System
-
-let rnd = Random()
-let mutable total = 0
-let numbers = Array.zeroCreate 4
-for i = 0 to 2 do
- let number = rnd.Next 1001
- numbers[i] <- number
- total <- total + number
-numbers[3] <- total
-Console.WriteLine("{0} + {1} + {2} = {3}", numbers)
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa21.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa21.fs
deleted file mode 100644
index 56dc9afe390d0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa21.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module qa21
-
-//
-open System
-
-let rnd = Random()
-let numbers = Array.zeroCreate 4
-let mutable total = 0
-for i = 0 to 2 do
- let number = rnd.Next 1001
- numbers[i] <- number
- total <- total + number
-numbers[3] <- total
-let values = Array.zeroCreate numbers.Length
-numbers.CopyTo(values, 0)
-Console.WriteLine("{0} + {1} + {2} = {3}", values)
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa26.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa26.fs
deleted file mode 100644
index 308535944f9c2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa26.fs
+++ /dev/null
@@ -1,16 +0,0 @@
-module qa26
-
-//
-open System
-
-let values: obj list = [ 1603, 1794.68235, 15436.14 ]
-for value in values do
- String.Format("{0,12:C2} {0,12:E3} {0,12:F4} {0,12:N3} {1,12:P2}\n", Convert.ToDouble(value), Convert.ToDouble(value) / 10000.)
- |> printfn "%s"
-// The example displays output like the following:
-// $1,603.00 1.603E+003 1603.0000 1,603.000 16.03 %
-//
-// $1,794.68 1.795E+003 1794.6824 1,794.682 17.95 %
-//
-// $15,436.14 1.544E+004 15436.1400 15,436.140 154.36 %
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa27.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa27.fs
deleted file mode 100644
index dde74671a0eb1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa27.fs
+++ /dev/null
@@ -1,11 +0,0 @@
-module qa27
-
-open System
-
-//
-let value = 16309.5436m
-String.Format("{0,12:#.00000} {0,12:0,000.00} {0,12:000.00#}", value)
-|> printfn "%s"
-// The example displays the following output:
-// 16309.54360 16,309.54 16309.544
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa28.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa28.fs
deleted file mode 100644
index dbb92793763f4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa28.fs
+++ /dev/null
@@ -1,11 +0,0 @@
-module qa28
-
-//
-open System
-
-let value = 16342
-String.Format("{0,18:00000000} {0,18:00000000.000} {0,18:000,0000,000.0}", value)
-|> printfn "%s"
-// The example displays the following output:
-// 00016342 00016342.000 0,000,016,342.0
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa29.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa29.fs
deleted file mode 100644
index 74ab5f7281bf0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa29.fs
+++ /dev/null
@@ -1,11 +0,0 @@
-module qa29
-
-//
-open System
-
-let value = 1326
-String.Format("{0,10:D6} {0,10:X8}", value)
-|> printfn "%s"
-// The example displays the following output:
-// 001326 0000052E
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa3.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa3.fs
deleted file mode 100644
index 3a48f6593d923..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/qa3.fs
+++ /dev/null
@@ -1,36 +0,0 @@
-module qa3
-
-open System
-
-let willThrow () =
- let nOpen = 1
- let nClose = 2
- //
- let result =
- String.Format("The text has {0} '{' characters and {1} '}' characters.", nOpen, nClose)
- //
- ()
-
-let wontThrow () =
- let nOpen = 1
- let nClose = 2
- //
- let result =
- String.Format("The text has {0} '{{' characters and {1} '}}' characters.", nOpen, nClose)
- //
- ()
-
-let recommended () =
- let nOpen = 1
- let nClose = 2
- //
- let result =
- String.Format("The text has {0} '{1}' characters and {2} '{3}' characters.", nOpen, "{", nClose, "}")
- //
- ()
-
-willThrow ()
-printfn ""
-wontThrow ()
-printfn ""
-recommended ()
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/starting1.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/starting1.fs
deleted file mode 100644
index 3ea79b6661f8b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/starting1.fs
+++ /dev/null
@@ -1,44 +0,0 @@
-module starting1
-
-open System
-
-let snippet31 () =
- //
- String.Format("At {0}, the temperature is {1}°C.", DateTime.Now, 20.4)
- |> printfn "%s"
- // Output similar to: 'At 4/10/2015 9:29:41 AM, the temperature is 20.4°C.'
- //
-
-let snippet32 () =
- //
- String.Format("It is now {0:d} at {0:t}", DateTime.Now)
- |> printfn "%s"
- // Output similar to: 'It is now 4/10/2015 at 10:04 AM'
- //
-
-let snippet34 () =
- //
- let years = [| 2013; 2014; 2015 |]
- let population = [| 1025632; 1105967; 1148203 |]
- let mutable s = String.Format("{0,-10} {1,-10}\n\n", "Year", "Population")
- for i = 0 to years.Length - 1 do
- s <- s + String.Format("{0,-10} {1,-10:N0}\n", years[i], population[i])
- printfn $"\n{s}"
- // Result:
- // Year Population
- //
- // 2013 1,025,632
- // 2014 1,105,967
- // 2015 1,148,203
- //
-
-//
-let temp = 20.4m
-String.Format("The temperature is {0}°C.", temp)
-|> printfn "%s"
-// Displays 'The temperature is 20.4°C.'
-//
-
-snippet31 ()
-snippet32 ()
-snippet34 ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/starting2.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/starting2.fs
deleted file mode 100644
index 9680d1bbabb04..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/starting2.fs
+++ /dev/null
@@ -1,20 +0,0 @@
-module starting2
-
-open System
-
-let showFormatted () =
- //
- let pricePerOunce = 17.36m
- String.Format("The current price is {0:C2} per ounce.", pricePerOunce)
- |> printfn "%s"
- // Result if current culture is en-US:
- // The current price is $17.36 per ounce.
- //
-
-//
-let pricePerOunce = 17.36m
-String.Format("The current price is {0} per ounce.", pricePerOunce)
-|> printfn "%s"
-// Result: The current price is 17.36 per ounce.
-//
-showFormatted ()
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/starting3.fs b/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/starting3.fs
deleted file mode 100644
index 0d881960c3ab6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/fsharp/starting3.fs
+++ /dev/null
@@ -1,22 +0,0 @@
-module starting3
-
-//
-open System
-open System.Text
-
-let years = [| 2013; 2014; 2015 |]
-let population = [| 1025632; 1105967; 1148203 |]
-let sb = StringBuilder()
-sb.Append(String.Format("{0,6} {1,15}\n\n", "Year", "Population")) |> ignore
-for i = 0 to years.Length - 1 do
- sb.Append(String.Format("{0,6} {1,15:N0}\n", years[i], population[i])) |> ignore
-
-printfn $"{sb}"
-
-// Result:
-// Year Population
-//
-// 2013 1,025,632
-// 2014 1,105,967
-// 2015 1,148,203
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/base1.cs b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/base1.cs
deleted file mode 100644
index d36a0356ad89b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/base1.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-
-class BaseClass1 : IDisposable
-{
- // Flag: Has Dispose already been called?
- bool disposed = false;
- // Instantiate a FileStream instance.
- FileStream fs = new FileStream("test.txt", FileMode.OpenOrCreate);
-
- // Public implementation of Dispose pattern callable by consumers.
- public void Dispose()
- {
- Dispose(disposing: true);
- GC.SuppressFinalize(this);
- }
-
- // Protected implementation of Dispose pattern.
- protected virtual void Dispose(bool disposing)
- {
- if (disposed)
- return;
-
- if (disposing)
- {
- fs.Dispose();
- // Free any other managed objects here.
- //
- }
-
- disposed = true;
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/base2.cs b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/base2.cs
deleted file mode 100644
index 84d93207f78d5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/base2.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-using System;
-
-class BaseClass2 : IDisposable
-{
- // Flag: Has Dispose already been called?
- bool disposed = false;
-
- // Public implementation of Dispose pattern callable by consumers.
- public void Dispose()
- {
- Dispose(disposing: true);
- GC.SuppressFinalize(this);
- }
-
- // Protected implementation of Dispose pattern.
- protected virtual void Dispose(bool disposing)
- {
- if (disposed)
- return;
-
- if (disposing)
- {
- // Free any other managed objects here.
- //
- }
-
- // Free any unmanaged objects here.
- //
- disposed = true;
- }
-
- ~BaseClass2()
- {
- Dispose(disposing: false);
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/calling1.cs b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/calling1.cs
deleted file mode 100644
index 6d6e6fdeab75d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/calling1.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Text.RegularExpressions;
-
-public class WordCount
-{
- private String filename = String.Empty;
- private int nWords = 0;
- private String pattern = @"\b\w+\b";
-
- public WordCount(string filename)
- {
- if (!File.Exists(filename))
- throw new FileNotFoundException("The file does not exist.");
-
- this.filename = filename;
- string txt = String.Empty;
- using (StreamReader sr = new StreamReader(filename))
- {
- txt = sr.ReadToEnd();
- }
- nWords = Regex.Matches(txt, pattern).Count;
- }
-
- public string FullName
- { get { return filename; } }
-
- public string Name
- { get { return Path.GetFileName(filename); } }
-
- public int Count
- { get { return nWords; } }
-}
-//
-
-public class Example8
-{
- public static void Main()
- {
- WordCount wc = new WordCount(@"C:\users\ronpet\documents\Fr_Mike_Mass.txt");
- Console.WriteLine($"File {wc.Name} ({wc.FullName}) has {wc.Count} words");
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/calling2.cs b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/calling2.cs
deleted file mode 100644
index 92c094d6733df..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/calling2.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Text.RegularExpressions;
-
-public class WordCount2
-{
- private String filename = String.Empty;
- private int nWords = 0;
- private String pattern = @"\b\w+\b";
-
- public WordCount2(string filename)
- {
- if (!File.Exists(filename))
- throw new FileNotFoundException("The file does not exist.");
-
- this.filename = filename;
- string txt = String.Empty;
- StreamReader? sr = null;
- try
- {
- sr = new StreamReader(filename);
- txt = sr.ReadToEnd();
- }
- finally
- {
- if (sr != null) sr.Dispose();
- }
- nWords = Regex.Matches(txt, pattern).Count;
- }
-
- public string FullName
- { get { return filename; } }
-
- public string Name
- { get { return Path.GetFileName(filename); } }
-
- public int Count
- { get { return nWords; } }
-}
-//
-
-public class Example
-{
- public static void Main()
- {
- WordCount2 wc = new WordCount2(@"C:\users\ronpet\documents\Fr_Mike_Mass.txt");
- Console.WriteLine($"File {wc.Name} ({wc.FullName}) has {wc.Count} words");
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/derived1.cs b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/derived1.cs
deleted file mode 100644
index a31a5b55085f9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/csharp/derived1.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-
-class MyDerivedClass : MyBaseClass
-{
- // Flag: Has Dispose already been called?
- bool disposed = false;
- // Instantiate a FileStream instance.
- FileStream fs = new FileStream("test.txt", FileMode.OpenOrCreate);
-
- // Protected implementation of Dispose pattern.
- protected override void Dispose(bool disposing)
- {
- if (disposed)
- return;
-
- if (disposing)
- {
- fs.Dispose();
- // Free any other managed objects here.
- //
- }
-
- // Free any unmanaged objects here.
- //
-
- disposed = true;
- // Call base class implementation.
- base.Dispose(disposing);
- }
-}
-//
-
-class MyBaseClass : IDisposable
-{
- // Flag: Has Dispose already been called?
- bool disposed = false;
-
- // Public implementation of Dispose pattern callable by consumers.
- public void Dispose()
- {
- Dispose(disposing: true);
- GC.SuppressFinalize(this);
- }
-
- // Protected implementation of Dispose pattern.
- protected virtual void Dispose(bool disposing)
- {
- if (disposed)
- return;
-
- if (disposing)
- {
- // Free any other managed objects here.
- //
- }
-
- // Free any unmanaged objects here.
- //
- disposed = true;
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/base1.fs b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/base1.fs
deleted file mode 100644
index 00a9713d4988b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/base1.fs
+++ /dev/null
@@ -1,29 +0,0 @@
-module base1
-
-//
-open System
-open System.IO
-
-type BaseClass1() =
- // Flag: Has Dispose already been called?
- let mutable disposed = false
-
- // Instantiate a FileStream instance.
- let fs = new FileStream("test.txt", FileMode.OpenOrCreate)
-
- interface IDisposable with
- // Public implementation of Dispose pattern callable by consumers.
- member this.Dispose() =
- this.Dispose true
- GC.SuppressFinalize this
-
- // Implementation of Dispose pattern.
- abstract Dispose: bool -> unit
- override _.Dispose(disposing) =
- if not disposed then
- if disposing then
- fs.Dispose()
- // Free any other managed objects here.
- disposed <- true
-
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/base2.fs b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/base2.fs
deleted file mode 100644
index c2ddca8bafff1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/base2.fs
+++ /dev/null
@@ -1,29 +0,0 @@
-module base2
-
-//
-open System
-
-type BaseClass2() =
- // Flag: Has Dispose already been called?
- let mutable disposed = false
-
- interface IDisposable with
- // Public implementation of Dispose pattern callable by consumers.
- member this.Dispose() =
- this.Dispose true
- GC.SuppressFinalize this
-
- // Implementation of Dispose pattern.
- abstract Dispose: bool -> unit
- override _.Dispose(disposing) =
- if not disposed then
- if disposing then
- // Free any other managed objects here.
- ()
-
- // Free any unmanaged objects here.
- disposed <- true
-
- override this.Finalize() =
- this.Dispose false
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/calling1.fs b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/calling1.fs
deleted file mode 100644
index 4beb81a697a75..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/calling1.fs
+++ /dev/null
@@ -1,24 +0,0 @@
-module calling1
-
-//
-open System.IO
-open System.Text.RegularExpressions
-
-type WordCount(filename) =
- let txt =
- if File.Exists filename |> not then
- raise (FileNotFoundException "The file does not exist.")
-
- use sr = new StreamReader(filename)
- sr.ReadToEnd()
-
- let pattern = @"\b\w+\b"
-
- let nWords = Regex.Matches(txt, pattern).Count
-
- member _.FullName = filename
-
- member _.Name = Path.GetFileName filename
-
- member _.Count = nWords
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/calling2.fs b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/calling2.fs
deleted file mode 100644
index f66bcff2fb28d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/calling2.fs
+++ /dev/null
@@ -1,27 +0,0 @@
-module calling2
-
-//
-open System.IO
-open System.Text.RegularExpressions
-
-type WordCount2(filename) =
- let txt =
- if File.Exists filename |> not then
- raise (FileNotFoundException "The file does not exist.")
-
- let sr = new StreamReader(filename)
- try
- sr.ReadToEnd()
- finally
- sr.Dispose()
-
- let pattern = @"\b\w+\b"
-
- let nWords = Regex.Matches(txt, pattern).Count
-
- member _.FullName = filename
-
- member _.Name = Path.GetFileName filename
-
- member _.Count = nWords
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/derived1.fs b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/derived1.fs
deleted file mode 100644
index c3ecd78d5fa75..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/fsharp/derived1.fs
+++ /dev/null
@@ -1,48 +0,0 @@
-module derived1
-open System
-open System.IO
-
-type MyBaseClass() =
- // Flag: Has Dispose already been called?
- let mutable disposed = false
-
- interface IDisposable with
- // Public implementation of Dispose pattern callable by consumers.
- member this.Dispose() =
- this.Dispose true
- GC.SuppressFinalize this
-
- // Implementation of Dispose pattern.
- abstract Dispose: bool -> unit
- override _.Dispose(disposing) =
- if not disposed then
- if disposing then
- // Free any other managed objects here.
- ()
- // Free any unmanaged objects here.
- disposed <- true
-
-//
-open Microsoft.Win32.SafeHandles
-open System
-
-type MyDerivedClass() =
- inherit MyBaseClass()
-
- // Flag: Has Dispose already been called?
- let mutable disposed = false
- // Instantiate a FileStream instance.
- let fs = new FileStream("test.txt", FileMode.OpenOrCreate)
-
- // Implementation of Dispose pattern.
- override _.Dispose(disposing) =
- if not disposed then
- if disposing then
- fs.Dispose()
- // Free any other managed objects here.
-
- // Free any unmanaged objects here.
- disposed <- true
- // Call base class implementation.
- base.Dispose disposing
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/base1.vb b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/base1.vb
deleted file mode 100644
index f0e4b14ce756c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/base1.vb
+++ /dev/null
@@ -1,34 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-Imports System.Runtime.InteropServices
-
-Class BaseClass1 : Implements IDisposable
- ' Flag: Has Dispose already been called?
- Dim disposed As Boolean = False
- ' Instantiate a FileStream instance.
- Dim fs As FileStream = New FileStream("test.txt", FileMode.OpenOrCreate)
-
- ' Public implementation of Dispose pattern callable by consumers.
- Public Sub Dispose() _
- Implements IDisposable.Dispose
- Dispose(disposing:=True)
- GC.SuppressFinalize(Me)
- End Sub
-
- ' Protected implementation of Dispose pattern.
- Protected Overridable Sub Dispose(disposing As Boolean)
- If disposed Then Return
-
- If disposing Then
- fs.Dispose()
- ' Free any other managed objects here.
- '
- End If
-
- disposed = True
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/base2.vb b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/base2.vb
deleted file mode 100644
index 554a3d710c39e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/base2.vb
+++ /dev/null
@@ -1,34 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Class BaseClass : Implements IDisposable
- ' Flag: Has Dispose already been called?
- Dim disposed As Boolean = False
-
- ' Public implementation of Dispose pattern callable by consumers.
- Public Sub Dispose() _
- Implements IDisposable.Dispose
- Dispose(disposing:=True)
- GC.SuppressFinalize(Me)
- End Sub
-
- ' Protected implementation of Dispose pattern.
- Protected Overridable Sub Dispose(disposing As Boolean)
- If disposed Then Return
-
- If disposing Then
- ' Free any other managed objects here.
- '
- End If
-
- ' Free any unmanaged objects here.
- '
- disposed = True
- End Sub
-
- Protected Overrides Sub Finalize()
- Dispose(disposing:=False)
- End Sub
-End Class
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/calling1.vb b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/calling1.vb
deleted file mode 100644
index 1ebfac83b9ea0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/calling1.vb
+++ /dev/null
@@ -1,52 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-Imports System.Text.RegularExpressions
-
-Public Class WordCount
- Private filename As String
- Private nWords As Integer
- Private pattern As String = "\b\w+\b"
-
- Public Sub New(filename As String)
- If Not File.Exists(filename) Then
- Throw New FileNotFoundException("The file does not exist.")
- End If
-
- Me.filename = filename
- Dim txt As String = String.Empty
- Using sr As New StreamReader(filename)
- txt = sr.ReadToEnd()
- End Using
- nWords = Regex.Matches(txt, pattern).Count
- End Sub
-
- Public ReadOnly Property FullName As String
- Get
- Return filename
- End Get
- End Property
-
- Public ReadOnly Property Name As String
- Get
- Return Path.GetFileName(filename)
- End Get
- End Property
-
- Public ReadOnly Property Count As Integer
- Get
- Return nWords
- End Get
- End Property
-End Class
-'
-
-Public Module Example
- Public Sub Main()
- Dim wc As New WordCount("C:\users\ronpet\documents\Fr_Mike_Mass.txt")
- Console.WriteLine("File {0} ({1}) has {2} words",
- wc.Name, wc.FullName, wc.Count)
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/calling2.vb b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/calling2.vb
deleted file mode 100644
index 75957b80d323b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/calling2.vb
+++ /dev/null
@@ -1,56 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-Imports System.Text.RegularExpressions
-
-Public Class WordCount2
- Private filename As String
- Private nWords As Integer
- Private pattern As String = "\b\w+\b"
-
- Public Sub New(filename As String)
- If Not File.Exists(filename) Then
- Throw New FileNotFoundException("The file does not exist.")
- End If
-
- Me.filename = filename
- Dim txt As String = String.Empty
- Dim sr As StreamReader = Nothing
- Try
- sr = New StreamReader(filename)
- txt = sr.ReadToEnd()
- Finally
- If sr IsNot Nothing Then sr.Dispose()
- End Try
- nWords = Regex.Matches(txt, pattern).Count
- End Sub
-
- Public ReadOnly Property FullName As String
- Get
- Return filename
- End Get
- End Property
-
- Public ReadOnly Property Name As String
- Get
- Return Path.GetFileName(filename)
- End Get
- End Property
-
- Public ReadOnly Property Count As Integer
- Get
- Return nWords
- End Get
- End Property
-End Class
-'
-
-Public Module Example2
- Public Sub Main()
- Dim wc As New WordCount2("C:\users\ronpet\documents\Fr_Mike_Mass.txt")
- Console.WriteLine("File {0} ({1}) has {2} words",
- wc.Name, wc.FullName, wc.Count)
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/derived1.vb b/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/derived1.vb
deleted file mode 100644
index 1bf423286cd03..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/IDisposable/Overview/vb/derived1.vb
+++ /dev/null
@@ -1,59 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-Imports System.Runtime.InteropServices
-
-Class DerivedClass2 : Inherits BaseClass2
- ' Flag: Has Dispose already been called?
- Dim disposed As Boolean = False
- ' Instantiate a FileStream instance.
- Dim fs As FileStream = New FileStream("test.txt", FileMode.OpenOrCreate)
-
- ' Protected implementation of Dispose pattern.
- Protected Overrides Sub Dispose(disposing As Boolean)
- If disposed Then Return
-
- If disposing Then
- fs.Dispose()
- ' Free any other managed objects here.
- '
- End If
-
- ' Free any unmanaged objects here.
- '
- disposed = True
-
- ' Call base class implementation.
- MyBase.Dispose(disposing)
- End Sub
-End Class
-'
-
-Class BaseClass2 : Implements IDisposable
- ' Flag: Has Dispose already been called?
- Dim disposed As Boolean = False
-
- ' Public implementation of Dispose pattern callable by consumers.
- Public Sub Dispose() _
- Implements IDisposable.Dispose
- Dispose(disposing:=True)
- GC.SuppressFinalize(Me)
- End Sub
-
- ' Protected implementation of Dispose pattern.
- Protected Overridable Sub Dispose(disposing As Boolean)
- If disposed Then Return
-
- If disposing Then
- ' Free any other managed objects here.
- '
- End If
-
- ' Free any unmanaged objects here.
- '
- disposed = True
- End Sub
-End Class
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/csharp/Formatting1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/csharp/Formatting1.cs
deleted file mode 100644
index 6b68dcf58bac3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/csharp/Formatting1.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-using System;
-
-public class Example1
-{
- public static void Main()
- {
- CallToString();
- Console.WriteLine("-----");
- CallConvert();
- }
-
- private static void CallToString()
- {
- //
- int[] numbers = { -1403, 0, 169, 1483104 };
- foreach (int number in numbers)
- {
- // Display value using default formatting.
- Console.Write("{0,-8} --> ", number.ToString());
- // Display value with 3 digits and leading zeros.
- Console.Write("{0,11:D3}", number);
- // Display value with 1 decimal digit.
- Console.Write("{0,13:N1}", number);
- // Display value as hexadecimal.
- Console.Write("{0,12:X2}", number);
- // Display value with eight hexadecimal digits.
- Console.WriteLine("{0,14:X8}", number);
- }
- // The example displays the following output:
- // -1403 --> -1403 -1,403.0 FFFFFA85 FFFFFA85
- // 0 --> 000 0.0 00 00000000
- // 169 --> 169 169.0 A9 000000A9
- // 1483104 --> 1483104 1,483,104.0 16A160 0016A160
- //
- }
-
- private static void CallConvert()
- {
- //
- int[] numbers = { -146, 11043, 2781913 };
- Console.WriteLine("{0,8} {1,32} {2,11} {3,10}",
- "Value", "Binary", "Octal", "Hex");
- foreach (int number in numbers)
- {
- Console.WriteLine("{0,8} {1,32} {2,11} {3,10}",
- number, Convert.ToString(number, 2),
- Convert.ToString(number, 8),
- Convert.ToString(number, 16));
- }
- // The example displays the following output:
- // Value Binary Octal Hex
- // -146 11111111111111111111111101101110 37777777556 ffffff6e
- // 11043 10101100100011 25443 2b23
- // 2781913 1010100111001011011001 12471331 2a72d9
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/csharp/Instantiate1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/csharp/Instantiate1.cs
deleted file mode 100644
index 84958e6bcd767..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/csharp/Instantiate1.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-using System;
-using System.Numerics;
-
-public class Example
-{
- public static void Main()
- {
- InstantiateByAssignment();
- Console.WriteLine("----");
- InstantiateByNarrowingConversion();
- Console.WriteLine("----");
- Parse();
- Console.WriteLine("----");
- InstantiateByWideningConversion();
- }
-
- private static void InstantiateByAssignment()
- {
- //
- int number1 = 64301;
- int number2 = 25548612;
- //
- Console.WriteLine($"{number1} - {number2}");
- }
-
- private static void InstantiateByNarrowingConversion()
- {
- //
- long lNumber = 163245617;
- try {
- int number1 = (int) lNumber;
- Console.WriteLine(number1);
- }
- catch (OverflowException) {
- Console.WriteLine($"{lNumber} is out of range of an Int32.");
- }
-
- double dbl2 = 35901.997;
- try {
- int number2 = (int) dbl2;
- Console.WriteLine(number2);
- }
- catch (OverflowException) {
- Console.WriteLine($"{dbl2} is out of range of an Int32.");
- }
-
- BigInteger bigNumber = 132451;
- try {
- int number3 = (int) bigNumber;
- Console.WriteLine(number3);
- }
- catch (OverflowException) {
- Console.WriteLine($"{bigNumber} is out of range of an Int32.");
- }
- // The example displays the following output:
- // 163245617
- // 35902
- // 132451
- //
- }
-
- private static void Parse()
- {
- //
- string string1 = "244681";
- try {
- int number1 = Int32.Parse(string1);
- Console.WriteLine(number1);
- }
- catch (OverflowException) {
- Console.WriteLine($"'{string1}' is out of range of a 32-bit integer.");
- }
- catch (FormatException) {
- Console.WriteLine($"The format of '{string1}' is invalid.");
- }
-
- string string2 = "F9A3C";
- try {
- int number2 = Int32.Parse(string2,
- System.Globalization.NumberStyles.HexNumber);
- Console.WriteLine(number2);
- }
- catch (OverflowException) {
- Console.WriteLine($"'{string2}' is out of range of a 32-bit integer.");
- }
- catch (FormatException) {
- Console.WriteLine($"The format of '{string2}' is invalid.");
- }
- // The example displays the following output:
- // 244681
- // 1022524
- //
- }
-
- private static void InstantiateByWideningConversion()
- {
- //
- sbyte value1 = 124;
- short value2 = 1618;
-
- int number1 = value1;
- int number2 = value2;
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/fsharp/Formatting1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/fsharp/Formatting1.fs
deleted file mode 100644
index 8655954ddb042..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/fsharp/Formatting1.fs
+++ /dev/null
@@ -1,43 +0,0 @@
-open System
-
-let callToString () =
- //
- let numbers = [| -1403; 0; 169; 1483104 |]
- for number in numbers do
- // Display value using default formatting.
- printf $"{number,-8} --> "
- // Display value with 3 digits and leading zeros.
- printf $"{number,11:D3}"
- // Display value with 1 decimal digit.
- printf $"{number,13:N1}"
- // Display value as hexadecimal.
- printf $"{number,12:X2}"
- // Display value with eight hexadecimal digits.
- printfn $"{number,14:X8}"
-
-
- // The example displays the following output:
- // -1403 --> -1403 -1,403.0 FFFFFA85 FFFFFA85
- // 0 --> 000 0.0 00 00000000
- // 169 --> 169 169.0 A9 000000A9
- // 1483104 --> 1483104 1,483,104.0 16A160 0016A160
- //
-
-
-let callConvert () =
- //
- let numbers = [| -146; 11043; 2781913 |]
- printfn $"""{"Value",8} {"Binary",32} {"Octal",11} {"Hex",10}"""
- for number in numbers do
- printfn $"{number,8} {Convert.ToString(number, 2),32} {Convert.ToString(number, 8),11} {Convert.ToString(number, 16),10}"
-
- // The example displays the following output:
- // Value Binary Octal Hex
- // -146 11111111111111111111111101101110 37777777556 ffffff6e
- // 11043 10101100100011 25443 2b23
- // 2781913 1010100111001011011001 12471331 2a72d9
- //
-
-callToString ()
-printfn "-----"
-callConvert ()
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/fsharp/Instantiate1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/fsharp/Instantiate1.fs
deleted file mode 100644
index b130cdddd5e9e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/fsharp/Instantiate1.fs
+++ /dev/null
@@ -1,84 +0,0 @@
-open System
-open System.Numerics
-
-let instantiateByAssignment () =
- //
- let number1 = 64301
- let number2 = 25548612
- //
- printfn $"{number1} - {number2}"
-
-let instantiateByNarrowingConversion () =
- //
- let lNumber = 163245617L
- try
- let number1 = int lNumber
- printfn $"{number1}"
- with :? OverflowException ->
- printfn "{lNumber} is out of range of an Int32."
-
- let dbl2 = 35901.997
- try
- let number2 = int dbl2
- printfn $"{number2}"
- with :? OverflowException ->
- printfn $"{dbl2} is out of range of an Int32."
-
- let bigNumber = BigInteger 132451
- try
- let number3 = int bigNumber
- printfn $"{number3}"
- with :? OverflowException ->
- printfn $"{bigNumber} is out of range of an Int32."
-
- // The example displays the following output:
- // 163245617
- // 35902
- // 132451
- //
-
-let parse () =
- //
- let string1 = "244681"
- try
- let number1 = Int32.Parse string1
- printfn $"{number1}"
- with
- | :? OverflowException ->
- printfn "'{string1}' is out of range of a 32-bit integer."
- | :? FormatException ->
- printfn $"The format of '{string1}' is invalid."
-
- let string2 = "F9A3C"
- try
- let number2 = Int32.Parse(string2, System.Globalization.NumberStyles.HexNumber)
- printfn $"{number2}"
- with
- | :? OverflowException ->
- printfn $"'{string2}' is out of range of a 32-bit integer."
- | :? FormatException ->
- printfn $"The format of '{string2}' is invalid."
-
- // The example displays the following output:
- // 244681
- // 1022524
- //
-
-let instantiateByWideningConversion () =
- //
- let value1 = 124y
- let value2 = 1618s
-
- let number1 = int value1
- let number2 = int value2
- //
- ()
-
-instantiateByAssignment ()
-printfn "----"
-instantiateByNarrowingConversion ()
-printfn "----"
-parse ()
-printfn "----"
-instantiateByWideningConversion ()
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/fsharp/toint32_1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/fsharp/toint32_1.fs
deleted file mode 100644
index 68d15b28a0915..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/fsharp/toint32_1.fs
+++ /dev/null
@@ -1,25 +0,0 @@
-open System
-
-//
-let values =
- [| Decimal.MinValue; -1034.23M; -12m; 0M; 147M
- 199.55M; 9214.16M; Decimal.MaxValue |]
-
-for value in values do
- try
- let result = Convert.ToInt32 value
- printfn $"Converted the {value.GetType().Name} value '{value}' to the {result.GetType().Name} value {result}."
-
- with :? OverflowException ->
- printfn $"{value} is outside the range of the Int32 type."
-
-// The example displays the following output:
-// -79228162514264337593543950335 is outside the range of the Int32 type.
-// Converted the Decimal value '-1034.23' to the Int32 value -1034.
-// Converted the Decimal value '-12' to the Int32 value -12.
-// Converted the Decimal value '0' to the Int32 value 0.
-// Converted the Decimal value '147' to the Int32 value 147.
-// Converted the Decimal value '199.55' to the Int32 value 200.
-// Converted the Decimal value '9214.16' to the Int32 value 9214.
-// 79228162514264337593543950335 is outside the range of the Int32 type.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/vb/Formatting1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/vb/Formatting1.vb
deleted file mode 100644
index 54fdbc6fed1f5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/vb/Formatting1.vb
+++ /dev/null
@@ -1,53 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example
- Public Sub Main()
- CallToString()
- Console.WriteLine("-----")
- CallConvert()
- End Sub
-
- Private Sub CallToString()
- '
- Dim numbers() As Integer = { -1403, 0, 169, 1483104 }
- For Each number As Integer In numbers
- ' Display value using default formatting.
- Console.Write("{0,-8} --> ", number.ToString())
- ' Display value with 3 digits and leading zeros.
- Console.Write("{0,11:D3}", number)
- ' Display value with 1 decimal digit.
- Console.Write("{0,13:N1}", number)
- ' Display value as hexadecimal.
- Console.Write("{0,12:X2}", number)
- ' Display value with eight hexadecimal digits.
- Console.WriteLine("{0,14:X8}", number)
- Next
- ' The example displays the following output:
- ' -1403 --> -1403 -1,403.0 FFFFFA85 FFFFFA85
- ' 0 --> 000 0.0 00 00000000
- ' 169 --> 169 169.0 A9 000000A9
- ' 1483104 --> 1483104 1,483,104.0 16A160 0016A160
- '
- End Sub
-
- Private Sub CallConvert()
- '
- Dim numbers() As Integer = { -146, 11043, 2781913 }
- Console.WriteLine("{0,8} {1,32} {2,11} {3,10}", _
- "Value", "Binary", "Octal", "Hex")
- For Each number As Integer In numbers
- Console.WriteLine("{0,8} {1,32} {2,11} {3,10}", _
- number, Convert.ToString(number, 2), _
- Convert.ToString(number, 8), _
- Convert.ToString(number, 16))
- Next
- ' The example displays the following output:
- ' Value Binary Octal Hex
- ' -146 11111111111111111111111101101110 37777777556 ffffff6e
- ' 11043 10101100100011 25443 2b23
- ' 2781913 1010100111001011011001 12471331 2a72d9
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/vb/Instantiate1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/vb/Instantiate1.vb
deleted file mode 100644
index 5dd634995d776..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/vb/Instantiate1.vb
+++ /dev/null
@@ -1,94 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Numerics
-
-Module Example1
- Public Sub Main()
- InstantiateByAssignment()
- Console.WriteLine("----")
- InstantiateByNarrowingConversion()
- Console.WriteLine("----")
- Parse()
- Console.WriteLine("----")
- InstantiateByWideningConversion()
- End Sub
-
- Private Sub InstantiateByAssignment()
- '
- Dim number1 As Integer = 64301
- Dim number2 As Integer = 25548612
- '
- End Sub
-
- Private Sub InstantiateByNarrowingConversion()
- '
- Dim lNumber As Long = 163245617
- Try
- Dim number1 As Integer = CInt(lNumber)
- Console.WriteLine(number1)
- Catch e As OverflowException
- Console.WriteLine("{0} is out of range of an Int32.", lNumber)
- End Try
-
- Dim dbl2 As Double = 35901.997
- Try
- Dim number2 As Integer = CInt(dbl2)
- Console.WriteLine(number2)
- Catch e As OverflowException
- Console.WriteLine("{0} is out of range of an Int32.", dbl2)
- End Try
-
- Dim bigNumber As BigInteger = 132451
- Try
- Dim number3 As Integer = CInt(bigNumber)
- Console.WriteLine(number3)
- Catch e As OverflowException
- Console.WriteLine("{0} is out of range of an Int32.", bigNumber)
- End Try
- ' The example displays the following output:
- ' 163245617
- ' 35902
- ' 132451
- '
- End Sub
-
- Private Sub Parse()
- '
- Dim string1 As String = "244681"
- Try
- Dim number1 As Integer = Int32.Parse(string1)
- Console.WriteLine(number1)
- Catch e As OverflowException
- Console.WriteLine("'{0}' is out of range of a 32-bit integer.", string1)
- Catch e As FormatException
- Console.WriteLine("The format of '{0}' is invalid.", string1)
- End Try
-
- Dim string2 As String = "F9A3C"
- Try
- Dim number2 As Integer = Int32.Parse(string2,
- System.Globalization.NumberStyles.HexNumber)
- Console.WriteLine(number2)
- Catch e As OverflowException
- Console.WriteLine("'{0}' is out of range of a 32-bit integer.", string2)
- Catch e As FormatException
- Console.WriteLine("The format of '{0}' is invalid.", string2)
- End Try
- ' The example displays the following output:
- ' 244681
- ' 1022524
- '
- End Sub
-
- Private Sub InstantiateByWideningConversion()
- '
- Dim value1 As SByte = 124
- Dim value2 As Int16 = 1618
-
- Dim number1 As Integer = value1
- Dim number2 As Integer = value2
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int32/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/csharp/formatting1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/csharp/formatting1.cs
deleted file mode 100644
index f4dedc1638193..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/csharp/formatting1.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-
-public class Example1
-{
- public static void Main()
- {
- CallToString();
- Console.WriteLine("-----");
- CallConvert();
- }
-
- private static void CallToString()
- {
- //
- long[] numbers = { -1403, 0, 169, 1483104 };
- foreach (var number in numbers)
- {
- // Display value using default formatting.
- Console.Write("{0,-8} --> ", number.ToString());
- // Display value with 3 digits and leading zeros.
- Console.Write("{0,8:D3}", number);
- // Display value with 1 decimal digit.
- Console.Write("{0,13:N1}", number);
- // Display value as hexadecimal.
- Console.Write("{0,18:X2}", number);
- // Display value with eight hexadecimal digits.
- Console.WriteLine("{0,18:X8}", number);
- }
- // The example displays the following output:
- // -1403 --> -1403 -1,403.0 FFFFFFFFFFFFFA85 FFFFFFFFFFFFFA85
- // 0 --> 000 0.0 00 00000000
- // 169 --> 169 169.0 A9 000000A9
- // 1483104 --> 1483104 1,483,104.0 16A160 0016A160
- //
- }
-
- private static void CallConvert()
- {
- //
- long[] numbers = { -146, 11043, 2781913 };
- foreach (var number in numbers)
- {
- Console.WriteLine($"{number} (Base 10):");
- Console.WriteLine($" Binary: {Convert.ToString(number, 2)}");
- Console.WriteLine($" Octal: {Convert.ToString(number, 8)}");
- Console.WriteLine($" Hex: {Convert.ToString(number, 16)}{Environment.NewLine}");
- }
- // The example displays the following output:
- // -146 (Base 10):
- // Binary: 1111111111111111111111111111111111111111111111111111111101101110
- // Octal: 1777777777777777777556
- // Hex: ffffffffffffff6e
- //
- // 11043 (Base 10):
- // Binary: 10101100100011
- // Octal: 25443
- // Hex: 2b23
- //
- // 2781913 (Base 10):
- // Binary: 1010100111001011011001
- // Octal: 12471331
- // Hex: 2a72d9
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/csharp/instantiate1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/csharp/instantiate1.cs
deleted file mode 100644
index ffe7cc22985c1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/csharp/instantiate1.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-using System;
-using System.Numerics;
-
-public class Example
-{
- public static void Main()
- {
- InstantiateByAssignment();
- Console.WriteLine("----");
- InstantiateByNarrowingConversion();
- Console.WriteLine("----");
- Parse();
- Console.WriteLine("----");
- InstantiateByWideningConversion();
- }
-
- private static void InstantiateByAssignment()
- {
- //
- long number1 = -64301728;
- long number2 = 255486129307;
- //
- Console.WriteLine($"{number1} - {number2}");
- }
-
- private static void InstantiateByNarrowingConversion()
- {
- //
- ulong ulNumber = 163245617943825;
- try {
- long number1 = (long) ulNumber;
- Console.WriteLine(number1);
- }
- catch (OverflowException) {
- Console.WriteLine($"{ulNumber} is out of range of an Int64.");
- }
-
- double dbl2 = 35901.997;
- try {
- long number2 = (long) dbl2;
- Console.WriteLine(number2);
- }
- catch (OverflowException) {
- Console.WriteLine($"{dbl2} is out of range of an Int64.");
- }
-
- BigInteger bigNumber = (BigInteger) 1.63201978555e30;
- try {
- long number3 = (long) bigNumber;
- Console.WriteLine(number3);
- }
- catch (OverflowException) {
- Console.WriteLine($"{bigNumber} is out of range of an Int64.");
- }
- // The example displays the following output:
- // 163245617943825
- // 35902
- // 1,632,019,785,549,999,969,612,091,883,520 is out of range of an Int64.
- //
- }
-
- private static void Parse()
- {
- //
- string string1 = "244681903147";
- try {
- long number1 = Int64.Parse(string1);
- Console.WriteLine(number1);
- }
- catch (OverflowException) {
- Console.WriteLine($"'{string1}' is out of range of a 64-bit integer.");
- }
- catch (FormatException) {
- Console.WriteLine($"The format of '{string1}' is invalid.");
- }
-
- string string2 = "F9A3CFF0A";
- try {
- long number2 = Int64.Parse(string2,
- System.Globalization.NumberStyles.HexNumber);
- Console.WriteLine(number2);
- }
- catch (OverflowException) {
- Console.WriteLine($"'{string2}' is out of range of a 64-bit integer.");
- }
- catch (FormatException) {
- Console.WriteLine($"The format of '{string2}' is invalid.");
- }
- // The example displays the following output:
- // 244681903147
- // 67012198154
- //
- }
-
- private static void InstantiateByWideningConversion()
- {
- //
- sbyte value1 = 124;
- short value2 = 1618;
- int value3 = Int32.MaxValue;
-
- long number1 = value1;
- long number2 = value2;
- long number3 = value3;
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/fsharp/instantiate1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/fsharp/instantiate1.fs
deleted file mode 100644
index 6d2644a4a7f6e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/fsharp/instantiate1.fs
+++ /dev/null
@@ -1,89 +0,0 @@
-open System
-open System.Globalization
-open System.Numerics
-
-let instantiateByAssignment () =
- //
- let number1 = -64301728L
- let number2 = 255486129307L
- //
- printfn $"{number1} - {number2}"
-
-
-let instantiateByNarrowingConversion () =
- //
- let ulNumber = 163245617943825uL
- try
- let number1 = int64 ulNumber
- printfn $"{number1}"
- with :? OverflowException ->
- printfn $"{ulNumber} is out of range of an Int64."
-
- let dbl2 = 35901.997
- try
- let number2 = int64 dbl2
- printfn $"{number2}"
- with :? OverflowException ->
- printfn $"{dbl2} is out of range of an Int64."
-
- let bigNumber = BigInteger 1.63201978555e30
- try
- let number3 = int64 bigNumber
- printfn $"{number3}"
- with :? OverflowException ->
- printfn $"{bigNumber} is out of range of an Int64."
-
- // The example displays the following output:
- // 163245617943825
- // 35902
- // 1,632,019,785,549,999,969,612,091,883,520 is out of range of an Int64.
- //
-
-let parse () =
- //
- let string1 = "244681903147"
- try
- let number1 = Int64.Parse string1
- printfn $"{number1}"
- with
- | :? OverflowException ->
- printfn $"'{string1}' is out of range of a 64-bit integer."
- | :? FormatException ->
- printfn $"The format of '{string1}' is invalid."
-
- let string2 = "F9A3CFF0A"
- try
- let number2 = Int64.Parse(string2, NumberStyles.HexNumber)
- printfn $"{number2}"
-
- with
- | :? OverflowException ->
- printfn $"'{string2}' is out of range of a 64-bit integer."
- | :? FormatException ->
- printfn $"The format of '{string2}' is invalid."
-
- // The example displays the following output:
- // 244681903147
- // 67012198154
- //
-
-let instantiateByWideningConversion () =
- //
- let value1 = 124y
- let value2 = 1618s
- let value3 = Int32.MaxValue
-
- let number1 = int64 value1
- let number2 = int64 value2
- let number3: int64 = value3
- //
- ()
-
-
-instantiateByAssignment ()
-printfn "----"
-instantiateByNarrowingConversion ()
-printfn "----"
-parse ()
-printfn "----"
-instantiateByWideningConversion ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/vb/formatting1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/vb/formatting1.vb
deleted file mode 100644
index c61d2ae9723f0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/vb/formatting1.vb
+++ /dev/null
@@ -1,62 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example
- Public Sub Main()
- CallToString()
- Console.WriteLine("-----")
- CallConvert()
- End Sub
-
- Private Sub CallToString()
- '
- Dim numbers() As Long = { -1403, 0, 169, 1483104 }
- For Each number In numbers
- ' Display value using default formatting.
- Console.Write("{0,-8} --> ", number.ToString())
- ' Display value with 3 digits and leading zeros.
- Console.Write("{0,8:D3}", number)
- ' Display value with 1 decimal digit.
- Console.Write("{0,13:N1}", number)
- ' Display value as hexadecimal.
- Console.Write("{0,18:X2}", number)
- ' Display value with eight hexadecimal digits.
- Console.WriteLine("{0,18:X8}", number)
- Next
- ' The example displays the following output:
- ' -1403 --> -1403 -1,403.0 FFFFFFFFFFFFFA85 FFFFFFFFFFFFFA85
- ' 0 --> 000 0.0 00 00000000
- ' 169 --> 169 169.0 A9 000000A9
- ' 1483104 --> 1483104 1,483,104.0 16A160 0016A160
- '
- End Sub
-
- Private Sub CallConvert()
- '
- Dim numbers() As Long = { -146, 11043, 2781913 }
- For Each number In numbers
- Console.WriteLine("{0} (Base 10):", number)
- Console.WriteLine(" Binary: {0}", Convert.ToString(number, 2))
- Console.WriteLine(" Octal: {0}", Convert.ToString(number, 8))
- Console.WriteLine(" Hex: {0}", Convert.ToString(number, 16))
- Console.WriteLine()
- Next
- ' The example displays the following output:
- ' -146 (Base 10):
- ' Binary: 1111111111111111111111111111111111111111111111111111111101101110
- ' Octal: 1777777777777777777556
- ' Hex: ffffffffffffff6e
- '
- ' 11043 (Base 10):
- ' Binary: 10101100100011
- ' Octal: 25443
- ' Hex: 2b23
- '
- ' 2781913 (Base 10):
- ' Binary: 1010100111001011011001
- ' Octal: 12471331
- ' Hex: 2a72d9
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/vb/instantiate1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/vb/instantiate1.vb
deleted file mode 100644
index a4df61dcfb0a2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Int64/Overview/vb/instantiate1.vb
+++ /dev/null
@@ -1,96 +0,0 @@
-' Visual Basic .NET Document
-Option Strict Off
-
-Imports System.Numerics
-
-Module Example1
- Public Sub Main()
- InstantiateByAssignment()
- Console.WriteLine("----")
- InstantiateByNarrowingConversion()
- Console.WriteLine("----")
- Parse()
- Console.WriteLine("----")
- InstantiateByWideningConversion()
- End Sub
-
- Private Sub InstantiateByAssignment()
- '
- Dim number1 As Long = -64301728
- Dim number2 As Long = 255486129307
- '
- End Sub
-
- Private Sub InstantiateByNarrowingConversion()
- '
- Dim ulNumber As ULong = 163245617943825
- Try
- Dim number1 As Long = CLng(ulNumber)
- Console.WriteLine(number1)
- Catch e As OverflowException
- Console.WriteLine("{0} is out of range of an Int64.", ulNumber)
- End Try
-
- Dim dbl2 As Double = 35901.997
- Try
- Dim number2 As Long = CLng(dbl2)
- Console.WriteLine(number2)
- Catch e As OverflowException
- Console.WriteLine("{0} is out of range of an Int64.", dbl2)
- End Try
-
- Dim bigNumber As BigInteger = 1.63201978555e30
- Try
- Dim number3 As Long = CLng(bigNumber)
- Console.WriteLine(number3)
- Catch e As OverflowException
- Console.WriteLine("{0:N0} is out of range of an Int64.", bigNumber)
- End Try
- ' The example displays the following output:
- ' 163245617943825
- ' 35902
- ' 1,632,019,785,549,999,969,612,091,883,520 is out of range of an Int64.
- '
- End Sub
-
- Private Sub Parse()
- '
- Dim string1 As String = "244681903147"
- Try
- Dim number1 As Long = Int64.Parse(string1)
- Console.WriteLine(number1)
- Catch e As OverflowException
- Console.WriteLine("'{0}' is out of range of a 64-bit integer.", string1)
- Catch e As FormatException
- Console.WriteLine("The format of '{0}' is invalid.", string1)
- End Try
-
- Dim string2 As String = "F9A3CFF0A"
- Try
- Dim number2 As Long = Int64.Parse(string2,
- System.Globalization.NumberStyles.HexNumber)
- Console.WriteLine(number2)
- Catch e As OverflowException
- Console.WriteLine("'{0}' is out of range of a 64-bit integer.", string2)
- Catch e As FormatException
- Console.WriteLine("The format of '{0}' is invalid.", string2)
- End Try
- ' The example displays the following output:
- ' 244681903147
- ' 67012198154
- '
- End Sub
-
- Private Sub InstantiateByWideningConversion()
- '
- Dim value1 As SByte = 124
- Dim value2 As Int16 = 1618
- Dim value3 As Int32 = Int32.MaxValue
-
- Dim number1 As Long = value1
- Dim number2 As Long = value2
- Dim number3 As Long = value3
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/Interface1.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/Interface1.cs
deleted file mode 100644
index b84106be760ee..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/Interface1.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class InterfaceEx
-{
- public static void Main()
- {
- var culture = CultureInfo.InvariantCulture;
- IFormatProvider provider = culture;
-
- DateTimeFormatInfo dt = (DateTimeFormatInfo)provider;
- }
-}
-// The example displays the following output:
-// Unhandled Exception: System.InvalidCastException:
-// Unable to cast object of type //System.Globalization.CultureInfo// to
-// type //System.Globalization.DateTimeFormatInfo//.
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/ToString1.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/ToString1.cs
deleted file mode 100644
index 121c1585e4607..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/ToString1.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-public class StringEx
-{
- public static void Main()
- {
- object value = 12;
- // Cast throws an InvalidCastException exception.
- string s = (string)value;
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/ToString2.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/ToString2.cs
deleted file mode 100644
index 8482f7dcbe79a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/ToString2.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-using System;
-
-public class ToStringEx2
-{
- public static void Main()
- {
- object value = 12;
- string s = value.ToString();
- Console.WriteLine(s);
- }
-}
-// The example displays the following output:
-// 12
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/basetoderived1.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/basetoderived1.cs
deleted file mode 100644
index ff589249a2cb4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/basetoderived1.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-using System;
-
-public class Person
-{
- String _name;
-
- public String Name
- {
- get { return _name; }
- set { _name = value; }
- }
-}
-
-public class PersonWithId : Person
-{
- String _id;
-
- public string Id
- {
- get { return _id; }
- set { _id = value; }
- }
-}
-
-public class Example
-{
- public static void Main()
- {
- Person p = new Person();
- p.Name = "John";
- try {
- PersonWithId pid = (PersonWithId) p;
- Console.WriteLine("Conversion succeeded.");
- }
- catch (InvalidCastException) {
- Console.WriteLine("Conversion failed.");
- }
-
- PersonWithId pid1 = new PersonWithId();
- pid1.Name = "John";
- pid1.Id = "246";
- Person p1 = pid1;
- try {
- PersonWithId pid1a = (PersonWithId) p1;
- Console.WriteLine("Conversion succeeded.");
- }
- catch (InvalidCastException) {
- Console.WriteLine("Conversion failed.");
- }
-
- Person p2 = null;
- try {
- PersonWithId pid2 = (PersonWithId) p2;
- Console.WriteLine("Conversion succeeded.");
- }
- catch (InvalidCastException) {
- Console.WriteLine("Conversion failed.");
- }
- }
-}
-// The example displays the following output:
-// Conversion failed.
-// Conversion succeeded.
-// Conversion succeeded.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/iconvertible1.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/iconvertible1.cs
deleted file mode 100644
index 24d9bb1223a11..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/iconvertible1.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-using System;
-
-public class IConvertibleEx
-{
- public static void Main()
- {
- bool flag = true;
- try
- {
- IConvertible conv = flag;
- Char ch = conv.ToChar(null);
- Console.WriteLine("Conversion succeeded.");
- }
- catch (InvalidCastException)
- {
- Console.WriteLine("Cannot convert a Boolean to a Char.");
- }
-
- try
- {
- Char ch = Convert.ToChar(flag);
- Console.WriteLine("Conversion succeeded.");
- }
- catch (InvalidCastException)
- {
- Console.WriteLine("Cannot convert a Boolean to a Char.");
- }
- }
-}
-// The example displays the following output:
-// Cannot convert a Boolean to a Char.
-// Cannot convert a Boolean to a Char.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/project.csproj
deleted file mode 100644
index dfdef3fd2a730..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/csharp/project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/Interface1.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/Interface1.fs
deleted file mode 100644
index 68ac52ee72d82..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/Interface1.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module Interface1
-
-//
-open System
-open System.Globalization
-
-let culture = CultureInfo.InvariantCulture
-let provider: IFormatProvider = culture
-
-let dt = provider :?> DateTimeFormatInfo
-
-// The example displays the following output:
-// Unhandled Exception: System.InvalidCastException:
-// Unable to cast object of type //System.Globalization.CultureInfo// to
-// type //System.Globalization.DateTimeFormatInfo//.
-// at Example.main()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/ToString1.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/ToString1.fs
deleted file mode 100644
index a5ac598ee018f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/ToString1.fs
+++ /dev/null
@@ -1,7 +0,0 @@
-module ToString1
-
-//
-let value: obj = 12
-// Cast throws an InvalidCastException exception.
-let s = value :?> string
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/ToString2.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/ToString2.fs
deleted file mode 100644
index 07f9dddbe0e61..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/ToString2.fs
+++ /dev/null
@@ -1,9 +0,0 @@
-module ToString2
-
-//
-let value: obj = 12
-let s = value.ToString()
-printfn $"{s}"
-// The example displays the following output:
-// 12
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/basetoderived1.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/basetoderived1.fs
deleted file mode 100644
index c31c43898844c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/basetoderived1.fs
+++ /dev/null
@@ -1,35 +0,0 @@
-module basetoderived1
-
-//
-open System
-
-type Person() =
- member val Name = String.Empty with get, set
-
-type PersonWithId() =
- inherit Person()
- member val Id = String.Empty with get, set
-
-
-let p = Person()
-p.Name <- "John"
-try
- let pid = p :?> PersonWithId
- printfn "Conversion succeeded."
-with :? InvalidCastException ->
- printfn "Conversion failed."
-
-let pid1 = PersonWithId()
-pid1.Name <- "John"
-pid1.Id <- "246"
-let p1: Person = pid1
-try
- let pid1a = p1 :?> PersonWithId
- printfn "Conversion succeeded."
-with :? InvalidCastException ->
- printfn "Conversion failed."
-
-// The example displays the following output:
-// Conversion failed.
-// Conversion succeeded.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/iconvertible1.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/iconvertible1.fs
deleted file mode 100644
index eccfe171f3021..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/fsharp/iconvertible1.fs
+++ /dev/null
@@ -1,23 +0,0 @@
-module iconvertible1
-
-//
-open System
-
-let flag = true
-try
- let conv: IConvertible = flag
- let ch = conv.ToChar null
- printfn "Conversion succeeded."
-with :? InvalidCastException ->
- printfn "Cannot convert a Boolean to a Char."
-
-try
- let ch = Convert.ToChar flag
- printfn "Conversion succeeded."
-with :? InvalidCastException ->
- printfn "Cannot convert a Boolean to a Char."
-
-// The example displays the following output:
-// Cannot convert a Boolean to a Char.
-// Cannot convert a Boolean to a Char.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/Interface1.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/Interface1.vb
deleted file mode 100644
index 9632e6357da45..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/Interface1.vb
+++ /dev/null
@@ -1,20 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-
-Module Example3
- Public Sub Main()
- Dim culture As CultureInfo = CultureInfo.InvariantCulture
- Dim provider As IFormatProvider = culture
-
- Dim dt As DateTimeFormatInfo = CType(provider, DateTimeFormatInfo)
- End Sub
-End Module
-' The example displays the following output:
-' Unhandled Exception: System.InvalidCastException:
-' Unable to cast object of type 'System.Globalization.CultureInfo' to
-' type 'System.Globalization.DateTimeFormatInfo'.
-' at Example.Main()
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/basetoderived1.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/basetoderived1.vb
deleted file mode 100644
index 06596be0ffc4b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/basetoderived1.vb
+++ /dev/null
@@ -1,67 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Class Person
- Dim _name As String
-
- Public Property Name As String
- Get
- Return _name
- End Get
- Set
- _name = value
- End Set
- End Property
-End Class
-
-Public Class PersonWithID : Inherits Person
- Dim _id As String
-
- Public Property Id As String
- Get
- Return _id
- End Get
- Set
- _id = value
- End Set
- End Property
-End Class
-
-Module Example1
- Public Sub Main()
- Dim p As New Person()
- p.Name = "John"
- Try
- Dim pid As PersonWithID = CType(p, PersonWithID)
- Console.WriteLine("Conversion succeeded.")
- Catch e As InvalidCastException
- Console.WriteLine("Conversion failed.")
- End Try
-
- Dim pid1 As New PersonWithID()
- pid1.Name = "John"
- pid1.Id = "246"
- Dim p1 As Person = pid1
-
- Try
- Dim pid1a As PersonWithID = CType(p1, PersonWithID)
- Console.WriteLine("Conversion succeeded.")
- Catch e As InvalidCastException
- Console.WriteLine("Conversion failed.")
- End Try
-
- Dim p2 As Person = Nothing
- Try
- Dim pid2 As PersonWithID = CType(p2, PersonWithID)
- Console.WriteLine("Conversion succeeded.")
- Catch e As InvalidCastException
- Console.WriteLine("Conversion failed.")
- End Try
- End Sub
-End Module
-' The example displays the following output:
-' Conversion failed.
-' Conversion succeeded.
-' Conversion succeeded.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/iconvertible1.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/iconvertible1.vb
deleted file mode 100644
index 692bc73fa4f74..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidCastException/Overview/vb/iconvertible1.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example2
- Public Sub Main()
- Dim flag As Boolean = True
- Try
- Dim conv As IConvertible = flag
- Dim ch As Char = conv.ToChar(Nothing)
- Console.WriteLine("Conversion succeeded.")
- Catch e As InvalidCastException
- Console.WriteLine("Cannot convert a Boolean to a Char.")
- End Try
-
- Try
- Dim ch As Char = Convert.ToChar(flag)
- Console.WriteLine("Conversion succeeded.")
- Catch e As InvalidCastException
- Console.WriteLine("Cannot convert a Boolean to a Char.")
- End Try
- End Sub
-End Module
-' The example displays the following output:
-' Cannot convert a Boolean to a Char.
-' Cannot convert a Boolean to a Char.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable1.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable1.cs
deleted file mode 100644
index c642bbfa5b2b3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable1.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-using System;
-using System.Linq;
-
-public class Example
-{
- public static void Main()
- {
- int[] data = { 1, 2, 3, 4 };
- var average = data.Where(num => num > 4).Average();
- Console.Write("The average of numbers greater than 4 is {0}",
- average);
- }
-}
-// The example displays the following output:
-// Unhandled Exception: System.InvalidOperationException: Sequence contains no elements
-// at System.Linq.Enumerable.Average(IEnumerable`1 source)
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable2.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable2.cs
deleted file mode 100644
index e5b8dc2651eec..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable2.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-using System.Linq;
-
-public class EnumerableEx2
-{
- public static void Main()
- {
- int[] dbQueryResults = { 1, 2, 3, 4 };
- var moreThan4 = dbQueryResults.Where(num => num > 4);
-
- if (moreThan4.Any())
- Console.WriteLine($"Average value of numbers greater than 4: {moreThan4.Average()}:");
- else
- // handle empty collection
- Console.WriteLine("The dataset has no values greater than 4.");
- }
-}
-// The example displays the following output:
-// The dataset has no values greater than 4.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable3.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable3.cs
deleted file mode 100644
index 7cc71ea68197b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable3.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-using System.Linq;
-
-public class EnumerableEx3
-{
- public static void Main()
- {
- int[] dbQueryResults = { 1, 2, 3, 4 };
-
- var firstNum = dbQueryResults.First(n => n > 4);
-
- Console.WriteLine($"The first value greater than 4 is {firstNum}");
- }
-}
-// The example displays the following output:
-// Unhandled Exception: System.InvalidOperationException:
-// Sequence contains no matching element
-// at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable4.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable4.cs
deleted file mode 100644
index 52bc3a5ce7910..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable4.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-using System.Linq;
-
-public class EnumerableEx4
-{
- public static void Main()
- {
- int[] dbQueryResults = { 1, 2, 3, 4 };
-
- var firstNum = dbQueryResults.FirstOrDefault(n => n > 4);
-
- if (firstNum == 0)
- Console.WriteLine("No value is greater than 4.");
- else
- Console.WriteLine($"The first value greater than 4 is {firstNum}");
- }
-}
-// The example displays the following output:
-// No value is greater than 4.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable5.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable5.cs
deleted file mode 100644
index a91f0e481f0c0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable5.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-using System;
-using System.Linq;
-
-public class EnumerableEx5
-{
- public static void Main()
- {
- int[] dbQueryResults = { 1, 2, 3, 4 };
-
- var singleObject = dbQueryResults.Single(value => value > 4);
-
- // Display results.
- Console.WriteLine($"{singleObject} is the only value greater than 4");
- }
-}
-// The example displays the following output:
-// Unhandled Exception: System.InvalidOperationException:
-// Sequence contains no matching element
-// at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable6.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable6.cs
deleted file mode 100644
index 8d2c1be06340b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Enumerable6.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-using System;
-using System.Linq;
-
-public class EnumerableEx6
-{
- public static void Main()
- {
- int[] dbQueryResults = { 1, 2, 3, 4 };
-
- var singleObject = dbQueryResults.SingleOrDefault(value => value > 2);
-
- if (singleObject != 0)
- Console.WriteLine($"{singleObject} is the only value greater than 2");
- else
- // Handle an empty collection.
- Console.WriteLine("No value is greater than 2");
- }
-}
-// The example displays the following output:
-// Unhandled Exception: System.InvalidOperationException:
-// Sequence contains more than one matching element
-// at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Iterating1.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Iterating1.cs
deleted file mode 100644
index d13af74d0ecba..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Iterating1.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-public class IteratingEx1
-{
- public static void Main()
- {
- var numbers = new List() { 1, 2, 3, 4, 5 };
- foreach (var number in numbers)
- {
- int square = (int)Math.Pow(number, 2);
- Console.WriteLine($"{number}^{square}");
- Console.WriteLine($"Adding {square} to the collection...");
- Console.WriteLine();
- numbers.Add(square);
- }
- }
-}
-// The example displays the following output:
-// 1^1
-// Adding 1 to the collection...
-//
-//
-// Unhandled Exception: System.InvalidOperationException: Collection was modified;
-// enumeration operation may not execute.
-// at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
-// at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Iterating2.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Iterating2.cs
deleted file mode 100644
index b68b322ffa440..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Iterating2.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-public class IteratingEx2
-{
- public static void Main()
- {
- var numbers = new List() { 1, 2, 3, 4, 5 };
-
- int upperBound = numbers.Count - 1;
- for (int ctr = 0; ctr <= upperBound; ctr++)
- {
- int square = (int)Math.Pow(numbers[ctr], 2);
- Console.WriteLine($"{numbers[ctr]}^{square}");
- Console.WriteLine($"Adding {square} to the collection...");
- Console.WriteLine();
- numbers.Add(square);
- }
-
- Console.WriteLine("Elements now in the collection: ");
- foreach (var number in numbers)
- Console.Write("{0} ", number);
- }
-}
-// The example displays the following output:
-// 1^1
-// Adding 1 to the collection...
-//
-// 2^4
-// Adding 4 to the collection...
-//
-// 3^9
-// Adding 9 to the collection...
-//
-// 4^16
-// Adding 16 to the collection...
-//
-// 5^25
-// Adding 25 to the collection...
-//
-// Elements now in the collection:
-// 1 2 3 4 5 1 4 9 16 25
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Iterating3.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Iterating3.cs
deleted file mode 100644
index b7d8b78aca708..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Iterating3.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-public class IteratingEx3
-{
- public static void Main()
- {
- var numbers = new List() { 1, 2, 3, 4, 5 };
- var temp = new List();
-
- // Square each number and store it in a temporary collection.
- foreach (var number in numbers)
- {
- int square = (int)Math.Pow(number, 2);
- temp.Add(square);
- }
-
- // Combine the numbers into a single array.
- int[] combined = new int[numbers.Count + temp.Count];
- Array.Copy(numbers.ToArray(), 0, combined, 0, numbers.Count);
- Array.Copy(temp.ToArray(), 0, combined, numbers.Count, temp.Count);
-
- // Iterate the array.
- foreach (var value in combined)
- Console.Write("{0} ", value);
- }
-}
-// The example displays the following output:
-// 1 2 3 4 5 1 4 9 16 25
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort1.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort1.cs
deleted file mode 100644
index 39fedd45e0d9f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort1.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-public class Person1
-{
- public Person1(string fName, string lName)
- {
- FirstName = fName;
- LastName = lName;
- }
-
- public string FirstName { get; set; }
- public string LastName { get; set; }
-}
-
-public class ListSortEx1
-{
- public static void Main()
- {
- var people = new List();
-
- people.Add(new Person1("John", "Doe"));
- people.Add(new Person1("Jane", "Doe"));
- people.Sort();
- foreach (var person in people)
- Console.WriteLine($"{person.FirstName} {person.LastName}");
- }
-}
-// The example displays the following output:
-// Unhandled Exception: System.InvalidOperationException: Failed to compare two elements in the array. --->
-// System.ArgumentException: At least one object must implement IComparable.
-// at System.Collections.Comparer.Compare(Object a, Object b)
-// at System.Collections.Generic.ArraySortHelper`1.SwapIfGreater(T[] keys, IComparer`1 comparer, Int32 a, Int32 b)
-// at System.Collections.Generic.ArraySortHelper`1.DepthLimitedQuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer, Int32 depthLimit)
-// at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
-// --- End of inner exception stack trace ---
-// at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
-// at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer`1 comparer)
-// at System.Collections.Generic.List`1.Sort(Int32 index, Int32 count, IComparer`1 comparer)
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort2.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort2.cs
deleted file mode 100644
index 480f962e20f24..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort2.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-public class Person2 : IComparable
-{
- public Person2(String fName, String lName)
- {
- FirstName = fName;
- LastName = lName;
- }
-
- public String FirstName { get; set; }
- public String LastName { get; set; }
-
- public int CompareTo(Person other)
- {
- return String.Format("{0} {1}", LastName, FirstName).
- CompareTo(String.Format("{0} {1}", other.LastName, other.FirstName));
- }
-}
-
-public class ListSortEx2
-{
- public static void Main()
- {
- var people = new List();
-
- people.Add(new Person2("John", "Doe"));
- people.Add(new Person2("Jane", "Doe"));
- people.Sort();
- foreach (var person in people)
- Console.WriteLine($"{person.FirstName} {person.LastName}");
- }
-}
-// The example displays the following output:
-// Jane Doe
-// John Doe
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort3.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort3.cs
deleted file mode 100644
index 83855abcedb58..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort3.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-public class Person3
-{
- public Person3(String fName, String lName)
- {
- FirstName = fName;
- LastName = lName;
- }
-
- public String FirstName { get; set; }
- public String LastName { get; set; }
-}
-
-public class PersonComparer : IComparer
-{
- public int Compare(Person3 x, Person3 y)
- {
- return String.Format("{0} {1}", x.LastName, x.FirstName).
- CompareTo(String.Format("{0} {1}", y.LastName, y.FirstName));
- }
-}
-
-public class ListSortEx3
-{
- public static void Main()
- {
- var people = new List();
-
- people.Add(new Person3("John", "Doe"));
- people.Add(new Person3("Jane", "Doe"));
- people.Sort(new PersonComparer());
- foreach (var person in people)
- Console.WriteLine($"{person.FirstName} {person.LastName}");
- }
-}
-// The example displays the following output:
-// Jane Doe
-// John Doe
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort4.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort4.cs
deleted file mode 100644
index b570cc078ab5d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/List_Sort4.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-public class Person
-{
- public Person(String fName, String lName)
- {
- FirstName = fName;
- LastName = lName;
- }
-
- public String FirstName { get; set; }
- public String LastName { get; set; }
-}
-
-public class ListSortEx4
-{
- public static void Main()
- {
- var people = new List();
-
- people.Add(new Person("John", "Doe"));
- people.Add(new Person("Jane", "Doe"));
- people.Sort(PersonComparison);
- foreach (var person in people)
- Console.WriteLine($"{person.FirstName} {person.LastName}");
- }
-
- public static int PersonComparison(Person x, Person y)
- {
- return String.Format("{0} {1}", x.LastName, x.FirstName).
- CompareTo(String.Format("{0} {1}", y.LastName, y.FirstName));
- }
-}
-// The example displays the following output:
-// Jane Doe
-// John Doe
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Nullable1.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Nullable1.cs
deleted file mode 100644
index 37eaffb7d5c6f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Nullable1.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-using System;
-using System.Linq;
-
-public class NullableEx1
-{
- public static void Main()
- {
- var queryResult = new int?[] { 1, 2, null, 4 };
- var map = queryResult.Select(nullableInt => (int)nullableInt);
-
- // Display list.
- foreach (var num in map)
- Console.Write("{0} ", num);
- Console.WriteLine();
- }
-}
-// The example displays the following output:
-// 1 2
-// Unhandled Exception: System.InvalidOperationException: Nullable object must have a value.
-// at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
-// at Example.b__0(Nullable`1 nullableInt)
-// at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Nullable2.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Nullable2.cs
deleted file mode 100644
index d8461cffa1665..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/Nullable2.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-using System;
-using System.Linq;
-
-public class NullableEx2
-{
- public static void Main()
- {
- var queryResult = new int?[] { 1, 2, null, 4 };
- var numbers = queryResult.Select(nullableInt => (int)nullableInt.GetValueOrDefault());
-
- // Display list using Nullable.HasValue.
- foreach (var number in numbers)
- Console.Write("{0} ", number);
- Console.WriteLine();
-
- numbers = queryResult.Select(nullableInt => (int) (nullableInt.HasValue ? nullableInt : -1));
- // Display list using Nullable.GetValueOrDefault.
- foreach (var number in numbers)
- Console.Write("{0} ", number);
- Console.WriteLine();
- }
-}
-// The example displays the following output:
-// 1 2 0 4
-// 1 2 -1 4
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/project.csproj
deleted file mode 100644
index dfdef3fd2a730..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/Other/project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/App1.xaml b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/App1.xaml
deleted file mode 100644
index d2061d8d2df28..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/App1.xaml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/App1.xaml.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/App1.xaml.cs
deleted file mode 100644
index d0f308dcda2d1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/App1.xaml.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace WPFCrossThreadCS
-{
- ///
- /// Interaction logic for App.xaml
- ///
- public partial class App : Application
- {
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/MainWindow.xaml b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/MainWindow.xaml
deleted file mode 100644
index e1f14215b8802..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/MainWindow.xaml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/MainWindow.xaml.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/MainWindow.xaml.cs
deleted file mode 100644
index 6c5a348ce69b9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/MainWindow.xaml.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using System;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace WPFCrossThreadCS
-{
- ///
- /// Interaction logic for MainWindow.xaml
- ///
- public partial class MainWindow : Window
- {
- public static void Main() { }
-
- public MainWindow()
- {
- InitializeComponent();
- }
-
- //
- private async void threadExampleBtn_Click(object sender, RoutedEventArgs e)
- {
- textBox1.Text = String.Empty;
-
- textBox1.Text = "Simulating work on UI thread.\n";
- DoSomeWork(20);
- textBox1.Text += "Work completed...\n";
-
- textBox1.Text += "Simulating work on non-UI thread.\n";
- await Task.Run(() => DoSomeWork(1000));
- textBox1.Text += "Work completed...\n";
- }
-
- private async void DoSomeWork(int milliseconds)
- {
- // Simulate work.
- await Task.Delay(milliseconds);
-
- // Report completion.
- var msg = String.Format("Some work completed in {0} ms.\n", milliseconds);
- textBox1.Text += msg;
- }
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/WPFCrossThreadCS.csproj b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/WPFCrossThreadCS.csproj
deleted file mode 100644
index f85d584328743..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/WPFCrossThreadCS.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- WinExe
- net10.0-windows
- True
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/app.config b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/app.config
deleted file mode 100644
index 3e0e37cfc8c7a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF1/app.config
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/App2.xaml b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/App2.xaml
deleted file mode 100644
index d2061d8d2df28..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/App2.xaml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/App2.xaml.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/App2.xaml.cs
deleted file mode 100644
index d0f308dcda2d1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/App2.xaml.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace WPFCrossThreadCS
-{
- ///
- /// Interaction logic for App.xaml
- ///
- public partial class App : Application
- {
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/MainWindow1.xaml b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/MainWindow1.xaml
deleted file mode 100644
index e1f14215b8802..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/MainWindow1.xaml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/MainWindowDispatcher.xaml.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/MainWindowDispatcher.xaml.cs
deleted file mode 100644
index 4548befd89da1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/MainWindowDispatcher.xaml.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace WPFCrossThreadCS
-{
- ///
- /// Interaction logic for MainWindow.xaml
- ///
- public partial class MainWindow : Window
- {
- public static void Main() { }
-
- public MainWindow()
- {
- InitializeComponent();
- }
-
- private async void threadExampleBtn_Click(object sender, RoutedEventArgs e)
- {
- textBox1.Text = String.Empty;
-
- textBox1.Text = "Simulating work on UI thread.\n";
- DoSomeWork(20);
- textBox1.Text += "Work completed...\n";
-
- textBox1.Text += "Simulating work on non-UI thread.\n";
- await Task.Run(() => DoSomeWork(1000));
- textBox1.Text += "Work completed...\n";
- }
-
- //
- private async void DoSomeWork(int milliseconds)
- {
- // Simulate work.
- await Task.Delay(milliseconds);
-
- // Report completion.
- bool uiAccess = textBox1.Dispatcher.CheckAccess();
- String msg = String.Format("Some work completed in {0} ms. on {1}UI thread\n",
- milliseconds, uiAccess ? String.Empty : "non-");
- if (uiAccess)
- textBox1.Text += msg;
- else
- textBox1.Dispatcher.Invoke(() => { textBox1.Text += msg; });
- }
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/WPFCrossThreadDispatcherCS.csproj b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/WPFCrossThreadDispatcherCS.csproj
deleted file mode 100644
index f85d584328743..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WPF2/WPFCrossThreadDispatcherCS.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- WinExe
- net10.0-windows
- True
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form1.Designer.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form1.Designer.cs
deleted file mode 100644
index ee0efc52c06bf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form1.Designer.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-namespace WFCrossThreadCS
-{
- partial class Form1
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.threadExampleBtn = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(28, 36);
- this.textBox1.Multiline = true;
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(459, 186);
- this.textBox1.TabIndex = 0;
- //
- // threadExampleBtn
- //
- this.threadExampleBtn.Location = new System.Drawing.Point(249, 256);
- this.threadExampleBtn.Name = "threadExampleBtn";
- this.threadExampleBtn.Size = new System.Drawing.Size(75, 23);
- this.threadExampleBtn.TabIndex = 2;
- this.threadExampleBtn.Text = "button2";
- this.threadExampleBtn.UseVisualStyleBackColor = true;
- this.threadExampleBtn.Click += new System.EventHandler(this.threadExampleBtn_Click);
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(541, 371);
- this.Controls.Add(this.threadExampleBtn);
- this.Controls.Add(this.textBox1);
- this.Name = "Form1";
- this.Text = "Form1";
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.TextBox textBox1;
- private System.Windows.Forms.Button threadExampleBtn;
- }
-}
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form1.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form1.cs
deleted file mode 100644
index b5370a63e9708..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form1.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace WFCrossThreadCS
-{
- public partial class Form1 : Form
- {
- public static void Main() { }
-
- public Form1()
- {
- InitializeComponent();
- }
-
- //
- List lines = new List();
-
- private async void threadExampleBtn_Click(object sender, EventArgs e)
- {
- textBox1.Text = String.Empty;
- lines.Clear();
-
- lines.Add("Simulating work on UI thread.");
- textBox1.Lines = lines.ToArray();
- DoSomeWork(20);
-
- lines.Add("Simulating work on non-UI thread.");
- textBox1.Lines = lines.ToArray();
- await Task.Run(() => DoSomeWork(1000));
-
- lines.Add("ThreadsExampleBtn_Click completes. ");
- textBox1.Lines = lines.ToArray();
- }
-
- private async void DoSomeWork(int milliseconds)
- {
- // simulate work
- await Task.Delay(milliseconds);
-
- // report completion
- lines.Add(String.Format("Some work completed in {0} ms on UI thread.", milliseconds));
- textBox1.Lines = lines.ToArray();
- }
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form1.resx b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form1.resx
deleted file mode 100644
index 1af7de150c99c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form1.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form11.Designer.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form11.Designer.cs
deleted file mode 100644
index 8639717eb131a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form11.Designer.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-namespace WFCrossThreadSolutionCS
-{
- partial class Form1
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.threadExampleBtn = new System.Windows.Forms.Button();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.SuspendLayout();
- //
- // threadExampleBtn
- //
- this.threadExampleBtn.Location = new System.Drawing.Point(100, 206);
- this.threadExampleBtn.Name = "threadExampleBtn";
- this.threadExampleBtn.Size = new System.Drawing.Size(75, 23);
- this.threadExampleBtn.TabIndex = 0;
- this.threadExampleBtn.Text = "button1";
- this.threadExampleBtn.UseVisualStyleBackColor = true;
- this.threadExampleBtn.Click += new System.EventHandler(this.threadExampleBtn_Click);
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(12, 43);
- this.textBox1.Multiline = true;
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(240, 137);
- this.textBox1.TabIndex = 1;
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(284, 261);
- this.Controls.Add(this.textBox1);
- this.Controls.Add(this.threadExampleBtn);
- this.Name = "Form1";
- this.Text = "Form1";
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.Button threadExampleBtn;
- private System.Windows.Forms.TextBox textBox1;
- }
-}
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form11.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form11.cs
deleted file mode 100644
index f5f22463e37ae..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form11.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace WFCrossThreadSolutionCS
-{
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
-
- List lines = new List();
-
- private async void threadExampleBtn_Click(object sender, EventArgs e)
- {
-
- textBox1.Text = String.Empty;
- lines.Clear();
-
- lines.Add("Simulating work on UI thread.");
- textBox1.Lines = lines.ToArray();
- DoSomeWork(20);
-
- lines.Add("Simulating work on non-UI thread.");
- textBox1.Lines = lines.ToArray();
- await Task.Run(() => DoSomeWork(1000));
-
- lines.Add("ThreadsExampleBtn_Click completes. ");
- textBox1.Lines = lines.ToArray();
- }
-
- //
- private async void DoSomeWork(int milliseconds)
- {
- // simulate work
- await Task.Delay(milliseconds);
-
- // Report completion.
- bool uiMarshal = textBox1.InvokeRequired;
- String msg = String.Format("Some work completed in {0} ms. on {1}UI thread\n",
- milliseconds, uiMarshal ? String.Empty : "non-");
- lines.Add(msg);
-
- if (uiMarshal) {
- textBox1.Invoke(new Action(() => { textBox1.Lines = lines.ToArray(); }));
- }
- else {
- textBox1.Lines = lines.ToArray();
- }
- }
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form11.resx b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form11.resx
deleted file mode 100644
index 1af7de150c99c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Form11.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Program.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Program.cs
deleted file mode 100644
index a2621a03055e1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Program.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace WFCrossThreadCS
-{
- static class Program
- {
- ///
- /// The main entry point for the application.
- ///
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form1());
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Program1.cs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Program1.cs
deleted file mode 100644
index 601298d4bc502..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/Program1.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace WFCrossThreadSolutionCS
-{
- static class Program
- {
- ///
- /// The main entry point for the application.
- ///
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form1());
- }
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/WFCrossThreadCS.csproj b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/WFCrossThreadCS.csproj
deleted file mode 100644
index 5063b1422fae0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/csharp/WinForms/WFCrossThreadCS.csproj
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
- WinExe
- net10.0-windows
- True
- WFCrossThreadCS.Form1
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable1.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable1.fs
deleted file mode 100644
index e1816262e3429..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable1.fs
+++ /dev/null
@@ -1,15 +0,0 @@
-module Enumerable1
-
-//
-open System
-open System.Linq
-
-let data = [| 1; 2; 3; 4 |]
-let average =
- data.Where(fun num -> num > 4).Average();
-printfn $"The average of numbers greater than 4 is {average}"
-// The example displays the following output:
-// Unhandled Exception: System.InvalidOperationException: Sequence contains no elements
-// at System.Linq.Enumerable.Average(IEnumerable`1 source)
-// at .main()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable2.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable2.fs
deleted file mode 100644
index 2d1aafb7a9c09..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable2.fs
+++ /dev/null
@@ -1,19 +0,0 @@
-module Enumerable2
-
-//
-open System
-open System.Linq
-
-let dbQueryResults = [| 1; 2; 3; 4 |]
-let moreThan4 =
- dbQueryResults.Where(fun num -> num > 4)
-
-if moreThan4.Any() then
- printfn $"Average value of numbers greater than 4: {moreThan4.Average()}:"
-else
- // handle empty collection
- printfn "The dataset has no values greater than 4."
-
-// The example displays the following output:
-// The dataset has no values greater than 4.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable3.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable3.fs
deleted file mode 100644
index d1a99e18b0884..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable3.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module Enumerable3
-
-//
-open System
-open System.Linq
-
-let dbQueryResults = [| 1; 2; 3; 4 |]
-
-let firstNum = dbQueryResults.First(fun n -> n > 4)
-
-printfn $"The first value greater than 4 is {firstNum}"
-
-// The example displays the following output:
-// Unhandled Exception: System.InvalidOperationException:
-// Sequence contains no matching element
-// at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
-// at .main()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable4.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable4.fs
deleted file mode 100644
index 6a6b2dc5a97f8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable4.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module Enumerable4
-
-//
-open System
-open System.Linq
-
-let dbQueryResults = [| 1; 2; 3; 4 |]
-
-let firstNum = dbQueryResults.FirstOrDefault(fun n -> n > 4)
-
-if firstNum = 0 then
- printfn "No value is greater than 4."
-else
- printfn $"The first value greater than 4 is {firstNum}"
-
-// The example displays the following output:
-// No value is greater than 4.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable5.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable5.fs
deleted file mode 100644
index 59779225c81ab..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable5.fs
+++ /dev/null
@@ -1,19 +0,0 @@
-module Enumerable5
-
-//
-open System
-open System.Linq
-
-let dbQueryResults = [| 1; 2; 3; 4 |]
-
-let singleObject = dbQueryResults.Single(fun value -> value > 4)
-
-// Display results.
-printfn $"{singleObject} is the only value greater than 4"
-
-// The example displays the following output:
-// Unhandled Exception: System.InvalidOperationException:
-// Sequence contains no matching element
-// at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
-// at .main()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable6.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable6.fs
deleted file mode 100644
index 2e8b3f1244f02..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable6.fs
+++ /dev/null
@@ -1,22 +0,0 @@
-module Enumerable6
-
-//
-open System
-open System.Linq
-
-let dbQueryResults = [| 1; 2; 3; 4 |]
-
-let singleObject = dbQueryResults.SingleOrDefault(fun value -> value > 2)
-
-if singleObject <> 0 then
- printfn $"{singleObject} is the only value greater than 2"
-else
- // Handle an empty collection.
- printfn "No value is greater than 2"
-
-// The example displays the following output:
-// Unhandled Exception: System.InvalidOperationException:
-// Sequence contains more than one matching element
-// at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
-// at .main()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Iterating1.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Iterating1.fs
deleted file mode 100644
index 26da82184be9c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Iterating1.fs
+++ /dev/null
@@ -1,23 +0,0 @@
-module Iterating1
-
-//
-open System
-
-let numbers = ResizeArray [| 1; 2; 3; 4; 5 |]
-for number in numbers do
- let square = Math.Pow(number, 2) |> int
- printfn $"{number}^{square}"
- printfn $"Adding {square} to the collection...\n"
- numbers.Add square
-
-// The example displays the following output:
-// 1^1
-// Adding 1 to the collection...
-//
-//
-// Unhandled Exception: System.InvalidOperationException: Collection was modified
-// enumeration operation may not execute.
-// at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
-// at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
-// at .main()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Iterating2.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Iterating2.fs
deleted file mode 100644
index 0a066c5c81227..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Iterating2.fs
+++ /dev/null
@@ -1,37 +0,0 @@
-module Iterating2
-
-//
-open System
-open System.Collections.Generic
-
-let numbers = ResizeArray [| 1; 2; 3; 4; 5 |]
-
-let upperBound = numbers.Count - 1
-for i = 0 to upperBound do
- let square = Math.Pow(numbers[i], 2) |> int
- printfn $"{numbers[i]}^{square}"
- printfn $"Adding {square} to the collection...\n"
- numbers.Add square
-
-printfn "Elements now in the collection: "
-for number in numbers do
- printf $"{number} "
-// The example displays the following output:
-// 1^1
-// Adding 1 to the collection...
-//
-// 2^4
-// Adding 4 to the collection...
-//
-// 3^9
-// Adding 9 to the collection...
-//
-// 4^16
-// Adding 16 to the collection...
-//
-// 5^25
-// Adding 25 to the collection...
-//
-// Elements now in the collection:
-// 1 2 3 4 5 1 4 9 16 25
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Iterating3.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Iterating3.fs
deleted file mode 100644
index aa58eb48f1929..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Iterating3.fs
+++ /dev/null
@@ -1,25 +0,0 @@
-module Iterating3
-
-//
-open System
-open System.Collections.Generic
-
-let numbers = ResizeArray [| 1; 2; 3; 4; 5 |]
-let temp = ResizeArray()
-
-// Square each number and store it in a temporary collection.
-for number in numbers do
- let square = Math.Pow(number, 2) |> int
- temp.Add square
-
-// Combine the numbers into a single array.
-let combined = Array.zeroCreate (numbers.Count + temp.Count)
-Array.Copy(numbers.ToArray(), 0, combined, 0, numbers.Count)
-Array.Copy(temp.ToArray(), 0, combined, numbers.Count, temp.Count)
-
-// Iterate the array.
-for value in combined do
- printf $"{value} "
-// The example displays the following output:
-// 1 2 3 4 5 1 4 9 16 25
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort1.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort1.fs
deleted file mode 100644
index c963a34db548b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort1.fs
+++ /dev/null
@@ -1,27 +0,0 @@
-module List_Sort1
-
-//
-type Person(firstName: string, lastName: string) =
- member val FirstName = firstName with get, set
- member val LastName = lastName with get, set
-
-let people = ResizeArray()
-
-people.Add(Person("John", "Doe"))
-people.Add(Person("Jane", "Doe"))
-people.Sort()
-for person in people do
- printfn $"{person.FirstName} {person.LastName}"
-// The example displays the following output:
-// Unhandled Exception: System.InvalidOperationException: Failed to compare two elements in the array. --->
-// System.ArgumentException: At least one object must implement IComparable.
-// at System.Collections.Comparer.Compare(Object a, Object b)
-// at System.Collections.Generic.ArraySortHelper`1.SwapIfGreater(T[] keys, IComparer`1 comparer, Int32 a, Int32 b)
-// at System.Collections.Generic.ArraySortHelper`1.DepthLimitedQuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer, Int32 depthLimit)
-// at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
-// --- End of inner exception stack trace ---
-// at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
-// at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer`1 comparer)
-// at System.Collections.Generic.List`1.Sort(Int32 index, Int32 count, IComparer`1 comparer)
-// at .main()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort2.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort2.fs
deleted file mode 100644
index 84df643b76e54..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort2.fs
+++ /dev/null
@@ -1,24 +0,0 @@
-module List_Sort2
-
-//
-open System
-
-type Person(firstName: string, lastName: string) =
- member val FirstName = firstName with get, set
- member val LastName = lastName with get, set
-
- interface IComparable with
- member this.CompareTo(other) =
- compare $"{this.LastName} {this.FirstName}" $"{other.LastName} {other.FirstName}"
-
-let people = ResizeArray()
-
-people.Add(new Person("John", "Doe"))
-people.Add(new Person("Jane", "Doe"))
-people.Sort()
-for person in people do
- printfn $"{person.FirstName} {person.LastName}"
-// The example displays the following output:
-// Jane Doe
-// John Doe
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort3.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort3.fs
deleted file mode 100644
index cba8d3890269b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort3.fs
+++ /dev/null
@@ -1,26 +0,0 @@
-module List_Sort3
-
-//
-open System
-open System.Collections.Generic
-
-type Person(firstName, lastName) =
- member val FirstName = firstName with get, set
- member val LastName = lastName with get, set
-
-type PersonComparer() =
- interface IComparer with
- member _.Compare(x: Person, y: Person) =
- $"{x.LastName} {x.FirstName}".CompareTo $"{y.LastName} {y.FirstName}"
-
-let people = ResizeArray()
-
-people.Add(Person("John", "Doe"))
-people.Add(Person("Jane", "Doe"))
-people.Sort(PersonComparer())
-for person in people do
- printfn $"{person.FirstName} {person.LastName}"
-// The example displays the following output:
-// Jane Doe
-// John Doe
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort4.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort4.fs
deleted file mode 100644
index fcc7113db7f6d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/List_Sort4.fs
+++ /dev/null
@@ -1,25 +0,0 @@
-module List_Sort4
-
-//
-open System
-open System.Collections.Generic
-
-type Person(firstName, lastName) =
- member val FirstName = firstName with get, set
- member val LastName = lastName with get, set
-
-let personComparison (x: Person) (y: Person) =
- $"{x.LastName} {x.FirstName}".CompareTo $"{y.LastName} {y.FirstName}"
-
-let people = ResizeArray()
-
-people.Add(Person("John", "Doe"))
-people.Add(Person("Jane", "Doe"))
-people.Sort personComparison
-for person in people do
- printfn $"{person.FirstName} {person.LastName}"
-
-// The example displays the following output:
-// Jane Doe
-// John Doe
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Nullable1.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Nullable1.fs
deleted file mode 100644
index 0703a1f749936..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Nullable1.fs
+++ /dev/null
@@ -1,21 +0,0 @@
-module Nullable1
-
-//
-open System
-open System.Linq
-
-let queryResult = [| Nullable 1; Nullable 2; Nullable(); Nullable 4 |]
-let map = queryResult.Select(fun nullableInt -> nullableInt.Value)
-
-// Display list.
-for num in map do
- printf $"{num} "
-printfn ""
-// The example displays the following output:
-// 1 2
-// Unhandled Exception: System.InvalidOperationException: Nullable object must have a value.
-// at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
-// at Example.b__0(Nullable`1 nullableInt)
-// at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
-// at .main()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Nullable2.fs b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Nullable2.fs
deleted file mode 100644
index 687b360631dcd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Nullable2.fs
+++ /dev/null
@@ -1,23 +0,0 @@
-module Nullable2
-
-//
-open System
-open System.Linq
-
-let queryResult = [| Nullable 1; Nullable 2; Nullable(); Nullable 4 |]
-let numbers = queryResult.Select(fun nullableInt -> nullableInt.GetValueOrDefault())
-
-// Display list using Nullable.HasValue.
-for number in numbers do
- printf $"{number} "
-printfn ""
-
-let numbers2 = queryResult.Select(fun nullableInt -> if nullableInt.HasValue then nullableInt.Value else -1)
-// Display list using Nullable.GetValueOrDefault.
-for number in numbers2 do
- printf $"{number} "
-printfn ""
-// The example displays the following output:
-// 1 2 0 4
-// 1 2 -1 4
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable1.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable1.vb
deleted file mode 100644
index 0a2e83e32ffe0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable1.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Linq
-
-Module Example
- Public Sub Main()
- Dim data() As Integer = { 1, 2, 3, 4 }
- Dim average = data.Where(Function(num) num > 4).Average()
- Console.Write("The average of numbers greater than 4 is {0}",
- average)
- End Sub
-End Module
-' The example displays the following output:
-' Unhandled Exception: System.InvalidOperationException: Sequence contains no elements
-' at System.Linq.Enumerable.Average(IEnumerable`1 source)
-' at Example.Main()
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable2.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable2.vb
deleted file mode 100644
index a7321693d72ec..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable2.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Linq
-
-Module Example1
- Public Sub Main()
- Dim dbQueryResults() As Integer = {1, 2, 3, 4}
- Dim moreThan4 = dbQueryResults.Where(Function(num) num > 4)
-
- If moreThan4.Any() Then
- Console.WriteLine("Average value of numbers greater than 4: {0}:",
- moreThan4.Average())
- Else
- ' Handle empty collection.
- Console.WriteLine("The dataset has no values greater than 4.")
- End If
- End Sub
-End Module
-' The example displays the following output:
-' The dataset has no values greater than 4.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable3.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable3.vb
deleted file mode 100644
index 56ce9767fb6bd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable3.vb
+++ /dev/null
@@ -1,22 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Linq
-
-Module Example2
- Public Sub Main()
- Dim dbQueryResults() As Integer = {1, 2, 3, 4}
-
- Dim firstNum = dbQueryResults.First(Function(n) n > 4)
-
- Console.WriteLine("The first value greater than 4 is {0}",
- firstNum)
- End Sub
-End Module
-' The example displays the following output:
-' Unhandled Exception: System.InvalidOperationException:
-' Sequence contains no matching element
-' at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
-' at Example.Main()
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable4.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable4.vb
deleted file mode 100644
index 4210a9f94b360..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable4.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Linq
-
-Module Example3
- Public Sub Main()
- Dim dbQueryResults() As Integer = {1, 2, 3, 4}
-
- Dim firstNum = dbQueryResults.FirstOrDefault(Function(n) n > 4)
-
- If firstNum = 0 Then
- Console.WriteLine("No value is greater than 4.")
- Else
- Console.WriteLine("The first value greater than 4 is {0}",
- firstNum)
- End If
- End Sub
-End Module
-' The example displays the following output:
-' No value is greater than 4.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable5.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable5.vb
deleted file mode 100644
index 95dd8c92560ad..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable5.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Linq
-
-Module Example4
- Public Sub Main()
- Dim dbQueryResults() As Integer = {1, 2, 3, 4}
-
- Dim singleObject = dbQueryResults.Single(Function(value) value > 4)
-
- ' Display results.
- Console.WriteLine("{0} is the only value greater than 4",
- singleObject)
- End Sub
-End Module
-' The example displays the following output:
-' Unhandled Exception: System.InvalidOperationException:
-' Sequence contains no matching element
-' at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
-' at Example.Main()
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable6.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable6.vb
deleted file mode 100644
index ec5792b06db3a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Enumerable6.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Linq
-
-Module Example5
- Public Sub Main()
- Dim dbQueryResults() As Integer = {1, 2, 3, 4}
-
- Dim singleObject = dbQueryResults.SingleOrDefault(Function(value) value > 2)
-
- If singleObject <> 0 Then
- Console.WriteLine("{0} is the only value greater than 2",
- singleObject)
- Else
- ' Handle an empty collection.
- Console.WriteLine("No value is greater than 2")
- End If
- End Sub
-End Module
-' The example displays the following output:
-' Unhandled Exception: System.InvalidOperationException:
-' Sequence contains more than one matching element
-' at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
-' at Example.Main()
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Iterating1.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Iterating1.vb
deleted file mode 100644
index 7011d5a65aed0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Iterating1.vb
+++ /dev/null
@@ -1,30 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-
-Module Example6
- Public Sub Main()
- Dim numbers As New List(Of Integer)({1, 2, 3, 4, 5})
- For Each number In numbers
- Dim square As Integer = CInt(Math.Pow(number, 2))
- Console.WriteLine("{0}^{1}", number, square)
- Console.WriteLine("Adding {0} to the collection..." + vbCrLf,
- square)
- numbers.Add(square)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 1^1
-' Adding 1 to the collection...
-'
-'
-' Unhandled Exception: System.InvalidOperationException: Collection was modified;
-' enumeration operation may not execute.
-' at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
-' at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
-' at Example.Main()
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Iterating2.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Iterating2.vb
deleted file mode 100644
index e57b706ce55fb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Iterating2.vb
+++ /dev/null
@@ -1,44 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-
-Module Example7
- Public Sub Main()
- Dim numbers As New List(Of Integer)({1, 2, 3, 4, 5})
- Dim upperBound = numbers.Count - 1
-
- For ctr As Integer = 0 To upperBound
- Dim square As Integer = CInt(Math.Pow(numbers(ctr), 2))
- Console.WriteLine("{0}^{1}", numbers(ctr), square)
- Console.WriteLine("Adding {0} to the collection..." + vbCrLf,
- square)
- numbers.Add(square)
- Next
-
- Console.WriteLine("Elements now in the collection: ")
- For Each number In numbers
- Console.Write("{0} ", number)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 1^1
-' Adding 1 to the collection...
-'
-' 2^4
-' Adding 4 to the collection...
-'
-' 3^9
-' Adding 9 to the collection...
-'
-' 4^16
-' Adding 16 to the collection...
-'
-' 5^25
-' Adding 25 to the collection...
-'
-' Elements now in the collection:
-' 1 2 3 4 5 1 4 9 16 25
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Iterating3.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Iterating3.vb
deleted file mode 100644
index 747366651358f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Iterating3.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-
-Module Example8
- Public Sub Main()
- Dim numbers As New List(Of Integer)({1, 2, 3, 4, 5})
- Dim temp As New List(Of Integer)()
-
- ' Square each number and store it in a temporary collection.
- For Each number In numbers
- Dim square As Integer = CInt(Math.Pow(number, 2))
- temp.Add(square)
- Next
-
- ' Combine the numbers into a single array.
- Dim combined(numbers.Count + temp.Count - 1) As Integer
- Array.Copy(numbers.ToArray(), 0, combined, 0, numbers.Count)
- Array.Copy(temp.ToArray(), 0, combined, numbers.Count, temp.Count)
-
- ' Iterate the array.
- For Each value In combined
- Console.Write("{0} ", value)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 1 2 3 4 5 1 4 9 16 25
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort1.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort1.vb
deleted file mode 100644
index dbb0df2779163..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort1.vb
+++ /dev/null
@@ -1,43 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-
-Public Class Person9
- Public Sub New(fName As String, lName As String)
- FirstName = fName
- LastName = lName
- End Sub
-
- Public Property FirstName As String
- Public Property LastName As String
-End Class
-
-Module Example9
- Public Sub Main()
- Dim people As New List(Of Person9)()
-
- people.Add(New Person9("John", "Doe"))
- people.Add(New Person9("Jane", "Doe"))
- people.Sort()
- For Each person In people
- Console.WriteLine("{0} {1}", person.FirstName, person.LastName)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Unhandled Exception: System.InvalidOperationException: Failed to compare two elements in the array. --->
-' System.ArgumentException: At least one object must implement IComparable.
-' at System.Collections.Comparer.Compare(Object a, Object b)
-' at System.Collections.Generic.ArraySortHelper`1.SwapIfGreater(T[] keys, IComparer`1 comparer, Int32 a, Int32 b)
-' at System.Collections.Generic.ArraySortHelper`1.DepthLimitedQuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer, Int32 depthLimit)
-' at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
-' --- End of inner exception stack trace ---
-' at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
-' at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer`1 comparer)
-' at System.Collections.Generic.List`1.Sort(Int32 index, Int32 count, IComparer`1 comparer)
-' at Example.Main()
-'
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort2.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort2.vb
deleted file mode 100644
index a5f67a5ee67f0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort2.vb
+++ /dev/null
@@ -1,38 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-
-Public Class Person : Implements IComparable(Of Person)
- Public Sub New(fName As String, lName As String)
- FirstName = fName
- LastName = lName
- End Sub
-
- Public Property FirstName As String
- Public Property LastName As String
-
- Public Function CompareTo(other As Person) As Integer _
- Implements IComparable(Of Person).CompareTo
- Return String.Format("{0} {1}", LastName, FirstName).
- CompareTo(String.Format("{0} {1}", other.LastName, other.FirstName))
- End Function
-End Class
-
-Module Example10
- Public Sub Main()
- Dim people As New List(Of Person)()
-
- people.Add(New Person("John", "Doe"))
- people.Add(New Person("Jane", "Doe"))
- people.Sort()
- For Each person In people
- Console.WriteLine("{0} {1}", person.FirstName, person.LastName)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Jane Doe
-' John Doe
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort3.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort3.vb
deleted file mode 100644
index 1ea32e88e4113..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort3.vb
+++ /dev/null
@@ -1,41 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-
-Public Class Person11
- Public Sub New(fName As String, lName As String)
- FirstName = fName
- LastName = lName
- End Sub
-
- Public Property FirstName As String
- Public Property LastName As String
-End Class
-
-Public Class PersonComparer : Implements IComparer(Of Person11)
- Public Function Compare(x As Person11, y As Person11) As Integer _
- Implements IComparer(Of Person11).Compare
- Return String.Format("{0} {1}", x.LastName, x.FirstName).
- CompareTo(String.Format("{0} {1}", y.LastName, y.FirstName))
- End Function
-End Class
-
-Module Example11
- Public Sub Main()
- Dim people As New List(Of Person11)()
-
- people.Add(New Person11("John", "Doe"))
- people.Add(New Person11("Jane", "Doe"))
- people.Sort(New PersonComparer())
- For Each person In people
- Console.WriteLine("{0} {1}", person.FirstName, person.LastName)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Jane Doe
-' John Doe
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort4.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort4.vb
deleted file mode 100644
index 8181874eb39fd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/List_Sort4.vb
+++ /dev/null
@@ -1,37 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-
-Public Class Person12
- Public Sub New(fName As String, lName As String)
- FirstName = fName
- LastName = lName
- End Sub
-
- Public Property FirstName As String
- Public Property LastName As String
-End Class
-
-Module Example12
- Public Sub Main()
- Dim people As New List(Of Person12)()
-
- people.Add(New Person12("John", "Doe"))
- people.Add(New Person12("Jane", "Doe"))
- people.Sort(AddressOf PersonComparison)
- For Each person In people
- Console.WriteLine("{0} {1}", person.FirstName, person.LastName)
- Next
- End Sub
-
- Public Function PersonComparison(x As Person12, y As Person12) As Integer
- Return String.Format("{0} {1}", x.LastName, x.FirstName).
- CompareTo(String.Format("{0} {1}", y.LastName, y.FirstName))
- End Function
-End Module
-' The example displays the following output:
-' Jane Doe
-' John Doe
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Nullable1.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Nullable1.vb
deleted file mode 100644
index 1a9cfd065090f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Nullable1.vb
+++ /dev/null
@@ -1,26 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Linq
-
-Module Example13
- Public Sub Main()
- Dim queryResult = New Integer?() {1, 2, Nothing, 4}
- Dim map = queryResult.Select(Function(nullableInt) CInt(nullableInt))
-
- ' Display list.
- For Each num In map
- Console.Write("{0} ", num)
- Next
- Console.WriteLine()
- End Sub
-End Module
-' The example displays thIe following output:
-' 1 2
-' Unhandled Exception: System.InvalidOperationException: Nullable object must have a value.
-' at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
-' at Example.b__0(Nullable`1 nullableInt)
-' at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
-' at Example.Main()
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Nullable2.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Nullable2.vb
deleted file mode 100644
index 8de19feb2eb56..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Nullable2.vb
+++ /dev/null
@@ -1,32 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Linq
-
-Module Example14
- Public Sub Main()
- Dim queryResult = New Integer?() {1, 2, Nothing, 4}
- Dim numbers = queryResult.Select(Function(nullableInt) _
- CInt(nullableInt.GetValueOrDefault()))
- ' Display list.
- For Each number In numbers
- Console.Write("{0} ", number)
- Next
- Console.WriteLine()
-
- ' Use -1 to indicate a missing values.
- numbers = queryResult.Select(Function(nullableInt) _
- CInt(If(nullableInt.HasValue, nullableInt, -1)))
- ' Display list.
- For Each number In numbers
- Console.Write("{0} ", number)
- Next
- Console.WriteLine()
-
- End Sub
-End Module
-' The example displays the following output:
-' 1 2 0 4
-' 1 2 -1 4
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/Other/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/ApplicationEvents.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/ApplicationEvents.vb
deleted file mode 100644
index cf403a009a2bb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/ApplicationEvents.vb
+++ /dev/null
@@ -1,29 +0,0 @@
-Imports Microsoft.VisualBasic.ApplicationServices
-
-Namespace My
- ' The following events are available for MyApplication:
- ' Startup: Raised when the application starts, before the startup form is created.
- ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
- ' UnhandledException: Raised if the application encounters an unhandled exception.
- ' StartupNextInstance: Raised when launching a single-instance application and the application is already active.
- ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
-
- ' **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application.
-
- ' Example:
- ' Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults
- '
- ' ' Setting the application-wide default Font:
- ' e.Font = New Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular)
- '
- ' ' Setting the HighDpiMode for the Application:
- ' e.HighDpiMode = HighDpiMode.PerMonitorV2
- '
- ' ' If a splash dialog is used, this sets the minimum display time:
- ' e.MinimumSplashScreenDisplayTime = 4000
- ' End Sub
-
- Partial Friend Class MyApplication
-
- End Class
-End Namespace
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form1.Designer.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form1.Designer.vb
deleted file mode 100644
index 620c39b3c38c7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form1.Designer.vb
+++ /dev/null
@@ -1,61 +0,0 @@
-
-Partial Class Form1
- Inherits System.Windows.Forms.Form
-
- 'Form overrides dispose to clean up the component list.
-
- Protected Overrides Sub Dispose(ByVal disposing As Boolean)
- Try
- If disposing AndAlso components IsNot Nothing Then
- components.Dispose()
- End If
- Finally
- MyBase.Dispose(disposing)
- End Try
- End Sub
-
- 'Required by the Windows Form Designer
- Private components As System.ComponentModel.IContainer
-
- 'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
- 'Do not modify it using the code editor.
-
- Private Sub InitializeComponent()
- Button1 = New Button()
- TextBox1 = New TextBox()
- SuspendLayout()
- '
- ' Button1
- '
- Button1.Location = New Point(99, 52)
- Button1.Name = "Button1"
- Button1.Size = New Size(112, 34)
- Button1.TabIndex = 0
- Button1.Text = "Button1"
- Button1.UseVisualStyleBackColor = True
- '
- ' TextBox1
- '
- TextBox1.Location = New Point(99, 111)
- TextBox1.Name = "TextBox1"
- TextBox1.Size = New Size(150, 31)
- TextBox1.TabIndex = 1
- '
- ' Form1
- '
- AutoScaleDimensions = New SizeF(10F, 25F)
- AutoScaleMode = AutoScaleMode.Font
- ClientSize = New Size(800, 450)
- Controls.Add(TextBox1)
- Controls.Add(Button1)
- Name = "Form1"
- Text = "Form1"
- ResumeLayout(False)
- PerformLayout()
- End Sub
-
- Friend WithEvents Button1 As Button
- Friend WithEvents TextBox1 As TextBox
-
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form1.resx b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form1.resx
deleted file mode 100644
index af32865ec12ff..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form1.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form1.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form1.vb
deleted file mode 100644
index 9219c8a815c37..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form1.vb
+++ /dev/null
@@ -1,32 +0,0 @@
-Imports System.Threading
-Imports System.Windows.Forms.VisualStyles.VisualStyleElement
-
-Public Class Form1
- '
- Dim lines As New List(Of String)()
- Private Async Sub threadExampleBtn_Click(sender As Object, e As EventArgs) Handles Button1.Click
- TextBox1.Text = String.Empty
- lines.Clear()
-
- lines.Add("Simulating work on UI thread.")
- TextBox1.Lines = lines.ToArray()
- DoSomeWork(20)
-
- lines.Add("Simulating work on non-UI thread.")
- TextBox1.Lines = lines.ToArray()
- Await Task.Run(Sub() DoSomeWork(1000))
-
- lines.Add("ThreadsExampleBtn_Click completes. ")
- TextBox1.Lines = lines.ToArray()
- End Sub
-
- Private Async Sub DoSomeWork(milliseconds As Integer)
- ' Simulate work.
- Await Task.Delay(milliseconds)
-
- ' Report completion.
- lines.Add(String.Format("Some work completed in {0} ms on UI thread.", milliseconds))
- textBox1.Lines = lines.ToArray()
- End Sub
- '
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form11.Designer.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form11.Designer.vb
deleted file mode 100644
index b241e8cc766cd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form11.Designer.vb
+++ /dev/null
@@ -1,60 +0,0 @@
- _
-Partial Class Form11
- Inherits System.Windows.Forms.Form
-
- 'Form overrides dispose to clean up the component list.
- _
- Protected Overrides Sub Dispose(ByVal disposing As Boolean)
- Try
- If disposing AndAlso components IsNot Nothing Then
- components.Dispose()
- End If
- Finally
- MyBase.Dispose(disposing)
- End Try
- End Sub
-
- 'Required by the Windows Form Designer
- Private components As System.ComponentModel.IContainer
-
- 'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
- 'Do not modify it using the code editor.
- _
- Private Sub InitializeComponent()
- Button1 = New Button()
- TextBox1 = New TextBox()
- SuspendLayout()
- '
- ' Button1
- '
- Button1.Location = New Point(58, 44)
- Button1.Name = "Button1"
- Button1.Size = New Size(112, 34)
- Button1.TabIndex = 0
- Button1.Text = "Button1"
- Button1.UseVisualStyleBackColor = True
- '
- ' TextBox1
- '
- TextBox1.Location = New Point(60, 100)
- TextBox1.Name = "TextBox1"
- TextBox1.Size = New Size(150, 31)
- TextBox1.TabIndex = 1
- '
- ' Form11
- '
- AutoScaleDimensions = New SizeF(10F, 25F)
- AutoScaleMode = AutoScaleMode.Font
- ClientSize = New Size(800, 450)
- Controls.Add(TextBox1)
- Controls.Add(Button1)
- Name = "Form11"
- Text = "Form11"
- ResumeLayout(False)
- PerformLayout()
- End Sub
-
- Friend WithEvents Button1 As Button
- Friend WithEvents TextBox1 As TextBox
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form11.resx b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form11.resx
deleted file mode 100644
index af32865ec12ff..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form11.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form11.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form11.vb
deleted file mode 100644
index 8febf6e702af2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/Form11.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-Imports System.Collections.Generic
-Imports System.Threading.Tasks
-
-Public Class Form11
-
- Dim lines As New List(Of String)()
-
- Private Async Sub threadExampleBtn_Click(sender As Object, e As EventArgs) Handles Button1.Click
- TextBox1.Text = String.Empty
- lines.Clear()
-
- lines.Add("Simulating work on UI thread.")
- TextBox1.Lines = lines.ToArray()
- DoSomeWork(20)
-
- lines.Add("Simulating work on non-UI thread.")
- TextBox1.Lines = lines.ToArray()
- Await Task.Run(Sub() DoSomeWork(1000))
-
- lines.Add("ThreadsExampleBtn_Click completes. ")
- TextBox1.Lines = lines.ToArray()
- End Sub
-
- '
- Private Async Sub DoSomeWork(milliseconds As Integer)
- ' Simulate work.
- Await Task.Delay(milliseconds)
-
- ' Report completion.
- Dim uiMarshal As Boolean = TextBox1.InvokeRequired
- Dim msg As String = String.Format("Some work completed in {0} ms. on {1}UI thread" + vbCrLf,
- milliseconds, If(uiMarshal, String.Empty, "non-"))
- lines.Add(msg)
-
- If uiMarshal Then
- TextBox1.Invoke(New Action(Sub() TextBox1.Lines = lines.ToArray()))
- Else
- TextBox1.Lines = lines.ToArray()
- End If
- End Sub
- '
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/My Project/Application.Designer.vb b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/My Project/Application.Designer.vb
deleted file mode 100644
index 007b31fc7d393..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/My Project/Application.Designer.vb
+++ /dev/null
@@ -1,37 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:4.0.30319.42000
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict On
-Option Explicit On
-
-Namespace My
-
- 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
- ' or if you encounter build errors in this file, go to the Project Designer
- ' (go to Project Properties or double-click the My Project node in
- ' Solution Explorer), and make changes on the Application tab.
- '
- Partial Friend Class MyApplication
-
-
- Public Sub New()
- MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
- Me.IsSingleInstance = False
- Me.EnableVisualStyles = True
- Me.SaveMySettingsOnExit = True
- Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
- End Sub
-
-
- Protected Overrides Sub OnCreateMainForm()
- Me.MainForm = Form1
- End Sub
- End Class
-End Namespace
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/My Project/Application.myapp b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/My Project/Application.myapp
deleted file mode 100644
index 0f12f3238863e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/My Project/Application.myapp
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
- true
- Form1
- false
- 0
- true
- 0
- true
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/WinFormsApp1.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/WinFormsApp1.vbproj
deleted file mode 100644
index 4fc092688af01..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/vb/WinForms/WinFormsApp1.vbproj
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
- WinExe
- net10.0-windows
- Sub Main
- true
- WindowsForms
-
-
-
-
-
-
-
-
-
-
- True
- True
- Application.myapp
-
-
-
-
-
- MyApplicationCodeGenerator
- Application.Designer.vb
-
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/BadState1.cs b/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/BadState1.cs
deleted file mode 100644
index 323cea8341019..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/BadState1.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Text;
-using System.Threading.Tasks;
-
-public class Example
-{
- public static async Task Main()
- {
- Encoding enc = Encoding.Unicode;
- String value = "This is a string to persist.";
- Byte[] bytes = enc.GetBytes(value);
-
- FileStream fs = new FileStream(@".\TestFile.dat",
- FileMode.Open,
- FileAccess.Read);
- Task t = fs.WriteAsync(enc.GetPreamble(), 0, enc.GetPreamble().Length);
- Task t2 = t.ContinueWith((a) => fs.WriteAsync(bytes, 0, bytes.Length));
- await t2;
- fs.Close();
- }
-}
-// The example displays the following output:
-// Unhandled Exception: System.NotSupportedException: Stream does not support writing.
-// at System.IO.Stream.BeginWriteInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state
-// , Boolean serializeAsynchronously)
-// at System.IO.FileStream.BeginWrite(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object sta
-// teObject)
-// at System.IO.Stream.<>c.b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback,
-// Object state)
-// at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMet
-// hod, Func`3 endMethod)
-// at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
-// at System.IO.FileStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
-// at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count)
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/TestProp1.cs b/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/TestProp1.cs
deleted file mode 100644
index 7eaf7c84e9284..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/TestProp1.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Threading.Tasks;
-
-public class TestPropEx1
-{
- public static async Task Main()
- {
- String name = @".\TestFile.dat";
- var fs = new FileStream(name,
- FileMode.Create,
- FileAccess.Write);
- Console.WriteLine("Filename: {0}, Encoding: {1}",
- name, await FileUtilities1.GetEncodingType(fs));
- }
-}
-
-public class FileUtilities1
-{
- public enum EncodingType
- { None = 0, Unknown = -1, Utf8 = 1, Utf16 = 2, Utf32 = 3 }
-
- public async static Task GetEncodingType(FileStream fs)
- {
- Byte[] bytes = new Byte[4];
- int bytesRead = await fs.ReadAsync(bytes, 0, 4);
- if (bytesRead < 2)
- return EncodingType.None;
-
- if (bytesRead >= 3 & (bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF))
- return EncodingType.Utf8;
-
- if (bytesRead == 4)
- {
- var value = BitConverter.ToUInt32(bytes, 0);
- if (value == 0x0000FEFF | value == 0xFEFF0000)
- return EncodingType.Utf32;
- }
-
- var value16 = BitConverter.ToUInt16(bytes, 0);
- if (value16 == (ushort)0xFEFF | value16 == (ushort)0xFFFE)
- return EncodingType.Utf16;
-
- return EncodingType.Unknown;
- }
-}
-// The example displays the following output:
-// Unhandled Exception: System.NotSupportedException: Stream does not support reading.
-// at System.IO.FileStream.BeginRead(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback callback, Object state)
-// at System.IO.Stream.<>c.b__46_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)
-// at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance, TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod)
-// at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)
-// at System.IO.FileStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
-// at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count)
-// at FileUtilities.GetEncodingType(FileStream fs) in C:\Work\docs\program.cs:line 26
-// at Example.Main() in C:\Work\docs\program.cs:line 13
-// at Example.()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/TestProp2.cs b/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/TestProp2.cs
deleted file mode 100644
index 795a01183ae5d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/TestProp2.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.IO;
-using System.Threading.Tasks;
-
-public class TestPropEx2
-{
- public static async Task Main()
- {
- String name = @".\TestFile.dat";
- var fs = new FileStream(name,
- FileMode.Create,
- FileAccess.Write);
- Console.WriteLine("Filename: {0}, Encoding: {1}",
- name, await FileUtilities.GetEncodingType(fs));
- }
-}
-
-public class FileUtilities
-{
- public enum EncodingType
- { None = 0, Unknown = -1, Utf8 = 1, Utf16 = 2, Utf32 = 3 }
-
- //
- public static async Task GetEncodingType(FileStream fs)
- {
- if (!fs.CanRead)
- return EncodingType.Unknown;
-
- Byte[] bytes = new Byte[4];
- int bytesRead = await fs.ReadAsync(bytes, 0, 4);
- if (bytesRead < 2)
- return EncodingType.None;
-
- if (bytesRead >= 3 & (bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF))
- return EncodingType.Utf8;
-
- if (bytesRead == 4)
- {
- var value = BitConverter.ToUInt32(bytes, 0);
- if (value == 0x0000FEFF | value == 0xFEFF0000)
- return EncodingType.Utf32;
- }
-
- var value16 = BitConverter.ToUInt16(bytes, 0);
- if (value16 == (ushort)0xFEFF | value16 == (ushort)0xFFFE)
- return EncodingType.Utf16;
-
- return EncodingType.Unknown;
- }
-}
-// The example displays the following output:
-// Filename: .\TestFile.dat, Encoding: Unknown
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/project.csproj
deleted file mode 100644
index dfdef3fd2a730..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/csharp/project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/fsharp/BadState1.fs b/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/fsharp/BadState1.fs
deleted file mode 100644
index 448563e30e738..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/fsharp/BadState1.fs
+++ /dev/null
@@ -1,34 +0,0 @@
-module BadState
-
-//
-open System.IO
-open System.Text
-
-let main = task {
- let enc = Encoding.Unicode
- let value = "This is a string to persist."
- let bytes = enc.GetBytes value
-
- let fs = new FileStream(@".\TestFile.dat", FileMode.Open, FileAccess.Read)
- let t = fs.WriteAsync(enc.GetPreamble(), 0, enc.GetPreamble().Length)
- let t2 = t.ContinueWith(fun a -> fs.WriteAsync(bytes, 0, bytes.Length))
- let! _ = t2
- fs.Close()
-}
-main.Wait()
-
-// The example displays the following output:
-// Unhandled Exception: System.NotSupportedException: Stream does not support writing.
-// at System.IO.Stream.BeginWriteInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state
-// , Boolean serializeAsynchronously)
-// at System.IO.FileStream.BeginWrite(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object sta
-// teObject)
-// at System.IO.Stream.<>c.b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback,
-// Object state)
-// at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMet
-// hod, Func`3 endMethod)
-// at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
-// at System.IO.FileStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
-// at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count)
-// at .main()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/fsharp/TestProp1.fs b/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/fsharp/TestProp1.fs
deleted file mode 100644
index 67c754a2d288b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/fsharp/TestProp1.fs
+++ /dev/null
@@ -1,55 +0,0 @@
-module TestProp1
-
-//
-open System
-open System.IO
-
-module FileUtilities =
- type EncodingType =
- | None = 0
- | Unknown = -1
- | Utf8 = 1
- | Utf16 = 2
- | Utf32 = 3
-
- let getEncodingType (fs: FileStream) =
- task {
- let bytes = Array.zeroCreate 4
- let! bytesRead = fs.ReadAsync(bytes, 0, 4)
- if bytesRead < 2 then
- return EncodingType.None
-
- elif bytesRead >= 3 && bytes[0] = 0xEFuy && bytes[1] = 0xBBuy && bytes[2] = 0xBFuy then
- return EncodingType.Utf8
- else
- let value = BitConverter.ToUInt32(bytes, 0)
- if bytesRead = 4 && (value = 0x0000FEFFu || value = 0xFEFF0000u) then
- return EncodingType.Utf32
- else
- let value16 = BitConverter.ToUInt16(bytes, 0)
- if value16 = 0xFEFFus || value16 = 0xFFFEus then
- return EncodingType.Utf16
- else
- return EncodingType.Unknown
- }
-
-let main _ =
- task {
- let name = @".\TestFile.dat"
- let fs = new FileStream(name, FileMode.Create, FileAccess.Write)
- let! et = FileUtilities.getEncodingType fs
- printfn $"Filename: {name}, Encoding: {et}"
- }
-
-// The example displays the following output:
-// Unhandled Exception: System.NotSupportedException: Stream does not support reading.
-// at System.IO.FileStream.BeginRead(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback callback, Object state)
-// at System.IO.Stream.<>c.b__46_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)
-// at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance, TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod)
-// at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)
-// at System.IO.FileStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
-// at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count)
-// at FileUtilities.GetEncodingType(FileStream fs)
-// at Example.Main()
-// at Example.()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/fsharp/TestProp2.fs b/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/fsharp/TestProp2.fs
deleted file mode 100644
index b5f68d73b68dc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/fsharp/TestProp2.fs
+++ /dev/null
@@ -1,48 +0,0 @@
-module TestProp2
-
-open System
-open System.IO
-
-module FileUtilities =
- type EncodingType =
- | None = 0
- | Unknown = -1
- | Utf8 = 1
- | Utf16 = 2
- | Utf32 = 3
-
- //
- let getEncodingType (fs: FileStream) =
- task {
- if not fs.CanRead then
- return EncodingType.Unknown
- else
- let bytes = Array.zeroCreate 4
- let! bytesRead = fs.ReadAsync(bytes, 0, 4)
- if bytesRead < 2 then
- return EncodingType.None
-
- elif bytesRead >= 3 && bytes[0] = 0xEFuy && bytes[1] = 0xBBuy && bytes[2] = 0xBFuy then
- return EncodingType.Utf8
- else
- let value = BitConverter.ToUInt32(bytes, 0)
- if bytesRead = 4 && (value = 0x0000FEFFu || value = 0xFEFF0000u) then
- return EncodingType.Utf32
- else
- let value16 = BitConverter.ToUInt16(bytes, 0)
- if value16 = 0xFEFFus || value16 = 0xFFFEus then
- return EncodingType.Utf16
- else
- return EncodingType.Unknown
- }
- // The example displays the following output:
- // Filename: .\TestFile.dat, Encoding: Unknown
- //
-
-let main _ =
- task {
- let name = @".\TestFile.dat"
- let fs = new FileStream(name, FileMode.Create, FileAccess.Write)
- let! et = FileUtilities.getEncodingType fs
- printfn $"Filename: {name}, Encoding: {et}"
- }
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/BadState1.vb b/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/BadState1.vb
deleted file mode 100644
index 682e15bf30a9b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/BadState1.vb
+++ /dev/null
@@ -1,37 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-'
-Imports System.IO
-Imports System.Text
-Imports System.Threading.Tasks
-
-Module Example
- Public Sub Main()
- Dim enc As Encoding = Encoding.Unicode
- Dim value As String = "This is a string to persist."
- Dim bytes() As Byte = enc.GetBytes(value)
-
- Dim fs As New FileStream(".\TestFile.dat",
- FileMode.Open,
- FileAccess.Read)
- Dim t As Task = fs.WriteAsync(enc.GetPreamble(), 0, enc.GetPreamble().Length)
- Dim t2 As Task = t.ContinueWith(Sub(a) fs.WriteAsync(bytes, 0, bytes.Length))
- t2.Wait()
- fs.Close()
- End Sub
-End Module
-' The example displays the following output:
-' Unhandled Exception: System.NotSupportedException: Stream does not support writing.
-' at System.IO.Stream.BeginWriteInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state
-' , Boolean serializeAsynchronously)
-' at System.IO.FileStream.BeginWrite(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object sta
-' teObject)
-' at System.IO.Stream.<>c.b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback,
-' Object state)
-' at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMet
-' hod, Func`3 endMethod)
-' at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
-' at System.IO.FileStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
-' at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count)
-' at Example.Main()
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/TestProp1.vb b/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/TestProp1.vb
deleted file mode 100644
index 169a96195e875..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/TestProp1.vb
+++ /dev/null
@@ -1,70 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-Imports System.Threading.Tasks
-
-Module Example2
- Public Sub Main()
- Dim name As String = ".\TestFile.dat"
- Dim fs As New FileStream(name,
- FileMode.Create,
- FileAccess.Write)
- Console.WriteLine("Filename: {0}, Encoding: {1}",
- name, FileUtilities2.GetEncodingType(fs))
- End Sub
-End Module
-
-Public Class FileUtilities2
- Public Enum EncodingType As Integer
- None = 0
- Unknown = -1
- Utf8 = 1
- Utf16 = 2
- Utf32 = 3
- End Enum
-
- Public Shared Function GetEncodingType(fs As FileStream) As EncodingType
- Dim bytes(3) As Byte
- Dim t As Task(Of Integer) = fs.ReadAsync(bytes, 0, 4)
- t.Wait()
- Dim bytesRead As Integer = t.Result
- If bytesRead < 2 Then Return EncodingType.None
-
- If bytesRead >= 3 And (bytes(0) = &HEF AndAlso bytes(1) = &HBB AndAlso bytes(2) = &HBF) Then
- Return EncodingType.Utf8
- End If
-
- If bytesRead = 4 Then
- Dim value As UInteger = BitConverter.ToUInt32(bytes, 0)
- If value = &HFEFF Or value = &HFEFF0000 Then
- Return EncodingType.Utf32
- End If
- End If
-
- Dim value16 As UInt16 = BitConverter.ToUInt16(bytes, 0)
- If value16 = &HFEFF Or value16 = &HFFFE Then
- Return EncodingType.Utf16
- End If
-
- Return EncodingType.Unknown
- End Function
-End Class
-' The example displays the following output:
-' Unhandled Exception: System.NotSupportedException: Stream does not support reading.
-' at System.IO.Stream.BeginReadInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state,
-' Boolean serializeAsynchronously)
-' at System.IO.FileStream.BeginRead(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object stat
-' eObject)
-' at System.IO.Stream.<>c.b__43_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, O
-' bject state)
-' at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMet
-' hod, Func`3 endMethod)
-' at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)
-' at System.IO.FileStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
-' at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count)
-' at FileUtilities2.GetEncodingType(FileStream fs)
-' at Example.Main()
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/TestProp2.vb b/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/TestProp2.vb
deleted file mode 100644
index 137c7393e5e14..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/NotSupportedException/Overview/vb/TestProp2.vb
+++ /dev/null
@@ -1,61 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.IO
-Imports System.Threading.Tasks
-
-Module Example3
- Public Sub Main()
- Dim name As String = ".\TestFile.dat"
- Dim fs As New FileStream(name,
- FileMode.Create,
- FileAccess.Write)
- Console.WriteLine("Filename: {0}, Encoding: {1}",
- name, FileUtilities3.GetEncodingType(fs))
- End Sub
-End Module
-
-'
-Public Class FileUtilities3
- Public Enum EncodingType As Integer
- None = 0
- Unknown = -1
- Utf8 = 1
- Utf16 = 2
- Utf32 = 3
- End Enum
-
- Public Shared Function GetEncodingType(fs As FileStream) As EncodingType
- If Not fs.CanRead Then
- Return EncodingType.Unknown
- End If
-
- Dim bytes(3) As Byte
- Dim t As Task(Of Integer) = fs.ReadAsync(bytes, 0, 4)
- t.Wait()
- Dim bytesRead As Integer = t.Result
- If bytesRead < 2 Then Return EncodingType.None
-
- If bytesRead >= 3 And (bytes(0) = &HEF AndAlso bytes(1) = &HBB AndAlso bytes(2) = &HBF) Then
- Return EncodingType.Utf8
- End If
-
- If bytesRead = 4 Then
- Dim value As UInteger = BitConverter.ToUInt32(bytes, 0)
- If value = &HFEFF Or value = &HFEFF0000 Then
- Return EncodingType.Utf32
- End If
- End If
-
- Dim value16 As UInt16 = BitConverter.ToUInt16(bytes, 0)
- If value16 = &HFEFF Or value16 = &HFFFE Then
- Return EncodingType.Utf16
- End If
-
- Return EncodingType.Unknown
- End Function
-End Class
-' The example displays the following output:
-' Filename: .\TestFile.dat, Encoding: Unknown
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals2.cs
deleted file mode 100644
index e64ae9a67b8f7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals2.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-using System;
-
-class Point2
-{
- protected int x, y;
-
- public Point2() : this(0, 0)
- { }
-
- public Point2(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
-
- public override bool Equals(Object obj)
- {
- //Check for null and compare run-time types.
- if ((obj == null) || !this.GetType().Equals(obj.GetType()))
- {
- return false;
- }
- else
- {
- Point2 p = (Point2)obj;
- return (x == p.x) && (y == p.y);
- }
- }
-
- public override int GetHashCode()
- {
- return HashCode.Combine(x, y);
- }
-
- public override string ToString()
- {
- return String.Format("Point2({0}, {1})", x, y);
- }
-}
-
-sealed class Point3D : Point2
-{
- int z;
-
- public Point3D(int x, int y, int z) : base(x, y)
- {
- this.z = z;
- }
-
- public override bool Equals(Object obj)
- {
- Point3D pt3 = obj as Point3D;
- if (pt3 == null)
- return false;
- else
- return base.Equals((Point2)obj) && z == pt3.z;
- }
-
- public override int GetHashCode()
- {
- return HashCode.Combine(base.GetHashCode(), z);
- }
-
- public override String ToString()
- {
- return String.Format("Point2({0}, {1}, {2})", x, y, z);
- }
-}
-
-class Example7
-{
- public static void Main()
- {
- Point2 point2D = new Point2(5, 5);
- Point3D point3Da = new Point3D(5, 5, 2);
- Point3D point3Db = new Point3D(5, 5, 2);
- Point3D point3Dc = new Point3D(5, 5, -1);
-
- Console.WriteLine($"{point2D} = {point3Da}: {point2D.Equals(point3Da)}");
- Console.WriteLine($"{point2D} = {point3Db}: {point2D.Equals(point3Db)}");
- Console.WriteLine($"{point3Da} = {point3Db}: {point3Da.Equals(point3Db)}");
- Console.WriteLine($"{point3Da} = {point3Dc}: {point3Da.Equals(point3Dc)}");
- }
-}
-// The example displays the following output:
-// Point2(5, 5) = Point2(5, 5, 2): False
-// Point2(5, 5) = Point2(5, 5, 2): False
-// Point2(5, 5, 2) = Point2(5, 5, 2): True
-// Point2(5, 5, 2) = Point2(5, 5, -1): False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals3.cs
deleted file mode 100644
index b03eeb114abbd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals3.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-using System;
-
-class Rectangle
-{
- private Point a, b;
-
- public Rectangle(int upLeftX, int upLeftY, int downRightX, int downRightY)
- {
- this.a = new Point(upLeftX, upLeftY);
- this.b = new Point(downRightX, downRightY);
- }
-
- public override bool Equals(Object obj)
- {
- // Perform an equality check on two rectangles (Point object pairs).
- if (obj == null || GetType() != obj.GetType())
- return false;
- Rectangle r = (Rectangle)obj;
- return a.Equals(r.a) && b.Equals(r.b);
- }
-
- public override int GetHashCode()
- {
- return Tuple.Create(a, b).GetHashCode();
- }
-
- public override String ToString()
- {
- return String.Format("Rectangle({0}, {1}, {2}, {3})",
- a.x, a.y, b.x, b.y);
- }
-}
-
-class Point
-{
- internal int x;
- internal int y;
-
- public Point(int X, int Y)
- {
- this.x = X;
- this.y = Y;
- }
-
- public override bool Equals (Object obj)
- {
- // Performs an equality check on two points (integer pairs).
- if (obj == null || GetType() != obj.GetType()) return false;
- Point p = (Point)obj;
- return (x == p.x) && (y == p.y);
- }
-
- public override int GetHashCode()
- {
- return Tuple.Create(x, y).GetHashCode();
- }
-}
-
-class Example
-{
- public static void Main()
- {
- Rectangle r1 = new Rectangle(0, 0, 100, 200);
- Rectangle r2 = new Rectangle(0, 0, 100, 200);
- Rectangle r3 = new Rectangle(0, 0, 150, 200);
-
- Console.WriteLine($"{r1} = {r2}: {r1.Equals(r2)}");
- Console.WriteLine($"{r1} = {r3}: {r1.Equals(r3)}");
- Console.WriteLine($"{r2} = {r3}: {r2.Equals(r3)}");
- }
-}
-// The example displays the following output:
-// Rectangle(0, 0, 100, 200) = Rectangle(0, 0, 100, 200): True
-// Rectangle(0, 0, 100, 200) = Rectangle(0, 0, 150, 200): False
-// Rectangle(0, 0, 100, 200) = Rectangle(0, 0, 150, 200): False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals4.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals4.cs
deleted file mode 100644
index fae811a3bca0e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals4.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-using System;
-
-public struct Complex
-{
- public double re, im;
-
- public override bool Equals(Object obj)
- {
- return obj is Complex && this == (Complex)obj;
- }
-
- public override int GetHashCode()
- {
- return Tuple.Create(re, im).GetHashCode();
- }
-
- public static bool operator ==(Complex x, Complex y)
- {
- return x.re == y.re && x.im == y.im;
- }
-
- public static bool operator !=(Complex x, Complex y)
- {
- return !(x == y);
- }
-
- public override String ToString()
- {
- return String.Format("({0}, {1})", re, im);
- }
-}
-
-class MyClass
-{
- public static void Main()
- {
- Complex cmplx1, cmplx2;
-
- cmplx1.re = 4.0;
- cmplx1.im = 1.0;
-
- cmplx2.re = 2.0;
- cmplx2.im = 1.0;
-
- Console.WriteLine($"{cmplx1} <> {cmplx2}: {cmplx1 != cmplx2}");
- Console.WriteLine($"{cmplx1} = {cmplx2}: {cmplx1.Equals(cmplx2)}");
-
- cmplx2.re = 4.0;
-
- Console.WriteLine($"{cmplx1} = {cmplx2}: {cmplx1 == cmplx2}");
- Console.WriteLine($"{cmplx1} = {cmplx2}: {cmplx1.Equals(cmplx2)}");
- }
-}
-// The example displays the following output:
-// (4, 1) <> (2, 1): True
-// (4, 1) = (2, 1): False
-// (4, 1) = (4, 1): True
-// (4, 1) = (4, 1): True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals_ref.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals_ref.cs
deleted file mode 100644
index 8db6b1dc08afe..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals_ref.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-using System;
-
-// Define a reference type that does not override Equals.
-public class Person
-{
- private string personName;
-
- public Person(string name)
- {
- this.personName = name;
- }
-
- public override string ToString()
- {
- return this.personName;
- }
-}
-
-public class Example1
-{
- public static void Main()
- {
- Person person1a = new Person("John");
- Person person1b = person1a;
- Person person2 = new Person(person1a.ToString());
-
- Console.WriteLine("Calling Equals:");
- Console.WriteLine($"person1a and person1b: {person1a.Equals(person1b)}");
- Console.WriteLine($"person1a and person2: {person1a.Equals(person2)}");
-
- Console.WriteLine("\nCasting to an Object and calling Equals:");
- Console.WriteLine($"person1a and person1b: {((object) person1a).Equals((object) person1b)}");
- Console.WriteLine($"person1a and person2: {((object) person1a).Equals((object) person2)}");
- }
-}
-// The example displays the following output:
-// person1a and person1b: True
-// person1a and person2: False
-//
-// Casting to an Object and calling Equals:
-// person1a and person1b: True
-// person1a and person2: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals_val1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals_val1.cs
deleted file mode 100644
index 533e01bf0983e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals_val1.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-public class Example2
-{
- public static void Main()
- {
- //
- byte value1 = 12;
- int value2 = 12;
-
- object object1 = value1;
- object object2 = value2;
-
- Console.WriteLine($"{object1} ({object1.GetType().Name}) = {object2} ({object2.GetType().Name}): {object1.Equals(object2)}");
-
- // The example displays the following output:
- // 12 (Byte) = 12 (Int32): False
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals_val2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals_val2.cs
deleted file mode 100644
index 2c128e53757f8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equals_val2.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-using System;
-
-// Define a value type that does not override Equals.
-public struct Person3
-{
- private string personName;
-
- public Person3(string name)
- {
- this.personName = name;
- }
-
- public override string ToString()
- {
- return this.personName;
- }
-}
-
-public struct Example3
-{
- public static void Main()
- {
- Person3 person1 = new Person3("John");
- Person3 person2 = new Person3("John");
-
- Console.WriteLine("Calling Equals:");
- Console.WriteLine(person1.Equals(person2));
-
- Console.WriteLine("\nCasting to an Object and calling Equals:");
- Console.WriteLine(((object) person1).Equals((object) person2));
- }
-}
-// The example displays the following output:
-// Calling Equals:
-// True
-//
-// Casting to an Object and calling Equals:
-// True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equalsoverride.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equalsoverride.cs
deleted file mode 100644
index b8da28c242f98..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equalsoverride.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-
-//
-public class Person6
-{
- private string idNumber;
- private string personName;
-
- public Person6(string name, string id)
- {
- this.personName = name;
- this.idNumber = id;
- }
-
- public override bool Equals(Object obj)
- {
- Person6 personObj = obj as Person6;
- if (personObj == null)
- return false;
- else
- return idNumber.Equals(personObj.idNumber);
- }
-
- public override int GetHashCode()
- {
- return this.idNumber.GetHashCode();
- }
-}
-
-public class Example6
-{
- public static void Main()
- {
- Person6 p1 = new Person6("John", "63412895");
- Person6 p2 = new Person6("Jack", "63412895");
- Console.WriteLine(p1.Equals(p2));
- Console.WriteLine(Object.Equals(p1, p2));
- }
-}
-// The example displays the following output:
-// True
-// True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equalssb1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equalssb1.cs
deleted file mode 100644
index b51fd0e2a2a92..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/csharp/equalssb1.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-using System;
-using System.Text;
-
-public class Example5
-{
- public static void Main()
- {
- StringBuilder sb1 = new StringBuilder("building a string...");
- StringBuilder sb2 = new StringBuilder("building a string...");
-
- Console.WriteLine($"sb1.Equals(sb2): {sb1.Equals(sb2)}");
- Console.WriteLine($"((Object) sb1).Equals(sb2): {((Object) sb1).Equals(sb2)}");
- Console.WriteLine($"Object.Equals(sb1, sb2): {Object.Equals(sb1, sb2)}");
-
- Object sb3 = new StringBuilder("building a string...");
- Console.WriteLine($"\nsb3.Equals(sb2): {sb3.Equals(sb2)}");
- }
-}
-// The example displays the following output:
-// sb1.Equals(sb2): True
-// ((Object) sb1).Equals(sb2): False
-// Object.Equals(sb1, sb2): False
-//
-// sb3.Equals(sb2): False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/Project.fsproj b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/Project.fsproj
deleted file mode 100644
index a045093666eef..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/Project.fsproj
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals2.fs
deleted file mode 100644
index 4724fd1968c0a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals2.fs
+++ /dev/null
@@ -1,54 +0,0 @@
-module equals2
-
-//
-type Point(x, y) =
- new () = Point(0, 0)
- member _.X = x
- member _.Y = y
-
- override _.Equals(obj) =
- //Check for null and compare run-time types.
- match obj with
- | :? Point as p ->
- x = p.X && y = p.Y
- | _ ->
- false
-
- override _.GetHashCode() =
- System.HashCode.Combine(x, y)
-
- override _.ToString() =
- $"Point({x}, {y})"
-
-type Point3D(x, y, z) =
- inherit Point(x, y)
- member _.Z = z
-
- override _.Equals(obj) =
- match obj with
- | :? Point3D as pt3 ->
- base.Equals(pt3 :> Point) && z = pt3.Z
- | _ ->
- false
-
- override _.GetHashCode() =
- System.HashCode.Combine(base.GetHashCode(), z)
-
- override _.ToString() =
- $"Point({x}, {y}, {z})"
-
-let point2D = Point(5, 5)
-let point3Da = Point3D(5, 5, 2)
-let point3Db = Point3D(5, 5, 2)
-let point3Dc = Point3D(5, 5, -1)
-
-printfn $"{point2D} = {point3Da}: {point2D.Equals point3Da}"
-printfn $"{point2D} = {point3Db}: {point2D.Equals point3Db}"
-printfn $"{point3Da} = {point3Db}: {point3Da.Equals point3Db}"
-printfn $"{point3Da} = {point3Dc}: {point3Da.Equals point3Dc}"
-// The example displays the following output:
-// Point(5, 5) = Point(5, 5, 2): False
-// Point(5, 5) = Point(5, 5, 2): False
-// Point(5, 5, 2) = Point(5, 5, 2): True
-// Point(5, 5, 2) = Point(5, 5, -1): False
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals3.fs
deleted file mode 100644
index 4321df320d46d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals3.fs
+++ /dev/null
@@ -1,51 +0,0 @@
-module equals3
-
-//
-type Point(x, y) =
- member _.X = x
- member _.Y = y
-
- override _.Equals(obj) =
- // Performs an equality check on two points (integer pairs).
- match obj with
- | :? Point as p ->
- x = p.X && y = p.Y
- | _ ->
- false
-
- override _.GetHashCode() =
- (x, y).GetHashCode()
-
-type Rectangle(upLeftX, upLeftY, downRightX, downRightY) =
- let a = Point(upLeftX, upLeftY)
- let b = Point(downRightX, downRightY)
-
- member _.UpLeft = a
- member _.DownRight = b
-
- override _.Equals(obj) =
- // Perform an equality check on two rectangles (Point object pairs).
- match obj with
- | :? Rectangle as r ->
- a.Equals(r.UpLeft) && b.Equals(r.DownRight)
- | _ ->
- false
-
- override _.GetHashCode() =
- (a, b).GetHashCode()
-
- override _.ToString() =
- $"Rectangle({a.X}, {a.Y}, {b.X}, {b.Y})"
-
-let r1 = Rectangle(0, 0, 100, 200)
-let r2 = Rectangle(0, 0, 100, 200)
-let r3 = Rectangle(0, 0, 150, 200)
-
-printfn $"{r1} = {r2}: {r1.Equals r2}"
-printfn $"{r1} = {r3}: {r1.Equals r3}"
-printfn $"{r2} = {r3}: {r2.Equals r3}"
-// The example displays the following output:
-// Rectangle(0, 0, 100, 200) = Rectangle(0, 0, 100, 200): True
-// Rectangle(0, 0, 100, 200) = Rectangle(0, 0, 150, 200): False
-// Rectangle(0, 0, 100, 200) = Rectangle(0, 0, 150, 200): False
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals4.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals4.fs
deleted file mode 100644
index ecde006fa161a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals4.fs
+++ /dev/null
@@ -1,48 +0,0 @@
-module equals4
-
-//
-[]
-type Complex =
- val mutable re: double
- val mutable im: double
-
- override this.Equals(obj) =
- match obj with
- | :? Complex as c when c = this -> true
- | _ -> false
-
- override this.GetHashCode() =
- (this.re, this.im).GetHashCode()
-
- override this.ToString() =
- $"({this.re}, {this.im})"
-
- static member op_Equality (x: Complex, y: Complex) =
- x.re = y.re && x.im = y.im
-
- static member op_Inequality (x: Complex, y: Complex) =
- x = y |> not
-
-let mutable cmplx1 = Complex()
-let mutable cmplx2 = Complex()
-
-cmplx1.re <- 4.0
-cmplx1.im <- 1.0
-
-cmplx2.re <- 2.0
-cmplx2.im <- 1.0
-
-printfn $"{cmplx1} <> {cmplx2}: {cmplx1 <> cmplx2}"
-printfn $"{cmplx1} = {cmplx2}: {cmplx1.Equals cmplx2}"
-
-cmplx2.re <- 4.0
-
-printfn $"{cmplx1} = {cmplx2}: {cmplx1 = cmplx2}"
-printfn $"{cmplx1} = {cmplx2}: {cmplx1.Equals cmplx2}"
-
-// The example displays the following output:
-// (4, 1) <> (2, 1): True
-// (4, 1) = (2, 1): False
-// (4, 1) = (4, 1): True
-// (4, 1) = (4, 1): True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals_ref.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals_ref.fs
deleted file mode 100644
index 230ddffa41107..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals_ref.fs
+++ /dev/null
@@ -1,27 +0,0 @@
-module equals_ref
-
-//
-// Define a reference type that does not override Equals.
-type Person(name) =
- override _.ToString() =
- name
-
-let person1a = Person "John"
-let person1b = person1a
-let person2 = Person(string person1a)
-
-printfn "Calling Equals:"
-printfn $"person1a and person1b: {person1a.Equals person1b}"
-printfn $"person1a and person2: {person1a.Equals person2}"
-
-printfn "\nCasting to an Object and calling Equals:"
-printfn $"person1a and person1b: {(person1a :> obj).Equals(person1b :> obj)}"
-printfn $"person1a and person2: {(person1a :> obj).Equals(person2 :> obj)}"
-// The example displays the following output:
-// person1a and person1b: True
-// person1a and person2: False
-//
-// Casting to an Object and calling Equals:
-// person1a and person1b: True
-// person1a and person2: False
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals_val1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals_val1.fs
deleted file mode 100644
index 1a3807394a73f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals_val1.fs
+++ /dev/null
@@ -1,14 +0,0 @@
-module equals_val1
-
-//
-let value1 = 12uy
-let value2 = 12
-
-let object1 = value1 :> obj
-let object2 = value2 :> obj
-
-printfn $"{object1} ({object1.GetType().Name}) = {object2} ({object2.GetType().Name}): {object1.Equals object2}"
-
-// The example displays the following output:
-// 12 (Byte) = 12 (Int32): False
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals_val2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals_val2.fs
deleted file mode 100644
index c41c65f0bb067..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equals_val2.fs
+++ /dev/null
@@ -1,24 +0,0 @@
-module equals_val2
-
-//
-// Define a value type that does not override Equals.
-[]
-type Person(personName: string) =
- override _.ToString() =
- personName
-
-let person1 = Person "John"
-let person2 = Person "John"
-
-printfn "Calling Equals:"
-printfn $"{person1.Equals person2}"
-
-printfn $"\nCasting to an Object and calling Equals:"
-printfn $"{(person1 :> obj).Equals(person2 :> obj)}"
-// The example displays the following output:
-// Calling Equals:
-// True
-//
-// Casting to an Object and calling Equals:
-// True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equalsoverride.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equalsoverride.fs
deleted file mode 100644
index bf1d13a6fa8c3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equalsoverride.fs
+++ /dev/null
@@ -1,27 +0,0 @@
-module equalsoverride
-
-//
-open System
-
-type Person(name, id) =
- member _.Name = name
- member _.Id = id
-
- override _.Equals(obj) =
- match obj with
- | :? Person as personObj ->
- id.Equals personObj.Id
- | _ ->
- false
-
- override _.GetHashCode() =
- id.GetHashCode()
-
-let p1 = Person("John", "63412895")
-let p2 = Person("Jack", "63412895")
-printfn $"{p1.Equals p2}"
-printfn $"{Object.Equals(p1, p2)}"
-// The example displays the following output:
-// True
-// True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equalssb1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equalssb1.fs
deleted file mode 100644
index 632f5045d9875..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/fsharp/equalssb1.fs
+++ /dev/null
@@ -1,23 +0,0 @@
-module equalssb1
-
-//
-open System
-open System.Text
-
-let sb1 = StringBuilder "building a string..."
-let sb2 = StringBuilder "building a string..."
-
-printfn $"sb1.Equals(sb2): {sb1.Equals sb2}"
-printfn $"((Object) sb1).Equals(sb2): {(sb1 :> obj).Equals sb2}"
-
-printfn $"Object.Equals(sb1, sb2): {Object.Equals(sb1, sb2)}"
-
-let sb3 = StringBuilder "building a string..."
-printfn $"\nsb3.Equals(sb2): {sb3.Equals sb2}"
-// The example displays the following output:
-// sb1.Equals(sb2): True
-// ((Object) sb1).Equals(sb2): False
-// Object.Equals(sb1, sb2): False
-//
-// sb3.Equals(sb2): False
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals2.vb
deleted file mode 100644
index 43dba9f38b9ae..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals2.vb
+++ /dev/null
@@ -1,82 +0,0 @@
-'
-Class Point1
- Protected x, y As Integer
-
- Public Sub New()
- Me.x = 0
- Me.y = 0
- End Sub
-
- Public Sub New(x As Integer, y As Integer)
- Me.x = x
- Me.y = y
- End Sub
-
- Public Overrides Function Equals(obj As Object) As Boolean
- ' Check for null and compare run-time types.
- If obj Is Nothing OrElse Not Me.GetType().Equals(obj.GetType()) Then
- Return False
- Else
- Dim p As Point1 = DirectCast(obj, Point1)
- Return x = p.x AndAlso y = p.y
- End If
- End Function
-
- Public Overrides Function GetHashCode() As Integer
- Return HashCode.Combine(x, y)
- End Function
-
- Public Overrides Function ToString() As String
- Return String.Format("Point1({0}, {1})", x, y)
- End Function
-End Class
-
-Class Point3D : Inherits Point1
- Private z As Integer
-
- Public Sub New(ByVal x As Integer, ByVal y As Integer, ByVal z As Integer)
- MyBase.New(x, y)
- Me.z = z
- End Sub
-
- Public Overrides Function Equals(ByVal obj As Object) As Boolean
- Dim pt3 As Point3D = TryCast(obj, Point3D)
- If pt3 Is Nothing Then
- Return False
- Else
- Return MyBase.Equals(CType(pt3, Point1)) AndAlso z = pt3.z
- End If
- End Function
-
- Public Overrides Function GetHashCode() As Integer
- Return HashCode.Combine(MyBase.GetHashCode(), z)
- End Function
-
- Public Overrides Function ToString() As String
- Return String.Format("Point1({0}, {1}, {2})", x, y, z)
- End Function
-End Class
-
-Module Example1
- Public Sub Main()
- Dim point2D As New Point1(5, 5)
- Dim point3Da As New Point3D(5, 5, 2)
- Dim point3Db As New Point3D(5, 5, 2)
- Dim point3Dc As New Point3D(5, 5, -1)
-
- Console.WriteLine("{0} = {1}: {2}",
- point2D, point3Da, point2D.Equals(point3Da))
- Console.WriteLine("{0} = {1}: {2}",
- point2D, point3Db, point2D.Equals(point3Db))
- Console.WriteLine("{0} = {1}: {2}",
- point3Da, point3Db, point3Da.Equals(point3Db))
- Console.WriteLine("{0} = {1}: {2}",
- point3Da, point3Dc, point3Da.Equals(point3Dc))
- End Sub
-End Module
-' The example displays the following output
-' Point1(5, 5) = Point1(5, 5, 2): False
-' Point1(5, 5) = Point1(5, 5, 2): False
-' Point1(5, 5, 2) = Point1(5, 5, 2): True
-' Point1(5, 5, 2) = Point1(5, 5, -1): False
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals3.vb
deleted file mode 100644
index 3c331248c67e9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals3.vb
+++ /dev/null
@@ -1,69 +0,0 @@
-'
-Class Rectangle
- Private a, b As Point
-
- Public Sub New(ByVal upLeftX As Integer, ByVal upLeftY As Integer, _
- ByVal downRightX As Integer, ByVal downRightY As Integer)
- Me.a = New Point(upLeftX, upLeftY)
- Me.b = New Point(downRightX, downRightY)
- End Sub
-
- Public Overrides Function Equals(ByVal obj As [Object]) As Boolean
- ' Performs an equality check on two rectangles (Point object pairs).
- If obj Is Nothing OrElse Not [GetType]().Equals(obj.GetType()) Then
- Return False
- End If
- Dim r As Rectangle = CType(obj, Rectangle)
- Return a.Equals(r.a) AndAlso b.Equals(r.b)
- End Function
-
- Public Overrides Function GetHashCode() As Integer
- Return Tuple.Create(a, b).GetHashCode()
- End Function
-
- Public Overrides Function ToString() As String
- Return String.Format("Rectangle({0}, {1}, {2}, {3})",
- a.x, a.y, b.x, b.y)
- End Function
-End Class
-
-Class Point
- Friend x As Integer
- Friend y As Integer
-
- Public Sub New(ByVal X As Integer, ByVal Y As Integer)
- Me.x = X
- Me.y = Y
- End Sub
-
- Public Overrides Function Equals(ByVal obj As [Object]) As Boolean
- ' Performs an equality check on two points (integer pairs).
- If obj Is Nothing OrElse Not [GetType]().Equals(obj.GetType()) Then
- Return False
- Else
- Dim p As Point = CType(obj, Point)
- Return x = p.x AndAlso y = p.y
- End If
- End Function
-
- Public Overrides Function GetHashCode() As Integer
- Return Tuple.Create(x, y).GetHashCode()
- End Function
-End Class
-
-Class Example
- Public Shared Sub Main()
- Dim r1 As New Rectangle(0, 0, 100, 200)
- Dim r2 As New Rectangle(0, 0, 100, 200)
- Dim r3 As New Rectangle(0, 0, 150, 200)
-
- Console.WriteLine("{0} = {1}: {2}", r1, r2, r1.Equals(r2))
- Console.WriteLine("{0} = {1}: {2}", r1, r3, r1.Equals(r3))
- Console.WriteLine("{0} = {1}: {2}", r2, r3, r2.Equals(r3))
- End Sub
-End Class
-' The example displays the following output:
-' Rectangle(0, 0, 100, 200) = Rectangle(0, 0, 100, 200): True
-' Rectangle(0, 0, 100, 200) = Rectangle(0, 0, 150, 200): False
-' Rectangle(0, 0, 100, 200) = Rectangle(0, 0, 150, 200): False
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals4.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals4.vb
deleted file mode 100644
index 9051d6445b4b5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals4.vb
+++ /dev/null
@@ -1,50 +0,0 @@
-'
-Public Structure Complex
- Public re, im As Double
-
- Public Overrides Function Equals(ByVal obj As [Object]) As Boolean
- Return TypeOf obj Is Complex AndAlso Me = CType(obj, Complex)
- End Function
-
- Public Overrides Function GetHashCode() As Integer
- Return Tuple.Create(re, im).GetHashCode()
- End Function
-
- Public Shared Operator = (x As Complex, y As Complex) As Boolean
- Return x.re = y.re AndAlso x.im = y.im
- End Operator
-
- Public Shared Operator <> (x As Complex, y As Complex) As Boolean
- Return Not (x = y)
- End Operator
-
- Public Overrides Function ToString() As String
- Return String.Format("({0}, {1})", re, im)
- End Function
-End Structure
-
-Class Example8
- Public Shared Sub Main()
- Dim cmplx1, cmplx2 As Complex
-
- cmplx1.re = 4.0
- cmplx1.im = 1.0
-
- cmplx2.re = 2.0
- cmplx2.im = 1.0
-
- Console.WriteLine("{0} <> {1}: {2}", cmplx1, cmplx2, cmplx1 <> cmplx2)
- Console.WriteLine("{0} = {1}: {2}", cmplx1, cmplx2, cmplx1.Equals(cmplx2))
-
- cmplx2.re = 4.0
-
- Console.WriteLine("{0} = {1}: {2}", cmplx1, cmplx2, cmplx1 = cmplx2)
- Console.WriteLine("{0} = {1}: {2}", cmplx1, cmplx2, cmplx1.Equals(cmplx2))
- End Sub
-End Class
-' The example displays the following output:
-' (4, 1) <> (2, 1): True
-' (4, 1) = (2, 1): False
-' (4, 1) = (4, 1): True
-' (4, 1) = (4, 1): True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals_ref.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals_ref.vb
deleted file mode 100644
index 1a0c953a4eb61..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals_ref.vb
+++ /dev/null
@@ -1,43 +0,0 @@
-' Visual Basic .NET Document
-' Illustrates reference equality with reference types.
-Option Strict On
-
-'
-' Define a reference type that does not override Equals.
-Public Class Person1
- Private personName As String
-
- Public Sub New(name As String)
- Me.personName = name
- End Sub
-
- Public Overrides Function ToString() As String
- Return Me.personName
- End Function
-End Class
-
-Module Example0
- Public Sub Main()
- Dim person1a As New Person1("John")
- Dim person1b As Person1 = person1a
- Dim person2 As New Person1(person1a.ToString())
-
- Console.WriteLine("Calling Equals:")
- Console.WriteLine("person1a and person1b: {0}", person1a.Equals(person1b))
- Console.WriteLine("person1a and person2: {0}", person1a.Equals(person2))
- Console.WriteLine()
-
- Console.WriteLine("Casting to an Object and calling Equals:")
- Console.WriteLine("person1a and person1b: {0}", CObj(person1a).Equals(CObj(person1b)))
- Console.WriteLine("person1a and person2: {0}", CObj(person1a).Equals(CObj(person2)))
- End Sub
-End Module
-' The example displays the following output:
-' Calling Equals:
-' person1a and person1b: True
-' person1a and person2: False
-'
-' Casting to an Object and calling Equals:
-' person1a and person1b: True
-' person1a and person2: False
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals_val1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals_val1.vb
deleted file mode 100644
index 4b4d127c8d81e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals_val1.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example2
- Public Sub Main()
- Dim value1 As Byte = 12
- Dim value2 As Integer = 12
-
- Dim object1 As Object = value1
- Dim object2 As Object = value2
-
- Console.WriteLine("{0} ({1}) = {2} ({3}): {4}",
- object1, object1.GetType().Name,
- object2, object2.GetType().Name,
- object1.Equals(object2))
- End Sub
-End Module
-' The example displays the following output:
-' 12 (Byte) = 12 (Int32): False
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals_val2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals_val2.vb
deleted file mode 100644
index dc15482d13507..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equals_val2.vb
+++ /dev/null
@@ -1,37 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-' Define a value type that does not override Equals.
-Public Structure Person4
- Private personName As String
-
- Public Sub New(name As String)
- Me.personName = name
- End Sub
-
- Public Overrides Function ToString() As String
- Return Me.personName
- End Function
-End Structure
-
-Module Example4
- Public Sub Main()
- Dim p1 As New Person4("John")
- Dim p2 As New Person4("John")
-
- Console.WriteLine("Calling Equals:")
- Console.WriteLine(p1.Equals(p2))
- Console.WriteLine()
-
- Console.WriteLine("Casting to an Object and calling Equals:")
- Console.WriteLine(CObj(p1).Equals(p2))
- End Sub
-End Module
-' The example displays the following output:
-' Calling Equals:
-' True
-'
-' Casting to an Object and calling Equals:
-' True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equalsoverride.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equalsoverride.vb
deleted file mode 100644
index 82b9d10930324..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equalsoverride.vb
+++ /dev/null
@@ -1,39 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Class Person
- Private idNumber As String
- Private personName As String
-
- Public Sub New(name As String, id As String)
- Me.personName = name
- Me.idNumber = id
- End Sub
-
- Public Overrides Function Equals(obj As Object) As Boolean
- Dim personObj As Person = TryCast(obj, Person)
- If personObj Is Nothing Then
- Return False
- Else
- Return idNumber.Equals(personObj.idNumber)
- End If
- End Function
-
- Public Overrides Function GetHashCode() As Integer
- Return Me.idNumber.GetHashCode()
- End Function
-End Class
-
-Module Example6
- Public Sub Main()
- Dim p1 As New Person("John", "63412895")
- Dim p2 As New Person("Jack", "63412895")
- Console.WriteLine(p1.Equals(p2))
- Console.WriteLine(Object.Equals(p1, p2))
- End Sub
-End Module
-' The example displays the following output:
-' True
-' True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equalssb1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equalssb1.vb
deleted file mode 100644
index 8614c04d0adb7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Equals/vb/equalssb1.vb
+++ /dev/null
@@ -1,29 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text
-
-Module Example5
- Public Sub Main()
- Dim sb1 As New StringBuilder("building a string...")
- Dim sb2 As New StringBuilder("building a string...")
-
- Console.WriteLine("sb1.Equals(sb2): {0}", sb1.Equals(sb2))
- Console.WriteLine("CObj(sb1).Equals(sb2): {0}",
- CObj(sb1).Equals(sb2))
- Console.WriteLine("Object.Equals(sb1, sb2): {0}",
- Object.Equals(sb1, sb2))
-
- Console.WriteLine()
- Dim sb3 As Object = New StringBuilder("building a string...")
- Console.WriteLine("sb3.Equals(sb2): {0}", sb3.Equals(sb2))
- End Sub
-End Module
-' The example displays the following output:
-' sb1.Equals(sb2): True
-' CObj(sb1).Equals(sb2): False
-' Object.Equals(sb1, sb2): False
-'
-' sb3.Equals(sb2): False
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/csharp/finalize_safe.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/csharp/finalize_safe.cs
deleted file mode 100644
index 2105ed307704a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/csharp/finalize_safe.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-using Microsoft.Win32.SafeHandles;
-using System;
-using System.ComponentModel;
-using System.IO;
-using System.Runtime.InteropServices;
-
-public class FileAssociationInfo : IDisposable
-{
- // Private variables.
- private String ext;
- private String openCmd;
- private String args;
- private SafeRegistryHandle hExtHandle, hAppIdHandle;
-
- // Windows API calls.
- [DllImport("advapi32.dll", CharSet= CharSet.Auto, SetLastError=true)]
- private static extern int RegOpenKeyEx(IntPtr hKey,
- String lpSubKey, int ulOptions, int samDesired,
- out IntPtr phkResult);
- [DllImport("advapi32.dll", CharSet= CharSet.Unicode, EntryPoint = "RegQueryValueExW",
- SetLastError=true)]
- private static extern int RegQueryValueEx(IntPtr hKey,
- string lpValueName, int lpReserved, out uint lpType,
- string lpData, ref uint lpcbData);
- [DllImport("advapi32.dll", SetLastError = true)]
- private static extern int RegSetValueEx(IntPtr hKey, [MarshalAs(UnmanagedType.LPStr)] string lpValueName,
- int Reserved, uint dwType, [MarshalAs(UnmanagedType.LPStr)] string lpData,
- int cpData);
- [DllImport("advapi32.dll", SetLastError=true)]
- private static extern int RegCloseKey(UIntPtr hKey);
-
- // Windows API constants.
- private const int HKEY_CLASSES_ROOT = unchecked((int) 0x80000000);
- private const int ERROR_SUCCESS = 0;
-
- private const int KEY_QUERY_VALUE = 1;
- private const int KEY_SET_VALUE = 0x2;
-
- private const uint REG_SZ = 1;
-
- private const int MAX_PATH = 260;
-
- public FileAssociationInfo(String fileExtension)
- {
- int retVal = 0;
- uint lpType = 0;
-
- if (!fileExtension.StartsWith("."))
- fileExtension = "." + fileExtension;
- ext = fileExtension;
-
- IntPtr hExtension = IntPtr.Zero;
- // Get the file extension value.
- retVal = RegOpenKeyEx(new IntPtr(HKEY_CLASSES_ROOT), fileExtension, 0, KEY_QUERY_VALUE, out hExtension);
- if (retVal != ERROR_SUCCESS)
- throw new Win32Exception(retVal);
- // Instantiate the first SafeRegistryHandle.
- hExtHandle = new SafeRegistryHandle(hExtension, true);
-
- string appId = new string(' ', MAX_PATH);
- uint appIdLength = (uint) appId.Length;
- retVal = RegQueryValueEx(hExtHandle.DangerousGetHandle(), String.Empty, 0, out lpType, appId, ref appIdLength);
- if (retVal != ERROR_SUCCESS)
- throw new Win32Exception(retVal);
- // We no longer need the hExtension handle.
- hExtHandle.Dispose();
-
- // Determine the number of characters without the terminating null.
- appId = appId.Substring(0, (int) appIdLength / 2 - 1) + @"\shell\open\Command";
-
- // Open the application identifier key.
- string exeName = new string(' ', MAX_PATH);
- uint exeNameLength = (uint) exeName.Length;
- IntPtr hAppId;
- retVal = RegOpenKeyEx(new IntPtr(HKEY_CLASSES_ROOT), appId, 0, KEY_QUERY_VALUE | KEY_SET_VALUE,
- out hAppId);
- if (retVal != ERROR_SUCCESS)
- throw new Win32Exception(retVal);
-
- // Instantiate the second SafeRegistryHandle.
- hAppIdHandle = new SafeRegistryHandle(hAppId, true);
-
- // Get the executable name for this file type.
- string exePath = new string(' ', MAX_PATH);
- uint exePathLength = (uint) exePath.Length;
- retVal = RegQueryValueEx(hAppIdHandle.DangerousGetHandle(), String.Empty, 0, out lpType, exePath, ref exePathLength);
- if (retVal != ERROR_SUCCESS)
- throw new Win32Exception(retVal);
-
- // Determine the number of characters without the terminating null.
- exePath = exePath.Substring(0, (int) exePathLength / 2 - 1);
- // Remove any environment strings.
- exePath = Environment.ExpandEnvironmentVariables(exePath);
-
- int position = exePath.IndexOf('%');
- if (position >= 0) {
- args = exePath.Substring(position);
- // Remove command line parameters ('%0', etc.).
- exePath = exePath.Substring(0, position).Trim();
- }
- openCmd = exePath;
- }
-
- public String Extension
- { get { return ext; } }
-
- public String Open
- { get { return openCmd; }
- set {
- if (hAppIdHandle.IsInvalid | hAppIdHandle.IsClosed)
- throw new InvalidOperationException("Cannot write to registry key.");
- if (! File.Exists(value)) {
- string message = String.Format("'{0}' does not exist", value);
- throw new FileNotFoundException(message);
- }
- string cmd = value + " %1";
- int retVal = RegSetValueEx(hAppIdHandle.DangerousGetHandle(), String.Empty, 0,
- REG_SZ, value, value.Length + 1);
- if (retVal != ERROR_SUCCESS)
- throw new Win32Exception(retVal);
- } }
-
- public void Dispose()
- {
- Dispose(disposing: true);
- GC.SuppressFinalize(this);
- }
-
- protected void Dispose(bool disposing)
- {
- // Ordinarily, we release unmanaged resources here;
- // but all are wrapped by safe handles.
-
- // Release disposable objects.
- if (disposing) {
- if (hExtHandle != null) hExtHandle.Dispose();
- if (hAppIdHandle != null) hAppIdHandle.Dispose();
- }
- }
-}
-//
-
-public class Example
-{
- public static void Main()
- {
- FileAssociationInfo fa = new FileAssociationInfo(".txt");
- Console.WriteLine($"{fa.Extension} files are handled by '{fa.Open}'");
- fa.Dispose();
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/fsharp/finalize_safe.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/fsharp/finalize_safe.fs
deleted file mode 100644
index 748b9a94823a3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/fsharp/finalize_safe.fs
+++ /dev/null
@@ -1,123 +0,0 @@
-module finalize_safe
-
-//
-open Microsoft.Win32.SafeHandles
-open System
-open System.ComponentModel
-open System.IO
-open System.Runtime.InteropServices
-
-// Windows API constants.
-let HKEY_CLASSES_ROOT = 0x80000000
-let ERROR_SUCCESS = 0
-let KEY_QUERY_VALUE = 1
-let KEY_SET_VALUE = 0x2
-let REG_SZ = 1u
-let MAX_PATH = 260
-
-// Windows API calls.
-[]
-extern int RegOpenKeyEx(nativeint hKey, string lpSubKey, int ulOptions, int samDesired, nativeint& phkResult)
-[]
-extern int RegQueryValueEx(nativeint hKey, string lpValueName, int lpReserved, uint& lpType, string lpData, uint& lpcbData)
-[]
-extern int RegSetValueEx(nativeint hKey, [] string lpValueName, int Reserved, uint dwType, [] string lpData, int cpData)
-[]
-extern int RegCloseKey(unativeint hKey)
-
-type FileAssociationInfo(fileExtension: string) =
- // Private values.
- let ext =
- if fileExtension.StartsWith "." |> not then
- "." + fileExtension
- else
- fileExtension
- let mutable args = ""
- let mutable hAppIdHandle = Unchecked.defaultof
- let mutable hExtHandle = Unchecked.defaultof
- let openCmd =
- let mutable lpType = 0u
- let mutable hExtension = 0n
- // Get the file extension value.
- let retVal = RegOpenKeyEx(nativeint HKEY_CLASSES_ROOT, fileExtension, 0, KEY_QUERY_VALUE, &hExtension)
- if retVal <> ERROR_SUCCESS then
- raise (Win32Exception retVal)
- // Instantiate the first SafeRegistryHandle.
- hExtHandle <- new SafeRegistryHandle(hExtension, true)
-
- let appId = String(' ', MAX_PATH)
- let mutable appIdLength = uint appId.Length
- let retVal = RegQueryValueEx(hExtHandle.DangerousGetHandle(), String.Empty, 0, &lpType, appId, &appIdLength)
- if retVal <> ERROR_SUCCESS then
- raise (Win32Exception retVal)
- // We no longer need the hExtension handle.
- hExtHandle.Dispose()
-
- // Determine the number of characters without the terminating null.
- let appId = appId.Substring(0, int appIdLength / 2 - 1) + @"\shell\open\Command"
-
- // Open the application identifier key.
- let exeName = String(' ', MAX_PATH)
- let exeNameLength = uint exeName.Length
- let mutable hAppId = 0n
- let retVal = RegOpenKeyEx(nativeint HKEY_CLASSES_ROOT, appId, 0, KEY_QUERY_VALUE ||| KEY_SET_VALUE, &hAppId)
- if retVal <> ERROR_SUCCESS then
- raise (Win32Exception retVal)
-
- // Instantiate the second SafeRegistryHandle.
- hAppIdHandle <- new SafeRegistryHandle(hAppId, true)
-
- // Get the executable name for this file type.
- let exePath = String(' ', MAX_PATH)
- let mutable exePathLength = uint exePath.Length
- let retVal = RegQueryValueEx(hAppIdHandle.DangerousGetHandle(), String.Empty, 0, &lpType, exePath, &exePathLength)
- if retVal <> ERROR_SUCCESS then
- raise (Win32Exception retVal)
-
- // Determine the number of characters without the terminating null.
- let exePath =
- exePath.Substring(0, int exePathLength / 2 - 1)
- // Remove any environment strings.
- |> Environment.ExpandEnvironmentVariables
-
- let position = exePath.IndexOf '%'
- if position >= 0 then
- args <- exePath.Substring position
- // Remove command line parameters ('%0', etc.).
- exePath.Substring(0, position).Trim()
- else
- exePath
-
- member _.Extension =
- ext
-
- member _.Open
- with get () = openCmd
- and set (value) =
- if hAppIdHandle.IsInvalid || hAppIdHandle.IsClosed then
- raise (InvalidOperationException "Cannot write to registry key.")
- if not (File.Exists value) then
- raise (FileNotFoundException $"'{value}' does not exist")
-
- let cmd = value + " %1"
- let retVal = RegSetValueEx(hAppIdHandle.DangerousGetHandle(), String.Empty, 0, REG_SZ, value, value.Length + 1)
- if retVal <> ERROR_SUCCESS then
- raise (Win32Exception retVal)
-
- member this.Dispose() =
- this.Dispose true
- GC.SuppressFinalize this
-
- member _.Dispose(disposing) =
- // Ordinarily, we release unmanaged resources here
- // but all are wrapped by safe handles.
-
- // Release disposable objects.
- if disposing then
- if hExtHandle <> null then hExtHandle.Dispose()
- if hAppIdHandle <> null then hAppIdHandle.Dispose()
-
- interface IDisposable with
- member this.Dispose() =
- this.Dispose()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/vb/finalize_safe.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/vb/finalize_safe.vb
deleted file mode 100644
index 72f4f3ad207b1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/Finalize/vb/finalize_safe.vb
+++ /dev/null
@@ -1,167 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports Microsoft.Win32.SafeHandles
-Imports System.ComponentModel
-Imports System.IO
-Imports System.Runtime.InteropServices
-Imports System.Text
-
-Public Class FileAssociationInfo : Implements IDisposable
- ' Private variables.
- Private ext As String
- Private openCmd As String
- Private args As String
- Private hExtHandle, hAppIdHandle As SafeRegistryHandle
-
- ' Windows API calls.
- Private Declare Unicode Function RegOpenKeyEx Lib"advapi32.dll" _
- Alias "RegOpenKeyExW" (hKey As IntPtr, lpSubKey As String, _
- ulOptions As Integer, samDesired As Integer, _
- ByRef phkResult As IntPtr) As Integer
- Private Declare Unicode Function RegQueryValueEx Lib "advapi32.dll" _
- Alias "RegQueryValueExW" (hKey As IntPtr, _
- lpValueName As String, lpReserved As Integer, _
- ByRef lpType As UInteger, lpData As String, _
- ByRef lpcbData As UInteger) As Integer
- Private Declare Function RegSetValueEx Lib "advapi32.dll" _
- (hKey As IntPtr, _
- lpValueName As String, _
- reserved As Integer, dwType As UInteger, _
- lpData As String, _
- cpData As Integer) As Integer
- Private Declare Function RegCloseKey Lib "advapi32.dll" _
- (hKey As IntPtr) As Integer
-
- ' Windows API constants.
- Private Const HKEY_CLASSES_ROOT As Integer = &h80000000
- Private Const ERROR_SUCCESS As Integer = 0
-
- Private Const KEY_QUERY_VALUE As Integer = 1
- Private Const KEY_SET_VALUE As Integer = &h2
-
- Private REG_SZ As UInteger = 1
-
- Private Const MAX_PATH As Integer = 260
-
- Public Sub New(fileExtension As String)
- Dim retVal As Integer = 0
- Dim lpType As UInteger = 0
-
- If Not fileExtension.StartsWith(".") Then
- fileExtension = "." + fileExtension
- End If
- ext = fileExtension
-
- Dim hExtension As IntPtr = IntPtr.Zero
- ' Get the file extension value.
- retVal = RegOpenKeyEx(New IntPtr(HKEY_CLASSES_ROOT), fileExtension, 0,
- KEY_QUERY_VALUE, hExtension)
- if retVal <> ERROR_SUCCESS Then
- Throw New Win32Exception(retVal)
- End If
- ' Instantiate the first SafeRegistryHandle.
- hExtHandle = New SafeRegistryHandle(hExtension, True)
-
- Dim appId As New String(" "c, MAX_PATH)
- Dim appIdLength As UInteger = CUInt(appId.Length)
- retVal = RegQueryValueEx(hExtHandle.DangerousGetHandle(), String.Empty, _
- 0, lpType, appId, appIdLength)
- if retVal <> ERROR_SUCCESS Then
- Throw New Win32Exception(retVal)
- End If
- ' We no longer need the hExtension handle.
- hExtHandle.Dispose()
-
- ' Determine the number of characters without the terminating null.
- appId = appId.Substring(0, CInt(appIdLength) \ 2 - 1) + "\shell\open\Command"
-
- ' Open the application identifier key.
- Dim exeName As New string(" "c, MAX_PATH)
- Dim exeNameLength As UInteger = CUInt(exeName.Length)
- Dim hAppId As IntPtr
- retVal = RegOpenKeyEx(New IntPtr(HKEY_CLASSES_ROOT), appId, 0,
- KEY_QUERY_VALUE Or KEY_SET_VALUE, hAppId)
- If retVal <> ERROR_SUCCESS Then
- Throw New Win32Exception(retVal)
- End If
-
- ' Instantiate the second SafeRegistryHandle.
- hAppIdHandle = New SafeRegistryHandle(hAppId, True)
-
- ' Get the executable name for this file type.
- Dim exePath As New string(" "c, MAX_PATH)
- Dim exePathLength As UInteger = CUInt(exePath.Length)
- retVal = RegQueryValueEx(hAppIdHandle.DangerousGetHandle(), _
- String.Empty, 0, lpType, exePath, exePathLength)
- If retVal <> ERROR_SUCCESS Then
- Throw New Win32Exception(retVal)
- End If
- ' Determine the number of characters without the terminating null.
- exePath = exePath.Substring(0, CInt(exePathLength) \ 2 - 1)
-
- exePath = Environment.ExpandEnvironmentVariables(exePath)
- Dim position As Integer = exePath.IndexOf("%"c)
- If position >= 0 Then
- args = exePath.Substring(position)
- ' Remove command line parameters ('%0', etc.).
- exePath = exePath.Substring(0, position).Trim()
- End If
- openCmd = exePath
- End Sub
-
- Public ReadOnly Property Extension As String
- Get
- Return ext
- End Get
- End Property
-
- Public Property Open As String
- Get
- Return openCmd
- End Get
- Set
- If hAppIdHandle.IsInvalid Or hAppIdHandle.IsClosed Then
- Throw New InvalidOperationException("Cannot write to registry key.")
- End If
- If Not File.Exists(value) Then
- Dim message As String = String.Format("'{0}' does not exist", value)
- Throw New FileNotFoundException(message)
- End If
- Dim cmd As String = value + " %1"
- Dim retVal As Integer = RegSetValueEx(hAppIdHandle.DangerousGetHandle(), String.Empty, 0,
- REG_SZ, value, value.Length + 1)
- If retVal <> ERROR_SUCCESS Then
- Throw New Win32Exception(retVal)
- End If
- End Set
- End Property
-
- Public Sub Dispose() _
- Implements IDisposable.Dispose
- Dispose(disposing:=True)
- GC.SuppressFinalize(Me)
- End Sub
-
- Protected Sub Dispose(disposing As Boolean)
- ' Ordinarily, we release unmanaged resources here
- ' but all are wrapped by safe handles.
-
- ' Release disposable objects.
- If disposing Then
- If hExtHandle IsNot Nothing Then hExtHandle.Dispose()
- If hAppIdHandle IsNot Nothing Then hAppIdHandle.Dispose()
- End If
- End Sub
-End Class
-'
-
-Module Example
- Public Sub Main()
- Dim fa As New FileAssociationInfo(".txt")
- Console.WriteLine("{0} files are handled by '{1}'", fa.Extension, fa.Open)
- fa.Dispose()
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/direct1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/direct1.cs
deleted file mode 100644
index 666b1dff9669e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/direct1.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-using System;
-
-public struct Number
-{
- private int n;
-
- public Number(int value)
- {
- n = value;
- }
-
- public int Value
- {
- get { return n; }
- }
-
- public override bool Equals(Object obj)
- {
- if (obj == null || ! (obj is Number))
- return false;
- else
- return n == ((Number) obj).n;
- }
-
- public override int GetHashCode()
- {
- return n;
- }
-
- public override string ToString()
- {
- return n.ToString();
- }
-}
-
-public class Example1
-{
- public static void Main()
- {
- Random rnd = new Random();
- for (int ctr = 0; ctr <= 9; ctr++) {
- int randomN = rnd.Next(Int32.MinValue, Int32.MaxValue);
- Number n = new Number(randomN);
- Console.WriteLine("n = {0,12}, hash code = {1,12}", n, n.GetHashCode());
- }
- }
-}
-// The example displays output like the following:
-// n = -634398368, hash code = -634398368
-// n = 2136747730, hash code = 2136747730
-// n = -1973417279, hash code = -1973417279
-// n = 1101478715, hash code = 1101478715
-// n = 2078057429, hash code = 2078057429
-// n = -334489950, hash code = -334489950
-// n = -68958230, hash code = -68958230
-// n = -379951485, hash code = -379951485
-// n = -31553685, hash code = -31553685
-// n = 2105429592, hash code = 2105429592
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/shift1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/shift1.cs
deleted file mode 100644
index c9f7c4431f990..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/shift1.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-using System;
-
-public struct Point
-{
- private int x;
- private int y;
-
- public Point(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
-
- public override bool Equals(Object obj)
- {
- if (!(obj is Point)) return false;
-
- Point p = (Point) obj;
- return x == p.x & y == p.y;
- }
-
- public override int GetHashCode()
- {
- return ShiftAndWrap(x.GetHashCode(), 2) ^ y.GetHashCode();
- }
-
- private int ShiftAndWrap(int value, int positions)
- {
- positions = positions & 0x1F;
-
- // Save the existing bit pattern, but interpret it as an unsigned integer.
- uint number = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
- // Preserve the bits to be discarded.
- uint wrapped = number >> (32 - positions);
- // Shift and wrap the discarded bits.
- return BitConverter.ToInt32(BitConverter.GetBytes((number << positions) | wrapped), 0);
- }
-}
-
-public class Example2
-{
- public static void Main()
- {
- Point pt = new Point(5, 8);
- Console.WriteLine(pt.GetHashCode());
-
- pt = new Point(8, 5);
- Console.WriteLine(pt.GetHashCode());
- }
-}
-// The example displays the following output:
-// 28
-// 37
-//
-
-public class Utility
-{
- //
- public int ShiftAndWrap(int value, int positions)
- {
- positions = positions & 0x1F;
-
- // Save the existing bit pattern, but interpret it as an unsigned integer.
- uint number = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);
- // Preserve the bits to be discarded.
- uint wrapped = number >> (32 - positions);
- // Shift and wrap the discarded bits.
- return BitConverter.ToInt32(BitConverter.GetBytes((number << positions) | wrapped), 0);
- }
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/xor1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/xor1.cs
deleted file mode 100644
index a37b2efa1b4b1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/xor1.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-using System;
-
-// A type that represents a 2-D point.
-public struct Point2
-{
- private int x;
- private int y;
-
- public Point2(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
-
- public override bool Equals(Object obj)
- {
- if (! (obj is Point2)) return false;
-
- Point2 p = (Point2) obj;
- return x == p.x & y == p.y;
- }
-
- public override int GetHashCode()
- {
- return x ^ y;
- }
-}
-
-public class Example3
-{
- public static void Main()
- {
- Point2 pt = new Point2(5, 8);
- Console.WriteLine(pt.GetHashCode());
-
- pt = new Point2(8, 5);
- Console.WriteLine(pt.GetHashCode());
- }
-}
-// The example displays the following output:
-// 13
-// 13
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/xor2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/xor2.cs
deleted file mode 100644
index d8ad45dd2f9f0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/csharp/xor2.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-using System;
-
-public struct Point3
-{
- private int x;
- private int y;
-
- public Point3(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
-
- public override bool Equals(Object obj)
- {
- if (obj is Point3)
- {
- Point3 p = (Point3) obj;
- return x == p.x & y == p.y;
- }
- else
- {
- return false;
- }
- }
-
- public override int GetHashCode()
- {
- return HashCode.Combine(x, y);
- }
-}
-
-public class Example
-{
- public static void Main()
- {
- Point3 pt = new Point3(5, 8);
- Console.WriteLine(pt.GetHashCode());
-
- pt = new Point3(8, 5);
- Console.WriteLine(pt.GetHashCode());
- }
-}
-// The example displays output similar to the following.
-// Note: HashCode.Combine results are not stable across .NET versions.
-// 185727722
-// -363254492
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/Project.fsproj b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/Project.fsproj
deleted file mode 100644
index 77f3e54624c69..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/Project.fsproj
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/direct1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/direct1.fs
deleted file mode 100644
index 49f21a4c4c2eb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/direct1.fs
+++ /dev/null
@@ -1,38 +0,0 @@
-module direct1
-
-//
-open System
-
-[]
-type Number(value: int) =
- member _.Value = value
-
- override _.Equals(obj) =
- match obj with
- | :? Number as n ->
- n.Value = value
- | _ -> false
-
- override _.GetHashCode() =
- value
-
- override _.ToString() =
- string value
-
-let rnd = Random()
-for _ = 0 to 9 do
- let randomN = rnd.Next(Int32.MinValue, Int32.MaxValue)
- let n = Number randomN
- printfn $"n = {n,12}, hash code = {n.GetHashCode(),12}"
-// The example displays output like the following:
-// n = -634398368, hash code = -634398368
-// n = 2136747730, hash code = 2136747730
-// n = -1973417279, hash code = -1973417279
-// n = 1101478715, hash code = 1101478715
-// n = 2078057429, hash code = 2078057429
-// n = -334489950, hash code = -334489950
-// n = -68958230, hash code = -68958230
-// n = -379951485, hash code = -379951485
-// n = -31553685, hash code = -31553685
-// n = 2105429592, hash code = 2105429592
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/shift1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/shift1.fs
deleted file mode 100644
index 76c44fe52a773..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/shift1.fs
+++ /dev/null
@@ -1,50 +0,0 @@
-module shift1
-
-//
-open System
-
-[]
-type Point(x: int, y: int) =
- member _.X = x
- member _.Y = y
- override _.Equals(obj) =
- match obj with
- | :? Point as p ->
- x = p.X && y = p.Y
- | _ ->
- false
-
- override this.GetHashCode() =
- this.ShiftAndWrap(x.GetHashCode(), 2) ^^^ y.GetHashCode()
-
- member _.ShiftAndWrap(value, positions) =
- let positions = positions &&& 0x1F
-
- // Save the existing bit pattern, but interpret it as an unsigned integer.
- let number = BitConverter.ToUInt32(BitConverter.GetBytes value, 0)
- // Preserve the bits to be discarded.
- let wrapped = number >>> (32 - positions)
- // Shift and wrap the discarded bits.
- BitConverter.ToInt32(BitConverter.GetBytes((number <<< positions) ||| wrapped), 0)
-
-let pt = Point(5, 8)
-printfn $"{pt.GetHashCode()}"
-
-let pt2 = Point(8, 5)
-printfn $"{pt2.GetHashCode()}"
-// The example displays the following output:
-// 28
-// 37
-//
-
-//
-let shiftAndWrap (value: int) positions =
- let positions = positions &&& 0x1F
-
- // Save the existing bit pattern, but interpret it as an unsigned integer.
- let number = BitConverter.ToUInt32(BitConverter.GetBytes value, 0)
- // Preserve the bits to be discarded.
- let wrapped = number >>> (32 - positions)
- // Shift and wrap the discarded bits.
- BitConverter.ToInt32(BitConverter.GetBytes((number <<< positions) ||| wrapped), 0)
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/xor1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/xor1.fs
deleted file mode 100644
index 98a461d9595cf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/xor1.fs
+++ /dev/null
@@ -1,28 +0,0 @@
-module xor1
-
-//
-// A type that represents a 2-D point.
-[]
-type Point(x: int, y: int) =
- member _.X = x
- member _.Y = y
-
- override _.Equals(obj) =
- match obj with
- | :? Point as p ->
- x = p.X && y = p.Y
- | _ ->
- false
-
- override _.GetHashCode() =
- x ^^^ y
-
-let pt = Point(5, 8)
-printfn $"{pt.GetHashCode()}"
-
-let pt2 = Point(8, 5)
-printfn $"{pt.GetHashCode()}"
-// The example displays the following output:
-// 13
-// 13
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/xor2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/xor2.fs
deleted file mode 100644
index 1290f982eb0ae..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/fsharp/xor2.fs
+++ /dev/null
@@ -1,28 +0,0 @@
-module xor2
-
-//
-[]
-type Point(x: int, y: int) =
- member _.X = x
- member _.Y = y
-
- override _.Equals(obj) =
- match obj with
- | :? Point as p ->
- x = p.X && y = p.Y
- | _ ->
- false
-
- override _.GetHashCode() =
- System.HashCode.Combine(x, y)
-
-let pt = Point(5, 8)
-printfn $"{pt.GetHashCode()}"
-
-let pt2 = Point(8, 5)
-printfn $"{pt2.GetHashCode()}"
-// The example displays output similar to the following.
-// Note: HashCode.Combine results are not stable across .NET versions.
-// 185727722
-// -363254492
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/direct1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/direct1.vb
deleted file mode 100644
index fa15d44fa6008..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/direct1.vb
+++ /dev/null
@@ -1,56 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Structure Number
- Private n As Integer
-
- Public Sub New(value As Integer)
- n = value
- End Sub
-
- Public ReadOnly Property Value As Integer
- Get
- Return n
- End Get
- End Property
-
- Public Overrides Function Equals(obj As Object) As Boolean
- If obj Is Nothing OrElse Not TypeOf obj Is Number Then
- Return False
- Else
- Return n = CType(obj, Number).n
- End If
- End Function
-
- Public Overrides Function GetHashCode() As Integer
- Return n
- End Function
-
- Public Overrides Function ToString() As String
- Return n.ToString()
- End Function
-End Structure
-
-Module Example1
- Public Sub Main()
- Dim rnd As New Random()
- For ctr As Integer = 0 To 9
- Dim randomN As Integer = rnd.Next(Int32.MinValue, Int32.MaxValue)
- Dim n As New Number(randomN)
- Console.WriteLine("n = {0,12}, hash code = {1,12}", n, n.GetHashCode())
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' n = -634398368, hash code = -634398368
-' n = 2136747730, hash code = 2136747730
-' n = -1973417279, hash code = -1973417279
-' n = 1101478715, hash code = 1101478715
-' n = 2078057429, hash code = 2078057429
-' n = -334489950, hash code = -334489950
-' n = -68958230, hash code = -68958230
-' n = -379951485, hash code = -379951485
-' n = -31553685, hash code = -31553685
-' n = 2105429592, hash code = 2105429592
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/shift1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/shift1.vb
deleted file mode 100644
index 965dbaae22ee6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/shift1.vb
+++ /dev/null
@@ -1,64 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Structure Point5
- Private x As Integer
- Private y As Integer
-
- Public Sub New(x As Integer, y As Integer)
- Me.x = x
- Me.y = y
- End Sub
-
- Public Overrides Function Equals(obj As Object) As Boolean
- If Not TypeOf obj Is Point5 Then Return False
-
- Dim p As Point5 = CType(obj, Point5)
- Return x = p.x And y = p.y
- End Function
-
- Public Overrides Function GetHashCode() As Integer
- Return ShiftAndWrap(x.GetHashCode(), 2) Xor y.GetHashCode()
- End Function
-
- Private Function ShiftAndWrap(value As Integer, positions As Integer) As Integer
- positions = positions And &H1F
-
- ' Save the existing bit pattern, but interpret it as an unsigned integer.
- Dim number As UInteger = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0)
- ' Preserve the bits to be discarded.
- Dim wrapped As UInteger = number >> (32 - positions)
- ' Shift and wrap the discarded bits.
- Return BitConverter.ToInt32(BitConverter.GetBytes((number << positions) Or wrapped), 0)
- End Function
-End Structure
-
-Module Example2
- Public Sub Main()
- Dim pt As New Point5(5, 8)
- Console.WriteLine(pt.GetHashCode())
-
- pt = New Point5(8, 5)
- Console.WriteLine(pt.GetHashCode())
- End Sub
-End Module
-' The example displays the following output:
-' 28
-' 37
-'
-
-Public Class Utility
- '
- Public Function ShiftAndWrap(value As Integer, positions As Integer) As Integer
- positions = positions And &h1F
-
- ' Save the existing bit pattern, but interpret it as an unsigned integer.
- Dim number As UInteger = BitConverter.ToUInt32(BitConverter.GetBytes(value), 0)
- ' Preserve the bits to be discarded.
- Dim wrapped AS UInteger = number >> (32 - positions)
- ' Shift and wrap the discarded bits.
- Return BitConverter.ToInt32(BitConverter.GetBytes((number << positions) Or wrapped), 0)
- End Function
- '
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/xor1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/xor1.vb
deleted file mode 100644
index ca429dba04f91..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/xor1.vb
+++ /dev/null
@@ -1,34 +0,0 @@
-'
-' A type that represents a 2-D point.
-Public Structure Point3
- Private x As Integer
- Private y As Integer
-
- Public Sub New(x As Integer, y As Integer)
- Me.x = x
- Me.y = y
- End Sub
-
- Public Overrides Function Equals(obj As Object) As Boolean
- If Not TypeOf obj Is Point3 Then Return False
-
- Dim p As Point3 = CType(obj, Point3)
- Return x = p.x And y = p.y
- End Function
-
- Public Overrides Function GetHashCode() As Integer
- Return x Xor y
- End Function
-End Structure
-
-Public Module Example3
- Public Sub Main()
- Dim pt As New Point3(5, 8)
- Console.WriteLine(pt.GetHashCode())
-
- pt = New Point3(8, 5)
- Console.WriteLine(pt.GetHashCode())
- End Sub
-End Module
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/xor2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/xor2.vb
deleted file mode 100644
index 7a18c7232ed10..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/GetHashCode/vb/xor2.vb
+++ /dev/null
@@ -1,36 +0,0 @@
-'
-Public Structure Point
- Private x As Integer
- Private y As Integer
-
- Public Sub New(x As Integer, y As Integer)
- Me.x = x
- Me.y = y
- End Sub
-
- Public Overrides Function Equals(obj As Object) As Boolean
- If Not TypeOf obj Is Point Then Return False
-
- Dim p As Point = CType(obj, Point)
- Return x = p.x And y = p.y
- End Function
-
- Public Overrides Function GetHashCode() As Integer
- Return HashCode.Combine(x, y)
- End Function
-End Structure
-
-Public Module Example
- Public Sub Main()
- Dim pt As New Point(5, 8)
- Console.WriteLine(pt.GetHashCode())
-
- pt = New Point(8, 5)
- Console.WriteLine(pt.GetHashCode())
- End Sub
-End Module
-' The example displays output similar to the following.
-' Note: HashCode.Combine results are not stable across .NET versions.
-' 185727722
-' -363254492
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/array1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/array1.cs
deleted file mode 100644
index cf7b237be0c1a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/array1.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-public class Example
-{
- public static void Main()
- {
- //
- int[] values = { 1, 2, 4, 8, 16, 32, 64, 128 };
- Console.WriteLine(values.ToString());
-
- List list = new List(values);
- Console.WriteLine(list.ToString());
-
- // The example displays the following output:
- // System.Int32[]
- // System.Collections.Generic.List`1[System.Int32]
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/customize1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/customize1.cs
deleted file mode 100644
index 6a8593a7b6caf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/customize1.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-public class CList : List
-{
- public CList(IEnumerable collection) : base(collection)
- { }
-
- public CList() : base()
- {}
-
- public override string ToString()
- {
- string retVal = string.Empty;
- foreach (T item in this) {
- if (string.IsNullOrEmpty(retVal))
- retVal += item.ToString();
- else
- retVal += string.Format(", {0}", item);
- }
- return retVal;
- }
-}
-
-public class Example2
-{
- public static void Main()
- {
- var list2 = new CList();
- list2.Add(1000);
- list2.Add(2000);
- Console.WriteLine(list2.ToString());
- }
-}
-// The example displays the following output:
-// 1000, 2000
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/customize2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/customize2.cs
deleted file mode 100644
index bc7495d76904e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/customize2.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-
-public static class StringExtensions
-{
- public static string ToString2(this List l)
- {
- string retVal = string.Empty;
- foreach (T item in l)
- retVal += string.Format("{0}{1}", string.IsNullOrEmpty(retVal) ?
- "" : ", ",
- item);
- return string.IsNullOrEmpty(retVal) ? "{}" : "{ " + retVal + " }";
- }
-
- public static string ToString(this List l, string fmt)
- {
- string retVal = string.Empty;
- foreach (T item in l) {
- IFormattable ifmt = item as IFormattable;
- if (ifmt != null)
- retVal += string.Format("{0}{1}",
- string.IsNullOrEmpty(retVal) ?
- "" : ", ", ifmt.ToString(fmt, null));
- else
- retVal += ToString2(l);
- }
- return string.IsNullOrEmpty(retVal) ? "{}" : "{ " + retVal + " }";
- }
-}
-
-public class Example3
-{
- public static void Main()
- {
- List list = new List();
- list.Add(1000);
- list.Add(2000);
- Console.WriteLine(list.ToString2());
- Console.WriteLine(list.ToString("N0"));
- }
-}
-// The example displays the following output:
-// { 1000, 2000 }
-// { 1,000, 2,000 }
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostring1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostring1.cs
deleted file mode 100644
index 4651e461af24b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostring1.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-public class Example4
-{
- public static void Main()
- {
- //
- Object obj = new Object();
- Console.WriteLine(obj.ToString());
-
- // The example displays the following output:
- // System.Object
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostring2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostring2.cs
deleted file mode 100644
index 651cd69732c2e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostring2.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-using System;
-using Examples;
-
-namespace Examples
-{
- public class Object1
- {
- }
-}
-
-public class Example5
-{
- public static void Main()
- {
- object obj1 = new Object1();
- Console.WriteLine(obj1.ToString());
- }
-}
-// The example displays the following output:
-// Examples.Object1
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostring3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostring3.cs
deleted file mode 100644
index 8752cac0b47f8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostring3.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-using System;
-
-public class Object2
-{
- private object value;
-
- public Object2(object value)
- {
- this.value = value;
- }
-
- public override string ToString()
- {
- return base.ToString() + ": " + value.ToString();
- }
-}
-
-public class Example6
-{
- public static void Main()
- {
- Object2 obj2 = new Object2('a');
- Console.WriteLine(obj2.ToString());
- }
-}
-// The example displays the following output:
-// Object2: a
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostringoverload1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostringoverload1.cs
deleted file mode 100644
index 83cf6df70ad66..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostringoverload1.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-using System;
-
-public class Automobile
-{
- private int _doors;
- private string _cylinders;
- private int _year;
- private string _model;
-
- public Automobile(string model, int year , int doors,
- string cylinders)
- {
- _model = model;
- _year = year;
- _doors = doors;
- _cylinders = cylinders;
- }
-
- public int Doors
- { get { return _doors; } }
-
- public string Model
- { get { return _model; } }
-
- public int Year
- { get { return _year; } }
-
- public string Cylinders
- { get { return _cylinders; } }
-
- public override string ToString()
- {
- return ToString("G");
- }
-
- public string ToString(string fmt)
- {
- if (string.IsNullOrEmpty(fmt))
- fmt = "G";
-
- switch (fmt.ToUpperInvariant())
- {
- case "G":
- return string.Format("{0} {1}", _year, _model);
- case "D":
- return string.Format("{0} {1}, {2} dr.",
- _year, _model, _doors);
- case "C":
- return string.Format("{0} {1}, {2}",
- _year, _model, _cylinders);
- case "A":
- return string.Format("{0} {1}, {2} dr. {3}",
- _year, _model, _doors, _cylinders);
- default:
- string msg = string.Format("'{0}' is an invalid format string",
- fmt);
- throw new ArgumentException(msg);
- }
- }
-}
-
-public class Example7
-{
- public static void Main()
- {
- var auto = new Automobile("Lynx", 2016, 4, "V8");
- Console.WriteLine(auto.ToString());
- Console.WriteLine(auto.ToString("A"));
- }
-}
-// The example displays the following output:
-// 2016 Lynx
-// 2016 Lynx, 4 dr. V8
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostringoverload2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostringoverload2.cs
deleted file mode 100644
index cce98befd3ecf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/csharp/tostringoverload2.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example8
-{
- public static void Main()
- {
- string[] cultureNames = { "en-US", "en-GB", "fr-FR",
- "hr-HR", "ja-JP" };
- Decimal value = 1603.49m;
- foreach (var cultureName in cultureNames) {
- CultureInfo culture = new CultureInfo(cultureName);
- Console.WriteLine($"{culture.Name}: {value.ToString("C2", culture)}");
- }
- }
-}
-// The example displays the following output:
-// en-US: $1,603.49
-// en-GB: £1,603.49
-// fr-FR: 1 603,49 €
-// hr-HR: 1.603,49 kn
-// ja-JP: ¥1,603.49
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/array1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/array1.fs
deleted file mode 100644
index c9ab8a253ba9e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/array1.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module array1
-
-//
-let values = [| 1; 2; 4; 8; 16; 32; 64; 128 |]
-printfn $"{values}"
-
-let list = ResizeArray values
-printfn $"{list}"
-
-// The example displays the following output:
-// System.Int32[]
-// System.Collections.Generic.List`1[System.Int32]
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/customize1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/customize1.fs
deleted file mode 100644
index 24e73763274a0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/customize1.fs
+++ /dev/null
@@ -1,25 +0,0 @@
-module customize1
-
-//
-open System
-open System.Collections.Generic
-
-type CList<'T>() =
- inherit ResizeArray<'T>()
-
- override this.ToString() =
- let mutable retVal = String.Empty
- for item in this do
- if String.IsNullOrEmpty retVal then
- retVal <- retVal + string item
- else
- retVal <- retVal + $", {item}"
- retVal
-
-let list2 = CList()
-list2.Add 1000
-list2.Add 2000
-printfn $"{list2}"
-// The example displays the following output:
-// 1000, 2000
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/customize2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/customize2.fs
deleted file mode 100644
index b84893fde8ce1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/customize2.fs
+++ /dev/null
@@ -1,32 +0,0 @@
-module customize2
-
-//
-open System
-open System.Collections.Generic
-
-type List<'T> with
- member this.ToString2<'T>() =
- let mutable retVal = String.Empty
- for item in this do
- retVal <- retVal + $"""{if String.IsNullOrEmpty retVal then "" else ", "}{item}"""
- if String.IsNullOrEmpty retVal then "{}" else "{ " + retVal + " }"
-
- member this.ToString<'T>(fmt: string) =
- let mutable retVal = String.Empty
- for item in this do
- match box item with
- | :? IFormattable as ifmt ->
- retVal <- retVal + $"""{if String.IsNullOrEmpty retVal then "" else ", "}{ifmt.ToString(fmt, null)}"""
- | _ ->
- retVal <- retVal + this.ToString2()
- if String.IsNullOrEmpty retVal then "{}" else "{ " + retVal + " }"
-
-let list = ResizeArray()
-list.Add 1000
-list.Add 2000
-printfn $"{list.ToString2()}"
-printfn $"""{list.ToString "N0"}"""
-// The example displays the following output:
-// { 1000, 2000 }
-// { 1,000, 2,000 }
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostring1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostring1.fs
deleted file mode 100644
index 85ffddd04a59f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostring1.fs
+++ /dev/null
@@ -1,10 +0,0 @@
-module tostring1
-
-//
-let obj = obj ()
-printfn $"{obj.ToString()}"
-// printfn $"{obj}" // Equivalent
-
-// The example displays the following output:
-// System.Object
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostring2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostring2.fs
deleted file mode 100644
index 87dba31ebcff0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostring2.fs
+++ /dev/null
@@ -1,10 +0,0 @@
-module tostring2
-
-//
-type Object1() = class end
-
-let obj1 = Object1()
-printfn $"{obj1.ToString()}"
-// The example displays the following output:
-// Examples.Object1
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostring3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostring3.fs
deleted file mode 100644
index 28db439aa305a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostring3.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module tostring3
-
-//
-type Object2(value: obj) =
- inherit obj ()
- override _.ToString() =
- base.ToString() + ": " + value.ToString()
-
-let obj2 = Object2 'a'
-printfn $"{obj2.ToString()}"
-// The example displays the following output:
-// Object2: a
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostringoverload1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostringoverload1.fs
deleted file mode 100644
index 2c0cc99c7da74..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostringoverload1.fs
+++ /dev/null
@@ -1,38 +0,0 @@
-module tostringoverload1
-
-//
-open System
-
-type Automobile(model: string, year: int, doors: int, cylinders: string) =
- member _.Doors = doors
- member _.Model = model
- member _.Year = year
- member _.Cylinders = cylinders
-
- override this.ToString() =
- this.ToString "G"
-
- member _.ToString(fmt) =
- let fmt =
- if String.IsNullOrEmpty fmt then "G"
- else fmt.ToUpperInvariant()
-
- match fmt with
- | "G" ->
- $"{year} {model}"
- | "D" ->
- $"{year} {model}, {doors} dr."
- | "C" ->
- $"{year} {model}, {cylinders}"
- | "A" ->
- $"{year} {model}, {doors} dr. {cylinders}"
- | _ ->
- raise (ArgumentException $"'{fmt}' is an invalid format string")
-
-let auto = Automobile("Lynx", 2016, 4, "V8")
-printfn $"{auto}"
-printfn $"""{auto.ToString "A"}"""
-// The example displays the following output:
-// 2016 Lynx
-// 2016 Lynx, 4 dr. V8
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostringoverload2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostringoverload2.fs
deleted file mode 100644
index c6e7e3e993ace..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/fsharp/tostringoverload2.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module tostringoverload2
-
-//
-open System.Globalization
-
-let cultureNames =
- [| "en-US"; "en-GB"; "fr-FR"; "hr-HR"; "ja-JP" |]
-let value = 1603.49m
-for cultureName in cultureNames do
- let culture = CultureInfo cultureName
- printfn $"""{culture.Name}: {value.ToString("C2", culture)}"""
-// The example displays the following output:
-// en-US: $1,603.49
-// en-GB: £1,603.49
-// fr-FR: 1 603,49 €
-// hr-HR: 1.603,49 kn
-// ja-JP: ¥1,603.49
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/array1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/array1.vb
deleted file mode 100644
index 22c69d9d01730..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/array1.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-
-Module Example
- Public Sub Main()
- Dim values() As Integer = { 1, 2, 4, 8, 16, 32, 64, 128 }
- Console.WriteLine(values.ToString())
-
- Dim list As New List(Of Integer)(values)
- Console.WriteLine(list.ToString())
- End Sub
-End Module
-' The example displays the following output:
-' System.Int32[]
-' System.Collections.Generic.List`1[System.Int32]
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/customize1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/customize1.vb
deleted file mode 100644
index 3b58a9eaf4e13..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/customize1.vb
+++ /dev/null
@@ -1,43 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-
-Public Class CList(Of T) : Inherits List(Of T)
- Public Sub New(capacity As Integer)
- MyBase.New(capacity)
- End Sub
-
- Public Sub New(collection As IEnumerable(Of T))
- MyBase.New(collection)
- End Sub
-
- Public Sub New()
- MyBase.New()
- End Sub
-
- Public Overrides Function ToString() As String
- Dim retVal As String = String.Empty
- For Each item As T In Me
- If String.IsNullOrEmpty(retval) Then
- retVal += item.ToString()
- Else
- retval += String.Format(", {0}", item)
- End If
- Next
- Return retVal
- End Function
-End Class
-
-Module Example1
- Public Sub Main()
- Dim list2 As New CList(Of Integer)
- list2.Add(1000)
- list2.Add(2000)
- Console.WriteLine(list2.ToString())
- End Sub
-End Module
-' The example displays the following output:
-' 1000, 2000
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/customize2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/customize2.vb
deleted file mode 100644
index 53aea4d40a70d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/customize2.vb
+++ /dev/null
@@ -1,49 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-Imports System.Runtime.CompilerServices
-
-Public Module StringExtensions
-
- Public Function ToString2(Of T)(l As List(Of T)) As String
- Dim retVal As String = ""
- For Each item As T In l
- retVal += String.Format("{0}{1}", If(String.IsNullOrEmpty(retVal),
- "", ", "),
- item)
- Next
- Return If(String.IsNullOrEmpty(retVal), "{}", "{ " + retVal + " }")
- End Function
-
-
- Public Function ToString(Of T)(l As List(Of T), fmt As String) As String
- Dim retVal As String = String.Empty
- For Each item In l
- Dim ifmt As IFormattable = TryCast(item, IFormattable)
- If ifmt IsNot Nothing Then
- retVal += String.Format("{0}{1}",
- If(String.IsNullOrEmpty(retval),
- "", ", "), ifmt.ToString(fmt, Nothing))
- Else
- retVal += ToString2(l)
- End If
- Next
- Return If(String.IsNullOrEmpty(retVal), "{}", "{ " + retVal + " }")
- End Function
-End Module
-
-Module Example2
- Public Sub Main()
- Dim list As New List(Of Integer)
- list.Add(1000)
- list.Add(2000)
- Console.WriteLine(list.ToString2())
- Console.WriteLine(list.ToString("N0"))
- End Sub
-End Module
-' The example displays the following output:
-' { 1000, 2000 }
-' { 1,000, 2,000 }
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostring1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostring1.vb
deleted file mode 100644
index 73942161b36ce..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostring1.vb
+++ /dev/null
@@ -1,14 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example3
- Public Sub Main()
- Dim obj As New Object()
- Console.WriteLine(obj.ToString())
- End Sub
-End Module
-' The example displays the following output:
-' System.Object
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostring2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostring2.vb
deleted file mode 100644
index 3e39d1172d582..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostring2.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Class Object1
-End Class
-
-Module Example4
- Public Sub Main()
- Dim obj1 As New Object1()
- Console.WriteLine(obj1.ToString())
- End Sub
-End Module
-' The example displays the following output:
-' Examples.Object1
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostring3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostring3.vb
deleted file mode 100644
index 675ed6076c148..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostring3.vb
+++ /dev/null
@@ -1,25 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Class Object2
- Private value As Object
-
- Public Sub New(value As Object)
- Me.value = value
- End Sub
-
- Public Overrides Function ToString() As String
- Return MyBase.ToString + ": " + value.ToString()
- End Function
-End Class
-
-Module Example5
- Public Sub Main()
- Dim obj2 As New Object2("a"c)
- Console.WriteLine(obj2.ToString())
- End Sub
-End Module
-' The example displays the following output:
-' Object2: a
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostringoverload1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostringoverload1.vb
deleted file mode 100644
index 298be82f5b9da..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostringoverload1.vb
+++ /dev/null
@@ -1,80 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Class Automobile
- Private _doors As Integer
- Private _cylinders As String
- Private _year As Integer
- Private _model As String
-
- Public Sub New(model As String, year As Integer, doors As Integer,
- cylinders As String)
- _model = model
- _year = year
- _doors = doors
- _cylinders = cylinders
- End Sub
-
- Public ReadOnly Property Doors As Integer
- Get
- Return _doors
- End Get
- End Property
-
- Public ReadOnly Property Model As String
- Get
- Return _model
- End Get
- End Property
-
- Public ReadOnly Property Year As Integer
- Get
- Return _year
- End Get
- End Property
-
- Public ReadOnly Property Cylinders As String
- Get
- Return _cylinders
- End Get
- End Property
-
- Public Overrides Function ToString() As String
- Return ToString("G")
- End Function
-
- Public Overloads Function ToString(fmt As String) As String
- If String.IsNullOrEmpty(fmt) Then fmt = "G"
-
- Select Case fmt.ToUpperInvariant()
- Case "G"
- Return String.Format("{0} {1}", _year, _model)
- Case "D"
- Return String.Format("{0} {1}, {2} dr.",
- _year, _model, _doors)
- Case "C"
- Return String.Format("{0} {1}, {2}",
- _year, _model, _cylinders)
- Case "A"
- Return String.Format("{0} {1}, {2} dr. {3}",
- _year, _model, _doors, _cylinders)
- Case Else
- Dim msg As String = String.Format("'{0}' is an invalid format string",
- fmt)
- Throw New ArgumentException(msg)
- End Select
- End Function
-End Class
-
-Module Example6
- Public Sub Main()
- Dim auto As New Automobile("Lynx", 2016, 4, "V8")
- Console.WriteLine(auto.ToString())
- Console.WriteLine(auto.ToString("A"))
- End Sub
-End Module
-' The example displays the following output:
-' 2016 Lynx
-' 2016 Lynx, 4 dr. V8
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostringoverload2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostringoverload2.vb
deleted file mode 100644
index 3ed2a4649cad1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Object/ToString/vb/tostringoverload2.vb
+++ /dev/null
@@ -1,26 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-
-Module Example7
- Public Sub Main()
- Dim cultureNames() As String = {"en-US", "en-GB", "fr-FR",
- "hr-HR", "ja-JP"}
- Dim value As Decimal = 1603.49D
- For Each cultureName In cultureNames
- Dim culture As New CultureInfo(cultureName)
- Console.WriteLine("{0}: {1}", culture.Name,
- value.ToString("C2", culture))
- Next
- End Sub
-End Module
-' The example displays the following output:
-' en-US: $1,603.49
-' en-GB: £1,603.49
-' fr-FR: 1 603,49 €
-' hr-HR: 1.603,49 kn
-' ja-JP: ¥1,603.49
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/Random1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/Random1.cs
deleted file mode 100644
index 4aefd9310565c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/Random1.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using System;
-
-public class Class1
-{
- public static void Main()
- {
- //
- byte[] bytes1 = new byte[100];
- byte[] bytes2 = new byte[100];
- Random rnd1 = new Random();
- Random rnd2 = new Random();
-
- rnd1.NextBytes(bytes1);
- rnd2.NextBytes(bytes2);
-
- Console.WriteLine("First Series:");
- for (int ctr = bytes1.GetLowerBound(0);
- ctr <= bytes1.GetUpperBound(0);
- ctr++) {
- Console.Write("{0, 5}", bytes1[ctr]);
- if ((ctr + 1) % 10 == 0) Console.WriteLine();
- }
-
- Console.WriteLine();
-
- Console.WriteLine("Second Series:");
- for (int ctr = bytes2.GetLowerBound(0);
- ctr <= bytes2.GetUpperBound(0);
- ctr++) {
- Console.Write("{0, 5}", bytes2[ctr]);
- if ((ctr + 1) % 10 == 0) Console.WriteLine();
- }
-
- // The example displays output like the following:
- // First Series:
- // 97 129 149 54 22 208 120 105 68 177
- // 113 214 30 172 74 218 116 230 89 18
- // 12 112 130 105 116 180 190 200 187 120
- // 7 198 233 158 58 51 50 170 98 23
- // 21 1 113 74 146 245 34 255 96 24
- // 232 255 23 9 167 240 255 44 194 98
- // 18 175 173 204 169 171 236 127 114 23
- // 167 202 132 65 253 11 254 56 214 127
- // 145 191 104 163 143 7 174 224 247 73
- // 52 6 231 255 5 101 83 165 160 231
- //
- // Second Series:
- // 97 129 149 54 22 208 120 105 68 177
- // 113 214 30 172 74 218 116 230 89 18
- // 12 112 130 105 116 180 190 200 187 120
- // 7 198 233 158 58 51 50 170 98 23
- // 21 1 113 74 146 245 34 255 96 24
- // 232 255 23 9 167 240 255 44 194 98
- // 18 175 173 204 169 171 236 127 114 23
- // 167 202 132 65 253 11 254 56 214 127
- // 145 191 104 163 143 7 174 224 247 73
- // 52 6 231 255 5 101 83 165 160 231
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/array1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/array1.cs
deleted file mode 100644
index bdff9f6768e0f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/array1.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-
-public class Example
-{
- public static void Main()
- {
- //
- String[] cities = { "Atlanta", "Boston", "Chicago", "Detroit",
- "Fort Wayne", "Greensboro", "Honolulu", "Indianapolis",
- "Jersey City", "Kansas City", "Los Angeles",
- "Milwaukee", "New York", "Omaha", "Philadelphia",
- "Raleigh", "San Francisco", "Tulsa", "Washington" };
- Random rnd = new Random();
- int index = rnd.Next(0, cities.Length);
- Console.WriteLine($"Today's city of the day: {cities[index]}");
-
- // The example displays output like the following:
- // Today's city of the day: Honolulu
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/booleans1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/booleans1.cs
deleted file mode 100644
index 2f869e1433fc6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/booleans1.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-using System;
-
-public class Example1
-{
- public static void Main()
- {
- // Instantiate the Boolean generator.
- BooleanGenerator boolGen = new BooleanGenerator();
- int totalTrue = 0, totalFalse = 0;
-
- // Generate 1,0000 random Booleans, and keep a running total.
- for (int ctr = 0; ctr < 1000000; ctr++)
- {
- bool value = boolGen.NextBoolean();
- if (value)
- totalTrue++;
- else
- totalFalse++;
- }
- Console.WriteLine("Number of true values: {0,7:N0} ({1:P3})",
- totalTrue,
- ((double)totalTrue) / (totalTrue + totalFalse));
- Console.WriteLine("Number of false values: {0,7:N0} ({1:P3})",
- totalFalse,
- ((double)totalFalse) / (totalTrue + totalFalse));
- }
-}
-
-public class BooleanGenerator
-{
- Random rnd;
-
- public BooleanGenerator()
- {
- rnd = new Random();
- }
-
- public bool NextBoolean()
- {
- return rnd.Next(0, 2) == 1;
- }
-}
-// The example displays output like the following:
-// Number of true values: 500,004 (50.000 %)
-// Number of false values: 499,996 (50.000 %)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/booleans2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/booleans2.cs
deleted file mode 100644
index bc46ea540b2ec..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/booleans2.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-
-public class Example2
-{
- public static void Main()
- {
- //
- Random rnd = new Random();
-
- int totalTrue = 0, totalFalse = 0;
-
- // Generate 1,000,000 random Booleans, and keep a running total.
- for (int ctr = 0; ctr < 1000000; ctr++)
- {
- bool value = NextBoolean();
- if (value)
- totalTrue++;
- else
- totalFalse++;
- }
- Console.WriteLine("Number of true values: {0,7:N0} ({1:P3})",
- totalTrue,
- ((double)totalTrue) / (totalTrue + totalFalse));
- Console.WriteLine("Number of false values: {0,7:N0} ({1:P3})",
- totalFalse,
- ((double)totalFalse) / (totalTrue + totalFalse));
-
- bool NextBoolean()
- {
- return rnd.Next(0, 2) == 1;
- }
-
- // The example displays output like the following:
- // Number of true values: 499,777 (49.978 %)
- // Number of false values: 500,223 (50.022 %)
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/bytes1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/bytes1.cs
deleted file mode 100644
index 0b118997e1d4f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/bytes1.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-using System;
-
-public class Example3
-{
- public static void Main()
- {
- Random2 rnd = new Random2();
- Byte[] bytes = new Byte[10000];
- int[] total = new int[101];
- rnd.NextBytes(bytes, 0, 101);
-
- // Calculate how many of each value we have.
- foreach (var value in bytes)
- total[value]++;
-
- // Display the results.
- for (int ctr = 0; ctr < total.Length; ctr++)
- {
- Console.Write("{0,3}: {1,-3} ", ctr, total[ctr]);
- if ((ctr + 1) % 5 == 0) Console.WriteLine();
- }
- }
-}
-
-public class Random2 : Random
-{
- public Random2() : base()
- { }
-
- public Random2(int seed) : base(seed)
- { }
-
- public void NextBytes(byte[] bytes, byte minValue, byte maxValue)
- {
- for (int ctr = bytes.GetLowerBound(0); ctr <= bytes.GetUpperBound(0); ctr++)
- bytes[ctr] = (byte)Next(minValue, maxValue);
- }
-}
-// The example displays output like the following:
-// 0: 115 1: 119 2: 92 3: 98 4: 92
-// 5: 102 6: 103 7: 84 8: 93 9: 116
-// 10: 91 11: 98 12: 106 13: 91 14: 92
-// 15: 101 16: 100 17: 96 18: 97 19: 100
-// 20: 101 21: 106 22: 112 23: 82 24: 85
-// 25: 102 26: 107 27: 98 28: 106 29: 102
-// 30: 109 31: 108 32: 94 33: 101 34: 107
-// 35: 101 36: 86 37: 100 38: 101 39: 102
-// 40: 113 41: 95 42: 96 43: 89 44: 99
-// 45: 81 46: 89 47: 105 48: 100 49: 85
-// 50: 103 51: 103 52: 93 53: 89 54: 91
-// 55: 97 56: 105 57: 97 58: 110 59: 86
-// 60: 116 61: 94 62: 117 63: 98 64: 110
-// 65: 93 66: 102 67: 100 68: 105 69: 83
-// 70: 81 71: 97 72: 85 73: 70 74: 98
-// 75: 100 76: 110 77: 114 78: 83 79: 90
-// 80: 96 81: 112 82: 102 83: 102 84: 99
-// 85: 81 86: 100 87: 93 88: 99 89: 118
-// 90: 95 91: 124 92: 108 93: 96 94: 104
-// 95: 106 96: 99 97: 99 98: 92 99: 99
-// 100: 108
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/doublerange1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/doublerange1.cs
deleted file mode 100644
index 5c3f6187e50ef..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/doublerange1.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-
-public class Example4
-{
- public static void Main()
- {
- //
- const long ONE_TENTH = 922337203685477581;
-
- Random rnd = new Random();
- double number;
- int[] count = new int[10];
-
- // Generate 20 million integer values between.
- for (int ctr = 1; ctr <= 20000000; ctr++)
- {
- number = rnd.NextDouble() * Int64.MaxValue;
- // Categorize random numbers into 10 groups.
- count[(int)(number / ONE_TENTH)]++;
- }
- // Display breakdown by range.
- Console.WriteLine("{0,28} {1,32} {2,7}\n", "Range", "Count", "Pct.");
- for (int ctr = 0; ctr <= 9; ctr++)
- Console.WriteLine("{0,25:N0}-{1,25:N0} {2,8:N0} {3,7:P2}", ctr * ONE_TENTH,
- ctr < 9 ? ctr * ONE_TENTH + ONE_TENTH - 1 : Int64.MaxValue,
- count[ctr], count[ctr] / 20000000.0);
-
- // The example displays output like the following:
- // Range Count Pct.
- //
- // 0- 922,337,203,685,477,580 1,996,148 9.98 %
- // 922,337,203,685,477,581-1,844,674,407,370,955,161 2,000,293 10.00 %
- // 1,844,674,407,370,955,162-2,767,011,611,056,432,742 2,000,094 10.00 %
- // 2,767,011,611,056,432,743-3,689,348,814,741,910,323 2,000,159 10.00 %
- // 3,689,348,814,741,910,324-4,611,686,018,427,387,904 1,999,552 10.00 %
- // 4,611,686,018,427,387,905-5,534,023,222,112,865,485 1,998,248 9.99 %
- // 5,534,023,222,112,865,486-6,456,360,425,798,343,066 2,000,696 10.00 %
- // 6,456,360,425,798,343,067-7,378,697,629,483,820,647 2,001,637 10.01 %
- // 7,378,697,629,483,820,648-8,301,034,833,169,298,228 2,002,870 10.01 %
- // 8,301,034,833,169,298,229-9,223,372,036,854,775,807 2,000,303 10.00 %
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/doublerange2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/doublerange2.cs
deleted file mode 100644
index 3c55de3e672c7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/doublerange2.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-
-public class Example6
-{
- public static void Main()
- {
- //
- Random rnd = new Random();
- for (int ctr = 1; ctr <= 10; ctr++)
- Console.WriteLine(rnd.NextDouble() - 1);
-
- // The example displays output like the following:
- // -0.930412760437658
- // -0.164699016215605
- // -0.9851692803135
- // -0.43468508843085
- // -0.177202483255976
- // -0.776813320245972
- // -0.0713201854710096
- // -0.0912875561468711
- // -0.540621722368813
- // -0.232211863730201
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/doublerange3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/doublerange3.cs
deleted file mode 100644
index ec322e9a547f6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/doublerange3.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-
-public class Example5
-{
- public static void Main()
- {
- //
- Random rnd = new Random();
- int lowerBound = 10;
- int upperBound = 11;
- int[] range = new int[10];
- for (int ctr = 1; ctr <= 1000000; ctr++)
- {
- Double value = rnd.NextDouble() * (upperBound - lowerBound) + lowerBound;
- range[(int)Math.Truncate((value - lowerBound) * 10)]++;
- }
-
- for (int ctr = 0; ctr <= 9; ctr++)
- {
- Double lowerRange = 10 + ctr * .1;
- Console.WriteLine("{0:N1} to {1:N1}: {2,8:N0} ({3,7:P2})",
- lowerRange, lowerRange + .1, range[ctr],
- range[ctr] / 1000000.0);
- }
-
- // The example displays output like the following:
- // 10.0 to 10.1: 99,929 ( 9.99 %)
- // 10.1 to 10.2: 100,189 (10.02 %)
- // 10.2 to 10.3: 99,384 ( 9.94 %)
- // 10.3 to 10.4: 100,240 (10.02 %)
- // 10.4 to 10.5: 99,397 ( 9.94 %)
- // 10.5 to 10.6: 100,580 (10.06 %)
- // 10.6 to 10.7: 100,293 (10.03 %)
- // 10.7 to 10.8: 100,135 (10.01 %)
- // 10.8 to 10.9: 99,905 ( 9.99 %)
- // 10.9 to 11.0: 99,948 ( 9.99 %)
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/long1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/long1.cs
deleted file mode 100644
index 6399f5e19e529..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/long1.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-
-public class Example14
-{
- public static void Main()
- {
- //
- const long ONE_TENTH = 922337203685477581;
-
- Random rnd = new Random();
- long number;
- int[] count = new int[10];
-
- // Generate 20 million long integers.
- for (int ctr = 1; ctr <= 20000000; ctr++)
- {
- number = (long)(rnd.NextDouble() * Int64.MaxValue);
- // Categorize random numbers.
- count[(int)(number / ONE_TENTH)]++;
- }
- // Display breakdown by range.
- Console.WriteLine("{0,28} {1,32} {2,7}\n", "Range", "Count", "Pct.");
- for (int ctr = 0; ctr <= 9; ctr++)
- Console.WriteLine("{0,25:N0}-{1,25:N0} {2,8:N0} {3,7:P2}", ctr * ONE_TENTH,
- ctr < 9 ? ctr * ONE_TENTH + ONE_TENTH - 1 : Int64.MaxValue,
- count[ctr], count[ctr] / 20000000.0);
-
- // The example displays output like the following:
- // Range Count Pct.
- //
- // 0- 922,337,203,685,477,580 1,996,148 9.98 %
- // 922,337,203,685,477,581-1,844,674,407,370,955,161 2,000,293 10.00 %
- // 1,844,674,407,370,955,162-2,767,011,611,056,432,742 2,000,094 10.00 %
- // 2,767,011,611,056,432,743-3,689,348,814,741,910,323 2,000,159 10.00 %
- // 3,689,348,814,741,910,324-4,611,686,018,427,387,904 1,999,552 10.00 %
- // 4,611,686,018,427,387,905-5,534,023,222,112,865,485 1,998,248 9.99 %
- // 5,534,023,222,112,865,486-6,456,360,425,798,343,066 2,000,696 10.00 %
- // 6,456,360,425,798,343,067-7,378,697,629,483,820,647 2,001,637 10.01 %
- // 7,378,697,629,483,820,648-8,301,034,833,169,298,228 2,002,870 10.01 %
- // 8,301,034,833,169,298,229-9,223,372,036,854,775,807 2,000,303 10.00 %
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/nextbytes1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/nextbytes1.cs
deleted file mode 100644
index 01997d3e95b0a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/nextbytes1.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-
-public class Example7
-{
- public static void Main()
- {
- //
- Random rnd = new Random();
- Byte[] bytes = new Byte[20];
- rnd.NextBytes(bytes);
- for (int ctr = 1; ctr <= bytes.Length; ctr++)
- {
- Console.Write("{0,3} ", bytes[ctr - 1]);
- if (ctr % 10 == 0) Console.WriteLine();
- }
-
- // The example displays output like the following:
- // 141 48 189 66 134 212 211 71 161 56
- // 181 166 220 133 9 252 222 57 62 62
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/nextdoubleex1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/nextdoubleex1.cs
deleted file mode 100644
index 35872b396f368..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/nextdoubleex1.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-
-public class Example8
-{
- public static void Main()
- {
- //
- Random rnd = new Random();
- for (int ctr = 0; ctr < 10; ctr++)
- {
- Console.Write("{0,-19:R} ", rnd.NextDouble());
- if ((ctr + 1) % 3 == 0) Console.WriteLine();
- }
-
- // The example displays output like the following:
- // 0.7911680553998649 0.0903414949264105 0.79776258291572455
- // 0.615568345233597 0.652644504165577 0.84023809378977776
- // 0.099662564741290441 0.91341467383942321 0.96018602045261581
- // 0.74772306473354022
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/nextex1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/nextex1.cs
deleted file mode 100644
index 9e3e09abfcef9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/nextex1.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-
-public class Example9
-{
- public static void Main()
- {
- //
- Random rnd = new Random();
- for (int ctr = 0; ctr < 10; ctr++)
- {
- Console.Write("{0,3} ", rnd.Next(-10, 11));
- }
-
- // The example displays output like the following:
- // 2 9 -3 2 4 -7 -3 -8 -8 5
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/range1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/range1.cs
deleted file mode 100644
index 77825627c2727..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/range1.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-
-public class Example10
-{
- public static void Main()
- {
- //
- Random rnd = new Random();
- for (int ctr = 1; ctr <= 15; ctr++)
- {
- Console.Write("{0,3} ", rnd.Next(-10, 11));
- if (ctr % 5 == 0) Console.WriteLine();
- }
-
- // The example displays output like the following:
- // -2 -5 -1 -2 10
- // -3 6 -4 -8 3
- // -7 10 5 -2 4
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/range2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/range2.cs
deleted file mode 100644
index f9541a704dc34..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/range2.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-
-public class Example11
-{
- public static void Main()
- {
- //
- Random rnd = new Random();
- for (int ctr = 1; ctr <= 50; ctr++)
- {
- Console.Write("{0,3} ", rnd.Next(1000, 10000));
- if (ctr % 10 == 0) Console.WriteLine();
- }
-
- // The example displays output like the following:
- // 9570 8979 5770 1606 3818 4735 8495 7196 7070 2313
- // 5279 6577 5104 5734 4227 3373 7376 6007 8193 5540
- // 7558 3934 3819 7392 1113 7191 6947 4963 9179 7907
- // 3391 6667 7269 1838 7317 1981 5154 7377 3297 5320
- // 9869 8694 2684 4949 2999 3019 2357 5211 9604 2593
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/same1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/same1.cs
deleted file mode 100644
index 1f354253d1e48..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/same1.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-using System;
-using System.IO;
-
-public class Example12
-{
- public static void Main()
- {
- int seed = 100100;
- ShowRandomNumbers(seed);
- Console.WriteLine();
-
- PersistSeed(seed);
-
- DisplayNewRandomNumbers();
- }
-
- private static void ShowRandomNumbers(int seed)
- {
- Random rnd = new Random(seed);
- for (int ctr = 0; ctr <= 20; ctr++)
- Console.WriteLine(rnd.NextDouble());
- }
-
- private static void PersistSeed(int seed)
- {
- FileStream fs = new FileStream(@".\seed.dat", FileMode.Create);
- BinaryWriter bin = new BinaryWriter(fs);
- bin.Write(seed);
- bin.Close();
- }
-
- private static void DisplayNewRandomNumbers()
- {
- FileStream fs = new FileStream(@".\seed.dat", FileMode.Open);
- BinaryReader bin = new BinaryReader(fs);
- int seed = bin.ReadInt32();
- bin.Close();
-
- Random rnd = new Random(seed);
- for (int ctr = 0; ctr <= 20; ctr++)
- Console.WriteLine(rnd.NextDouble());
- }
-}
-// The example displays output like the following:
-// 0.500193602172748
-// 0.0209461245783354
-// 0.465869495396442
-// 0.195512794514891
-// 0.928583675496552
-// 0.729333720509584
-// 0.381455668891527
-// 0.0508996467343064
-// 0.019261200921266
-// 0.258578445417145
-// 0.0177532266908107
-// 0.983277184415272
-// 0.483650274334313
-// 0.0219647376900375
-// 0.165910115077118
-// 0.572085966622497
-// 0.805291457942357
-// 0.927985211335116
-// 0.4228545699375
-// 0.523320379910674
-// 0.157783938645285
-//
-// 0.500193602172748
-// 0.0209461245783354
-// 0.465869495396442
-// 0.195512794514891
-// 0.928583675496552
-// 0.729333720509584
-// 0.381455668891527
-// 0.0508996467343064
-// 0.019261200921266
-// 0.258578445417145
-// 0.0177532266908107
-// 0.983277184415272
-// 0.483650274334313
-// 0.0219647376900375
-// 0.165910115077118
-// 0.572085966622497
-// 0.805291457942357
-// 0.927985211335116
-// 0.4228545699375
-// 0.523320379910674
-// 0.157783938645285
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/threadsafeex1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/threadsafeex1.cs
deleted file mode 100644
index 5dca8aa952b80..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/threadsafeex1.cs
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-using System;
-using System.Threading;
-
-public class Example13
-{
- [ThreadStatic] static double previous = 0.0;
- [ThreadStatic] static int perThreadCtr = 0;
- [ThreadStatic] static double perThreadTotal = 0.0;
- static CancellationTokenSource source;
- static CountdownEvent countdown;
- static Object randLock, numericLock;
- static Random rand;
- double totalValue = 0.0;
- int totalCount = 0;
-
- public Example13()
- {
- rand = new Random();
- randLock = new Object();
- numericLock = new Object();
- countdown = new CountdownEvent(1);
- source = new CancellationTokenSource();
- }
-
- public static void Main()
- {
- Example13 ex = new Example13();
- Thread.CurrentThread.Name = "Main";
- ex.Execute();
- }
-
- private void Execute()
- {
- CancellationToken token = source.Token;
-
- for (int threads = 1; threads <= 10; threads++)
- {
- Thread newThread = new Thread(this.GetRandomNumbers);
- newThread.Name = threads.ToString();
- newThread.Start(token);
- }
- this.GetRandomNumbers(token);
-
- countdown.Signal();
- // Make sure all threads have finished.
- countdown.Wait();
- source.Dispose();
-
- Console.WriteLine($"\nTotal random numbers generated: {totalCount:N0}");
- Console.WriteLine($"Total sum of all random numbers: {totalValue:N2}");
- Console.WriteLine($"Random number mean: {totalValue / totalCount:N4}");
- }
-
- private void GetRandomNumbers(Object o)
- {
- CancellationToken token = (CancellationToken)o;
- double result = 0.0;
- countdown.AddCount(1);
-
- try
- {
- for (int ctr = 0; ctr < 2000000; ctr++)
- {
- // Make sure there's no corruption of Random.
- token.ThrowIfCancellationRequested();
-
- lock (randLock)
- {
- result = rand.NextDouble();
- }
- // Check for corruption of Random instance.
- if ((result == previous) && result == 0)
- {
- source.Cancel();
- }
- else
- {
- previous = result;
- }
- perThreadCtr++;
- perThreadTotal += result;
- }
-
- Console.WriteLine($"Thread {Thread.CurrentThread.Name} finished execution.");
- Console.WriteLine($"Random numbers generated: {perThreadCtr:N0}");
- Console.WriteLine($"Sum of random numbers: {perThreadTotal:N2}");
- Console.WriteLine($"Random number mean: {perThreadTotal / perThreadCtr:N4}\n");
-
- // Update overall totals.
- lock (numericLock)
- {
- totalCount += perThreadCtr;
- totalValue += perThreadTotal;
- }
- }
- catch (OperationCanceledException e)
- {
- Console.WriteLine($"Corruption in Thread {Thread.CurrentThread.Name}");
- }
- finally
- {
- countdown.Signal();
- }
- }
-}
-// The example displays output like the following:
-// Thread 6 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,491.05
-// Random number mean: 0.5002
-//
-// Thread 10 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,329.64
-// Random number mean: 0.4997
-//
-// Thread 4 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,166.89
-// Random number mean: 0.5001
-//
-// Thread 8 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,628.37
-// Random number mean: 0.4998
-//
-// Thread Main finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,920.89
-// Random number mean: 0.5000
-//
-// Thread 3 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,370.45
-// Random number mean: 0.4997
-//
-// Thread 7 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,330.92
-// Random number mean: 0.4997
-//
-// Thread 9 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,172.79
-// Random number mean: 0.5001
-//
-// Thread 5 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,079.43
-// Random number mean: 0.5000
-//
-// Thread 1 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,817.91
-// Random number mean: 0.4999
-//
-// Thread 2 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,930.63
-// Random number mean: 0.5000
-//
-//
-// Total random numbers generated: 22,000,000
-// Total sum of all random numbers: 10,998,238.98
-// Random number mean: 0.4999
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/threadsafeex2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/threadsafeex2.cs
deleted file mode 100644
index 05a4ca7bf7b1a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/threadsafeex2.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-
-public class Example15
-{
- static Object randLock, numericLock;
- static Random rand;
- static CancellationTokenSource source;
- double totalValue = 0.0;
- int totalCount = 0;
-
- public Example15()
- {
- rand = new Random();
- randLock = new Object();
- numericLock = new Object();
- source = new CancellationTokenSource();
- }
-
- public static async Task Main()
- {
- Example15 ex = new Example15();
- Thread.CurrentThread.Name = "Main";
- await ex.Execute();
- }
-
- private async Task Execute()
- {
- List tasks = new List();
-
- for (int ctr = 0; ctr <= 10; ctr++)
- {
- CancellationToken token = source.Token;
- int taskNo = ctr;
- tasks.Add(Task.Run(() =>
- {
- double previous = 0.0;
- int taskCtr = 0;
- double taskTotal = 0.0;
- double result = 0.0;
-
- for (int n = 0; n < 2000000; n++)
- {
- // Make sure there's no corruption of Random.
- token.ThrowIfCancellationRequested();
-
- lock (randLock)
- {
- result = rand.NextDouble();
- }
- // Check for corruption of Random instance.
- if ((result == previous) && result == 0)
- {
- source.Cancel();
- }
- else
- {
- previous = result;
- }
- taskCtr++;
- taskTotal += result;
- }
-
- // Show result.
- Console.WriteLine($"Task {taskNo} finished execution.");
- Console.WriteLine($"Random numbers generated: {taskCtr:N0}");
- Console.WriteLine($"Sum of random numbers: {taskTotal:N2}");
- Console.WriteLine($"Random number mean: {taskTotal / taskCtr:N4}\n");
-
- // Update overall totals.
- lock (numericLock)
- {
- totalCount += taskCtr;
- totalValue += taskTotal;
- }
- },
- token));
- }
- try
- {
- await Task.WhenAll(tasks.ToArray());
- Console.WriteLine($"\nTotal random numbers generated: {totalCount:N0}");
- Console.WriteLine($"Total sum of all random numbers: {totalValue:N2}");
- Console.WriteLine($"Random number mean: {totalValue / totalCount:N4}");
- }
- catch (AggregateException e)
- {
- foreach (Exception inner in e.InnerExceptions)
- {
- TaskCanceledException canc = inner as TaskCanceledException;
- if (canc != null)
- Console.WriteLine($"Task #{canc.Task.Id} cancelled.");
- else
- Console.WriteLine($"Exception: {inner.GetType().Name}");
- }
- }
- finally
- {
- source.Dispose();
- }
- }
-}
-// The example displays output like the following:
-// Task 1 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,502.47
-// Random number mean: 0.5003
-//
-// Task 0 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,445.63
-// Random number mean: 0.5002
-//
-// Task 2 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,556.04
-// Random number mean: 0.5003
-//
-// Task 3 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,178.87
-// Random number mean: 0.5001
-//
-// Task 4 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,819.17
-// Random number mean: 0.4999
-//
-// Task 5 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,190.58
-// Random number mean: 0.5001
-//
-// Task 6 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,720.21
-// Random number mean: 0.4999
-//
-// Task 7 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,000.96
-// Random number mean: 0.4995
-//
-// Task 8 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,499.33
-// Random number mean: 0.4997
-//
-// Task 9 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,193.25
-// Random number mean: 0.5001
-//
-// Task 10 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,960.82
-// Random number mean: 0.5000
-//
-//
-// Total random numbers generated: 22,000,000
-// Total sum of all random numbers: 11,000,067.33
-// Random number mean: 0.5000
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/unique.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/unique.cs
deleted file mode 100644
index 8cf5841f80b3b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/unique.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-using System;
-using System.Threading;
-
-public class Example16
-{
- public static void Main()
- {
- Console.WriteLine("Instantiating two random number generators...");
- Random rnd1 = new Random();
- Thread.Sleep(2000);
- Random rnd2 = new Random();
-
- Console.WriteLine("\nThe first random number generator:");
- for (int ctr = 1; ctr <= 10; ctr++)
- Console.WriteLine($" {rnd1.Next()}");
-
- Console.WriteLine("\nThe second random number generator:");
- for (int ctr = 1; ctr <= 10; ctr++)
- Console.WriteLine($" {rnd2.Next()}");
- }
-}
-// The example displays output like the following:
-// Instantiating two random number generators...
-//
-// The first random number generator:
-// 643164361
-// 1606571630
-// 1725607587
-// 2138048432
-// 496874898
-// 1969147632
-// 2034533749
-// 1840964542
-// 412380298
-// 47518930
-//
-// The second random number generator:
-// 1251659083
-// 1514185439
-// 1465798544
-// 517841554
-// 1821920222
-// 195154223
-// 1538948391
-// 1548375095
-// 546062716
-// 897797880
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/uniquearray1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/uniquearray1.cs
deleted file mode 100644
index 76b086b5cb86f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/csharp/uniquearray1.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-using System;
-
-// A class that represents an individual card in a playing deck.
-public class Card
-{
- public Suit Suit;
- public FaceValue FaceValue;
-
- public override String ToString()
- {
- return String.Format("{0:F} of {1:F}", this.FaceValue, this.Suit);
- }
-}
-
-public enum Suit { Hearts, Diamonds, Spades, Clubs };
-
-public enum FaceValue
-{
- Ace = 1, Two, Three, Four, Five, Six,
- Seven, Eight, Nine, Ten, Jack, Queen,
- King
-};
-
-public class Dealer
-{
- Random rnd;
- // A deck of cards, without Jokers.
- Card[] deck = new Card[52];
- // Parallel array for sorting cards.
- Double[] order = new Double[52];
- // A pointer to the next card to deal.
- int ptr = 0;
- // A flag to indicate the deck is used.
- bool mustReshuffle = false;
-
- public Dealer()
- {
- rnd = new Random();
- // Initialize the deck.
- int deckCtr = 0;
- foreach (var suit in Enum.GetValues(typeof(Suit)))
- {
- foreach (var faceValue in Enum.GetValues(typeof(FaceValue)))
- {
- Card card = new Card();
- card.Suit = (Suit)suit;
- card.FaceValue = (FaceValue)faceValue;
- deck[deckCtr] = card;
- deckCtr++;
- }
- }
-
- for (int ctr = 0; ctr < order.Length; ctr++)
- order[ctr] = rnd.NextDouble();
-
- Array.Sort(order, deck);
- }
-
- public Card[] Deal(int numberToDeal)
- {
- if (mustReshuffle)
- {
- Console.WriteLine("There are no cards left in the deck");
- return null;
- }
-
- Card[] cardsDealt = new Card[numberToDeal];
- for (int ctr = 0; ctr < numberToDeal; ctr++)
- {
- cardsDealt[ctr] = deck[ptr];
- ptr++;
- if (ptr == deck.Length)
- mustReshuffle = true;
-
- if (mustReshuffle & ctr < numberToDeal - 1)
- {
- Console.WriteLine($"Can only deal the {ctr + 1} cards remaining on the deck.");
- return cardsDealt;
- }
- }
- return cardsDealt;
- }
-}
-
-public class Example17
-{
- public static void Main()
- {
- Dealer dealer = new Dealer();
- ShowCards(dealer.Deal(20));
- }
-
- private static void ShowCards(Card[] cards)
- {
- foreach (var card in cards)
- if (card != null)
- Console.WriteLine($"{card.FaceValue} of {card.Suit}");
- }
-}
-// The example displays output like the following:
-// Six of Diamonds
-// King of Clubs
-// Eight of Clubs
-// Seven of Clubs
-// Queen of Clubs
-// King of Hearts
-// Three of Spades
-// Ace of Clubs
-// Four of Hearts
-// Three of Diamonds
-// Nine of Diamonds
-// Two of Hearts
-// Ace of Hearts
-// Three of Hearts
-// Four of Spades
-// Eight of Hearts
-// Queen of Diamonds
-// Two of Clubs
-// Four of Diamonds
-// Jack of Hearts
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/Random1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/Random1.fs
deleted file mode 100644
index 0017b215d5bd4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/Random1.fs
+++ /dev/null
@@ -1,50 +0,0 @@
-module Random1
-
-open System
-
-//
-let bytes1 = Array.zeroCreate 100
-let bytes2 = Array.zeroCreate 100
-let rnd1 = Random()
-let rnd2 = Random()
-
-rnd1.NextBytes bytes1
-rnd2.NextBytes bytes2
-
-printfn "First Series"
-for i = bytes1.GetLowerBound 0 to bytes1.GetUpperBound 0 do
- printf "%5i" bytes1.[i]
- if (i + 1) % 10 = 0 then printfn ""
-
-printfn ""
-
-printfn "Second Series"
-for i = bytes2.GetLowerBound 0 to bytes2.GetUpperBound 0 do
- printf "%5i" bytes2.[i]
- if (i + 1) % 10 = 0 then printfn ""
-
-// The example displays output like the following:
-// First Series:
-// 97 129 149 54 22 208 120 105 68 177
-// 113 214 30 172 74 218 116 230 89 18
-// 12 112 130 105 116 180 190 200 187 120
-// 7 198 233 158 58 51 50 170 98 23
-// 21 1 113 74 146 245 34 255 96 24
-// 232 255 23 9 167 240 255 44 194 98
-// 18 175 173 204 169 171 236 127 114 23
-// 167 202 132 65 253 11 254 56 214 127
-// 145 191 104 163 143 7 174 224 247 73
-// 52 6 231 255 5 101 83 165 160 231
-//
-// Second Series:
-// 97 129 149 54 22 208 120 105 68 177
-// 113 214 30 172 74 218 116 230 89 18
-// 12 112 130 105 116 180 190 200 187 120
-// 7 198 233 158 58 51 50 170 98 23
-// 21 1 113 74 146 245 34 255 96 24
-// 232 255 23 9 167 240 255 44 194 98
-// 18 175 173 204 169 171 236 127 114 23
-// 167 202 132 65 253 11 254 56 214 127
-// 145 191 104 163 143 7 174 224 247 73
-// 52 6 231 255 5 101 83 165 160 231
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/array1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/array1.fs
deleted file mode 100644
index ca56497d57354..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/array1.fs
+++ /dev/null
@@ -1,21 +0,0 @@
-module Array1
-
-open System
-
-//
-let cities =
- [| "Atlanta"; "Boston"; "Chicago"; "Detroit";
- "Fort Wayne"; "Greensboro"; "Honolulu"; "Indianapolis";
- "Jersey City"; "Kansas City"; "Los Angeles";
- "Milwaukee"; "New York"; "Omaha"; "Philadelphia";
- "Raleigh"; "San Francisco"; "Tulsa"; "Washington" |]
-
-let rnd = Random()
-
-let index = rnd.Next(0,cities.Length)
-
-printfn "Today's city of the day: %s" cities.[index]
-
-// The example displays output like the following:
-// Today's city of the day: Honolulu
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/booleans1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/booleans1.fs
deleted file mode 100644
index 44a9bba0f75ff..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/booleans1.fs
+++ /dev/null
@@ -1,28 +0,0 @@
-module Booleans1
-
-//
-open System
-
-type BooleanGenerator() =
- let rnd = Random()
-
- member _.NextBoolean() =
- rnd.Next(0, 2) = 1
-
-let boolGen = BooleanGenerator()
-let mutable totalTrue, totalFalse = 0, 0
-
-for _ = 1 to 1000000 do
- let value = boolGen.NextBoolean()
- if value then
- totalTrue <- totalTrue + 1
- else
- totalFalse <- totalFalse + 1
-
-printfn $"Number of true values: {totalTrue,7:N0} ({(double totalTrue) / double (totalTrue + totalFalse):P3})"
-printfn $"Number of false values: {totalFalse,7:N0} ({(double totalFalse) / double (totalTrue + totalFalse):P3})"
-
-// The example displays output like the following:
-// Number of true values: 500,004 (50.000 %)
-// Number of false values: 499,996 (50.000 %)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/booleans2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/booleans2.fs
deleted file mode 100644
index e4e146c3a8d34..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/booleans2.fs
+++ /dev/null
@@ -1,26 +0,0 @@
-module Booleans2
-
-open System
-
-//
-let rnd = Random()
-
-let nextBool () =
- rnd.Next(0, 2) = 1
-
-let mutable totalTrue, totalFalse = 0, 0
-
-for _ = 1 to 1000000 do
- let value = nextBool ()
- if value then
- totalTrue <- totalTrue + 1
- else
- totalFalse <- totalFalse + 1
-
-printfn $"Number of true values: {totalTrue,7:N0} ({(double totalTrue) / double (totalTrue + totalFalse):P3})"
-printfn $"Number of false values: {totalFalse,7:N0} ({(double totalFalse) / double (totalTrue + totalFalse):P3})"
-
-// The example displays output like the following:
-// Number of true values: 499,777 (49.978 %)
-// Number of false values: 500,223 (50.022 %)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/bytes1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/bytes1.fs
deleted file mode 100644
index 9b605bc10ea82..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/bytes1.fs
+++ /dev/null
@@ -1,49 +0,0 @@
-module Bytes1
-
-//
-open System
-
-type Random2() =
- inherit Random()
-
- member this.NextBytes(bytes: byte[], minValue: byte, maxValue: byte) =
- for i=bytes.GetLowerBound(0) to bytes.GetUpperBound(0) do
- bytes.[i] <- this.Next(int minValue, int maxValue) |> byte
-
-let rnd = Random2()
-let bytes = Array.zeroCreate 10000
-let total = Array.zeroCreate 101
-rnd.NextBytes(bytes, 0uy, 101uy)
-
-// Calculate how many of each value we have.
-for v in bytes do
- total.[int v] <- total.[int v] + 1
-
-// Display the results.
-for i = 0 to total.Length - 1 do
- printf "%3i: %-3i " i total.[i]
- if (i + 1) % 5 = 0 then printfn ""
-
-// The example displays output like the following:
-// 0: 115 1: 119 2: 92 3: 98 4: 92
-// 5: 102 6: 103 7: 84 8: 93 9: 116
-// 10: 91 11: 98 12: 106 13: 91 14: 92
-// 15: 101 16: 100 17: 96 18: 97 19: 100
-// 20: 101 21: 106 22: 112 23: 82 24: 85
-// 25: 102 26: 107 27: 98 28: 106 29: 102
-// 30: 109 31: 108 32: 94 33: 101 34: 107
-// 35: 101 36: 86 37: 100 38: 101 39: 102
-// 40: 113 41: 95 42: 96 43: 89 44: 99
-// 45: 81 46: 89 47: 105 48: 100 49: 85
-// 50: 103 51: 103 52: 93 53: 89 54: 91
-// 55: 97 56: 105 57: 97 58: 110 59: 86
-// 60: 116 61: 94 62: 117 63: 98 64: 110
-// 65: 93 66: 102 67: 100 68: 105 69: 83
-// 70: 81 71: 97 72: 85 73: 70 74: 98
-// 75: 100 76: 110 77: 114 78: 83 79: 90
-// 80: 96 81: 112 82: 102 83: 102 84: 99
-// 85: 81 86: 100 87: 93 88: 99 89: 118
-// 90: 95 91: 124 92: 108 93: 96 94: 104
-// 95: 106 96: 99 97: 99 98: 92 99: 99
-// 100: 108
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/doublerange1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/doublerange1.fs
deleted file mode 100644
index d4c9fe115ef48..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/doublerange1.fs
+++ /dev/null
@@ -1,37 +0,0 @@
-module DoubleRange1
-
-open System
-
-//
-[]
-let ONE_TENTH = 922337203685477581L
-
-let rnd = Random()
-
-// Generate 20 million random integers.
-let count =
- Array.init 20000000 (fun _ -> rnd.NextDouble() * (float Int64.MaxValue) )
- |> Array.countBy (fun x -> x / (float ONE_TENTH) |> int ) // Categorize into 10 groups and count them.
- |> Array.map snd
-
-// Display breakdown by range.
-printfn "%28s %32s %7s\n" "Range" "Count" "Pct."
-for i = 0 to 9 do
- let r1 = int64 i * ONE_TENTH
- let r2 = if i < 9 then r1 + ONE_TENTH - 1L else Int64.MaxValue
- printfn $"{r1,25:N0}-{r2,25:N0} {count.[i],8:N0} {float count.[i] / 20000000.0,7:P2}"
-
-// The example displays output like the following:
-// Range Count Pct.
-//
-// 0- 922,337,203,685,477,580 1,996,148 9.98 %
-// 922,337,203,685,477,581-1,844,674,407,370,955,161 2,000,293 10.00 %
-// 1,844,674,407,370,955,162-2,767,011,611,056,432,742 2,000,094 10.00 %
-// 2,767,011,611,056,432,743-3,689,348,814,741,910,323 2,000,159 10.00 %
-// 3,689,348,814,741,910,324-4,611,686,018,427,387,904 1,999,552 10.00 %
-// 4,611,686,018,427,387,905-5,534,023,222,112,865,485 1,998,248 9.99 %
-// 5,534,023,222,112,865,486-6,456,360,425,798,343,066 2,000,696 10.00 %
-// 6,456,360,425,798,343,067-7,378,697,629,483,820,647 2,001,637 10.01 %
-// 7,378,697,629,483,820,648-8,301,034,833,169,298,228 2,002,870 10.01 %
-// 8,301,034,833,169,298,229-9,223,372,036,854,775,807 2,000,303 10.00 %
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/doublerange2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/doublerange2.fs
deleted file mode 100644
index 04c48ba953f5f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/doublerange2.fs
+++ /dev/null
@@ -1,22 +0,0 @@
-module DoubleRange2
-
-open System
-
-//
-let rnd = Random()
-
-for _ = 1 to 10 do
- printfn "%O" (rnd.NextDouble() - 1.0)
-
-// The example displays output like the following:
-// -0.930412760437658
-// -0.164699016215605
-// -0.9851692803135
-// -0.43468508843085
-// -0.177202483255976
-// -0.776813320245972
-// -0.0713201854710096
-// -0.0912875561468711
-// -0.540621722368813
-// -0.232211863730201
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/doublerange3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/doublerange3.fs
deleted file mode 100644
index 829f6d79b1ecb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/doublerange3.fs
+++ /dev/null
@@ -1,31 +0,0 @@
-module DoubleRange3
-
-open System
-
-//
-let rnd = Random()
-
-let lowerBound = 10.0
-let upperBound = 11.0
-
-let range =
- Array.init 1000000 (fun _ -> rnd.NextDouble() * (upperBound - lowerBound) + lowerBound)
- |> Array.countBy (fun x -> Math.Truncate((x - lowerBound) * 10.0) |> int)
- |> Array.map snd
-
-for i = 0 to 9 do
- let lowerRange = 10.0 + float i * 0.1
- printfn $"{lowerRange:N1} to {lowerRange + 0.1:N1}: {range.[i],8:N0} ({float range.[i] / 1000000.0,6:P2})"
-
-// The example displays output like the following:
-// 10.0 to 10.1: 99,929 ( 9.99 %)
-// 10.1 to 10.2: 100,189 (10.02 %)
-// 10.2 to 10.3: 99,384 ( 9.94 %)
-// 10.3 to 10.4: 100,240 (10.02 %)
-// 10.4 to 10.5: 99,397 ( 9.94 %)
-// 10.5 to 10.6: 100,580 (10.06 %)
-// 10.6 to 10.7: 100,293 (10.03 %)
-// 10.7 to 10.8: 100,135 (10.01 %)
-// 10.8 to 10.9: 99,905 ( 9.99 %)
-// 10.9 to 11.0: 99,948 ( 9.99 %)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/long1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/long1.fs
deleted file mode 100644
index 90b86226dced5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/long1.fs
+++ /dev/null
@@ -1,37 +0,0 @@
-module Long1
-
-open System
-
-//
-[]
-let ONE_TENTH = 922337203685477581L
-
-let rnd = Random()
-
-let count =
- // Generate 20 million random long integers.
- Array.init 20000000 (fun _ -> rnd.NextDouble() * (float Int64.MaxValue) |> int64 )
- |> Array.countBy (fun x -> x / ONE_TENTH) // Categorize and count random numbers.
- |> Array.map snd
-
-// Display breakdown by range.
-printfn "%28s %32s %7s\n" "Range" "Count" "Pct."
-for i = 0 to 9 do
- let r1 = int64 i * ONE_TENTH
- let r2 = if i < 9 then r1 + ONE_TENTH - 1L else Int64.MaxValue
- printfn $"{r1,25:N0}-{r2,25:N0} {count.[i],8:N0} {float count.[i] / 20000000.0,7:P2}"
-
-// The example displays output like the following:
-// Range Count Pct.
-//
-// 0- 922,337,203,685,477,580 1,996,148 9.98 %
-// 922,337,203,685,477,581-1,844,674,407,370,955,161 2,000,293 10.00 %
-// 1,844,674,407,370,955,162-2,767,011,611,056,432,742 2,000,094 10.00 %
-// 2,767,011,611,056,432,743-3,689,348,814,741,910,323 2,000,159 10.00 %
-// 3,689,348,814,741,910,324-4,611,686,018,427,387,904 1,999,552 10.00 %
-// 4,611,686,018,427,387,905-5,534,023,222,112,865,485 1,998,248 9.99 %
-// 5,534,023,222,112,865,486-6,456,360,425,798,343,066 2,000,696 10.00 %
-// 6,456,360,425,798,343,067-7,378,697,629,483,820,647 2,001,637 10.01 %
-// 7,378,697,629,483,820,648-8,301,034,833,169,298,228 2,002,870 10.01 %
-// 8,301,034,833,169,298,229-9,223,372,036,854,775,807 2,000,303 10.00 %
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/nextbytes1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/nextbytes1.fs
deleted file mode 100644
index 53520b2b3ce5b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/nextbytes1.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module NextBytes1
-
-open System
-
-//
-let rnd = Random()
-let bytes = Array.zeroCreate 20
-rnd.NextBytes bytes
-
-for i = 1 to bytes.Length do
- printf "%3i " bytes.[i - 1]
- if (i % 10 = 0) then printfn ""
-
-// The example displays output like the following:
-// 141 48 189 66 134 212 211 71 161 56
-// 181 166 220 133 9 252 222 57 62 62
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/nextdoubleex1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/nextdoubleex1.fs
deleted file mode 100644
index 5e1fe90a3701c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/nextdoubleex1.fs
+++ /dev/null
@@ -1,16 +0,0 @@
-module NextDoubleEx1
-
-open System
-
-//
-let rnd = Random()
-for i = 0 to 9 do
- printf $"{rnd.NextDouble(),-19:R} "
- if (i + 1) % 3 = 0 then printfn ""
-
-// The example displays output like the following:
-// 0.7911680553998649 0.0903414949264105 0.79776258291572455
-// 0.615568345233597 0.652644504165577 0.84023809378977776
-// 0.099662564741290441 0.91341467383942321 0.96018602045261581
-// 0.74772306473354022
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/nextex1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/nextex1.fs
deleted file mode 100644
index 9b65015571812..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/nextex1.fs
+++ /dev/null
@@ -1,12 +0,0 @@
-module NextEx1
-
-open System
-
-//
-let rnd = Random()
-for i = 0 to 9 do
- printf "%3i " (rnd.Next(-10, 11))
-
-// The example displays output like the following:
-// 2 9 -3 2 4 -7 -3 -8 -8 5
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/range1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/range1.fs
deleted file mode 100644
index 13943083adb3d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/range1.fs
+++ /dev/null
@@ -1,14 +0,0 @@
-module Range1
-
-open System
-
-//
-let rnd = Random()
-for i = 1 to 15 do
- printf "%3i " (rnd.Next(-10, 11))
- if i % 5 = 0 then printfn ""
-// The example displays output like the following:
-// -2 -5 -1 -2 10
-// -3 6 -4 -8 3
-// -7 10 5 -2 4
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/range2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/range2.fs
deleted file mode 100644
index 3f8a084972c2f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/range2.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module Range2
-
-open System
-
-//
-let rnd = Random()
-for i = 1 to 50 do
- printf "%3i " (rnd.Next(1000, 10000))
- if i % 10 = 0 then printfn ""
-
-// The example displays output like the following:
-// 9570 8979 5770 1606 3818 4735 8495 7196 7070 2313
-// 5279 6577 5104 5734 4227 3373 7376 6007 8193 5540
-// 7558 3934 3819 7392 1113 7191 6947 4963 9179 7907
-// 3391 6667 7269 1838 7317 1981 5154 7377 3297 5320
-// 9869 8694 2684 4949 2999 3019 2357 5211 9604 2593
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/same1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/same1.fs
deleted file mode 100644
index 0d8e9045a1614..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/same1.fs
+++ /dev/null
@@ -1,76 +0,0 @@
-module Same1
-
-//
-open System
-open System.IO
-
-let showRandomNumbers seed =
- let rnd = Random seed
- for _ = 0 to 20 do
- printfn $"{rnd.NextDouble()}"
-
-let persistSeed (seed: int) =
- use bin = new BinaryWriter(new FileStream(@".\seed.dat", FileMode.Create))
- bin.Write seed
-
-let displayNewRandomNumbers () =
- use bin = new BinaryReader(new FileStream(@".\seed.dat", FileMode.Open))
- let seed = bin.ReadInt32()
-
- let rnd = Random seed
- for _ = 0 to 20 do
- printfn $"{rnd.NextDouble()}"
-
-let seed = 100100
-showRandomNumbers seed
-printfn ""
-
-persistSeed seed
-
-displayNewRandomNumbers ()
-
-// The example displays output like the following:
-// 0.500193602172748
-// 0.0209461245783354
-// 0.465869495396442
-// 0.195512794514891
-// 0.928583675496552
-// 0.729333720509584
-// 0.381455668891527
-// 0.0508996467343064
-// 0.019261200921266
-// 0.258578445417145
-// 0.0177532266908107
-// 0.983277184415272
-// 0.483650274334313
-// 0.0219647376900375
-// 0.165910115077118
-// 0.572085966622497
-// 0.805291457942357
-// 0.927985211335116
-// 0.4228545699375
-// 0.523320379910674
-// 0.157783938645285
-//
-// 0.500193602172748
-// 0.0209461245783354
-// 0.465869495396442
-// 0.195512794514891
-// 0.928583675496552
-// 0.729333720509584
-// 0.381455668891527
-// 0.0508996467343064
-// 0.019261200921266
-// 0.258578445417145
-// 0.0177532266908107
-// 0.983277184415272
-// 0.483650274334313
-// 0.0219647376900375
-// 0.165910115077118
-// 0.572085966622497
-// 0.805291457942357
-// 0.927985211335116
-// 0.4228545699375
-// 0.523320379910674
-// 0.157783938645285
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/threadsafeex1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/threadsafeex1.fs
deleted file mode 100644
index df8058ffdd9b7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/threadsafeex1.fs
+++ /dev/null
@@ -1,146 +0,0 @@
-module ThreadSafeEx1
-
-//
-open System
-open System.Threading
-
-type Example() =
- []
- static val mutable private previous : float
-
- []
- static val mutable private perThreadCtr : int
-
- []
- static val mutable private perThreadTotal : float
-
- static let source = new CancellationTokenSource()
- static let countdown = new CountdownEvent(1)
- static let randLock = obj ()
- static let numericLock = obj ()
- static let rand = Random()
-
- let mutable totalValue = 0.0
- let mutable totalCount = 0
-
- member _.GetRandomNumbers(token: CancellationToken) =
- let mutable result = 0.0
- countdown.AddCount 1
- try
- try
- for _ = 0 to 1999999 do
- // Make sure there's no corruption of Random.
- token.ThrowIfCancellationRequested()
-
- lock randLock (fun () ->
- result <- rand.NextDouble() )
-
- // Check for corruption of Random instance.
- if result = Example.previous && result = 0.0 then
- source.Cancel()
- else
- Example.previous <- result
-
- Example.perThreadCtr <- Example.perThreadCtr + 1
- Example.perThreadTotal <- Example.perThreadTotal + result
-
- // Update overall totals.
- lock numericLock (fun () ->
- // Show result.
- printfn "Thread %s finished execution." Thread.CurrentThread.Name
- printfn $"Random numbers generated: {Example.perThreadCtr:N0}"
- printfn $"Sum of random numbers: {Example.perThreadTotal:N2}"
- printfn $"Random number mean: {(Example.perThreadTotal / float Example.perThreadCtr):N4}\n"
-
- // Update overall totals.
- totalCount <- totalCount + Example.perThreadCtr
- totalValue <- totalValue + Example.perThreadTotal)
-
- with :? OperationCanceledException as e ->
- printfn "Corruption in Thread %s %s" (e.GetType().Name) Thread.CurrentThread.Name
- finally
- countdown.Signal() |> ignore
-
- member this.Execute() =
- let token = source.Token
- for i = 1 to 10 do
- let newThread = Thread(fun () -> this.GetRandomNumbers token)
- newThread.Name <- string i
- newThread.Start()
- this.GetRandomNumbers token
-
- countdown.Signal() |> ignore
-
- countdown.Wait()
-
- source.Dispose()
-
- printfn $"\nTotal random numbers generated: {totalCount:N0}"
- printfn $"Total sum of all random numbers: {totalValue:N2}"
- printfn $"Random number mean: {(totalValue / float totalCount):N4}"
-
-let ex = Example()
-Thread.CurrentThread.Name <- "Main"
-ex.Execute()
-
-// The example displays output like the following:
-// Thread 6 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,491.05
-// Random number mean: 0.5002
-//
-// Thread 10 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,329.64
-// Random number mean: 0.4997
-//
-// Thread 4 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,166.89
-// Random number mean: 0.5001
-//
-// Thread 8 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,628.37
-// Random number mean: 0.4998
-//
-// Thread Main finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,920.89
-// Random number mean: 0.5000
-//
-// Thread 3 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,370.45
-// Random number mean: 0.4997
-//
-// Thread 7 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,330.92
-// Random number mean: 0.4997
-//
-// Thread 9 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,172.79
-// Random number mean: 0.5001
-//
-// Thread 5 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,079.43
-// Random number mean: 0.5000
-//
-// Thread 1 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,817.91
-// Random number mean: 0.4999
-//
-// Thread 2 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,930.63
-// Random number mean: 0.5000
-//
-//
-// Total random numbers generated: 22,000,000
-// Total sum of all random numbers: 10,998,238.98
-// Random number mean: 0.4999
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/threadsafeex2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/threadsafeex2.fs
deleted file mode 100644
index aa9cd5bdee293..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/threadsafeex2.fs
+++ /dev/null
@@ -1,143 +0,0 @@
-module ThreadSafeEx2
-
-//
-open System
-open System.Threading
-open System.Threading.Tasks
-
-type Example() =
- static let source = new CancellationTokenSource()
- static let rand = Random()
-
- static let randLock = obj ()
- static let numericLock = obj ()
-
- let mutable totalValue = 0.0
- let mutable totalCount = 0
-
- member _.Execute() =
- use source = source // Dispose of the CancellationTokenSource when we're done with it.
- let token = source.Token
-
- let tasks =
- [| for i = 0 to 10 do
- Task.Run(
- (fun () ->
- let mutable previous = 0.0
- let mutable taskCtr = 0
- let mutable taskTotal = 0.0
- let mutable result = 0.0
-
- for _ = 1 to 2000000 do
- // Make sure there's no corruption of Random.
- token.ThrowIfCancellationRequested()
-
- lock randLock (fun () -> result <- rand.NextDouble())
-
- // Check for corruption of Random instance.
- if result = previous && result = 0.0 then
- source.Cancel()
- else
- previous <- result
-
- taskCtr <- taskCtr + 1
- taskTotal <- taskTotal + result
-
- lock numericLock (fun () ->
- // Show result.
- printfn "Task %i finished execution." i
- printfn $"Random numbers generated: {taskCtr:N0}"
- printfn $"Sum of random numbers: {taskTotal:N2}"
- printfn $"Random number mean: {(taskTotal / float taskCtr):N4}\n"
-
- // Update overall totals.
- totalCount <- totalCount + taskCtr
- totalValue <- totalValue + taskTotal)),
- token
- ) |]
-
- try
- // Run tasks with F# Async.
- Task.WhenAll tasks
- |> Async.AwaitTask
- |> Async.RunSynchronously
-
- printfn $"\nTotal random numbers generated: {totalCount:N0}"
- printfn $"Total sum of all random numbers: {totalValue:N2}"
- printfn $"Random number mean: {(totalValue / float totalCount):N4}"
- with
- | :? AggregateException as e ->
- for inner in e.InnerExceptions do
- match inner with
- | :? TaskCanceledException as canc ->
- if canc <> null then
- printfn $"Task #{canc.Task.Id} cancelled"
- else
- printfn $"Exception: {inner.GetType().Name}"
- | _ -> ()
-
-let ex = Example()
-Thread.CurrentThread.Name <- "Main"
-ex.Execute()
-
-// The example displays output like the following:
-// Task 1 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,502.47
-// Random number mean: 0.5003
-//
-// Task 0 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,445.63
-// Random number mean: 0.5002
-//
-// Task 2 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,556.04
-// Random number mean: 0.5003
-//
-// Task 3 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,178.87
-// Random number mean: 0.5001
-//
-// Task 4 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,819.17
-// Random number mean: 0.4999
-//
-// Task 5 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,190.58
-// Random number mean: 0.5001
-//
-// Task 6 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,720.21
-// Random number mean: 0.4999
-//
-// Task 7 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,000.96
-// Random number mean: 0.4995
-//
-// Task 8 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,499.33
-// Random number mean: 0.4997
-//
-// Task 9 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 1,000,193.25
-// Random number mean: 0.5001
-//
-// Task 10 finished execution.
-// Random numbers generated: 2,000,000
-// Sum of random numbers: 999,960.82
-// Random number mean: 0.5000
-//
-//
-// Total random numbers generated: 22,000,000
-// Total sum of all random numbers: 11,000,067.33
-// Random number mean: 0.5000
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/unique.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/unique.fs
deleted file mode 100644
index 2a0d2c1466ea9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/unique.fs
+++ /dev/null
@@ -1,46 +0,0 @@
-module Unique
-
-//
-open System
-open System.Threading
-
-printfn "Instantiating two random number generators..."
-let rnd1 = Random()
-Thread.Sleep 2000
-let rnd2 = Random()
-
-printfn "\nThe first random number generator:"
-for _ = 1 to 10 do
- printfn $" {rnd1.Next()}"
-
-printfn "\nThe second random number generator:"
-for _ = 1 to 10 do
- printfn $" {rnd2.Next()}"
-
-// The example displays output like the following:
-// Instantiating two random number generators...
-//
-// The first random number generator:
-// 643164361
-// 1606571630
-// 1725607587
-// 2138048432
-// 496874898
-// 1969147632
-// 2034533749
-// 1840964542
-// 412380298
-// 47518930
-//
-// The second random number generator:
-// 1251659083
-// 1514185439
-// 1465798544
-// 517841554
-// 1821920222
-// 195154223
-// 1538948391
-// 1548375095
-// 546062716
-// 897797880
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/uniquearray1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/uniquearray1.fs
deleted file mode 100644
index 5cae6445e6d48..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/fsharp/uniquearray1.fs
+++ /dev/null
@@ -1,78 +0,0 @@
-module UniqueArray1
-
-//
-open System
-
-type Suit =
- | Clubs
- | Diamonds
- | Hearts
- | Spades
-
-type Face =
- | Ace | Two | Three
- | Four | Five | Six
- | Seven | Eight | Nine
- | Ten | Jack | Queen | King
-
-type Card = { Face: Face; Suit: Suit }
-
-let suits = [ Clubs; Diamonds; Hearts; Spades ]
-let faces = [ Ace; Two; Three; Four; Five; Six; Seven; Eight; Nine; Ten; Jack; Queen; King ]
-
-type Dealer() =
- let rnd = Random()
- let mutable pos = 0
- // Parallel array for sorting cards.
- let order = Array.init (suits.Length * faces.Length) (fun _ -> rnd.NextDouble() )
- // A deck of cards, without Jokers.
- let deck = [|
- for s in suits do
- for f in faces do
- { Face = f; Suit = s } |]
- // Shuffle the deck.
- do Array.Sort(order, deck)
-
- // Deal a number of cards from the deck, return None if failed
- member _.Deal(numberToDeal) : Card [] option =
- if numberToDeal = 0 || pos = deck.Length then
- printfn "There are no cards left in the deck"
- None
- else
- let cards = deck.[pos .. numberToDeal + pos - 1]
- if numberToDeal > deck.Length - pos then
- printfn "Can only deal the %i cards remaining on the deck." (deck.Length - pos)
- pos <- min (pos + numberToDeal) deck.Length
- Some cards
-
-let showCards cards =
- for card in cards do
- printfn $"{card.Face} of {card.Suit}"
-
-let dealer = Dealer()
-
-dealer.Deal 20
-|> Option.iter showCards
-
-// The example displays output like the following:
-// Six of Diamonds
-// King of Clubs
-// Eight of Clubs
-// Seven of Clubs
-// Queen of Clubs
-// King of Hearts
-// Three of Spades
-// Ace of Clubs
-// Four of Hearts
-// Three of Diamonds
-// Nine of Diamonds
-// Two of Hearts
-// Ace of Hearts
-// Three of Hearts
-// Four of Spades
-// Eight of Hearts
-// Queen of Diamonds
-// Two of Clubs
-// Four of Diamonds
-// Jack of Hearts
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/Random1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/Random1.vb
deleted file mode 100644
index 997827ecf77a9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/Random1.vb
+++ /dev/null
@@ -1,55 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'Imports System.Threading
-
-'
-Module modMain
-
- Public Sub Main()
- Dim bytes1(99), bytes2(99) As Byte
- Dim rnd1 As New Random()
- Dim rnd2 As New Random()
-
- rnd1.NextBytes(bytes1)
- rnd2.NextBytes(bytes2)
-
- Console.WriteLine("First Series:")
- For ctr As Integer = bytes1.GetLowerBound(0) to bytes1.GetUpperBound(0)
- Console.Write("{0, 5}", bytes1(ctr))
- If (ctr + 1) Mod 10 = 0 Then Console.WriteLine()
- Next
- Console.WriteLine()
- Console.WriteLine("Second Series:")
- For ctr As Integer = bytes2.GetLowerBound(0) to bytes2.GetUpperBound(0)
- Console.Write("{0, 5}", bytes2(ctr))
- If (ctr + 1) Mod 10 = 0 Then Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' First Series:
-' 97 129 149 54 22 208 120 105 68 177
-' 113 214 30 172 74 218 116 230 89 18
-' 12 112 130 105 116 180 190 200 187 120
-' 7 198 233 158 58 51 50 170 98 23
-' 21 1 113 74 146 245 34 255 96 24
-' 232 255 23 9 167 240 255 44 194 98
-' 18 175 173 204 169 171 236 127 114 23
-' 167 202 132 65 253 11 254 56 214 127
-' 145 191 104 163 143 7 174 224 247 73
-' 52 6 231 255 5 101 83 165 160 231
-'
-' Second Series:
-' 97 129 149 54 22 208 120 105 68 177
-' 113 214 30 172 74 218 116 230 89 18
-' 12 112 130 105 116 180 190 200 187 120
-' 7 198 233 158 58 51 50 170 98 23
-' 21 1 113 74 146 245 34 255 96 24
-' 232 255 23 9 167 240 255 44 194 98
-' 18 175 173 204 169 171 236 127 114 23
-' 167 202 132 65 253 11 254 56 214 127
-' 145 191 104 163 143 7 174 224 247 73
-' 52 6 231 255 5 101 83 165 160 231
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/array1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/array1.vb
deleted file mode 100644
index 1e229ea93a458..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/array1.vb
+++ /dev/null
@@ -1,20 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example1
- Public Sub Main()
- Dim cities() As String = {"Atlanta", "Boston", "Chicago", "Detroit",
- "Fort Wayne", "Greensboro", "Honolulu", "Indianapolis",
- "Jersey City", "Kansas City", "Los Angeles",
- "Milwaukee", "New York", "Omaha", "Philadelphia",
- "Raleigh", "San Francisco", "Tulsa", "Washington"}
- Dim rnd As New Random()
- Dim index As Integer = rnd.Next(0, cities.Length)
- Console.WriteLine("Today's city of the day: {0}",
- cities(index))
- End Sub
-End Module
-' The example displays output like the following:
-' Today's city of the day: Honolulu
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/booleans1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/booleans1.vb
deleted file mode 100644
index 5f9c954af264b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/booleans1.vb
+++ /dev/null
@@ -1,43 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example2
- Public Sub Main()
- ' Instantiate the Boolean generator.
- Dim boolGen As New BooleanGenerator()
- Dim totalTrue, totalFalse As Integer
-
- ' Generate 1,0000 random Booleans, and keep a running total.
- For ctr As Integer = 0 To 9999999
- Dim value As Boolean = boolGen.NextBoolean()
- If value Then
- totalTrue += 1
- Else
- totalFalse += 1
- End If
- Next
- Console.WriteLine("Number of true values: {0,7:N0} ({1:P3})",
- totalTrue,
- totalTrue / (totalTrue + totalFalse))
- Console.WriteLine("Number of false values: {0,7:N0} ({1:P3})",
- totalFalse,
- totalFalse / (totalTrue + totalFalse))
- End Sub
-End Module
-
-Public Class BooleanGenerator
- Dim rnd As Random
-
- Public Sub New()
- rnd = New Random()
- End Sub
-
- Public Function NextBoolean() As Boolean
- Return Convert.ToBoolean(rnd.Next(0, 2))
- End Function
-End Class
-' The example displays the following output:
-' Number of true values: 500,004 (50.000 %)
-' Number of false values: 499,996 (50.000 %)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/booleans2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/booleans2.vb
deleted file mode 100644
index 7d6de5554e5c5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/booleans2.vb
+++ /dev/null
@@ -1,34 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example3
- Public Sub Main()
- Dim totalTrue, totalFalse As Integer
-
- ' Generate 1,0000 random Booleans, and keep a running total.
- For ctr As Integer = 0 To 9999999
- Dim value As Boolean = NextBoolean()
- If value Then
- totalTrue += 1
- Else
- totalFalse += 1
- End If
- Next
- Console.WriteLine("Number of true values: {0,7:N0} ({1:P3})",
- totalTrue,
- totalTrue / (totalTrue + totalFalse))
- Console.WriteLine("Number of false values: {0,7:N0} ({1:P3})",
- totalFalse,
- totalFalse / (totalTrue + totalFalse))
- End Sub
-
- Public Function NextBoolean() As Boolean
- Static rnd As New Random()
- Return Convert.ToBoolean(rnd.Next(0, 2))
- End Function
-End Module
-' The example displays the following output:
-' Number of true values: 499,777 (49.978 %)
-' Number of false values: 500,223 (50.022 %)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/bytes1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/bytes1.vb
deleted file mode 100644
index 0aac57c768a0c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/bytes1.vb
+++ /dev/null
@@ -1,64 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example4
- Public Sub Main()
- Dim rnd As New Random2()
- Dim bytes(9999) As Byte
- Dim total(100) As Integer
- rnd.NextBytes(bytes, 0, 101)
-
- ' Calculate how many of each value we have.
- For Each value In bytes
- total(value) += 1
- Next
-
- ' Display the results.
- For ctr As Integer = 0 To total.Length - 1
- Console.Write("{0,3}: {1,-3} ", ctr, total(ctr))
- If (ctr + 1) Mod 5 = 0 Then Console.WriteLine()
- Next
- End Sub
-End Module
-
-Public Class Random2 : Inherits Random
- Public Sub New()
- MyBase.New()
- End Sub
-
- Public Sub New(seed As Integer)
- MyBase.New(seed)
- End Sub
-
- Public Overloads Sub NextBytes(bytes() As Byte,
- minValue As Byte, maxValue As Byte)
- For ctr As Integer = bytes.GetLowerbound(0) To bytes.GetUpperBound(0)
- bytes(ctr) = CByte(MyBase.Next(minValue, maxValue))
- Next
- End Sub
-End Class
-' The example displays output like the following:
-' 0: 115 1: 119 2: 92 3: 98 4: 92
-' 5: 102 6: 103 7: 84 8: 93 9: 116
-' 10: 91 11: 98 12: 106 13: 91 14: 92
-' 15: 101 16: 100 17: 96 18: 97 19: 100
-' 20: 101 21: 106 22: 112 23: 82 24: 85
-' 25: 102 26: 107 27: 98 28: 106 29: 102
-' 30: 109 31: 108 32: 94 33: 101 34: 107
-' 35: 101 36: 86 37: 100 38: 101 39: 102
-' 40: 113 41: 95 42: 96 43: 89 44: 99
-' 45: 81 46: 89 47: 105 48: 100 49: 85
-' 50: 103 51: 103 52: 93 53: 89 54: 91
-' 55: 97 56: 105 57: 97 58: 110 59: 86
-' 60: 116 61: 94 62: 117 63: 98 64: 110
-' 65: 93 66: 102 67: 100 68: 105 69: 83
-' 70: 81 71: 97 72: 85 73: 70 74: 98
-' 75: 100 76: 110 77: 114 78: 83 79: 90
-' 80: 96 81: 112 82: 102 83: 102 84: 99
-' 85: 81 86: 100 87: 93 88: 99 89: 118
-' 90: 95 91: 124 92: 108 93: 96 94: 104
-' 95: 106 96: 99 97: 99 98: 92 99: 99
-' 100: 108
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/doublerange1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/doublerange1.vb
deleted file mode 100644
index 86f6298c6c346..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/doublerange1.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example5
- Public Sub Main()
- Const ONE_TENTH As Long = 922337203685477581
-
- Dim rnd As New Random()
- Dim number As Long
- Dim count(9) As Integer
-
- ' Generate 20 million integer values.
- For ctr As Integer = 1 To 20000000
- number = CLng(rnd.NextDouble() * Int64.MaxValue)
- ' Categorize random numbers.
- count(CInt(number \ ONE_TENTH)) += 1
- Next
- ' Display breakdown by range.
- Console.WriteLine("{0,28} {1,32} {2,7}", "Range", "Count", "Pct.")
- Console.WriteLine()
- For ctr As Integer = 0 To 9
- Console.WriteLine("{0,25:N0}-{1,25:N0} {2,8:N0} {3,7:P2}", ctr * ONE_TENTH,
- If(ctr < 9, ctr * ONE_TENTH + ONE_TENTH - 1, Int64.MaxValue),
- count(ctr), count(ctr) / 20000000)
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' Range Count Pct.
-'
-' 0- 922,337,203,685,477,580 1,996,148 9.98 %
-' 922,337,203,685,477,581-1,844,674,407,370,955,161 2,000,293 10.00 %
-' 1,844,674,407,370,955,162-2,767,011,611,056,432,742 2,000,094 10.00 %
-' 2,767,011,611,056,432,743-3,689,348,814,741,910,323 2,000,159 10.00 %
-' 3,689,348,814,741,910,324-4,611,686,018,427,387,904 1,999,552 10.00 %
-' 4,611,686,018,427,387,905-5,534,023,222,112,865,485 1,998,248 9.99 %
-' 5,534,023,222,112,865,486-6,456,360,425,798,343,066 2,000,696 10.00 %
-' 6,456,360,425,798,343,067-7,378,697,629,483,820,647 2,001,637 10.01 %
-' 7,378,697,629,483,820,648-8,301,034,833,169,298,228 2,002,870 10.01 %
-' 8,301,034,833,169,298,229-9,223,372,036,854,775,807 2,000,303 10.00 %
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/doublerange2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/doublerange2.vb
deleted file mode 100644
index 9ece828201adf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/doublerange2.vb
+++ /dev/null
@@ -1,24 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example6
- Public Sub Main()
- Dim rnd As New Random()
- For ctr As Integer = 1 To 10
- Console.WriteLine(rnd.NextDouble() - 1)
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' -0.930412760437658
-' -0.164699016215605
-' -0.9851692803135
-' -0.43468508843085
-' -0.177202483255976
-' -0.776813320245972
-' -0.0713201854710096
-' -0.0912875561468711
-' -0.540621722368813
-' -0.232211863730201
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/doublerange3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/doublerange3.vb
deleted file mode 100644
index 0a6c970150414..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/doublerange3.vb
+++ /dev/null
@@ -1,36 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example7
- Public Sub Main()
- Dim rnd As New Random()
- Dim lowerBound As Integer = 10
- Dim upperBound As Integer = 11
- Dim range(9) As Integer
- For ctr As Integer = 1 To 1000000
- Dim value As Double = rnd.NextDouble() * (upperBound - lowerBound) + lowerBound
- range(CInt(Math.Truncate((value - lowerBound) * 10))) += 1
- Next
-
- For ctr As Integer = 0 To 9
- Dim lowerRange As Double = 10 + ctr * 0.1
- Console.WriteLine("{0:N1} to {1:N1}: {2,8:N0} ({3,7:P2})",
- lowerRange, lowerRange + 0.1, range(ctr),
- range(ctr) / 1000000.0)
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' 10.0 to 10.1: 99,929 ( 9.99 %)
-' 10.1 to 10.2: 100,189 (10.02 %)
-' 10.2 to 10.3: 99,384 ( 9.94 %)
-' 10.3 to 10.4: 100,240 (10.02 %)
-' 10.4 to 10.5: 99,397 ( 9.94 %)
-' 10.5 to 10.6: 100,580 (10.06 %)
-' 10.6 to 10.7: 100,293 (10.03 %)
-' 10.7 to 10.8: 100,135 (10.01 %)
-' 10.8 to 10.9: 99,905 ( 9.99 %)
-' 10.9 to 11.0: 99,948 ( 9.99 %)
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/long1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/long1.vb
deleted file mode 100644
index 5123939faf9e9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/long1.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example8
- Public Sub Main()
- Const ONE_TENTH As Long = 922337203685477581
-
- Dim rnd As New Random()
- Dim number As Long
- Dim count(9) As Integer
-
- ' Generate 20 million long integers.
- For ctr As Integer = 1 To 20000000
- number = CLng(rnd.NextDouble() * Int64.MaxValue)
- ' Categorize random numbers.
- count(CInt(number \ ONE_TENTH)) += 1
- Next
- ' Display breakdown by range.
- Console.WriteLine("{0,28} {1,32} {2,7}", "Range", "Count", "Pct.")
- Console.WriteLine()
- For ctr As Integer = 0 To 9
- Console.WriteLine("{0,25:N0}-{1,25:N0} {2,8:N0} {3,7:P2}", ctr * ONE_TENTH,
- If(ctr < 9, ctr * ONE_TENTH + ONE_TENTH - 1, Int64.MaxValue),
- count(ctr), count(ctr) / 20000000)
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' Range Count Pct.
-'
-' 0- 922,337,203,685,477,580 1,996,148 9.98 %
-' 922,337,203,685,477,581-1,844,674,407,370,955,161 2,000,293 10.00 %
-' 1,844,674,407,370,955,162-2,767,011,611,056,432,742 2,000,094 10.00 %
-' 2,767,011,611,056,432,743-3,689,348,814,741,910,323 2,000,159 10.00 %
-' 3,689,348,814,741,910,324-4,611,686,018,427,387,904 1,999,552 10.00 %
-' 4,611,686,018,427,387,905-5,534,023,222,112,865,485 1,998,248 9.99 %
-' 5,534,023,222,112,865,486-6,456,360,425,798,343,066 2,000,696 10.00 %
-' 6,456,360,425,798,343,067-7,378,697,629,483,820,647 2,001,637 10.01 %
-' 7,378,697,629,483,820,648-8,301,034,833,169,298,228 2,002,870 10.01 %
-' 8,301,034,833,169,298,229-9,223,372,036,854,775,807 2,000,303 10.00 %
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/nextbytes1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/nextbytes1.vb
deleted file mode 100644
index 0f9004361146c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/nextbytes1.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example9
- Public Sub Main()
- Dim rnd As New Random()
- Dim bytes(19) As Byte
- rnd.NextBytes(bytes)
- For ctr As Integer = 1 To bytes.Length
- Console.Write("{0,3} ", bytes(ctr - 1))
- If ctr Mod 10 = 0 Then Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' 141 48 189 66 134 212 211 71 161 56
-' 181 166 220 133 9 252 222 57 62 62
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/nextdoubleex1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/nextdoubleex1.vb
deleted file mode 100644
index d8c63d68654f9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/nextdoubleex1.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example10
- Public Sub Main()
- Dim rnd As New Random()
- For ctr As Integer = 0 To 9
- Console.Write("{0,-19:R} ", rnd.NextDouble())
- If (ctr + 1) Mod 3 = 0 Then Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' 0.7911680553998649 0.0903414949264105 0.79776258291572455
-' 0.615568345233597 0.652644504165577 0.84023809378977776
-' 0.099662564741290441 0.91341467383942321 0.96018602045261581
-' 0.74772306473354022
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/nextex1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/nextex1.vb
deleted file mode 100644
index c7fec4d9a8ad2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/nextex1.vb
+++ /dev/null
@@ -1,15 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example11
- Public Sub Main()
- Dim rnd As New Random()
- For ctr As Integer = 0 To 9
- Console.Write("{0,3} ", rnd.Next(-10, 11))
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' 2 9 -3 2 4 -7 -3 -8 -8 5
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/range1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/range1.vb
deleted file mode 100644
index d8a9beacb5d66..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/range1.vb
+++ /dev/null
@@ -1,18 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example12
- Public Sub Main()
- Dim rnd As New Random()
- For ctr As Integer = 1 To 15
- Console.Write("{0,3} ", rnd.Next(-10, 11))
- If ctr Mod 5 = 0 Then Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' -2 -5 -1 -2 10
-' -3 6 -4 -8 3
-' -7 10 5 -2 4
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/range2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/range2.vb
deleted file mode 100644
index f2fa6e2d382d7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/range2.vb
+++ /dev/null
@@ -1,20 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example13
- Public Sub Main()
- Dim rnd As New Random()
- For ctr As Integer = 1 To 50
- Console.Write("{0,3} ", rnd.Next(1000, 10000))
- If ctr Mod 10 = 0 Then Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' 9570 8979 5770 1606 3818 4735 8495 7196 7070 2313
-' 5279 6577 5104 5734 4227 3373 7376 6007 8193 5540
-' 7558 3934 3819 7392 1113 7191 6947 4963 9179 7907
-' 3391 6667 7269 1838 7317 1981 5154 7377 3297 5320
-' 9869 8694 2684 4949 2999 3019 2357 5211 9604 2593
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/same1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/same1.vb
deleted file mode 100644
index b7afc1049081c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/same1.vb
+++ /dev/null
@@ -1,88 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-
-Module Example14
- Public Sub Main()
- Dim seed As Integer = 100100
- ShowRandomNumbers(seed)
- Console.WriteLine()
-
- PersistSeed(seed)
-
- DisplayNewRandomNumbers()
- End Sub
-
- Private Sub ShowRandomNumbers(seed As Integer)
- Dim rnd As New Random(seed)
- For ctr As Integer = 0 To 20
- Console.WriteLine(rnd.NextDouble())
- Next
- End Sub
-
- Private Sub PersistSeed(seed As Integer)
- Dim fs As New FileStream(".\seed.dat", FileMode.Create)
- Dim bin As New BinaryWriter(fs)
- bin.Write(seed)
- bin.Close()
- End Sub
-
- Private Sub DisplayNewRandomNumbers()
- Dim fs As New FileStream(".\seed.dat", FileMode.Open)
- Dim bin As New BinaryReader(fs)
- Dim seed As Integer = bin.ReadInt32()
- bin.Close()
-
- Dim rnd As New Random(seed)
- For ctr As Integer = 0 To 20
- Console.WriteLine(rnd.NextDouble())
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' 0.500193602172748
-' 0.0209461245783354
-' 0.465869495396442
-' 0.195512794514891
-' 0.928583675496552
-' 0.729333720509584
-' 0.381455668891527
-' 0.0508996467343064
-' 0.019261200921266
-' 0.258578445417145
-' 0.0177532266908107
-' 0.983277184415272
-' 0.483650274334313
-' 0.0219647376900375
-' 0.165910115077118
-' 0.572085966622497
-' 0.805291457942357
-' 0.927985211335116
-' 0.4228545699375
-' 0.523320379910674
-' 0.157783938645285
-'
-' 0.500193602172748
-' 0.0209461245783354
-' 0.465869495396442
-' 0.195512794514891
-' 0.928583675496552
-' 0.729333720509584
-' 0.381455668891527
-' 0.0508996467343064
-' 0.019261200921266
-' 0.258578445417145
-' 0.0177532266908107
-' 0.983277184415272
-' 0.483650274334313
-' 0.0219647376900375
-' 0.165910115077118
-' 0.572085966622497
-' 0.805291457942357
-' 0.927985211335116
-' 0.4228545699375
-' 0.523320379910674
-' 0.157783938645285
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/threadsafeex1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/threadsafeex1.vb
deleted file mode 100644
index bf1411760daa9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/threadsafeex1.vb
+++ /dev/null
@@ -1,144 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Threading
-
-Module Example15
- Dim previous As Double = 0.0
- Dim perThreadCtr As Integer = 0
- Dim perThreadTotal As Double = 0.0
- Dim source As New CancellationTokenSource()
- Dim countdown As New CountdownEvent(1)
- Dim randLock As New Object()
- Dim numericLock As New Object()
- Dim rand As New Random()
- Dim totalValue As Double = 0.0
- Dim totalCount As Integer = 0
-
- Public Sub Main()
- Thread.CurrentThread.Name = "Main"
-
- Dim token As CancellationToken = source.Token
- For threads As Integer = 1 To 10
- Dim newThread As New Thread(AddressOf GetRandomNumbers)
- newThread.Name = threads.ToString()
- newThread.Start(token)
- Next
- GetRandomNumbers(token)
-
- countdown.Signal()
- ' Make sure all threads have finished.
- countdown.Wait()
-
- Console.WriteLine()
- Console.WriteLine("Total random numbers generated: {0:N0}", totalCount)
- Console.WriteLine("Total sum of all random numbers: {0:N2}", totalValue)
- Console.WriteLine("Random number mean: {0:N4}", totalValue / totalCount)
- End Sub
-
- Private Sub GetRandomNumbers(o As Object)
- Dim token As CancellationToken = CType(o, CancellationToken)
- Dim result As Double = 0.0
- countdown.AddCount(1)
-
- Try
- For ctr As Integer = 1 To 2000000
- ' Make sure there's no corruption of Random.
- token.ThrowIfCancellationRequested()
-
- SyncLock randLock
- result = rand.NextDouble()
- End SyncLock
- ' Check for corruption of Random instance.
- If result = previous AndAlso result = 0 Then
- source.Cancel()
- Else
- previous = result
- End If
- perThreadCtr += 1
- perThreadTotal += result
- Next
-
- Console.WriteLine("Thread {0} finished execution.",
- Thread.CurrentThread.Name)
- Console.WriteLine("Random numbers generated: {0:N0}", perThreadCtr)
- Console.WriteLine("Sum of random numbers: {0:N2}", perThreadTotal)
- Console.WriteLine("Random number mean: {0:N4}", perThreadTotal / perThreadCtr)
- Console.WriteLine()
-
- ' Update overall totals.
- SyncLock numericLock
- totalCount += perThreadCtr
- totalValue += perThreadTotal
- End SyncLock
- Catch e As OperationCanceledException
- Console.WriteLine("Corruption in Thread {1}", e.GetType().Name, Thread.CurrentThread.Name)
- Finally
- countdown.Signal()
- source.Dispose()
- End Try
- End Sub
-End Module
-' The example displays output like the following:
-' Thread 6 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 1,000,491.05
-' Random number mean: 0.5002
-'
-' Thread 10 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,329.64
-' Random number mean: 0.4997
-'
-' Thread 4 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 1,000,166.89
-' Random number mean: 0.5001
-'
-' Thread 8 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,628.37
-' Random number mean: 0.4998
-'
-' Thread Main finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,920.89
-' Random number mean: 0.5000
-'
-' Thread 3 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,370.45
-' Random number mean: 0.4997
-'
-' Thread 7 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,330.92
-' Random number mean: 0.4997
-'
-' Thread 9 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 1,000,172.79
-' Random number mean: 0.5001
-'
-' Thread 5 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 1,000,079.43
-' Random number mean: 0.5000
-'
-' Thread 1 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,817.91
-' Random number mean: 0.4999
-'
-' Thread 2 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,930.63
-' Random number mean: 0.5000
-'
-'
-' Total random numbers generated: 22,000,000
-' Total sum of all random numbers: 10,998,238.98
-' Random number mean: 0.4999
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/threadsafeex2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/threadsafeex2.vb
deleted file mode 100644
index 2e01f27849d33..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/threadsafeex2.vb
+++ /dev/null
@@ -1,143 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-Imports System.Threading
-Imports System.Threading.Tasks
-
-Module Example16
- Dim source As New CancellationTokenSource()
- Dim randLock As New Object()
- Dim numericLock As New Object()
- Dim rand As New Random()
- Dim totalValue As Double = 0.0
- Dim totalCount As Integer = 0
-
- Public Sub Main()
- Dim tasks As New List(Of Task)()
-
- For ctr As Integer = 1 To 10
- Dim token As CancellationToken = source.Token
- Dim taskNo As Integer = ctr
- tasks.Add(Task.Run(
- Sub()
- Dim previous As Double = 0.0
- Dim taskCtr As Integer = 0
- Dim taskTotal As Double = 0.0
- Dim result As Double = 0.0
-
- For n As Integer = 1 To 2000000
- ' Make sure there's no corruption of Random.
- token.ThrowIfCancellationRequested()
-
- SyncLock randLock
- result = rand.NextDouble()
- End SyncLock
- ' Check for corruption of Random instance.
- If result = previous AndAlso result = 0 Then
- source.Cancel()
- Else
- previous = result
- End If
- taskCtr += 1
- taskTotal += result
- Next
-
- ' Show result.
- Console.WriteLine("Task {0} finished execution.", taskNo)
- Console.WriteLine("Random numbers generated: {0:N0}", taskCtr)
- Console.WriteLine("Sum of random numbers: {0:N2}", taskTotal)
- Console.WriteLine("Random number mean: {0:N4}", taskTotal / taskCtr)
- Console.WriteLine()
-
- ' Update overall totals.
- SyncLock numericLock
- totalCount += taskCtr
- totalValue += taskTotal
- End SyncLock
- End Sub, token))
- Next
-
- Try
- Task.WaitAll(tasks.ToArray())
- Console.WriteLine()
- Console.WriteLine("Total random numbers generated: {0:N0}", totalCount)
- Console.WriteLine("Total sum of all random numbers: {0:N2}", totalValue)
- Console.WriteLine("Random number mean: {0:N4}", totalValue / totalCount)
- Catch e As AggregateException
- For Each inner As Exception In e.InnerExceptions
- Dim canc As TaskCanceledException = TryCast(inner, TaskCanceledException)
- If canc IsNot Nothing Then
- Console.WriteLine("Task #{0} cancelled.", canc.Task.Id)
- Else
- Console.WriteLine("Exception: {0}", inner.GetType().Name)
- End If
- Next
- Finally
- source.Dispose()
- End Try
- End Sub
-End Module
-' The example displays output like the following:
-' Task 1 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 1,000,502.47
-' Random number mean: 0.5003
-'
-' Task 0 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 1,000,445.63
-' Random number mean: 0.5002
-'
-' Task 2 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 1,000,556.04
-' Random number mean: 0.5003
-'
-' Task 3 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 1,000,178.87
-' Random number mean: 0.5001
-'
-' Task 4 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,819.17
-' Random number mean: 0.4999
-'
-' Task 5 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 1,000,190.58
-' Random number mean: 0.5001
-'
-' Task 6 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,720.21
-' Random number mean: 0.4999
-'
-' Task 7 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,000.96
-' Random number mean: 0.4995
-'
-' Task 8 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,499.33
-' Random number mean: 0.4997
-'
-' Task 9 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 1,000,193.25
-' Random number mean: 0.5001
-'
-' Task 10 finished execution.
-' Random numbers generated: 2,000,000
-' Sum of random numbers: 999,960.82
-' Random number mean: 0.5000
-'
-'
-' Total random numbers generated: 22,000,000
-' Total sum of all random numbers: 11,000,067.33
-' Random number mean: 0.5000
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/unique.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/unique.vb
deleted file mode 100644
index 102b020518c98..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/unique.vb
+++ /dev/null
@@ -1,54 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Threading
-
-Module Example17
- Public Sub Main()
- Console.WriteLine("Instantiating two random number generators...")
- Dim rnd1 As New Random()
- Thread.Sleep(2000)
- Dim rnd2 As New Random()
- Console.WriteLine()
-
- Console.WriteLine("The first random number generator:")
- For ctr As Integer = 1 To 10
- Console.WriteLine(" {0}", rnd1.Next())
- Next
- Console.WriteLine()
-
- Console.WriteLine("The second random number generator:")
- For ctr As Integer = 1 To 10
- Console.WriteLine(" {0}", rnd2.Next())
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' Instantiating two random number generators...
-'
-' The first random number generator:
-' 643164361
-' 1606571630
-' 1725607587
-' 2138048432
-' 496874898
-' 1969147632
-' 2034533749
-' 1840964542
-' 412380298
-' 47518930
-'
-' The second random number generator:
-' 1251659083
-' 1514185439
-' 1465798544
-' 517841554
-' 1821920222
-' 195154223
-' 1538948391
-' 1548375095
-' 546062716
-' 897797880
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/uniquearray1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/uniquearray1.vb
deleted file mode 100644
index 7d5d6a30da14f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Random/Overview/vb/uniquearray1.vb
+++ /dev/null
@@ -1,125 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-' A class that represents an individual card in a playing deck.
-Public Class Card
- Public Suit As Suit
- Public FaceValue As FaceValue
-
- Public Overrides Function ToString() As String
- Return String.Format("{0:F} of {1:F}", Me.FaceValue, Me.Suit)
- End Function
-End Class
-
-Public Enum Suit As Integer
- Hearts = 0
- Diamonds = 1
- Spades = 2
- Clubs = 3
-End Enum
-
-Public Enum FaceValue As Integer
- Ace = 1
- Two = 2
- Three = 3
- Four = 4
- Five = 5
- Six = 6
- Seven = 7
- Eight = 8
- Nine = 9
- Ten = 10
- Jack = 11
- Queen = 12
- King = 13
-End Enum
-
-Public Class Dealer
- Dim rnd As Random
- ' A deck of cards, without Jokers.
- Dim deck(51) As Card
- ' Parallel array for sorting cards.
- Dim order(51) As Double
- ' A pointer to the next card to deal.
- Dim ptr As Integer = 0
- ' A flag to indicate the deck is used.
- Dim mustReshuffle As Boolean
-
- Public Sub New()
- rnd = New Random()
- ' Initialize the deck.
- Dim deckCtr As Integer = 0
- For Each Suit In [Enum].GetValues(GetType(Suit))
- For Each faceValue In [Enum].GetValues(GetType(FaceValue))
- Dim card As New Card()
- card.Suit = CType(Suit, Suit)
- card.FaceValue = CType(faceValue, FaceValue)
- deck(deckCtr) = card
- deckCtr += 1
- Next
- Next
- For ctr As Integer = 0 To order.Length - 1
- order(ctr) = rnd.NextDouble()
- Next
- Array.Sort(order, deck)
- End Sub
-
- Public Function Deal(numberToDeal As Integer) As Card()
- If mustReshuffle Then
- Console.WriteLine("There are no cards left in the deck")
- Return Nothing
- End If
-
- Dim cardsDealt(numberToDeal - 1) As Card
- For ctr As Integer = 0 To numberToDeal - 1
- cardsDealt(ctr) = deck(ptr)
- ptr += 1
- If ptr = deck.Length Then
- mustReshuffle = True
- End If
- If mustReshuffle And ctr < numberToDeal - 1
- Console.WriteLine("Can only deal the {0} cards remaining on the deck.",
- ctr + 1)
- Return cardsDealt
- End If
- Next
- Return cardsDealt
- End Function
-End Class
-
-Public Module Example
- Public Sub Main()
- Dim dealer As New Dealer()
- ShowCards(dealer.Deal(20))
- End Sub
-
- Private Sub ShowCards(cards() As Card)
- For Each card In cards
- If card IsNot Nothing Then _
- Console.WriteLine("{0} of {1}", card.FaceValue, card.Suit)
- Next
- End Sub
-End Module
-' The example displays output like the following:
-' Six of Diamonds
-' King of Clubs
-' Eight of Clubs
-' Seven of Clubs
-' Queen of Clubs
-' King of Hearts
-' Three of Spades
-' Ace of Clubs
-' Four of Hearts
-' Three of Diamonds
-' Nine of Diamonds
-' Two of Hearts
-' Ace of Hearts
-' Three of Hearts
-' Four of Spades
-' Eight of Hearts
-' Queen of Diamonds
-' Two of Clubs
-' Four of Diamonds
-' Jack of Hearts
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/csharp/compareto2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/csharp/compareto2.cs
deleted file mode 100644
index cdd6191ed7715..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/csharp/compareto2.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-using System;
-
-public class Example2
-{
- public static void Main()
- {
- float value1 = 16.5457f;
- float operand = 3.8899982f;
- float value2 = value1 * operand / operand;
- Console.WriteLine($"Comparing {value1} and {value2}: {value1.CompareTo(value2)}");
- Console.WriteLine();
- Console.WriteLine($"Comparing {value1:R} and {value2:R}: {value1.CompareTo(value2)}");
- }
-}
-// The example displays the following output:
-// Comparing 16.5457 and 16.5457: -1
-//
-// Comparing 16.5457 and 16.545702: -1
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/csharp/compareto3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/csharp/compareto3.cs
deleted file mode 100644
index 4d5b9b389fcd9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/csharp/compareto3.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-using System;
-
-public class Example
-{
- public static void Main()
- {
- float value1 = 16.5457f;
- float operand = 3.8899982f;
- object value2 = value1 * operand / operand;
- Console.WriteLine($"Comparing {value1} and {value2}: {value1.CompareTo(value2)}");
- Console.WriteLine();
- Console.WriteLine($"Comparing {value1:R} and {value2:R}: {value1.CompareTo(value2)}");
- }
-}
-// The example displays the following output:
-// Comparing 16.5457 and 16.5457: -1
-//
-// Comparing 16.5457 and 16.545702: -1
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/fsharp/compareto2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/fsharp/compareto2.fs
deleted file mode 100644
index e097f734ffc64..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/fsharp/compareto2.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module compareto2
-
-//
-let value1 = 16.5457f
-let operand = 3.8899982f
-let value2 = value1 * operand / operand
-printfn $"Comparing {value1} and {value2}: {value1.CompareTo value2}\n"
-printfn $"Comparing {value1:R} and {value2:R}: {value1.CompareTo value2}"
-// The example displays the following output:
-// Comparing 16.5457 and 16.5457: -1
-//
-// Comparing 16.5457 and 16.545702: -1
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/fsharp/compareto3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/fsharp/compareto3.fs
deleted file mode 100644
index d541c895f14a6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/fsharp/compareto3.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module compareto3
-
-//
-let value1 = 16.5457f
-let operand = 3.8899982f
-let value2 = box (value1 * operand / operand)
-printfn $"Comparing {value1} and {value2}: {value1.CompareTo value2}\n"
-printfn $"Comparing {value1:R} and {value2:R}: {value1.CompareTo value2}"
-// The example displays the following output:
-// Comparing 16.5457 and 16.5457: -1
-//
-// Comparing 16.5457 and 16.545702: -1
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/vb/compareto2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/vb/compareto2.vb
deleted file mode 100644
index 11204a9339035..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/vb/compareto2.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- Dim value1 As Single = 16.5457
- Dim value2 As Single = value1 * CSng(3.8899982) / CSng(3.8899982)
- Console.WriteLine("Comparing {0} and {1}: {2}",
- value1, value2, value1.CompareTo(value2))
- Console.WriteLine()
- Console.WriteLine("Comparing {0:R} and {1:R}: {2}",
- value1, value2, value1.CompareTo(value2))
- End Sub
-End Module
-' The example displays the following output:
-' Comparing 16.5457 and 16.5457: -1
-'
-' Comparing 16.5457 and 16.545702: -1
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/vb/compareto3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/vb/compareto3.vb
deleted file mode 100644
index 1822759f127b0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/CompareTo/vb/compareto3.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example2
- Public Sub Main()
- Dim value1 As Single = 16.5457
- Dim value2 As Object = value1 * CSng(3.8899982) / CSng(3.8899982)
- Console.WriteLine("Comparing {0} and {1}: {2}",
- value1, value2, value1.CompareTo(value2))
- Console.WriteLine()
- Console.WriteLine("Comparing {0:R} and {1:R}: {2}",
- value1, value2, value1.CompareTo(value2))
- End Sub
-End Module
-' The example displays the following output:
-' Comparing 16.5457 and 16.5457: -1
-'
-' Comparing 16.5457 and 16.545702: -1
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/SingleEquals_25051.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/SingleEquals_25051.cs
deleted file mode 100644
index da27b7ae54cb6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/SingleEquals_25051.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using System;
-
-public class Class1
-{
- public static void Main()
- {
- CompareUsingEquals();
- Console.WriteLine();
- CompareApproximateValues();
- Console.WriteLine();
- CompareObjectsUsingEquals();
- Console.WriteLine();
- CompareApproximateObjectValues();
- Console.WriteLine();
- }
-
- private static void CompareUsingEquals()
- {
- //
- // Initialize two floats with apparently identical values
- float float1 = .33333f;
- float float2 = 1/3;
- // Compare them for equality
- Console.WriteLine(float1.Equals(float2)); // displays false
- //
- }
-
- private static void CompareApproximateValues()
- {
- //
- // Initialize two floats with apparently identical values
- float float1 = .33333f;
- float float2 = (float) 1/3;
- // Define the tolerance for variation in their values
- float difference = Math.Abs(float1 * .0001f);
-
- // Compare the values
- // The output to the console indicates that the two values are equal
- if (Math.Abs(float1 - float2) <= difference)
- Console.WriteLine("float1 and float2 are equal.");
- else
- Console.WriteLine("float1 and float2 are unequal.");
- //
- }
-
- private static void CompareObjectsUsingEquals()
- {
- //
- // Initialize two floats with apparently identical values
- float float1 = .33333f;
- object float2 = 1/3;
- // Compare them for equality
- Console.WriteLine(float1.Equals(float2)); // displays false
- //
- }
-
- private static void CompareApproximateObjectValues()
- {
- //
- // Initialize two floats with apparently identical values
- float float1 = .33333f;
- object float2 = (float) 1/3;
- // Define the tolerance for variation in their values
- float difference = Math.Abs(float1 * .0001f);
-
- // Compare the values
- // The output to the console indicates that the two values are equal
- if (Math.Abs(float1 - (float) float2) <= difference)
- Console.WriteLine("float1 and float2 are equal.");
- else
- Console.WriteLine("float1 and float2 are unequal.");
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/epsilon.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/epsilon.cs
deleted file mode 100644
index 2bf16f5c802c6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/epsilon.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-using System;
-
-public class Example1
-{
- public static void Main()
- {
- float[] values = { 0f, Single.Epsilon, Single.Epsilon * .5f };
-
- for (int ctr = 0; ctr <= values.Length - 2; ctr++)
- {
- for (int ctr2 = ctr + 1; ctr2 <= values.Length - 1; ctr2++)
- {
- Console.WriteLine($"{values[ctr]:r} = {values[ctr2]:r}: {values[ctr].Equals(values[ctr2])}");
- }
- Console.WriteLine();
- }
- }
-}
-// The example displays the following output:
-// 0 = 1.401298E-45: False
-// 0 = 0: True
-//
-// 1.401298E-45 = 0: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/epsilon1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/epsilon1.cs
deleted file mode 100644
index 87664989eac98..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/csharp/epsilon1.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-using System;
-
-public class Example2
-{
- public static void Main()
- {
- float[] values = { 0.0f, Single.Epsilon };
- foreach (var value in values) {
- Console.WriteLine(GetComponentParts(value));
- Console.WriteLine();
- }
- }
-
- private static string GetComponentParts(float value)
- {
- string result = String.Format("{0:R}: ", value);
- int indent = result.Length;
-
- // Convert the single to a 4-byte array.
- byte[] bytes = BitConverter.GetBytes(value);
- int formattedSingle = BitConverter.ToInt32(bytes, 0);
-
- // Get the sign bit (byte 3, bit 7).
- result += String.Format("Sign: {0}\n",
- (formattedSingle >> 31) != 0 ? "1 (-)" : "0 (+)");
-
- // Get the exponent (byte 2 bit 7 to byte 3, bits 6)
- int exponent = (formattedSingle >> 23) & 0x000000FF;
- int adjustment = (exponent != 0) ? 127 : 126;
- result += String.Format("{0}Exponent: 0x{1:X4} ({1})\n", new String(' ', indent), exponent - adjustment);
-
- // Get the significand (bits 0-22)
- long significand = exponent != 0 ?
- ((formattedSingle & 0x007FFFFF) | 0x800000) :
- (formattedSingle & 0x007FFFFF);
- result += String.Format("{0}Mantissa: 0x{1:X13}\n", new String(' ', indent), significand);
- return result;
- }
-}
-// // The example displays the following output:
-// 0: Sign: 0 (+)
-// Exponent: 0xFFFFFF82 (-126)
-// Mantissa: 0x0000000000000
-//
-//
-// 1.401298E-45: Sign: 0 (+)
-// Exponent: 0xFFFFFF82 (-126)
-// Mantissa: 0x0000000000001
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/fsharp/SingleEquals_25051.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/fsharp/SingleEquals_25051.fs
deleted file mode 100644
index d9fba4a57bd73..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/fsharp/SingleEquals_25051.fs
+++ /dev/null
@@ -1,62 +0,0 @@
-module SingleEquals_25021
-
-open System
-
-let compareUsingEquals () =
- //
- // Initialize two floats with apparently identical values
- let float1 = 0.33333f
- let float2 = 1f / 3f
- // Compare them for equality
- printfn $"{float1.Equals float2}" // displays false
- //
-
-let compareApproximateValues () =
- //
- // Initialize two floats with apparently identical values
- let float1 = 0.33333f
- let float2 = 1f / 3f
- // Define the tolerance for variation in their values
- let difference = abs (float1 * 0.0001f)
-
- // Compare the values
- // The output to the console indicates that the two values are equal
- if abs (float1 - float2) <= difference then
- printfn "float1 and float2 are equal."
- else
- printfn "float1 and float2 are unequal."
- //
-
-let compareObjectsUsingEquals () =
- //
- // Initialize two floats with apparently identical values
- let float1 = 0.33333f
- let float2 = box (1f / 3f)
- // Compare them for equality
- printfn $"{float1.Equals float2}" // displays false
- //
-
-let compareApproximateObjectValues () =
- //
- // Initialize two floats with apparently identical values
- let float1 = 0.33333f
- let float2 = box (1f / 3f)
- // Define the tolerance for variation in their values
- let difference = abs (float1 * 0.0001f)
-
- // Compare the values
- // The output to the console indicates that the two values are equal
- if abs (float1 - (float2 :?> float32)) <= difference then
- printfn "float1 and float2 are equal."
- else
- printfn "float1 and float2 are unequal."
- //
-
-compareUsingEquals ()
-printfn ""
-compareApproximateValues ()
-printfn ""
-compareObjectsUsingEquals ()
-printfn ""
-compareApproximateObjectValues ()
-printfn ""
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/fsharp/epsilon.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/fsharp/epsilon.fs
deleted file mode 100644
index ef10b674b189d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/fsharp/epsilon.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module epsilon
-
-//
-open System
-
-let values = [ 0f; Single.Epsilon; Single.Epsilon * 0.5f ]
-
-for i = 0 to values.Length - 2 do
- for i2 = i + 1 to values.Length - 1 do
- printfn $"{values[i]:r} = {values[i2]:r}: {values[i].Equals(values[i2])}"
- printfn ""
-// The example displays the following output:
-// 0 = 1.401298E-45: False
-// 0 = 0: True
-//
-// 1.401298E-45 = 0: False
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/fsharp/epsilon1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/fsharp/epsilon1.fs
deleted file mode 100644
index 71b536519fc31..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/fsharp/epsilon1.fs
+++ /dev/null
@@ -1,44 +0,0 @@
-module epsilon1
-
-//
-open System
-
-let getComponentParts (value: float32) =
- let result = $"{value:R}: "
- let indent = result.Length
-
- // Convert the single to a 4-byte array.
- let bytes = BitConverter.GetBytes value
- let formattedSingle = BitConverter.ToInt32(bytes, 0)
-
- // Get the sign bit (byte 3, bit 7).
- let result = result + $"""Sign: {if formattedSingle >>> 31 <> 0 then "1 (-)" else "0 (+)"}\n"""
-
- // Get the exponent (byte 2 bit 7 to byte 3, bits 6)
- let exponent = (formattedSingle >>> 23) &&& 0x000000FF
- let adjustment = if exponent <> 0 then 127 else 126
- let result = result + $"{String(' ', indent)}Exponent: 0x{1:X4} ({exponent - adjustment})\n"
-
- // Get the significand (bits 0-22)
- let significand =
- if exponent <> 0 then
- (formattedSingle &&& 0x007FFFFF) ||| 0x800000
- else
- formattedSingle &&& 0x007FFFFF
-
- result + $"{String(' ', indent)}Mantissa: 0x{significand:X13}\n"
-
-
-let values = [ 0f; Single.Epsilon ]
-for value in values do
- printfn $"{getComponentParts value}\n"
-// // The example displays the following output:
-// 0: Sign: 0 (+)
-// Exponent: 0xFFFFFF82 (-126)
-// Mantissa: 0x0000000000000
-//
-//
-// 1.401298E-45: Sign: 0 (+)
-// Exponent: 0xFFFFFF82 (-126)
-// Mantissa: 0x0000000000001
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/SingleEquals_25051.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/SingleEquals_25051.vb
deleted file mode 100644
index 257091aabb50e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/SingleEquals_25051.vb
+++ /dev/null
@@ -1,71 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module modMain
- Public Sub Main()
- CompareUsingEquals()
- Console.WriteLine()
- CompareApproximateValues()
- Console.WriteLine()
- CompareObjectsUsingEquals()
- Console.WriteLine()
- CompareApproximateObjectValues()
- End Sub
-
- Private Sub CompareUsingEquals()
- '
- ' Initialize two singles with apparently identical values
- Dim single1 As Single = .33333
- Dim single2 As Single = 1/3
- ' Compare them for equality
- Console.WriteLine(single1.Equals(single2)) ' displays False
- '
- End Sub
-
- Private Sub CompareApproximateValues()
- '
- ' Initialize two singles with apparently identical values
- Dim single1 As Single = .33333
- Dim single2 As Single = 1/3
- ' Define the tolerance for variation in their values
- Dim difference As Single = Math.Abs(single1 * .0001f)
-
- ' Compare the values
- ' The output to the console indicates that the two values are equal
- If Math.Abs(single1 - single2) <= difference Then
- Console.WriteLine("single1 and single2 are equal.")
- Else
- Console.WriteLine("single1 and single2 are unequal.")
- End If
- '
- End Sub
-
- Private Sub CompareObjectsUsingEquals()
- '
- ' Initialize two singles with apparently identical values
- Dim single1 As Single = .33333
- Dim single2 As Object = 1/3
- ' Compare them for equality
- Console.WriteLine(single1.Equals(single2)) ' displays False
- '
- End Sub
-
- Private Sub CompareApproximateObjectValues()
- '
- ' Initialize two singles with apparently identical values
- Dim single1 As Single = .33333
- Dim single2 As Object = 1/3
- ' Define the tolerance for variation in their values
- Dim difference As Single = Math.Abs(single1 * .0001f)
-
- ' Compare the values
- ' The output to the console indicates that the two values are equal
- If Math.Abs(single1 - CSng(single2)) <= difference Then
- Console.WriteLine("single1 and single2 are equal.")
- Else
- Console.WriteLine("single1 and single2 are unequal.")
- End If
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/epsilon.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/epsilon.vb
deleted file mode 100644
index 09b88e9a91559..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/epsilon.vb
+++ /dev/null
@@ -1,24 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example1
- Public Sub Main()
- Dim values() As Single = {0, Single.Epsilon, Single.Epsilon * 0.5}
-
- For ctr As Integer = 0 To values.Length - 2
- For ctr2 As Integer = ctr + 1 To values.Length - 1
- Console.WriteLine("{0:r} = {1:r}: {2}",
- values(ctr), values(ctr2),
- values(ctr).Equals(values(ctr2)))
- Next
- Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 0 = 1.401298E-45: False
-' 0 = 0: True
-'
-' 1.401298E-45 = 0: False
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/epsilon1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/epsilon1.vb
deleted file mode 100644
index f002bf8ccef31..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Epsilon/vb/epsilon1.vb
+++ /dev/null
@@ -1,54 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example2
- Public Sub Main()
- Dim values() As Single = {0.0, Single.Epsilon}
- For Each value In values
- Console.WriteLine(GetComponentParts(value))
- Console.WriteLine()
- Next
- End Sub
-
- Private Function GetComponentParts(value As Single) As String
- Dim result As String = String.Format("{0:R}: ", value)
- Dim indent As Integer = result.Length
-
- ' Convert the single to an 8-byte array.
- Dim bytes() As Byte = BitConverter.GetBytes(value)
- Dim formattedSingle As Integer = BitConverter.ToInt32(bytes, 0)
-
- ' Get the sign bit (byte 3, bit 7).
- result += String.Format("Sign: {0}{1}",
- If(formattedSingle >> 31 <> 0, "1 (-)", "0 (+)"),
- vbCrLf)
-
- ' Get the exponent (byte 2 bit 7 to byte 3, bits 6)
- Dim exponent As Integer = (formattedSingle >> 23) And &HFF
- Dim adjustment As Integer = If(exponent <> 0, 127, 126)
- result += String.Format("{0}Exponent: 0x{1:X4} ({1}){2}",
- New String(" "c, indent), exponent - adjustment,
- vbCrLf)
-
- ' Get the significand (bits 0-22)
- Dim significand As Long = If(exponent <> 0,
- (formattedSingle And &H7FFFFF) Or &H800000,
- formattedSingle And &H7FFFFF)
- result += String.Format("{0}Mantissa: 0x{1:X13}{2}",
- New String(" "c, indent), significand, vbCrLf)
-
- Return result
- End Function
-End Module
-' The example displays the following output:
-' 0: Sign: 0 (+)
-' Exponent: 0xFFFFFF82 (-126)
-' Mantissa: 0x0000000000000
-'
-'
-' 1.401298E-45: Sign: 0 (+)
-' Exponent: 0xFFFFFF82 (-126)
-' Mantissa: 0x0000000000001
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/csharp/equalsabs1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/csharp/equalsabs1.cs
deleted file mode 100644
index 6aa1d68c28ea4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/csharp/equalsabs1.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-using System;
-
-public class Example
-{
- public static void Main()
- {
- float value1 = .1f * 10f;
- float value2 = 0f;
- for (int ctr = 0; ctr < 10; ctr++)
- value2 += .1f;
-
- Console.WriteLine($"{value1:R} = {value2:R}: {HasMinimalDifference(value1, value2, 1)}");
- }
-
- public static bool HasMinimalDifference(float value1, float value2, int units)
- {
- byte[] bytes = BitConverter.GetBytes(value1);
- int iValue1 = BitConverter.ToInt32(bytes, 0);
-
- bytes = BitConverter.GetBytes(value2);
- int iValue2 = BitConverter.ToInt32(bytes, 0);
-
- // If the signs are different, return false except for +0 and -0.
- if ((iValue1 >> 31) != (iValue2 >> 31))
- {
- if (value1 == value2)
- return true;
-
- return false;
- }
-
- int diff = Math.Abs(iValue1 - iValue2);
-
- if (diff <= units)
- return true;
-
- return false;
- }
-}
-// The example displays the following output:
-// 1 = 1.00000012: True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/fsharp/equalsabs1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/fsharp/equalsabs1.fs
deleted file mode 100644
index be7777d1a441c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/fsharp/equalsabs1.fs
+++ /dev/null
@@ -1,27 +0,0 @@
-module equalsabs1
-
-//
-open System
-
-let hasMinimalDifference (value1: float32) (value2: float32) units =
- let bytes = BitConverter.GetBytes value1
- let iValue1 = BitConverter.ToInt32(bytes, 0)
- let bytes = BitConverter.GetBytes(value2)
- let iValue2 = BitConverter.ToInt32(bytes, 0)
-
- // If the signs are different, return false except for +0 and -0.
- if (iValue1 >>> 31) <> (iValue2 >>> 31) then
- value1 = value2
- else
- let diff = abs (iValue1 - iValue2)
- diff <= units
-
-let value1 = 0.1f * 10f
-let value2 =
- List.replicate 10 0.1f
- |> List.sum
-
-printfn $"{value1:R} = {value2:R}: {hasMinimalDifference value1 value2 1}"
-// The example displays the following output:
-// 1 = 1.0000001: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/vb/equalsabs1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/vb/equalsabs1.vb
deleted file mode 100644
index 7d623e79d3338..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Equals/vb/equalsabs1.vb
+++ /dev/null
@@ -1,44 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- Dim value1 As Single = .1 * 10
- Dim value2 As Single = 0
- For ctr As Integer = 0 To 9
- value2 += CSng(.1)
- Next
-
- Console.WriteLine("{0:R} = {1:R}: {2}", value1, value2,
- HasMinimalDifference(value1, value2, 1))
- End Sub
-
- Public Function HasMinimalDifference(value1 As Single, value2 As Single, units As Integer) As Boolean
- Dim bytes() As Byte = BitConverter.GetBytes(value1)
- Dim iValue1 As Integer = BitConverter.ToInt32(bytes, 0)
-
- bytes = BitConverter.GetBytes(value2)
- Dim iValue2 As Integer = BitConverter.ToInt32(bytes, 0)
-
- ' If the signs are different, Return False except for +0 and -0.
- If ((iValue1 >> 31) <> (iValue2 >> 31)) Then
- If value1 = value2 Then
- Return True
- End If
- Return False
- End If
-
- Dim diff As Integer = Math.Abs(iValue1 - iValue2)
-
- If diff <= units Then
- Return True
- End If
-
- Return False
- End Function
-End Module
-' The example displays the following output:
-' 1 = 1.00000012: True
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/Program.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/Program.cs
deleted file mode 100644
index 0da786ed61aea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/Program.cs
+++ /dev/null
@@ -1 +0,0 @@
-Example10.Main();
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/Project.csproj
deleted file mode 100644
index f99395b4b2b39..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Exe
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison1.cs
deleted file mode 100644
index 965c922e4f90e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison1.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-using System;
-
-public class Example
-{
- public static void Main()
- {
- float value1 = .3333333f;
- float value2 = 1.0f/3;
- Console.WriteLine($"{value1:R} = {value2:R}: {value1.Equals(value2)}");
- }
-}
-// The example displays the following output:
-// 0.3333333 = 0.333333343: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison2.cs
deleted file mode 100644
index 3282246945f96..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison2.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-public class Example1
-{
- public static void Main()
- {
- //
- float value1 = 10.201438f;
- value1 = (float)Math.Sqrt((float)Math.Pow(value1, 2));
- float value2 = (float)Math.Pow((float)value1 * 3.51f, 2);
- value2 = ((float)Math.Sqrt(value2)) / 3.51f;
- Console.WriteLine($"{value1} = {value2}: {value1.Equals(value2)}");
-
- // The example displays the following output on .NET:
- // 10.201438 = 10.201439: False
- // The example displays the following output on .NET Framework:
- // 10.20144 = 10.20144: False
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison3.cs
deleted file mode 100644
index 4f82ff0c2ea5c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison3.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-
-public class Example2
-{
- public static void Main()
- {
- //
- float value1 = .3333333f;
- float value2 = 1.0f / 3;
- int precision = 7;
- value1 = (float)Math.Round(value1, precision);
- value2 = (float)Math.Round(value2, precision);
- Console.WriteLine($"{value1:R} = {value2:R}: {value1.Equals(value2)}");
-
- // The example displays the following output:
- // 0.3333333 = 0.3333333: True
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison4.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison4.cs
deleted file mode 100644
index ded666dc51494..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/comparison4.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System;
-
-public class Example3
-{
- //
- public static void Main()
- {
- float one1 = .1f * 10;
- float one2 = 0f;
- for (int ctr = 1; ctr <= 10; ctr++)
- one2 += .1f;
-
- Console.WriteLine($"{one1:R} = {one2:R}: {one1.Equals(one2)}");
- Console.WriteLine($"{one1:R} is approximately equal to {one2:R}: " +
- $"{IsApproximatelyEqual(one1, one2, .000001f)}");
-
- float negativeOne1 = -1 * one1;
- float negativeOne2 = -1 * one2;
-
- Console.WriteLine($"{negativeOne1:R} = {negativeOne2:R}: {negativeOne1.Equals(negativeOne2)}");
- Console.WriteLine($"{negativeOne1:R} is approximately equal to {negativeOne2:R}: " +
- $"{IsApproximatelyEqual(negativeOne1, negativeOne2, .000001f)}");
- }
-
- static bool IsApproximatelyEqual(float value1, float value2, float epsilon)
- {
- // If they are equal anyway, just return True.
- if (value1.Equals(value2))
- return true;
-
- // Handle NaN, Infinity.
- if (Double.IsInfinity(value1) | Double.IsNaN(value1))
- return value1.Equals(value2);
- else if (Double.IsInfinity(value2) | Double.IsNaN(value2))
- return value1.Equals(value2);
-
- // Handle zero to avoid division by zero.
- double divisor = Math.Max(value1, value2);
- if (divisor.Equals(0))
- divisor = Math.Min(value1, value2);
-
- return Math.Abs((value1 - value2) / divisor) <= epsilon;
- }
-
- // The example displays the following output on .NET:
- // 1 = 1.0000001: False
- // 1 is approximately equal to 1.0000001: True
- // -1 = -1.0000001: False
- // -1 is approximately equal to -1.0000001: True
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/convert1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/convert1.cs
deleted file mode 100644
index 8a5e0e75a9707..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/convert1.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-using System;
-
-public class Example4
-{
- public static void Main()
- {
- dynamic[] values = { Byte.MinValue, Byte.MaxValue, Decimal.MinValue,
- Decimal.MaxValue, Double.MinValue, Double.MaxValue,
- Int16.MinValue, Int16.MaxValue, Int32.MinValue,
- Int32.MaxValue, Int64.MinValue, Int64.MaxValue,
- SByte.MinValue, SByte.MaxValue, UInt16.MinValue,
- UInt16.MaxValue, UInt32.MinValue, UInt32.MaxValue,
- UInt64.MinValue, UInt64.MaxValue };
- float sngValue;
- foreach (var value in values)
- {
- if (value.GetType() == typeof(Decimal) ||
- value.GetType() == typeof(Double))
- sngValue = (float)value;
- else
- sngValue = value;
- Console.WriteLine($"{value} ({value.GetType().Name}) --> {sngValue:R} ({sngValue.GetType().Name})");
- }
- }
-}
-// The example displays the following output:
-// 0 (Byte) --> 0 (Single)
-// 255 (Byte) --> 255 (Single)
-// -79228162514264337593543950335 (Decimal) --> -7.92281625E+28 (Single)
-// 79228162514264337593543950335 (Decimal) --> 7.92281625E+28 (Single)
-// -1.79769313486232E+308 (Double) --> -Infinity (Single)
-// 1.79769313486232E+308 (Double) --> Infinity (Single)
-// -32768 (Int16) --> -32768 (Single)
-// 32767 (Int16) --> 32767 (Single)
-// -2147483648 (Int32) --> -2.14748365E+09 (Single)
-// 2147483647 (Int32) --> 2.14748365E+09 (Single)
-// -9223372036854775808 (Int64) --> -9.223372E+18 (Single)
-// 9223372036854775807 (Int64) --> 9.223372E+18 (Single)
-// -128 (SByte) --> -128 (Single)
-// 127 (SByte) --> 127 (Single)
-// 0 (UInt16) --> 0 (Single)
-// 65535 (UInt16) --> 65535 (Single)
-// 0 (UInt32) --> 0 (Single)
-// 4294967295 (UInt32) --> 4.2949673E+09 (Single)
-// 0 (UInt64) --> 0 (Single)
-// 18446744073709551615 (UInt64) --> 1.84467441E+19 (Single)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/convert2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/convert2.cs
deleted file mode 100644
index d9a17fb336cf5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/convert2.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using System;
-
-public class Example5
-{
- public static void Main()
- {
- //
- float[] values = { Single.MinValue, -67890.1234f, -12345.6789f,
- 12345.6789f, 67890.1234f, Single.MaxValue,
- Single.NaN, Single.PositiveInfinity,
- Single.NegativeInfinity };
- checked
- {
- foreach (var value in values)
- {
- try
- {
- Int64 lValue = (long)value;
- Console.WriteLine($"{value} ({value.GetType().Name}) --> {lValue} (0x{lValue:X16}) ({lValue.GetType().Name})");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"Unable to convert {value} to Int64.");
- }
- try
- {
- UInt64 ulValue = (ulong)value;
- Console.WriteLine($"{value} ({value.GetType().Name}) --> {ulValue} (0x{ulValue:X16}) ({ulValue.GetType().Name})");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"Unable to convert {value} to UInt64.");
- }
- try
- {
- Decimal dValue = (decimal)value;
- Console.WriteLine($"{value} ({value.GetType().Name}) --> {dValue} ({dValue.GetType().Name})");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"Unable to convert {value} to Decimal.");
- }
-
- Double dblValue = value;
- Console.WriteLine($"{value} ({value.GetType().Name}) --> {dblValue} ({dblValue.GetType().Name})");
- Console.WriteLine();
- }
- }
-
- // The example displays the following output for conversions performed
- // in a checked context:
- // Unable to convert -3.402823E+38 to Int64.
- // Unable to convert -3.402823E+38 to UInt64.
- // Unable to convert -3.402823E+38 to Decimal.
- // -3.402823E+38 (Single) --> -3.40282346638529E+38 (Double)
- //
- // -67890.13 (Single) --> -67890 (0xFFFFFFFFFFFEF6CE) (Int64)
- // Unable to convert -67890.13 to UInt64.
- // -67890.13 (Single) --> -67890.12 (Decimal)
- // -67890.13 (Single) --> -67890.125 (Double)
- //
- // -12345.68 (Single) --> -12345 (0xFFFFFFFFFFFFCFC7) (Int64)
- // Unable to convert -12345.68 to UInt64.
- // -12345.68 (Single) --> -12345.68 (Decimal)
- // -12345.68 (Single) --> -12345.6787109375 (Double)
- //
- // 12345.68 (Single) --> 12345 (0x0000000000003039) (Int64)
- // 12345.68 (Single) --> 12345 (0x0000000000003039) (UInt64)
- // 12345.68 (Single) --> 12345.68 (Decimal)
- // 12345.68 (Single) --> 12345.6787109375 (Double)
- //
- // 67890.13 (Single) --> 67890 (0x0000000000010932) (Int64)
- // 67890.13 (Single) --> 67890 (0x0000000000010932) (UInt64)
- // 67890.13 (Single) --> 67890.12 (Decimal)
- // 67890.13 (Single) --> 67890.125 (Double)
- //
- // Unable to convert 3.402823E+38 to Int64.
- // Unable to convert 3.402823E+38 to UInt64.
- // Unable to convert 3.402823E+38 to Decimal.
- // 3.402823E+38 (Single) --> 3.40282346638529E+38 (Double)
- //
- // Unable to convert NaN to Int64.
- // Unable to convert NaN to UInt64.
- // Unable to convert NaN to Decimal.
- // NaN (Single) --> NaN (Double)
- //
- // Unable to convert ∞ to Int64.
- // Unable to convert ∞ to UInt64.
- // Unable to convert ∞ to Decimal.
- // ∞ (Single) --> ∞ (Double)
- //
- // Unable to convert -∞ to Int64.
- // Unable to convert -∞ to UInt64.
- // Unable to convert -∞ to Decimal.
- // -∞ (Single) --> -∞ (Double)
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/exceptional1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/exceptional1.cs
deleted file mode 100644
index 5f914834675b9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/exceptional1.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-
-public class Example6
-{
- public static void Main()
- {
- //
- float value1 = 1.163287e-36f;
- float value2 = 9.164234e-25f;
- float result = value1 * value2;
- Console.WriteLine($"{value1} * {value2} = {result}");
- Console.WriteLine($"{result} = 0: {result.Equals(0.0f)}");
-
- // The example displays the following output:
- // 1.163287E-36 * 9.164234E-25 = 0
- // 0 = 0: True
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/exceptional2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/exceptional2.cs
deleted file mode 100644
index 6c0cf45b151f6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/exceptional2.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-
-public class Example7
-{
- public static void Main()
- {
- //
- float value1 = 3.065e35f;
- float value2 = 6.9375e32f;
- float result = value1 * value2;
- Console.WriteLine($"PositiveInfinity: {Single.IsPositiveInfinity(result)}");
- Console.WriteLine($"NegativeInfinity: {Single.IsNegativeInfinity(result)}");
- Console.WriteLine();
-
- value1 = -value1;
- result = value1 * value2;
- Console.WriteLine($"PositiveInfinity: {Single.IsPositiveInfinity(result)}");
- Console.WriteLine($"NegativeInfinity: {Single.IsNegativeInfinity(result)}");
-
- // The example displays the following output:
- // PositiveInfinity: True
- // NegativeInfinity: False
- //
- // PositiveInfinity: False
- // NegativeInfinity: True
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/precisionlist1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/precisionlist1.cs
deleted file mode 100644
index c42b4fc898f78..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/precisionlist1.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-public class Example9
-{
- public static void Main()
- {
- //
- Double value1 = 1 / 3.0;
- Single sValue2 = 1 / 3.0f;
- Double value2 = (Double)sValue2;
- Console.WriteLine($"{value1:R} = {value2:R}: {value1.Equals(value2)}");
-
- // The example displays the following output on .NET:
- // 0.3333333333333333 = 0.3333333432674408: False
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/precisionlist3.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/precisionlist3.cs
deleted file mode 100644
index d05493e8b9369..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/precisionlist3.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-using System;
-
-public class PrecisionList3Example
-{
- public static void Main()
- {
- Single[] values = { 10.01f, 2.88f, 2.88f, 2.88f, 9.0f };
- Single result = 27.65f;
- Single total = 0f;
- foreach (var value in values)
- total += value;
-
- if (total.Equals(result))
- Console.WriteLine("The sum of the values equals the total.");
- else
- Console.WriteLine($"The sum of the values ({total}) does not equal the total ({result}).");
- }
-}
-
-// The example displays the following output on .NET:
-// The sum of the values (27.650002) does not equal the total (27.65).
-// The example displays the following output on .NET Framework:
-// The sum of the values (27.65) does not equal the total (27.65).
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/precisionlist4a.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/precisionlist4a.cs
deleted file mode 100644
index 299b38273f907..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/precisionlist4a.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.IO;
-
-public class Example10
-{
- public static void Main()
- {
- //
- StreamWriter sw = new(@"./Singles.dat");
- float[] values = { 3.2f / 1.11f, 1.0f / 3f, (float)Math.PI };
- for (int ctr = 0; ctr < values.Length; ctr++)
- {
- sw.Write(values[ctr].ToString());
- if (ctr != values.Length - 1)
- sw.Write("|");
- }
- sw.Close();
-
- float[] restoredValues = new float[values.Length];
- StreamReader sr = new(@"./Singles.dat");
- string temp = sr.ReadToEnd();
- string[] tempStrings = temp.Split('|');
- for (int ctr = 0; ctr < tempStrings.Length; ctr++)
- restoredValues[ctr] = float.Parse(tempStrings[ctr]);
-
- for (int ctr = 0; ctr < values.Length; ctr++)
- Console.WriteLine($"{values[ctr]} {(values[ctr].Equals(restoredValues[ctr]) ? "=" : "<>")} {restoredValues[ctr]}");
-
- // The example displays the following output on .NET Framework:
- // 2.882883 <> 2.882883
- // 0.3333333 <> 0.3333333
- // 3.141593 <> 3.141593
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/representation1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/representation1.cs
deleted file mode 100644
index 6ea38e68a79ca..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/representation1.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-using System;
-
-public class Example12
-{
- public static void Main()
- {
- Single value = .2f;
- Single result1 = value * 10f;
- Single result2 = 0f;
- for (int ctr = 1; ctr <= 10; ctr++)
- result2 += value;
-
- Console.WriteLine($".2 * 10: {result1:R}");
- Console.WriteLine($".2 Added 10 times: {result2:R}");
- }
-}
-// The example displays the following output:
-// .2 * 10: 2
-// .2 Added 10 times: 2.0000002
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/representation2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/representation2.cs
deleted file mode 100644
index a3a072bdb3b77..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/csharp/representation2.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-using System;
-
-public class Example13
-{
- public static void Main()
- {
- Single value = 123.456f;
- Single additional = Single.Epsilon * 1e15f;
- Console.WriteLine($"{value} + {additional} = {value + additional}");
- }
-}
-
-// The example displays the following output:
-// 123.456 + 1.401298E-30 = 123.456
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/Project.fsproj b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/Project.fsproj
deleted file mode 100644
index 55b62720a6340..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/Project.fsproj
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- Library
- net10.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison1.fs
deleted file mode 100644
index bec80ce7f3c7e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison1.fs
+++ /dev/null
@@ -1,9 +0,0 @@
-module comparison1
-
-//
-let value1 = 0.3333333f
-let value2 = 1f / 3f
-printfn $"{value1:R} = {value2:R}: {value1.Equals value2}"
-// The example displays the following output:
-// 0.3333333 = 0.333333343: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison2.fs
deleted file mode 100644
index 451e5a5c46027..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison2.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module comparison2
-
-//
-let value1 =
- 10.201438f ** 2f
- |> sqrt
-
-let value2 =
- ((value1 * 3.51f) ** 2f |> sqrt) / 3.51f
-
-printfn $"{value1} = {value2}: {value1.Equals value2}"
-
-// The example displays the following output on .NET:
-// 10.201438 = 10.201439: False
-// The example displays the following output on .NET Framework:
-// 10.20144 = 10.20144: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison3.fs
deleted file mode 100644
index b1d8e90674e01..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison3.fs
+++ /dev/null
@@ -1,14 +0,0 @@
-module comparison3
-
-//
-open System
-
-let value1 = 0.3333333f
-let value2 = 1f / 3f
-let precision = 7
-let value1r = Math.Round(float value1, precision) |> float32
-let value2r = Math.Round(float value2, precision) |> float32
-printfn $"{value1:R} = {value2:R}: {value1.Equals value2}"
-// The example displays the following output:
-// 0.3333333 = 0.3333333: True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison4.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison4.fs
deleted file mode 100644
index c64ce04e3dfe7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/comparison4.fs
+++ /dev/null
@@ -1,35 +0,0 @@
-module comparison4
-
-//
-open System
-
-let isApproximatelyEqual value1 value2 epsilon =
- // If they are equal anyway, just return True.
- if value1.Equals value2 then
- true
- // Handle NaN, Infinity.
- elif Single.IsInfinity value1 || Single.IsNaN value1 then
- value1.Equals value2
- elif Single.IsInfinity value2 || Single.IsNaN value2 then
- value1.Equals value2
- else
- // Handle zero to avoid division by zero
- let divisor = max value1 value2
- let divisor =
- if divisor.Equals 0 then
- min value1 value2
- else divisor
- abs (value1 - value2) / divisor <= epsilon
-
-
-let one1 = 0.1f * 10f
-let mutable one2 = 0f
-for _ = 1 to 10 do
- one2 <- one2 + 0.1f
-
-printfn $"{one1:R} = {one2:R}: {one1.Equals one2}"
-printfn $"{one1:R} is approximately equal to {one2:R}: {isApproximatelyEqual one1 one2 0.000001f}"
-// The example displays the following output:
-// 1 = 1.0000001: False
-// 1 is approximately equal to 1.0000001: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/convert1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/convert1.fs
deleted file mode 100644
index 922ccf416b3f0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/convert1.fs
+++ /dev/null
@@ -1,51 +0,0 @@
-module convert1
-
-//
-open System
-
-let values: obj list =
- [ Byte.MinValue; Byte.MaxValue; Decimal.MinValue
- Decimal.MaxValue; Double.MinValue; Double.MaxValue
- Int16.MinValue; Int16.MaxValue; Int32.MinValue
- Int32.MaxValue; Int64.MinValue; Int64.MaxValue
- SByte.MinValue; SByte.MaxValue; UInt16.MinValue
- UInt16.MaxValue; UInt32.MinValue; UInt32.MaxValue
- UInt64.MinValue; UInt64.MaxValue ]
-
-for value in values do
- let sngValue =
- match value with
- | :? byte as v -> float32 v
- | :? decimal as v -> float32 v
- | :? double as v -> float32 v
- | :? int16 as v -> float32 v
- | :? int as v -> float32 v
- | :? int64 as v -> float32 v
- | :? int8 as v -> float32 v
- | :? uint16 as v -> float32 v
- | :? uint as v -> float32 v
- | :? uint64 as v -> float32 v
- | _ -> raise (NotImplementedException "Unknown Type")
- printfn $"{value} ({value.GetType().Name}) --> {sngValue:R} ({sngValue.GetType().Name})"
-// The example displays the following output:
-// 0 (Byte) --> 0 (Single)
-// 255 (Byte) --> 255 (Single)
-// -79228162514264337593543950335 (Decimal) --> -7.92281625E+28 (Single)
-// 79228162514264337593543950335 (Decimal) --> 7.92281625E+28 (Single)
-// -1.79769313486232E+308 (Double) --> -Infinity (Single)
-// 1.79769313486232E+308 (Double) --> Infinity (Single)
-// -32768 (Int16) --> -32768 (Single)
-// 32767 (Int16) --> 32767 (Single)
-// -2147483648 (Int32) --> -2.14748365E+09 (Single)
-// 2147483647 (Int32) --> 2.14748365E+09 (Single)
-// -9223372036854775808 (Int64) --> -9.223372E+18 (Single)
-// 9223372036854775807 (Int64) --> 9.223372E+18 (Single)
-// -128 (SByte) --> -128 (Single)
-// 127 (SByte) --> 127 (Single)
-// 0 (UInt16) --> 0 (Single)
-// 65535 (UInt16) --> 65535 (Single)
-// 0 (UInt32) --> 0 (Single)
-// 4294967295 (UInt32) --> 4.2949673E+09 (Single)
-// 0 (UInt64) --> 0 (Single)
-// 18446744073709551615 (UInt64) --> 1.84467441E+19 (Single)
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/convert2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/convert2.fs
deleted file mode 100644
index 0556232e8922c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/convert2.fs
+++ /dev/null
@@ -1,79 +0,0 @@
-module convert2
-
-//
-open System
-open Checked
-
-let values =
- [ Single.MinValue; -67890.1234f; -12345.6789f
- 12345.6789f; 67890.1234f; Single.MaxValue
- Single.NaN; Single.PositiveInfinity
- Single.NegativeInfinity ]
-
-for value in values do
- try
- let lValue = int64 value
- printfn $"{value} ({value.GetType().Name}) --> {lValue} (0x{lValue:X16}) ({lValue.GetType().Name})"
- with :? OverflowException ->
- printfn $"Unable to convert {value} to Int64."
- try
- let ulValue = uint64 value
- printfn $"{value} ({value.GetType().Name}) --> {ulValue} (0x{ulValue:X16}) ({ulValue.GetType().Name})"
- with :? OverflowException ->
- printfn $"Unable to convert {value} to UInt64."
- try
- let dValue = decimal value
- printfn $"{value} ({value.GetType().Name}) --> {dValue} ({dValue.GetType().Name})"
- with :? OverflowException ->
- printfn $"Unable to convert {value} to Decimal."
-
- let dblValue = double value
- printfn $"{value} ({value.GetType().Name}) --> {dblValue} ({dblValue.GetType().Name})\n"
-
-// The example displays the following output for conversions performed
-// in a checked context:
-// Unable to convert -3.402823E+38 to Int64.
-// Unable to convert -3.402823E+38 to UInt64.
-// Unable to convert -3.402823E+38 to Decimal.
-// -3.402823E+38 (Single) --> -3.40282346638529E+38 (Double)
-//
-// -67890.13 (Single) --> -67890 (0xFFFFFFFFFFFEF6CE) (Int64)
-// Unable to convert -67890.13 to UInt64.
-// -67890.13 (Single) --> -67890.12 (Decimal)
-// -67890.13 (Single) --> -67890.125 (Double)
-//
-// -12345.68 (Single) --> -12345 (0xFFFFFFFFFFFFCFC7) (Int64)
-// Unable to convert -12345.68 to UInt64.
-// -12345.68 (Single) --> -12345.68 (Decimal)
-// -12345.68 (Single) --> -12345.6787109375 (Double)
-//
-// 12345.68 (Single) --> 12345 (0x0000000000003039) (Int64)
-// 12345.68 (Single) --> 12345 (0x0000000000003039) (UInt64)
-// 12345.68 (Single) --> 12345.68 (Decimal)
-// 12345.68 (Single) --> 12345.6787109375 (Double)
-//
-// 67890.13 (Single) --> 67890 (0x0000000000010932) (Int64)
-// 67890.13 (Single) --> 67890 (0x0000000000010932) (UInt64)
-// 67890.13 (Single) --> 67890.12 (Decimal)
-// 67890.13 (Single) --> 67890.125 (Double)
-//
-// Unable to convert 3.402823E+38 to Int64.
-// Unable to convert 3.402823E+38 to UInt64.
-// Unable to convert 3.402823E+38 to Decimal.
-// 3.402823E+38 (Single) --> 3.40282346638529E+38 (Double)
-//
-// Unable to convert NaN to Int64.
-// Unable to convert NaN to UInt64.
-// Unable to convert NaN to Decimal.
-// NaN (Single) --> NaN (Double)
-//
-// Unable to convert ∞ to Int64.
-// Unable to convert ∞ to UInt64.
-// Unable to convert ∞ to Decimal.
-// ∞ (Single) --> ∞ (Double)
-//
-// Unable to convert -∞ to Int64.
-// Unable to convert -∞ to UInt64.
-// Unable to convert -∞ to Decimal.
-// -∞ (Single) --> -∞ (Double)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/exceptional1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/exceptional1.fs
deleted file mode 100644
index 489213da8470f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/exceptional1.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module exceptional1
-
-//
-let value1 = 1.163287e-36f
-let value2 = 9.164234e-25f
-let result = value1 * value2
-printfn $"{value1} * {value2} = {result}"
-printfn $"{result} = 0: {result.Equals(0f)}"
-
-// The example displays the following output:
-// 1.163287E-36 * 9.164234E-25 = 0
-// 0 = 0: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/exceptional2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/exceptional2.fs
deleted file mode 100644
index 58a2e94f3c65f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/exceptional2.fs
+++ /dev/null
@@ -1,23 +0,0 @@
-module exceptional2
-
-//
-open System
-
-let value1 = 3.065e35f
-let value2 = 6.9375e32f
-let result = value1 * value2
-printfn $"PositiveInfinity: {Single.IsPositiveInfinity result}"
-printfn $"NegativeInfinity: {Single.IsNegativeInfinity result}\n"
-
-let value3 = -value1
-let result2 = value3 * value2
-printfn $"PositiveInfinity: {Single.IsPositiveInfinity result}"
-printfn $"NegativeInfinity: {Single.IsNegativeInfinity result}"
-
-// The example displays the following output:
-// PositiveInfinity: True
-// NegativeInfinity: False
-//
-// PositiveInfinity: False
-// NegativeInfinity: True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/precisionlist1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/precisionlist1.fs
deleted file mode 100644
index 1ebcff2eae33d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/precisionlist1.fs
+++ /dev/null
@@ -1,11 +0,0 @@
-module percisionlist1
-
-//
-let value1 = 1. / 3.
-let sValue2 = 1f / 3f
-let value2 = double sValue2
-printfn $"{value1:R} = {value2:R}: {value1.Equals value2}"
-
-// The example displays the following output on .NET:
-// 0.3333333333333333 = 0.3333333432674408: False
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/precisionlist3.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/precisionlist3.fs
deleted file mode 100644
index 5d888f85833cf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/precisionlist3.fs
+++ /dev/null
@@ -1,19 +0,0 @@
-module precisionlist3
-
-//
-let values = [| 10.01f; 2.88f; 2.88f; 2.88f; 9f |]
-let result = 27.65f
-let mutable total = 0f
-for value in values do
- total <- total + value
-
-if total.Equals result then
- printfn "The sum of the values equals the total."
-else
- printfn $"The sum of the values ({total}) does not equal the total ({result})."
-
-// The example displays the following output on .NET:
-// The sum of the values (27.650002) does not equal the total (27.65).
-// The example displays the following output on .NET Framework:
-// The sum of the values (27.65) does not equal the total (27.65).
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/precisionlist4a.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/precisionlist4a.fs
deleted file mode 100644
index c45aeff493576..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/precisionlist4a.fs
+++ /dev/null
@@ -1,28 +0,0 @@
-module precisionlist4a
-
-//
-open System
-open System.IO
-
-let values = [| 3.2f / 1.11f; 1f / 3f; MathF.PI |]
-
-do
- use sw = new StreamWriter(@".\Singles.dat")
- for i = 0 to values.Length - 1 do
- sw.Write(string values[i])
- if i <> values.Length - 1 then
- sw.Write "|"
-
-let restoredValues =
- use sr = new StreamReader(@".\Singles.dat")
- sr.ReadToEnd().Split '|'
- |> Array.map Single.Parse
-
-for i = 0 to values.Length - 1 do
- printfn $"""{values[i]} {if values[i].Equals restoredValues[i] then "=" else "<>"} {restoredValues[i]}"""
-
-// The example displays the following output on .NET Framework:
-// 2.882883 <> 2.882883
-// 0.3333333 <> 0.3333333
-// 3.141593 <> 3.141593
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/representation1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/representation1.fs
deleted file mode 100644
index e29c56539bc9b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/representation1.fs
+++ /dev/null
@@ -1,16 +0,0 @@
-module representation1
-
-//
-let value = 0.2f
-let result1 = value * 10f
-let mutable result2 = 0f
-for _ = 1 to 10 do
- result2 <- result2 + value
-
-printfn $".2 * 10: {result1:R}"
-printfn $".2 Added 10 times: {result2:R}"
-
-// The example displays the following output:
-// .2 * 10: 2
-// .2 Added 10 times: 2.0000002
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/representation2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/representation2.fs
deleted file mode 100644
index 88a527637abea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/fsharp/representation2.fs
+++ /dev/null
@@ -1,11 +0,0 @@
-module representation2
-
-//
-open System
-
-let value = 123.456f
-let additional = Single.Epsilon * 1e15f
-printfn $"{value} + {additional} = {value + additional}"
-// The example displays the following output:
-// 123.456 + 1.401298E-30 = 123.456
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/PrecisionList4a.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/PrecisionList4a.vb
deleted file mode 100644
index 7e9692ec3f73c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/PrecisionList4a.vb
+++ /dev/null
@@ -1,37 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.IO
-
-Module Example11
- Public Sub Main()
- '
- Dim sw As New StreamWriter(".\Singles.dat")
- Dim values() As Single = {3.2 / 1.11, 1.0 / 3, CSng(Math.PI)}
- For ctr As Integer = 0 To values.Length - 1
- sw.Write(values(ctr).ToString())
- If ctr <> values.Length - 1 Then sw.Write("|")
- Next
- sw.Close()
-
- Dim restoredValues(values.Length - 1) As Single
- Dim sr As New StreamReader(".\Singles.dat")
- Dim temp As String = sr.ReadToEnd()
- Dim tempStrings() As String = temp.Split("|"c)
- For ctr As Integer = 0 To tempStrings.Length - 1
- restoredValues(ctr) = Single.Parse(tempStrings(ctr))
- Next
-
- For ctr As Integer = 0 To values.Length - 1
- Console.WriteLine("{0} {2} {1}", values(ctr),
- restoredValues(ctr),
- If(values(ctr).Equals(restoredValues(ctr)), "=", "<>"))
- Next
-
- ' The example displays the following output on .NET Framework:
- ' 2.882883 <> 2.882883
- ' 0.3333333 <> 0.3333333
- ' 3.141593 <> 3.141593
- '
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/PrecisionList5a.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/PrecisionList5a.vb
deleted file mode 100644
index 8c84f9c680a98..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/PrecisionList5a.vb
+++ /dev/null
@@ -1,36 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-
-Module Example12
- Public Sub Main()
- Dim sw As New StreamWriter(".\Singles.dat")
- Dim values() As Single = {3.2 / 1.11, 1.0 / 3, CSng(Math.PI)}
- For ctr As Integer = 0 To values.Length - 1
- sw.Write("{0:G9}{1}", values(ctr),
- If(ctr < values.Length - 1, "|", ""))
- Next
- sw.Close()
-
- Dim restoredValues(values.Length - 1) As Single
- Dim sr As New StreamReader(".\Singles.dat")
- Dim temp As String = sr.ReadToEnd()
- Dim tempStrings() As String = temp.Split("|"c)
- For ctr As Integer = 0 To tempStrings.Length - 1
- restoredValues(ctr) = Single.Parse(tempStrings(ctr))
- Next
-
- For ctr As Integer = 0 To values.Length - 1
- Console.WriteLine("{0} {2} {1}", values(ctr),
- restoredValues(ctr),
- If(values(ctr).Equals(restoredValues(ctr)), "=", "<>"))
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 2.882883 = 2.882883
-' 0.3333333 = 0.3333333
-' 3.141593 = 3.141593
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison1.vb
deleted file mode 100644
index dca470b4395b0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison1.vb
+++ /dev/null
@@ -1,15 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example1
- Public Sub Main()
- Dim value1 As Single = 0.3333333
- Dim value2 As Single = 1 / 3
- Console.WriteLine("{0:R} = {1:R}: {2}", value1, value2, value1.Equals(value2))
- End Sub
-End Module
-' The example displays the following output:
-' 0.3333333 = 0.333333343: False
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison2.vb
deleted file mode 100644
index d56467bdaa7b9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison2.vb
+++ /dev/null
@@ -1,20 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example2
- Public Sub Main()
- '
- Dim value1 As Single = 10.201438
- value1 = CSng(Math.Sqrt(CSng(Math.Pow(value1, 2))))
- Dim value2 As Single = CSng(Math.Pow(value1 * CSng(3.51), 2))
- value2 = CSng(Math.Sqrt(value2) / CSng(3.51))
- Console.WriteLine("{0} = {1}: {2}",
- value1, value2, value1.Equals(value2))
-
- ' The example displays the following output on .NET:
- ' 10.201438 = 10.201439: False
- ' The example displays the following output on .NET Framework:
- ' 10.20144 = 10.20144: False
- '
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison3.vb
deleted file mode 100644
index db9d08a7e8b9b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison3.vb
+++ /dev/null
@@ -1,18 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example3
- Public Sub Main()
- Dim value1 As Single = 0.3333333
- Dim value2 As Single = 1 / 3
- Dim precision As Integer = 7
- value1 = CSng(Math.Round(value1, precision))
- value2 = CSng(Math.Round(value2, precision))
- Console.WriteLine("{0:R} = {1:R}: {2}", value1, value2, value1.Equals(value2))
- End Sub
-End Module
-' The example displays the following output:
-' 0.3333333 = 0.3333333: True
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison4.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison4.vb
deleted file mode 100644
index f05888920eaf5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/comparison4.vb
+++ /dev/null
@@ -1,43 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example4
- '
- Public Sub Main()
- Dim one1 As Single = 0.1 * 10
- Dim one2 As Single = 0
- For ctr As Integer = 1 To 10
- one2 += CSng(0.1)
- Next
- Console.WriteLine("{0:R} = {1:R}: {2}", one1, one2, one1.Equals(one2))
- Console.WriteLine("{0:R} is approximately equal to {1:R}: {2}",
- one1, one2,
- IsApproximatelyEqual(one1, one2, 0.000001))
- End Sub
-
- Function IsApproximatelyEqual(value1 As Single, value2 As Single,
- epsilon As Single) As Boolean
- ' If they are equal anyway, just return True.
- If value1.Equals(value2) Then Return True
-
- ' Handle NaN, Infinity.
- If Single.IsInfinity(value1) Or Single.IsNaN(value1) Then
- Return value1.Equals(value2)
- ElseIf Single.IsInfinity(value2) Or Single.IsNaN(value2) Then
- Return value1.Equals(value2)
- End If
-
- ' Handle zero to avoid division by zero.
- Dim divisor As Single = Math.Max(value1, value2)
- If divisor.Equals(0) Then
- divisor = Math.Min(value1, value2)
- End If
-
- Return Math.Abs(value1 - value2) / divisor <= epsilon
- End Function
-
- ' The example displays the following output:
- ' 1 = 1.0000001: False
- ' 1 is approximately equal to 1.0000001: True
- '
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/convert1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/convert1.vb
deleted file mode 100644
index 9b4c7fffb53ea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/convert1.vb
+++ /dev/null
@@ -1,49 +0,0 @@
-' Visual Basic .NET Document
-'Option Strict On
-
-'
-Module Example5
- Public Sub Main()
- Dim values() As Object = {Byte.MinValue, Byte.MaxValue, Decimal.MinValue,
- Decimal.MaxValue, Double.MinValue, Double.MaxValue,
- Int16.MinValue, Int16.MaxValue, Int32.MinValue,
- Int32.MaxValue, Int64.MinValue, Int64.MaxValue,
- SByte.MinValue, SByte.MaxValue, UInt16.MinValue,
- UInt16.MaxValue, UInt32.MinValue, UInt32.MaxValue,
- UInt64.MinValue, UInt64.MaxValue}
- Dim sngValue As Single
- For Each value In values
- If value.GetType() = GetType(Double) Then
- sngValue = CSng(value)
- Else
- sngValue = value
- End If
- Console.WriteLine("{0} ({1}) --> {2:R} ({3})",
- value, value.GetType().Name,
- sngValue, sngValue.GetType().Name)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' 0 (Byte) --> 0 (Single)
-' 255 (Byte) --> 255 (Single)
-' -79228162514264337593543950335 (Decimal) --> -7.92281625E+28 (Single)
-' 79228162514264337593543950335 (Decimal) --> 7.92281625E+28 (Single)
-' -1.79769313486232E+308 (Double) --> -Infinity (Single)
-' 1.79769313486232E+308 (Double) --> Infinity (Single)
-' -32768 (Int16) --> -32768 (Single)
-' 32767 (Int16) --> 32767 (Single)
-' -2147483648 (Int32) --> -2.14748365E+09 (Single)
-' 2147483647 (Int32) --> 2.14748365E+09 (Single)
-' -9223372036854775808 (Int64) --> -9.223372E+18 (Single)
-' 9223372036854775807 (Int64) --> 9.223372E+18 (Single)
-' -128 (SByte) --> -128 (Single)
-' 127 (SByte) --> 127 (Single)
-' 0 (UInt16) --> 0 (Single)
-' 65535 (UInt16) --> 65535 (Single)
-' 0 (UInt32) --> 0 (Single)
-' 4294967295 (UInt32) --> 4.2949673E+09 (Single)
-' 0 (UInt64) --> 0 (Single)
-' 18446744073709551615 (UInt64) --> 1.84467441E+19 (Single)
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/convert2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/convert2.vb
deleted file mode 100644
index c2192caf9cd16..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/convert2.vb
+++ /dev/null
@@ -1,92 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example6
- Public Sub Main()
- Dim values() As Single = {Single.MinValue, -67890.1234, -12345.6789,
- 12345.6789, 67890.1234, Single.MaxValue,
- Single.NaN, Single.PositiveInfinity,
- Single.NegativeInfinity}
- For Each value In values
- Try
- Dim lValue As Long = CLng(value)
- Console.WriteLine("{0} ({1}) --> {2} (0x{2:X16}) ({3})",
- value, value.GetType().Name,
- lValue, lValue.GetType().Name)
- Catch e As OverflowException
- Console.WriteLine("Unable to convert {0} to Int64.", value)
- End Try
- Try
- Dim ulValue As UInt64 = CULng(value)
- Console.WriteLine("{0} ({1}) --> {2} (0x{2:X16}) ({3})",
- value, value.GetType().Name,
- ulValue, ulValue.GetType().Name)
- Catch e As OverflowException
- Console.WriteLine("Unable to convert {0} to UInt64.", value)
- End Try
- Try
- Dim dValue As Decimal = CDec(value)
- Console.WriteLine("{0} ({1}) --> {2} ({3})",
- value, value.GetType().Name,
- dValue, dValue.GetType().Name)
- Catch e As OverflowException
- Console.WriteLine("Unable to convert {0} to Decimal.", value)
- End Try
-
- Dim dblValue As Double = value
- Console.WriteLine("{0} ({1}) --> {2} ({3})",
- value, value.GetType().Name,
- dblValue, dblValue.GetType().Name)
- Console.WriteLine()
- Next
- End Sub
-End Module
-
-' The example displays the following output for conversions performed
-' in a checked context:
-' Unable to convert -3.402823E+38 to Int64.
-' Unable to convert -3.402823E+38 to UInt64.
-' Unable to convert -3.402823E+38 to Decimal.
-' -3.402823E+38 (Single) --> -3.40282346638529E+38 (Double)
-'
-' -67890.13 (Single) --> -67890 (0xFFFFFFFFFFFEF6CE) (Int64)
-' Unable to convert -67890.13 to UInt64.
-' -67890.13 (Single) --> -67890.12 (Decimal)
-' -67890.13 (Single) --> -67890.125 (Double)
-'
-' -12345.68 (Single) --> -12346 (0xFFFFFFFFFFFFCFC6) (Int64)
-' Unable to convert -12345.68 to UInt64.
-' -12345.68 (Single) --> -12345.68 (Decimal)
-' -12345.68 (Single) --> -12345.6787109375 (Double)
-'
-' 12345.68 (Single) --> 12346 (0x000000000000303A) (Int64)
-' 12345.68 (Single) --> 12346 (0x000000000000303A) (UInt64)
-' 12345.68 (Single) --> 12345.68 (Decimal)
-' 12345.68 (Single) --> 12345.6787109375 (Double)
-'
-' 67890.13 (Single) --> 67890 (0x0000000000010932) (Int64)
-' 67890.13 (Single) --> 67890 (0x0000000000010932) (UInt64)
-' 67890.13 (Single) --> 67890.12 (Decimal)
-' 67890.13 (Single) --> 67890.125 (Double)
-'
-' Unable to convert 3.402823E+38 to Int64.
-' Unable to convert 3.402823E+38 to UInt64.
-' Unable to convert 3.402823E+38 to Decimal.
-' 3.402823E+38 (Single) --> 3.40282346638529E+38 (Double)
-'
-' Unable to convert NaN to Int64.
-' Unable to convert NaN to UInt64.
-' Unable to convert NaN to Decimal.
-' NaN (Single) --> NaN (Double)
-'
-' Unable to convert ∞ to Int64.
-' Unable to convert ∞ to UInt64.
-' Unable to convert ∞ to Decimal.
-' ∞ (Single) --> ∞ (Double)
-'
-' Unable to convert -∞ to Int64.
-' Unable to convert -∞ to UInt64.
-' Unable to convert -∞ to Decimal.
-' -∞ (Single) --> -∞ (Double)
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/exceptional1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/exceptional1.vb
deleted file mode 100644
index 330616d78ba06..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/exceptional1.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example7
- Public Sub Main()
- Dim value1 As Single = 1.163287E-36
- Dim value2 As Single = 9.164234E-25
- Dim result As Single = value1 * value2
- Console.WriteLine("{0} * {1} = {2:R}", value1, value2, result)
- Console.WriteLine("{0} = 0: {1}", result, result.Equals(0))
- End Sub
-End Module
-' The example displays the following output:
-' 1.163287E-36 * 9.164234E-25 = 0
-' 0 = 0: True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/exceptional2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/exceptional2.vb
deleted file mode 100644
index 1ef9a90b7bb39..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/exceptional2.vb
+++ /dev/null
@@ -1,29 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example8
- Public Sub Main()
- Dim value1 As Single = 3.065E+35
- Dim value2 As Single = 6.9375E+32
- Dim result As Single = value1 * value2
- Console.WriteLine("PositiveInfinity: {0}",
- Single.IsPositiveInfinity(result))
- Console.WriteLine("NegativeInfinity: {0}",
- Single.IsNegativeInfinity(result))
- Console.WriteLine()
- value1 = -value1
- result = value1 * value2
- Console.WriteLine("PositiveInfinity: {0}",
- Single.IsPositiveInfinity(result))
- Console.WriteLine("NegativeInfinity: {0}",
- Single.IsNegativeInfinity(result))
- End Sub
-End Module
-' The example displays the following output:
-' PositiveInfinity: True
-' NegativeInfinity: False
-'
-' PositiveInfinity: False
-' NegativeInfinity: True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/precisionlist1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/precisionlist1.vb
deleted file mode 100644
index a581242965627..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/precisionlist1.vb
+++ /dev/null
@@ -1,13 +0,0 @@
-Module Example10
- Public Sub Main()
- '
- Dim value1 As Double = 1 / 3
- Dim sValue2 As Single = 1 / 3
- Dim value2 As Double = CDbl(sValue2)
- Console.WriteLine("{0} = {1}: {2}", value1, value2, value1.Equals(value2))
-
- ' The example displays the following output:
- ' 0.3333333333333333 = 0.3333333432674408: False
- '
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/precisionlist3.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/precisionlist3.vb
deleted file mode 100644
index c859ea1c29a2f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/precisionlist3.vb
+++ /dev/null
@@ -1,25 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module PrecisionList3
- Public Sub Main()
- '
- Dim values() As Single = {10.01, 2.88, 2.88, 2.88, 9.0}
- Dim result As Single = 27.65
- Dim total As Single
- For Each value In values
- total += value
- Next
- If total.Equals(result) Then
- Console.WriteLine("The sum of the values equals the total.")
- Else
- Console.WriteLine($"The sum of the values ({total}) does not equal the total ({result}).")
- End If
- End Sub
-
- ' The example displays the following output on .NET:
- ' The sum of the values (27.650002) does not equal the total (27.65).
- ' The example displays the following output on .NET Framework:
- ' The sum of the values (27.65) does not equal the total (27.65).
- '
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/representation1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/representation1.vb
deleted file mode 100644
index fe77569fa9a02..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/representation1.vb
+++ /dev/null
@@ -1,22 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example13
- Public Sub Main()
- Dim value As Single = 0.2
- Dim result1 As Single = value * 10
- Dim result2 As Single
- For ctr As Integer = 1 To 10
- result2 += value
- Next
- Console.WriteLine(".2 * 10: {0:R}", result1)
- Console.WriteLine(".2 Added 10 times: {0:R}", result2)
- End Sub
-End Module
-
-' The example displays the following output:
-' .2 * 10: 2
-' .2 Added 10 times: 2.0000002
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/representation2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/representation2.vb
deleted file mode 100644
index 3b44c2f25c65f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Single/Overview/vb/representation2.vb
+++ /dev/null
@@ -1,15 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- Dim value As Single = 123.456
- Dim additional As Single = Single.Epsilon * 1e15
- Console.WriteLine($"{value} + {additional} = {value + additional}")
- End Sub
-End Module
-' The example displays the following output:
-' 123.456 + 1.401298E-30 = 123.456
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/csharp/Program2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/csharp/Program2.cs
deleted file mode 100644
index f1aa05d9b584c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/csharp/Program2.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-class Program2
-{
- static void Run()
- {
- string contentLength = "Content-Length: 132";
- int length = GetContentLength(contentLength.ToCharArray());
- Console.WriteLine($"Content length: {length}");
- }
-
- private static int GetContentLength(ReadOnlySpan span)
- {
- ReadOnlySpan slice = span.Slice(16);
- return int.Parse(slice);
- }
-}
-
-// Output:
-// Content length: 132
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/csharp/Project.csproj
deleted file mode 100644
index fa04d802aa24b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Exe
- net10.0
- true
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/csharp/program.cs b/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/csharp/program.cs
deleted file mode 100644
index cd09f784a6788..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/csharp/program.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-using static ProgramB;
-
-class Program
-{
- static void Main()
- {
- CreateSpanFromArray();
- Console.WriteLine("-----");
- CreateSpanFromNativeMemory();
- Console.WriteLine("-----");
- CreateSpanFromStack();
- WorkWithSpans();
- Console.WriteLine("-----");
- ProgramB.WorkWithSpans();
- }
-
- private static void CreateSpanFromArray()
- {
- //
- // Create a span over an array.
- byte[] array = new byte[100];
- Span arraySpan = new(array);
-
- byte data = 0;
- for (int ctr = 0; ctr < arraySpan.Length; ctr++)
- arraySpan[ctr] = data++;
-
- int arraySum = 0;
- foreach (byte value in array)
- arraySum += value;
-
- Console.WriteLine($"The sum is {arraySum}");
-
- // Output: The sum is 4950
- //
- }
-
- private static void CreateSpanFromNativeMemory()
- {
- //
- // Create a span from native memory.
- nint native = Marshal.AllocHGlobal(100);
- Span nativeSpan;
- unsafe
- {
- nativeSpan = new Span(native.ToPointer(), 100);
- }
- byte data = 0;
- for (int ctr = 0; ctr < nativeSpan.Length; ctr++)
- nativeSpan[ctr] = data++;
-
- int nativeSum = 0;
- foreach (byte value in nativeSpan)
- nativeSum += value;
-
- Console.WriteLine($"The sum is {nativeSum}");
- Marshal.FreeHGlobal(native);
-
- // Output: The sum is 4950
- //
- }
-
- private static void CreateSpanFromStack()
- {
- //
- // Create a span on the stack.
- byte data = 0;
- Span stackSpan = stackalloc byte[100];
- for (int ctr = 0; ctr < stackSpan.Length; ctr++)
- stackSpan[ctr] = data++;
-
- int stackSum = 0;
- foreach (byte value in stackSpan)
- stackSum += value;
-
- Console.WriteLine($"The sum is {stackSum}");
-
- // Output: The sum is 4950
- //
- }
-}
-
-public class ProgramB
-{
- //
- public static void WorkWithSpans()
- {
- // Create a span over an array.
- byte[] array = new byte[100];
- Span arraySpan = new(array);
-
- InitializeSpan(arraySpan);
- Console.WriteLine($"The sum is {ComputeSum(arraySpan):N0}");
-
- // Create an array from native memory.
- var native = Marshal.AllocHGlobal(100);
- Span nativeSpan;
- unsafe
- {
- nativeSpan = new Span(native.ToPointer(), 100);
- }
-
- InitializeSpan(nativeSpan);
- Console.WriteLine($"The sum is {ComputeSum(nativeSpan):N0}");
-
- Marshal.FreeHGlobal(native);
-
- // Create a span on the stack.
- Span stackSpan = stackalloc byte[100];
-
- InitializeSpan(stackSpan);
- Console.WriteLine($"The sum is {ComputeSum(stackSpan):N0}");
- }
-
- public static void InitializeSpan(Span span)
- {
- byte value = 0;
- for (int ctr = 0; ctr < span.Length; ctr++)
- span[ctr] = value++;
- }
-
- public static int ComputeSum(ReadOnlySpan span)
- {
- int sum = 0;
- foreach (byte value in span)
- sum += value;
-
- return sum;
- }
-
- // The example displays the following output:
- // The sum is 4,950
- // The sum is 4,950
- // The sum is 4,950
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/fsharp/program.fs b/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/fsharp/program.fs
deleted file mode 100644
index 020d59e42e026..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Span/Overview/fsharp/program.fs
+++ /dev/null
@@ -1,121 +0,0 @@
-open System
-open System.Runtime.InteropServices
-
-let createSpanFromArray () =
- //
- // Create a span over an array.
- let array = Array.zeroCreate 100
- let arraySpan = Span array
-
- let mutable data = 0uy
- for i = 0 to arraySpan.Length - 1 do
- arraySpan[i] <- data
- data <- data + 1uy
-
- let mutable arraySum = 0
- for value in array do
- arraySum <- arraySum + int value
-
- printfn $"The sum is {arraySum}"
- // Output: The sum is 4950
- //
-
-let createSpanFromNativeMemory () =
- //
- // Create a span from native memory.
- let native = Marshal.AllocHGlobal 100
- let nativeSpan = Span(native.ToPointer(), 100)
-
- let mutable data = 0uy
- for i = 0 to nativeSpan.Length - 1 do
- nativeSpan[i] <- data
- data <- data + 1uy
-
- let mutable nativeSum = 0
- for value in nativeSpan do
- nativeSum <- nativeSum + int value
-
- printfn $"The sum is {nativeSum}"
- Marshal.FreeHGlobal native
- // Output: The sum is 4950
- //
-
-let createSpanFromStack () =
- //
- // Create a span on the stack.
- let mutable data = 0uy
- let stackSpan =
- let p = NativeInterop.NativePtr.stackalloc 100 |> NativeInterop.NativePtr.toVoidPtr
- Span(p, 100)
-
- for i = 0 to stackSpan.Length - 1 do
- stackSpan[i] <- data
- data <- data + 1uy
-
- let mutable stackSum = 0
- for value in stackSpan do
- stackSum <- stackSum + int value
-
- printfn $"The sum is {stackSum}"
-// Output: The sum is 4950
-//
-
-module Program2 =
- //
- open System
- open System.Runtime.InteropServices
- open FSharp.NativeInterop
-
- // Package FSharp.NativeInterop.NativePtr.stackalloc for reuse.
- let inline stackalloc<'a when 'a: unmanaged> length : Span<'a> =
- let voidPointer = NativePtr.stackalloc<'a> length |> NativePtr.toVoidPtr
- Span<'a>(voidPointer, length)
-
- let initializeSpan (span: Span) =
- let mutable value = 0uy
- for i = 0 to span.Length - 1 do
- span[i] <- value
- value <- value + 1uy
-
- let computeSum (span: Span) =
- let mutable sum = 0
- for value in span do
- sum <- sum + int value
- sum
-
- let workWithSpans () =
- // Create a span over an array.
- let array = Array.zeroCreate 100
- let arraySpan = Span array
-
- initializeSpan arraySpan
- printfn $"The sum is {computeSum arraySpan:N0}"
-
- // Create an array from native memory.
- let native = Marshal.AllocHGlobal 100
- let nativeSpan = Span(native.ToPointer(), 100)
-
- initializeSpan nativeSpan
- printfn $"The sum is {computeSum nativeSpan:N0}"
-
- Marshal.FreeHGlobal native
-
- // Create a span on the stack.
- let stackSpan = stackalloc 100
-
- initializeSpan stackSpan
- printfn $"The sum is {computeSum stackSpan:N0}"
-
- // The example displays the following output:
- // The sum is 4,950
- // The sum is 4,950
- // The sum is 4,950
- //
-
-createSpanFromArray ()
-printfn "-----"
-createSpanFromNativeMemory ()
-printfn "-----"
-createSpanFromStack ()
-printfn "-----"
-Program2.workWithSpans ()
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/csharp/Program.cs b/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/csharp/Program.cs
deleted file mode 100644
index 4bd2e3d18d4a6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/csharp/Program.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-
-var array = new int[] { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 };
-var slice = new Span(array, 2, 5);
-for (int ctr = 0; ctr < slice.Length; ctr++)
- slice[ctr] *= 2;
-
-// Examine the original array values.
-foreach (var value in array)
- Console.Write($"{value} ");
-Console.WriteLine();
-
-// The example displays the following output:
-// 2 4 12 16 20 24 28 16 18 20
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/csharp/Program2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/csharp/Program2.cs
deleted file mode 100644
index 75bfaeff52a93..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/csharp/Program2.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-
-class Program2
-{
- static void Run()
- {
- string contentLength = "Content-Length: 132";
- var length = GetContentLength(contentLength.ToCharArray());
- Console.WriteLine($"Content length: {length}");
- }
-
- private static int GetContentLength(ReadOnlySpan span)
- {
- var slice = span.Slice(16);
- return int.Parse(slice);
- }
-}
-// Output:
-// Content length: 132
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/csharp/slice.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/csharp/slice.csproj
deleted file mode 100644
index 3d7de13b2e5a4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/csharp/slice.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Exe
- net10.0
- enable
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/fsharp/Program.fs b/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/fsharp/Program.fs
deleted file mode 100644
index c915c701a7100..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/fsharp/Program.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module Program
-
-open System
-
-[]
-let main _ =
- let array = [| 2; 4; 6; 8; 10; 12; 14; 16; 18; 20 |]
- let slice = Span(array, 2, 5)
- for i = 0 to slice.Length - 1 do
- slice[i] <- slice[i] * 2
-
- // Examine the original array values.
- for value in array do
- printf $"{value} "
- printfn ""
- 0
-// The example displays the following output:
-// 2 4 12 16 20 24 28 16 18 20
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/fsharp/Program2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/fsharp/Program2.fs
deleted file mode 100644
index 7690b30c1830f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/fsharp/Program2.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module Program2
-
-open System
-
-let getContentLength (span: ReadOnlySpan) =
- let slice = span.Slice 16
- Int32.Parse slice
-
-let contentLength = "Content-Length: 132"
-let length = getContentLength (contentLength.ToCharArray())
-printfn $"Content length: {length}"
-// Output:
-// Content length: 132
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/fsharp/fs.fsproj b/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/fsharp/fs.fsproj
deleted file mode 100644
index f0f5caaf5c86a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Span/Slice/fsharp/fs.fsproj
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
- Exe
- net10.0
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/cpp/sbyte_ctor1.cpp b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/cpp/sbyte_ctor1.cpp
deleted file mode 100644
index 7356456043644..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/cpp/sbyte_ctor1.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// SByte_Ctor1.cpp : Defines the entry point for the console application.
-//
-
-//#include "stdafx.h"
-
-//
-using namespace System;
-
-void main()
-{
- char chars[] = { 'a', 'b', 'c', 'd', '\x00' };
-
- char* charPtr = chars;
- String^ value = gcnew String(charPtr);
-
- Console::WriteLine(value);
-}
-// The example displays the following output:
-// abcd
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/Project.csproj
deleted file mode 100644
index 22dd9034898ba..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- true
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/char2_ctor.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/char2_ctor.cs
deleted file mode 100644
index ea152e7404d4e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/char2_ctor.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-using System;
-
-public class Example1
-{
- public static unsafe void Main()
- {
- char[] characters = { 'H', 'e', 'l', 'l', 'o', ' ',
- 'w', 'o', 'r', 'l', 'd', '!', '\u0000' };
- String value;
-
- fixed (char* charPtr = characters) {
- int length = 0;
- Char* iterator = charPtr;
-
- while (*iterator != '\x0000')
- {
- if (*iterator == '!' || *iterator == '.')
- break;
- iterator++;
- length++;
- }
- value = new String(charPtr, 0, length);
- }
- Console.WriteLine(value);
- }
-}
-// The example displays the following output:
-// Hello World
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/chptrctor_null.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/chptrctor_null.cs
deleted file mode 100644
index 41eb2e7fa08aa..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/chptrctor_null.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-using System;
-
-public class Example2
-{
- public unsafe static void Main()
- {
- char[] chars = { 'a', 'b', 'c', 'd', '\0', 'A', 'B', 'C', 'D', '\0' };
- string s = null;
-
- fixed(char* chPtr = chars) {
- s = new string(chPtr, 0, chars.Length);
- }
-
- foreach (var ch in s)
- Console.Write($"{(ushort)ch:X4} ");
- Console.WriteLine();
-
- fixed(char* chPtr = chars) {
- s = new string(chPtr);
- }
-
- foreach (var ch in s)
- Console.Write($"{(ushort)ch:X4} ");
- Console.WriteLine();
- }
-}
-// The example displays the following output:
-// 0061 0062 0063 0064 0000 0041 0042 0043 0044 0000
-// 0061 0062 0063 0064
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/ctor1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/ctor1.cs
deleted file mode 100644
index c3ff8a27bd101..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/ctor1.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-using System;
-
-public class Example3
-{
- public static void Main()
- {
- String value1 = "This is a string.";
- String value2 = value1;
- Console.WriteLine(value1);
- Console.WriteLine(value2);
- }
-}
-// The example displays the following output:
-// This is a string.
-// This is a string.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/ctor2.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/ctor2.cs
deleted file mode 100644
index b6e0d7f78853c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/ctor2.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-using System;
-
-public class Example4
-{
- public static unsafe void Main()
- {
- char[] characters = { 'H', 'e', 'l', 'l', 'o', ' ',
- 'w', 'o', 'r', 'l', 'd', '!', '\u0000' };
- string value;
-
- fixed (char* charPtr = characters) {
- value = new String(charPtr);
- }
- Console.WriteLine(value);
- }
-}
-// The example displays the following output:
-// Hello world!
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/ptrctor_null.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/ptrctor_null.cs
deleted file mode 100644
index 7209113786fb8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/ptrctor_null.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-using System;
-
-public class Example5
-{
- public unsafe static void Main()
- {
- sbyte[] bytes = { 0x61, 0x62, 0x063, 0x064, 0x00, 0x41, 0x42, 0x43, 0x44, 0x00 };
-
- string s = null;
- fixed (sbyte* bytePtr = bytes) {
- s = new string(bytePtr, 0, bytes.Length);
- }
-
- foreach (var ch in s)
- Console.Write($"{(ushort)ch:X4} ");
-
- Console.WriteLine();
-
- fixed(sbyte* bytePtr = bytes) {
- s = new string(bytePtr);
- }
-
- foreach (var ch in s)
- Console.Write($"{(ushort)ch:X4} ");
- Console.WriteLine();
- }
-}
-// The example displays the following output:
-// 0061 0062 0063 0064 0000 0041 0042 0043 0044 0000
-// 0061 0062 0063 0064
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/source.cs
deleted file mode 100644
index 7eebd4e46d9e3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/csharp/source.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-using System;
-using System.Text;
-
-namespace Microsoft.Demo
-{
- class ConsoleApp
- {
- [STAThread]
- static void Main(string[] args)
- {
-//
- // Unicode Mathematical operators
- char [] charArr1 = {'\u2200','\u2202','\u200F','\u2205'};
- String szMathSymbols = new String(charArr1);
-
- // Unicode Letterlike Symbols
- char [] charArr2 = {'\u2111','\u2118','\u2122','\u2126'};
- String szLetterLike = new String (charArr2);
-
- // Compare Strings - the result is false
- Console.WriteLine("The Strings are equal? " +
- (String.Compare(szMathSymbols, szLetterLike)==0?"true":"false") );
-//
-//
- unsafe
- {
- // Null terminated ASCII characters in an sbyte array
- String szAsciiUpper = null;
- sbyte[] sbArr1 = new sbyte[] { 0x41, 0x42, 0x43, 0x00 };
- // Instruct the Garbage Collector not to move the memory
- fixed(sbyte* pAsciiUpper = sbArr1)
- {
- szAsciiUpper = new String(pAsciiUpper);
- }
- String szAsciiLower = null;
- sbyte[] sbArr2 = { 0x61, 0x62, 0x63, 0x00 };
- // Instruct the Garbage Collector not to move the memory
- fixed(sbyte* pAsciiLower = sbArr2)
- {
- szAsciiLower = new String(pAsciiLower, 0, sbArr2.Length);
- }
- // Prints "ABC abc"
- Console.WriteLine(szAsciiUpper + " " + szAsciiLower);
-
- // Compare Strings - the result is true
- Console.WriteLine("The Strings are equal when capitalized ? " +
- (String.Compare(szAsciiUpper.ToUpper(), szAsciiLower.ToUpper())==0?"true":"false") );
-
- // This is the effective equivalent of another Compare method, which ignores case
- Console.WriteLine("The Strings are equal when capitalized ? " +
- (String.Compare(szAsciiUpper, szAsciiLower, true)==0?"true":"false") );
- }
-//
-//
- // Create a Unicode String with 5 Greek Alpha characters
- String szGreekAlpha = new String('\u0391',5);
- // Create a Unicode String with a Greek Omega character
- String szGreekOmega = new String(new char [] {'\u03A9','\u03A9','\u03A9'},2,1);
-
- String szGreekLetters = String.Concat(szGreekOmega, szGreekAlpha, szGreekOmega.Clone());
-
- // Examine the result
- Console.WriteLine(szGreekLetters);
-
- // The first index of Alpha
- int ialpha = szGreekLetters.IndexOf('\u0391');
- // The last index of Omega
- int iomega = szGreekLetters.LastIndexOf('\u03A9');
-
- Console.WriteLine("The Greek letter Alpha first appears at index " + ialpha +
- " and Omega last appears at index " + iomega + " in this String.");
-//
-
-//
- unsafe
- {
- String utfeightstring = null;
- sbyte [] asciiChars = new sbyte[] { 0x51,0x52,0x53,0x54,0x54,0x56 };
- UTF8Encoding encoding = new UTF8Encoding(true, true);
-
- // Instruct the Garbage Collector not to move the memory
- fixed(sbyte* pAsciiChars = asciiChars)
- {
- utfeightstring = new String(pAsciiChars,0,asciiChars.Length,encoding);
- }
- Console.WriteLine("The UTF8 String is " + utfeightstring ); // prints "QRSTTV"
- }
-//
- }
- }
-}
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/char2_ctor.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/char2_ctor.fs
deleted file mode 100644
index 159ab3913a059..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/char2_ctor.fs
+++ /dev/null
@@ -1,29 +0,0 @@
-module char2_ctor
-
-//
-#nowarn "9"
-open System
-open FSharp.NativeInterop
-
-let characters =
- [| 'H'; 'e'; 'l'; 'l'; 'o'; ' '
- 'w'; 'o'; 'r'; 'l'; 'd'; '!'; '\u0000' |]
-
-[]
-let main _ =
- use charPtr = fixed characters
- let mutable length = 0
- let mutable iterator = charPtr
- let mutable broken = false
- while not broken && NativePtr.read iterator <> '\u0000' do
- if NativePtr.read iterator = '!' || NativePtr.read iterator = '.' then
- broken <- true
- else
- iterator <- NativePtr.add iterator 1
- length <- length + 1
- String(charPtr, 0, length)
- |> printfn "%s"
- 0
-// The example displays the following output:
-// Hello World
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/chptrctor_null.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/chptrctor_null.fs
deleted file mode 100644
index b973bca4ee7ee..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/chptrctor_null.fs
+++ /dev/null
@@ -1,26 +0,0 @@
-module chptrctor_null
-
-//
-#nowarn "9"
-open System
-
-let chars = [| 'a'; 'b'; 'c'; 'd'; '\000'; 'A'; 'B'; 'C'; 'D'; '\000' |]
-let s =
- use chPtr = fixed chars
- String(chPtr, 0, chars.Length)
-
-for ch in s do
- printf $"{uint16 ch:X4} "
-printfn ""
-
-let s2 =
- use chPtr = fixed chars
- String chPtr
-
-for ch in s2 do
- printf $"{uint16 ch:X4} "
-printfn ""
-// The example displays the following output:
-// 0061 0062 0063 0064 0000 0041 0042 0043 0044 0000
-// 0061 0062 0063 0064
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/ctor1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/ctor1.fs
deleted file mode 100644
index b44b9bb30d62b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/ctor1.fs
+++ /dev/null
@@ -1,11 +0,0 @@
-module ctor1
-
-//
-let value1 = "This is a string."
-let value2 = value1
-printfn "%s" value1
-printfn "%s" value2
-// The example displays the following output:
-// This is a string.
-// This is a string.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/ctor2.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/ctor2.fs
deleted file mode 100644
index 1042312649ac5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/ctor2.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module ctor2
-
-//
-#nowarn "9"
-open System
-
-let characters =
- [| 'H'; 'e'; 'l'; 'l'; 'o'; ' '
- 'w'; 'o'; 'r'; 'l'; 'd'; '!'; '\u0000' |]
-
-let value =
- use charPtr = fixed characters
- String charPtr
-
-printfn $"{value}"
-// The example displays the following output:
-// Hello world!
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/ptrctor_null.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/ptrctor_null.fs
deleted file mode 100644
index e3753c593e014..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/ptrctor_null.fs
+++ /dev/null
@@ -1,28 +0,0 @@
-module ptrctor_null
-
-//
-#nowarn "9"
-open System
-
-let bytes =
- [| 0x61y; 0x62y; 0x063y; 0x064y; 0x00y; 0x41y; 0x42y; 0x43y; 0x44y; 0x00y |]
-
-let s =
- use bytePtr = fixed bytes
- String(bytePtr, 0, bytes.Length)
-
-for ch in s do
- printf $"{uint16 ch:X4} "
-printfn ""
-
-let s2 =
- use bytePtr = fixed bytes
- String bytePtr
-
-for ch in s do
- printf $"{uint16 ch:X4} "
-printfn ""
-// The example displays the following output:
-// 0061 0062 0063 0064 0000 0041 0042 0043 0044 0000
-// 0061 0062 0063 0064
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/source.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/source.fs
deleted file mode 100644
index 017dbeeaaba34..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/fsharp/source.fs
+++ /dev/null
@@ -1,70 +0,0 @@
-module source
-
-open System
-open System.Text
-
-do
-//
- // Unicode Mathematical operators
- let charArr1 = [| '\u2200'; '\u2202'; '\u200F'; '\u2205' |]
- let szMathSymbols = String charArr1
-
- // Unicode Letterlike Symbols
- let charArr2 = [| '\u2111'; '\u2118'; '\u2122'; '\u2126' |]
- let szLetterLike = String charArr2
-
- // Compare Strings - the result is false
- printfn $"The Strings are equal? %b{String.Compare(szMathSymbols, szLetterLike) = 0}"
-//
-//
- // Null terminated ASCII characters in an sbyte array
- let szAsciiUpper =
- let sbArr1 = [| 0x41y; 0x42y; 0x43y; 0x00y |]
- // Instruct the Garbage Collector not to move the memory
- use pAsciiUpper = fixed sbArr1
- String pAsciiUpper
-
- let szAsciiLower =
- let sbArr2 = [| 0x61y; 0x62y; 0x63y; 0x00y |]
- // Instruct the Garbage Collector not to move the memory
- use pAsciiLower = fixed sbArr2
- String(pAsciiLower, 0, sbArr2.Length)
-
- // Prints "ABC abc"
- printfn $"{szAsciiUpper} {szAsciiLower}"
-
- // Compare Strings - the result is true
- printfn $"The Strings are equal when capitalized ? %b{String.Compare(szAsciiUpper.ToUpper(), szAsciiLower.ToUpper()) = 0}"
-
- // This is the effective equivalent of another Compare method, which ignores case
- printfn $"The Strings are equal when capitalized ? %b{String.Compare(szAsciiUpper, szAsciiLower, true) = 0}"
-//
-//
- // Create a Unicode String with 5 Greek Alpha characters
- let szGreekAlpha = String('\u0391',5)
- // Create a Unicode String with a Greek Omega character
- let szGreekOmega = String([| '\u03A9'; '\u03A9'; '\u03A9' |],2,1)
-
- let szGreekLetters = String.Concat(szGreekOmega, szGreekAlpha, szGreekOmega.Clone())
-
- // Examine the result
- printfn $"{szGreekLetters}"
-
- // The first index of Alpha
- let ialpha = szGreekLetters.IndexOf '\u0391'
- // The last index of Omega
- let iomega = szGreekLetters.LastIndexOf '\u03A9'
-
- printfn $"The Greek letter Alpha first appears at index {ialpha} and Omega last appears at index {iomega} in this String."
-//
-
-//
- let utfeightstring =
- let asciiChars = [| 0x51y; 0x52y; 0x53y; 0x54y; 0x54y; 0x56y |]
- let encoding = UTF8Encoding(true, true)
-
- // Instruct the Garbage Collector not to move the memory
- use pAsciiChars = fixed asciiChars
- String(pAsciiChars,0,asciiChars.Length,encoding)
- printfn $"The UTF8 String is {utfeightstring}" // prints "QRSTTV"
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/vb/ctor1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/vb/ctor1.vb
deleted file mode 100644
index 07eb0b334d421..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/vb/ctor1.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- Dim value1 As String = "This is a string."
- Dim value2 As String = value1
- Console.WriteLine(value1)
- Console.WriteLine(value2)
- End Sub
-End Module
-' The example displays the following output:
-' This is a string.
-' This is a string.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/vb/source.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/vb/source.vb
deleted file mode 100644
index 822f09067ac5b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/.ctor/vb/source.vb
+++ /dev/null
@@ -1,47 +0,0 @@
-Option Strict On
-
-Imports System.Text
-
-Class ConsoleApp
- Public Shared Sub Main()
- '
- ' Unicode Mathematical operators
- Dim charArr1() As Char = {ChrW(&H2200), ChrW(&H2202), _
- ChrW(&H200F), ChrW(&H2205)}
- Dim szMathSymbols As New String(charArr1)
-
- ' Unicode Letterlike Symbols
- Dim charArr2() As Char = {ChrW(&H2111), ChrW(&H2118), _
- ChrW(&H2122), ChrW(&H2126)}
- Dim szLetterLike As New String(charArr2)
-
- ' Compare Strings - the result is false
- Console.WriteLine("The strings are equal? " & _
- CStr(szMathSymbols.Equals(szLetterLike)))
- '
-
- '
- ' Create a Unicode String with 5 Greek Alpha characters
- Dim szGreekAlpha As New String(ChrW(&H0391), 5)
- ' Create a Unicode String with a Greek Omega character
- Dim szGreekOmega As New String(New Char() {ChrW(&H03A9), ChrW(&H03A9), _
- ChrW(&H03A9)}, 2, 1)
-
- Dim szGreekLetters As String = String.Concat(szGreekOmega, szGreekAlpha, _
- szGreekOmega.Clone())
-
- ' Examine the result
- Console.WriteLine(szGreekLetters)
-
- ' The first index of Alpha
- Dim iAlpha As Integer = szGreekLetters.IndexOf(ChrW(&H0391))
- ' The last index of Omega
- Dim iomega As Integer = szGreekLetters.LastIndexOf(ChrW(&H03A9))
-
- Console.WriteLine("The Greek letter Alpha first appears at index {0}.", _
- ialpha)
- Console.WriteLIne("The Greek letter Omega last appears at index {0}.", _
- iomega)
- '
- End Sub
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/csharp/Example1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/csharp/Example1.cs
deleted file mode 100644
index 9eb74d2cf8ebe..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/csharp/Example1.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-
-public class Example
-{
- public static void Main()
- {
- //
- short[] values= { Int16.MinValue, -27, 0, 1042, Int16.MaxValue };
- Console.WriteLine("{0,10} {1,10}\n", "Decimal", "Hex");
- foreach (short value in values)
- {
- string formatString = String.Format("{0,10:G}: {0,10:X}", value);
- Console.WriteLine(formatString);
- }
- // The example displays the following output:
- // Decimal Hex
- //
- // -32768: 8000
- // -27: FFE5
- // 0: 0
- // 1042: 412
- // 32767: 7FFF
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/fsharp/Example1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/fsharp/Example1.fs
deleted file mode 100644
index 6f76849429cdd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/fsharp/Example1.fs
+++ /dev/null
@@ -1,19 +0,0 @@
-module Example1
-
-//
-open System
-
-let values= [| Int16.MinValue; -27s; 0s; 1042s; Int16.MaxValue |]
-printfn "%10s %10s\n" "Decimal" "Hex"
-for value in values do
- String.Format("{0,10:G}: {0,10:X}", value)
- |> printfn "%s"
-// The example displays the following output:
-// Decimal Hex
-//
-// -32768: 8000
-// -27: FFE5
-// 0: 0
-// 1042: 412
-// 32767: 7FFF
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/Example1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/Example1.vb
deleted file mode 100644
index 25f6752711a82..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/Example1.vb
+++ /dev/null
@@ -1,24 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example1
- Public Sub Main()
- Dim values() As Short = {Int16.MinValue, -27, 0, 1042, Int16.MaxValue}
- Console.WriteLine("{0,10} {1,10}", "Decimal", "Hex")
- Console.WriteLine()
- For Each value As Short In values
- Dim formatString As String = String.Format("{0,10:G}: {0,10:X}", value)
- Console.WriteLine(formatString)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Decimal Hex
-'
-' -32768: 8000
-' -27: FFE5
-' 0: 0
-' 1042: 412
-' 32767: 7FFF
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/FormatExample2.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/FormatExample2.vb
deleted file mode 100644
index 26b3a3e6e1945..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/FormatExample2.vb
+++ /dev/null
@@ -1,69 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module TestFormatter
- Public Sub Main()
- Dim acctNumber As Integer = 79203159
- Console.WriteLine(String.Format(New CustomerFormatter, "{0}", acctNumber))
- Console.WriteLine(String.Format(New CustomerFormatter, "{0:G}", acctNumber))
- Console.WriteLine(String.Format(New CustomerFormatter, "{0:S}", acctNumber))
- Console.WriteLine(String.Format(New CustomerFormatter, "{0:P}", acctNumber))
- Try
- Console.WriteLine(String.Format(New CustomerFormatter, "{0:X}", acctNumber))
- Catch e As FormatException
- Console.WriteLine(e.Message)
- End Try
- End Sub
-End Module
-
-Public Class CustomerFormatter : Implements IFormatProvider, ICustomFormatter
- Public Function GetFormat(type As Type) As Object _
- Implements IFormatProvider.GetFormat
- If type Is GetType(ICustomFormatter) Then
- Return Me
- Else
- Return Nothing
- End If
- End Function
-
- Public Function Format(fmt As String, _
- arg As Object, _
- formatProvider As IFormatProvider) As String _
- Implements ICustomFormatter.Format
- If Not Me.Equals(formatProvider) Then
- Return Nothing
- Else
- If String.IsNullOrEmpty(fmt) Then fmt = "G"
-
- Dim customerString As String = arg.ToString()
- if customerString.Length < 8 Then _
- customerString = customerString.PadLeft(8, "0"c)
-
- Select Case fmt
- Case "G"
- Return customerString.Substring(0, 1) & "-" & _
- customerString.Substring(1, 5) & "-" & _
- customerString.Substring(6)
- Case "S"
- Return customerString.Substring(0, 1) & "/" & _
- customerString.Substring(1, 5) & "/" & _
- customerString.Substring(6)
- Case "P"
- Return customerString.Substring(0, 1) & "." & _
- customerString.Substring(1, 5) & "." & _
- customerString.Substring(6)
- Case Else
- Throw New FormatException( _
- String.Format("The '{0}' format specifier is not supported.", fmt))
- End Select
- End If
- End Function
-End Class
-' The example displays the following output:
-' 7-92031-59
-' 7-92031-59
-' 7/92031/59
-' 7.92031.59
-' The 'X' format specifier is not supported.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/formatoverload1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/formatoverload1.vb
deleted file mode 100644
index b7d2919677ee5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/formatoverload1.vb
+++ /dev/null
@@ -1,18 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example2
- Public Sub Main()
- '
- Dim dat As Date = #1/17/2012 9:30AM#
- Dim city As String = "Chicago"
- Dim temp As Integer = -16
- Dim output As String = String.Format("At {0} in {1}, the temperature was {2} degrees.",
- dat, city, temp)
- Console.WriteLine(output)
- ' The example displays the following output:
- ' At 1/17/2012 9:30:00 AM in Chicago, the temperature was -16 degrees.
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/formatoverload2.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/formatoverload2.vb
deleted file mode 100644
index 51f6fed6dd983..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/formatoverload2.vb
+++ /dev/null
@@ -1,35 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-Option Infer On
-
-'
-Module Example3
- Public Sub Main()
- ' Create array of 5-tuples with population data for three U.S. cities, 1940-1950.
- Dim cities() =
- {Tuple.Create("Los Angeles", #1/1/1940#, 1504277, #1/1/1950#, 1970358),
- Tuple.Create("New York", #1/1/1940#, 7454995, #1/1/1950#, 7891957),
- Tuple.Create("Chicago", #1/1/1940#, 3396808, #1/1/1950#, 3620962),
- Tuple.Create("Detroit", #1/1/1940#, 1623452, #1/1/1950#, 1849568)}
-
- ' Display header
- Dim header As String = String.Format("{0,-12}{1,8}{2,12}{1,8}{2,12}{3,14}",
- "City", "Year", "Population", "Change (%)")
- Console.WriteLine(header)
- Console.WriteLine()
- For Each city In cities
- Dim output = String.Format("{0,-12}{1,8:yyyy}{2,12:N0}{3,8:yyyy}{4,12:N0}{5,14:P1}",
- city.Item1, city.Item2, city.Item3, city.Item4, city.Item5,
- (city.Item5 - city.Item3) / city.Item3)
- Console.WriteLine(output)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' City Year Population Year Population Change (%)
-'
-' Los Angeles 1940 1,504,277 1950 1,970,358 31.0 %
-' New York 1940 7,454,995 1950 7,891,957 5.9 %
-' Chicago 1940 3,396,808 1950 3,620,962 6.6 %
-' Detroit 1940 1,623,452 1950 1,849,568 13.9 %
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/formatsyntax1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/formatsyntax1.vb
deleted file mode 100644
index 97d584704385c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/formatsyntax1.vb
+++ /dev/null
@@ -1,12 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example4
- Public Sub Main()
- 'Dim value As String =
- '
- String.Format("{0,-10:C}", 126347.89D)
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/interceptor2.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/interceptor2.vb
deleted file mode 100644
index 7636c4f7b27c1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/interceptor2.vb
+++ /dev/null
@@ -1,120 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-
-Public Class InterceptProvider : Implements IFormatProvider, ICustomFormatter
- Public Function GetFormat(formatType As Type) As Object _
- Implements IFormatProvider.GetFormat
- If formatType Is GetType(ICustomFormatter) Then
- Return Me
- Else
- Return Nothing
- End If
- End Function
-
- Public Function Format(fmt As String, obj As Object, provider As IFormatProvider) As String _
- Implements ICustomFormatter.Format
-
- Dim formatString As String = If(fmt IsNot Nothing, fmt, "")
- Console.WriteLine("Provider: {0}, Object: {1}, Format String: {2}",
- provider, If(obj IsNot Nothing, obj, ""), formatString)
-
- If obj Is Nothing Then Return String.Empty
-
- ' If this is a byte and the "R" format string, format it with Roman numerals.
- If TypeOf(obj) Is Byte AndAlso formatString.ToUpper.Equals("R") Then
- Dim value As Byte = CByte(obj)
- Dim remainder As Integer
- Dim result As Integer
- Dim returnString As String = String.Empty
-
- ' Get the hundreds digit(s)
- result = Math.DivRem(value, 100, remainder)
- If result > 0 Then returnString = New String("C"c, result)
- value = CByte(remainder)
- ' Get the 50s digit
- result = Math.DivRem(value, 50, remainder)
- If result = 1 Then returnString += "L"
- value = CByte(remainder)
- ' Get the tens digit.
- result = Math.DivRem(value, 10, remainder)
- If result > 0 Then returnString += New String("X"c, result)
- value = CByte(remainder)
- ' Get the fives digit.
- result = Math.DivRem(value, 5, remainder)
- If result > 0 Then returnString += "V"
- value = CByte(remainder)
- ' Add the ones digit.
- If remainder > 0 Then returnString += New String("I"c, remainder)
-
- ' Check whether we have too many X characters.
- Dim pos As Integer = returnString.IndexOf("XXXX")
- If pos >= 0 Then
- Dim xPos As Integer = returnString.IndexOf("L")
- If xPos >= 0 And xPos = pos - 1 Then
- returnString = returnString.Replace("LXXXX", "XC")
- Else
- returnString = returnString.Replace("XXXX", "XL")
- End If
- End If
- ' Check whether we have too many I characters
- pos = returnString.IndexOf("IIII")
- If pos >= 0 Then
- If returnString.IndexOf("V") >= 0 Then
- returnString = returnString.Replace("VIIII", "IX")
- Else
- returnString = returnString.Replace("IIII", "IV")
- End If
- End If
- Return returnString
- End If
-
- ' Use default for all other formatting.
- If obj Is GetType(IFormattable)
- Return CType(obj, IFormattable).ToString(fmt, CultureInfo.CurrentCulture)
- Else
- Return obj.ToString()
- End If
- End Function
-End Class
-
-Module Example
- Public Sub Main()
- Dim n As Integer = 10
- Dim value As Double = 16.935
- Dim day As DateTime = Date.Now
- Dim provider As New InterceptProvider()
- Console.WriteLine(String.Format(provider, "{0:N0}: {1:C2} on {2:d}", n, value, day))
- Console.WriteLine()
- Console.WriteLine(String.Format(provider, "{0}: {1:F}", "Today",
- CType(Date.Now.DayOfWeek, DayOfWeek)))
- Console.WriteLine()
- Console.WriteLine(String.Format(provider, "{0:X}, {1}, {2}\n",
- CByte(2), CByte(12), CByte(199)))
- Console.WriteLine()
- Console.WriteLine(String.Format(provider, "{0:R}, {1:R}, {2:R}",
- CByte(2), CByte(12), CByte(199)))
- End Sub
-End Module
-' The example displays the following output:
-' Provider: InterceptProvider, Object: 10, Format String: N0
-' Provider: InterceptProvider, Object: 16.935, Format String: C2
-' Provider: InterceptProvider, Object: 1/31/2013 6:10:28 PM, Format String: d
-' 10: $16.94 on 1/31/2013
-'
-' Provider: InterceptProvider, Object: Today: , Format String:
-' Provider: InterceptProvider, Object: Thursday, Format String: F
-' Today: : Thursday
-'
-' Provider: InterceptProvider, Object: 2, Format String: X
-' Provider: InterceptProvider, Object: 12, Format String:
-' Provider: InterceptProvider, Object: 199, Format String:
-' 2, 12, 199
-'
-' Provider: InterceptProvider, Object: 2, Format String: R
-' Provider: InterceptProvider, Object: 12, Format String: R
-' Provider: InterceptProvider, Object: 199, Format String: R
-' II, XII, CXCIX
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa-interpolated1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa-interpolated1.vb
deleted file mode 100644
index 7444b0bf30a6b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa-interpolated1.vb
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Module Example12
- Public Sub Main()
- Dim names = {"Balto", "Vanya", "Dakota", "Samuel", "Koani", "Yiska", "Yuma"}
- Dim output = names(0) + ", " + names(1) + ", " + names(2) + ", " +
- names(3) + ", " + names(4) + ", " + names(5) + ", " +
- names(6)
-
- output += vbCrLf
- Dim dat = DateTime.Now
- output += String.Format("It is {0:t} on {0:d}. The day of the week is {1}.",
- dat, dat.DayOfWeek)
- Console.WriteLine(output)
- End Sub
-End Module
-' The example displays the following output:
-' Balto, Vanya, Dakota, Samuel, Koani, Yiska, Yuma
-' It is 10:29 AM on 1/8/2018. The day of the week is Monday.
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa-interpolated2.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa-interpolated2.vb
deleted file mode 100644
index 9f4953e45f3f2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa-interpolated2.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-
-Module Example13
- Public Sub Main()
- Dim names = {"Balto", "Vanya", "Dakota", "Samuel", "Koani", "Yiska", "Yuma"}
- Dim output = $"{names(0)}, {names(1)}, {names(2)}, {names(3)}, {names(4)}, " +
- $"{names(5)}, {names(6)}"
-
- Dim dat = DateTime.Now
- output += $"{vbCrLf}It is {dat:t} on {dat:d}. The day of the week is {dat.DayOfWeek}."
- Console.WriteLine(output)
- End Sub
-End Module
-' The example displays the following output:
-' Balto, Vanya, Dakota, Samuel, Koani, Yiska, Yuma
-' It is 10:29 AM on 1/8/2018. The day of the week is Monday.
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa1.vb
deleted file mode 100644
index 23c06303d4554..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa1.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-
-Module Example5
- Public Sub Main()
- Dim rnd As New Random()
- Dim numbers(3) As Integer
- Dim total As Integer = 0
- For ctr = 0 To 2
- Dim number As Integer = rnd.Next(1001)
- numbers(ctr) = number
- total += number
- Next
- numbers(3) = total
- Console.WriteLine("{0} + {1} + {2} = {3}", numbers)
- End Sub
-End Module
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa2.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa2.vb
deleted file mode 100644
index 969c96643377d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa2.vb
+++ /dev/null
@@ -1,25 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections.Generic
-
-Module Example6
- Public Sub Main()
- Dim rnd As New Random()
- Dim numbers(3) As Integer
- Dim total As Integer = 0
- For ctr = 0 To 2
- Dim number As Integer = rnd.Next(1001)
- numbers(ctr) = number
- total += number
- Next
- numbers(3) = total
- Dim values(numbers.Length - 1) As Object
- numbers.CopyTo(values, 0)
- Console.WriteLine("{0} + {1} + {2} = {3}", values)
- End Sub
-End Module
-'
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa26.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa26.vb
deleted file mode 100644
index eab0d5015937e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa26.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example7
- Public Sub Main()
- Dim values() As Object = {1603, 1794.68235, 15436.14}
- Dim result As String
- For Each value In values
- result = String.Format("{0,12:C2} {0,12:E3} {0,12:F4} {0,12:N3} {1,12:P2}",
- value, CDbl(value) / 10000)
- Console.WriteLine(result)
- Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays the following output:
-' $1,603.00 1.603E+003 1603.0000 1,603.000 16.03 %
-'
-' $1,794.68 1.795E+003 1794.6824 1,794.682 17.95 %
-'
-' $15,436.14 1.544E+004 15436.1400 15,436.140 154.36 %
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa27.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa27.vb
deleted file mode 100644
index faf15d373a353..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa27.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example8
- Public Sub Main()
- Dim value As Decimal = 16309.5436D
- Dim result As String = String.Format("{0,12:#.00000} {0,12:0,000.00} {0,12:000.00#}",
- value)
- Console.WriteLine(result)
- End Sub
-End Module
-' The example displays the following output:
-' 16309.54360 16,309.54 16309.544
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa28.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa28.vb
deleted file mode 100644
index 9612caac6ffad..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa28.vb
+++ /dev/null
@@ -1,16 +0,0 @@
-'Visual Basic .NET Document
-
-Option Strict On
-
-'
-Module Example9
- Public Sub Main()
- Dim value As Integer = 16342
- Dim result As String = String.Format("{0,18:00000000} {0,18:00000000.000} {0,18:000,0000,000.0}",
- value)
- Console.WriteLine(result)
- End Sub
-End Module
-' The example displays the following output:
-' 00016342 00016342.000 0,000,016,342.0
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa29.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa29.vb
deleted file mode 100644
index 70e558104aafe..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa29.vb
+++ /dev/null
@@ -1,14 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example10
- Public Sub Main()
- Dim value As Integer = 1326
- Dim result As String = String.Format("{0,10:D6} {0,10:X8}", value)
- Console.WriteLine(result)
- End Sub
-End Module
-' The example displays the following output:
-' 001326 0000052E
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa3.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa3.vb
deleted file mode 100644
index 22254d6772b98..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/qa3.vb
+++ /dev/null
@@ -1,58 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example11
- Public Sub Main()
- WillThrow()
- Console.WriteLine()
- WontThrow()
- Console.WriteLine()
- Recommended()
- End Sub
-
- Public Sub WillThrow()
- Dim result As String
- Dim nOpen As Integer = 1
- Dim nClose As Integer = 2
- Try
- '
- result = String.Format("The text has {0} '{' characters and {1} '}' characters.",
- nOpen, nClose)
- '
- Console.WriteLine(result)
- Catch e As FormatException
- Console.WriteLine("FormatException")
- End Try
- End Sub
-
- Public Sub WontThrow()
- Dim result As String
- Dim nOpen As Integer = 1
- Dim nClose As Integer = 2
- Try
- '
- result = String.Format("The text has {0} '{{' characters and {1} '}}' characters.",
- nOpen, nClose)
- '
- Console.WriteLine(result)
- Catch e As FormatException
- Console.WriteLine("FormatException")
- End Try
- End Sub
-
- Public Sub Recommended()
- Dim result As String
- Dim nOpen As Integer = 1
- Dim nClose As Integer = 2
- Try
- '
- result = String.Format("The text has {0} '{1}' characters and {2} '{3}' characters.",
- nOpen, "{", nClose, "}")
- '
- Console.WriteLine(result)
- Catch e As FormatException
- Console.WriteLine("FormatException")
- End Try
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/starting1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/starting1.vb
deleted file mode 100644
index 692f6eb627003..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/starting1.vb
+++ /dev/null
@@ -1,80 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Text
-
-Module Example14
- Public Sub Main()
- '
- Dim temp As Decimal = 20.4D
- Dim s As String = String.Format("The temperature is {0}°C.", temp)
- Console.WriteLine(s)
- ' Displays 'The temperature is 20.4°C.'
- '
-
- Snippet31()
- Snippet32()
- Snippet33()
- Snippet34()
- End Sub
-
- Private Sub Snippet31()
- '
- Dim s As String = String.Format("At {0}, the temperature is {1}°C.",
- Date.Now, 20.4)
- ' Output similar to: 'At 4/10/2015 9:29:41 AM, the temperature is 20.4°C.'
- '
- Console.WriteLine(s)
- End Sub
-
- Private Sub Snippet32()
- '
- Dim s As String = String.Format("It is now {0:d} at {0:t}",
- Date.Now)
- ' Output similar to: 'It is now 4/10/2015 at 10:04 AM'
- '
- Console.WriteLine(s)
- End Sub
-
- Private Sub Snippet33()
- '
- Dim years() As Integer = {2013, 2014, 2015}
- Dim population() As Integer = {1025632, 1105967, 1148203}
- Dim sb As New StringBuilder()
- sb.Append(String.Format("{0,6} {1,15}{2}{2}",
- "Year", "Population", vbCrLf))
- For index As Integer = 0 To years.Length - 1
- sb.AppendFormat("{0,6} {1,15:N0}{2}",
- years(index), population(index), vbCrLf)
- Next
- ' Result:
- ' Year Population
- '
- ' 2013 1,025,632
- ' 2014 1,105,967
- ' 2015 1,148,203
- '
- Console.WriteLine(sb)
- End Sub
-
- Private Sub Snippet34()
- '
- Dim years() As Integer = {2013, 2014, 2015}
- Dim population() As Integer = {1025632, 1105967, 1148203}
- Dim s As String = String.Format("{0,-10} {1,-10}{2}{2}",
- "Year", "Population", vbCrLf)
- For index As Integer = 0 To years.Length - 1
- s += String.Format("{0,-10} {1,-10:N0}{2}",
- years(index), population(index), vbCrLf)
- Next
- ' Result:
- ' Year Population
- '
- ' 2013 1,025,632
- ' 2014 1,105,967
- ' 2015 1,148,203
- '
- Console.WriteLine(vbCrLf + s)
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/starting2.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/starting2.vb
deleted file mode 100644
index 9267fd49bae49..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Format/vb/starting2.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example15
- Public Sub Main()
- '
- Dim pricePerOunce As Decimal = 17.36D
- Dim s As String = String.Format("The current price is {0} per ounce.",
- pricePerOunce)
- ' Result: The current price is 17.36 per ounce.
- '
- Console.WriteLine(s)
- ShowFormatted()
- End Sub
-
- Private Sub ShowFormatted()
- '
- Dim pricePerOunce As Decimal = 17.36D
- Dim s As String = String.Format("The current price is {0:C2} per ounce.",
- pricePerOunce)
- ' Result if current culture is en-US:
- ' The current price is $17.36 per ounce.
- '
- Console.WriteLine(s)
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/csharp/Intern1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/csharp/Intern1.cs
deleted file mode 100644
index fa3a57ae33ad1..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/csharp/Intern1.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Text;
-
-[assembly: CLSCompliant(true)]
-public class Class1
-{
- public static void Main()
- {
- //
- string s1 = "MyTest";
- string s2 = new StringBuilder().Append("My").Append("Test").ToString();
- string s3 = String.Intern(s2);
- Console.WriteLine((Object)s2==(Object)s1); // Different references.
- Console.WriteLine((Object)s3==(Object)s1); // The same reference.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/fsharp/Intern1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/fsharp/Intern1.fs
deleted file mode 100644
index 8443ea61d61f4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/fsharp/Intern1.fs
+++ /dev/null
@@ -1,11 +0,0 @@
-module Intern1.fs
-open System
-open System.Text
-
-//
-let s1 = "MyTest"
-let s2 = StringBuilder().Append("My").Append("Test").ToString()
-let s3 = String.Intern s2
-printfn $"{s2 :> obj = s1 :> obj}" // Different references.
-printfn $"{s3 :> obj = s1 :> obj}" // The same reference.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/fsharp/fs.fsproj b/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/fsharp/fs.fsproj
deleted file mode 100644
index 0dc05a76755de..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/fsharp/fs.fsproj
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
- Exe
- net10.0
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/vb/Intern1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/vb/Intern1.vb
deleted file mode 100644
index cf5eb1e1d2898..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/vb/Intern1.vb
+++ /dev/null
@@ -1,18 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Text
-
-
-Module modMain
- Public Sub Main()
- '
- Dim s1 As String = "MyTest"
- Dim s2 As String = New StringBuilder().Append("My").Append("Test").ToString()
- Dim s3 As String = String.Intern(s2)
- Console.WriteLine(CObj(s2) Is CObj(s1)) ' Different references.
- Console.WriteLine(CObj(s3) Is CObj(s1)) ' The same reference.
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Intern/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/csharp/NullString1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/csharp/NullString1.cs
deleted file mode 100644
index c9da93895bacc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/csharp/NullString1.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-
-public class Example
-{
- public static void Main()
- {
- //
- String s = null;
-
- Console.WriteLine($"The value of the string is '{s}'");
-
- try
- {
- Console.WriteLine($"String length is {s.Length}");
- }
- catch (NullReferenceException e)
- {
- Console.WriteLine(e.Message);
- }
-
- // The example displays the following output:
- // The value of the string is ''
- // Object reference not set to an instance of an object.
- //
- }
-}
-
-public class Empty
-{
- public void Test()
- {
- //
- String s = "";
- Console.WriteLine($"The length of '{s}' is {s.Length}.");
-
- // The example displays the following output:
- // The length of '' is 0.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/csharp/isnullorempty1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/csharp/isnullorempty1.cs
deleted file mode 100644
index d023d3a523683..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/csharp/isnullorempty1.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-
-public class Example1
-{
- public static void Main()
- {
- //
- bool TestForNullOrEmpty(string s)
- {
- bool result;
- result = s == null || s == string.Empty;
- return result;
- }
-
- string s1 = null;
- string s2 = "";
- Console.WriteLine(TestForNullOrEmpty(s1));
- Console.WriteLine(TestForNullOrEmpty(s2));
-
- // The example displays the following output:
- // True
- // True
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/fsharp/NullString1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/fsharp/NullString1.fs
deleted file mode 100644
index 21f1ee3462c37..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/fsharp/NullString1.fs
+++ /dev/null
@@ -1,19 +0,0 @@
-namespace IsNullOrEmpty
-open System
-
-module NullString1 =
-
- //
- let (s: string) = null
-
- printfn "The value of the string is '%s'" s
-
- try
- printfn "String length is %d" s.Length
- with
- | :? NullReferenceException as ex -> printfn "%s" ex.Message
-
- // The example displays the following output:
- // The value of the string is ''
- // Object reference not set to an instance of an object.
- //
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/fsharp/NullString2.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/fsharp/NullString2.fs
deleted file mode 100644
index d8c8fad9c8c80..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/fsharp/NullString2.fs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace IsNullOrEmpty
-open System
-
-module NullString2 =
-
- //
- let s = ""
- printfn "The length of '%s' is %d." s s.Length
-
- // The example displays the following output:
- // The length of '' is 0.
- //
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/fsharp/isnullorempty1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/fsharp/isnullorempty1.fs
deleted file mode 100644
index 7f4e29126fe0d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/fsharp/isnullorempty1.fs
+++ /dev/null
@@ -1,19 +0,0 @@
-namespace IsNullOrEmpty
-open System
-
-module IsNullOrEmpty1 =
-
- //
- let testForNullOrEmpty (s: string): bool =
- s = null || s = String.Empty
-
- let s1 = null
- let s2 = ""
-
- printfn "%b" (testForNullOrEmpty s1)
- printfn "%b" (testForNullOrEmpty s2)
-
- // The example displays the following output:
- // true
- // true
- //
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/vb/NullString1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/vb/NullString1.vb
deleted file mode 100644
index 30fcd45a40934..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/vb/NullString1.vb
+++ /dev/null
@@ -1,34 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- Dim s As String
-
- Console.WriteLine("The value of the string is '{0}'", s)
-
- Try
- Console.WriteLine("String length is {0}", s.Length)
- Catch e As NullReferenceException
- Console.WriteLine(e.Message)
- End Try
- End Sub
-End Module
-' The example displays the following output:
-' The value of the string is ''
-' Object reference not set to an instance of an object.
-'
-
-Public Class Empty
- Public Sub Test()
- '
- Dim s As String = ""
- Console.WriteLine("The length of '{0}' is {1}.", s, s.Length)
- ' The example displays the following output:
- ' The length of '' is 0.
- '
- End Sub
-End Class
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/vb/isnullorempty1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/vb/isnullorempty1.vb
deleted file mode 100644
index 9f5d4513a36ea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/IsNullOrEmpty/vb/isnullorempty1.vb
+++ /dev/null
@@ -1,20 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example1
- Public Sub Main()
- Dim s1 As String = Nothing
- Dim s2 As String = ""
- Console.WriteLine(TestForNullOrEmpty(s1))
- Console.WriteLine(TestForNullOrEmpty(s2))
- End Sub
-
- Private Function TestForNullOrEmpty(s As String) As Boolean
- Dim result As Boolean
- '
- result = s Is Nothing OrElse s = String.Empty
- '
- Return result
- End Function
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/Project.csproj
deleted file mode 100644
index 22dd9034898ba..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- Library
- net10.0
- true
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/case1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/case1.cs
deleted file mode 100644
index 7bf03f61dbfae..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/case1.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.IO;
-
-public class Example
-{
- public static void Main()
- {
- StreamWriter sw = new StreamWriter(@".\case.txt");
- string[] words = { "file", "sıfır", "Dženana" };
- CultureInfo[] cultures = { CultureInfo.InvariantCulture,
- new CultureInfo("en-US"),
- new CultureInfo("tr-TR") };
-
- foreach (var word in words) {
- sw.WriteLine("{0}:", word);
- foreach (var culture in cultures) {
- string name = String.IsNullOrEmpty(culture.Name) ?
- "Invariant" : culture.Name;
- string upperWord = word.ToUpper(culture);
- sw.WriteLine(" {0,10}: {1,7} {2, 38}", name,
- upperWord, ShowHexValue(upperWord));
- }
- sw.WriteLine();
- }
- sw.Close();
- }
-
- private static string ShowHexValue(string s)
- {
- string retval = null;
- foreach (var ch in s) {
- byte[] bytes = BitConverter.GetBytes(ch);
- retval += String.Format("{0:X2} {1:X2} ", bytes[1], bytes[0]);
- }
- return retval;
- }
-}
-// The example displays the following output:
-// file:
-// Invariant: FILE 00 46 00 49 00 4C 00 45
-// en-US: FILE 00 46 00 49 00 4C 00 45
-// tr-TR: FİLE 00 46 01 30 00 4C 00 45
-//
-// sıfır:
-// Invariant: SıFıR 00 53 01 31 00 46 01 31 00 52
-// en-US: SIFIR 00 53 00 49 00 46 00 49 00 52
-// tr-TR: SIFIR 00 53 00 49 00 46 00 49 00 52
-//
-// Dženana:
-// Invariant: DžENANA 01 C5 00 45 00 4E 00 41 00 4E 00 41
-// en-US: DŽENANA 01 C4 00 45 00 4E 00 41 00 4E 00 41
-// tr-TR: DŽENANA 01 C4 00 45 00 4E 00 41 00 4E 00 41
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/case2.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/case2.cs
deleted file mode 100644
index 966719e67c84a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/case2.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class Example1
-{
- const string disallowed = "file";
-
- public static void Main()
- {
- IsAccessAllowed(@"FILE:\\\c:\users\user001\documents\FinancialInfo.txt");
- }
-
- private static void IsAccessAllowed(String resource)
- {
- CultureInfo[] cultures = { CultureInfo.CreateSpecificCulture("en-US"),
- CultureInfo.CreateSpecificCulture("tr-TR") };
- String scheme = null;
- int index = resource.IndexOfAny( new Char[] { '\\', '/' } );
- if (index > 0)
- scheme = resource.Substring(0, index - 1);
-
- // Change the current culture and perform the comparison.
- foreach (var culture in cultures) {
- Thread.CurrentThread.CurrentCulture = culture;
- Console.WriteLine($"Culture: {CultureInfo.CurrentCulture.DisplayName}");
- Console.WriteLine(resource);
- Console.WriteLine($"Access allowed: {! String.Equals(disallowed, scheme, StringComparison.CurrentCultureIgnoreCase)}");
- Console.WriteLine();
- }
- }
-}
-// The example displays the following output:
-// Culture: English (United States)
-// FILE:\\\c:\users\user001\documents\FinancialInfo.txt
-// Access allowed: False
-//
-// Culture: Turkish (Turkey)
-// FILE:\\\c:\users\user001\documents\FinancialInfo.txt
-// Access allowed: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare11.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare11.cs
deleted file mode 100644
index 71b6330189c1b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare11.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class Example2
-{
- public static void Main()
- {
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
- Console.WriteLine(String.Compare("A", "a", StringComparison.CurrentCulture));
- Console.WriteLine(String.Compare("A", "a", StringComparison.Ordinal));
- }
-}
-// The example displays the following output:
-// 1
-// -32
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare2.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare2.cs
deleted file mode 100644
index 347c43aaffa90..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare2.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-
-public class Example3
-{
- public static void Main()
- {
- string[] strings = { "coop", "co-op", "cooperative",
- "co\u00ADoperative", "cœur", "coeur" };
-
- // Perform a word sort using the current (en-US) culture.
- string[] current = new string[strings.Length];
- strings.CopyTo(current, 0);
- Array.Sort(current, StringComparer.CurrentCulture);
-
- // Perform a word sort using the invariant culture.
- string[] invariant = new string[strings.Length];
- strings.CopyTo(invariant, 0);
- Array.Sort(invariant, StringComparer.InvariantCulture);
-
- // Perform an ordinal sort.
- string[] ordinal = new string[strings.Length];
- strings.CopyTo(ordinal, 0);
- Array.Sort(ordinal, StringComparer.Ordinal);
-
- // Perform a string sort using the current culture.
- string[] stringSort = new string[strings.Length];
- strings.CopyTo(stringSort, 0);
- Array.Sort(stringSort, new SCompare());
-
- // Display array values
- Console.WriteLine("{0,13} {1,13} {2,15} {3,13} {4,13}\n",
- "Original", "Word Sort", "Invariant Word",
- "Ordinal Sort", "String Sort");
- for (int ctr = 0; ctr < strings.Length; ctr++)
- Console.WriteLine("{0,13} {1,13} {2,15} {3,13} {4,13}",
- strings[ctr], current[ctr], invariant[ctr],
- ordinal[ctr], stringSort[ctr] );
- }
-}
-
-// IComparer implementation to perform string sort.
-internal class SCompare : IComparer
-{
- public int Compare(string x, string y)
- {
- return CultureInfo.CurrentCulture.CompareInfo.Compare(x, y, CompareOptions.StringSort);
- }
-}
-// The example displays the following output:
-// Original Word Sort Invariant Word Ordinal Sort String Sort
-//
-// coop cœur cœur co-op co-op
-// co-op coeur coeur coeur cœur
-// cooperative coop coop coop coeur
-// cooperative co-op co-op cooperative coop
-// cœur cooperative cooperative cooperative cooperative
-// coeur cooperative cooperative cœur cooperative
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare3.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare3.cs
deleted file mode 100644
index 832720bc04a68..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare3.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-using System;
-
-public class Example8
-{
- public static void Main()
- {
- // Search for "oe" and "œu" in "œufs" and "oeufs".
- string s1 = "œufs";
- string s2 = "oeufs";
- FindInString(s1, "oe", StringComparison.CurrentCulture);
- FindInString(s1, "oe", StringComparison.Ordinal);
- FindInString(s2, "œu", StringComparison.CurrentCulture);
- FindInString(s2, "œu", StringComparison.Ordinal);
- Console.WriteLine();
-
- string s3 = "co\u00ADoperative";
- FindInString(s3, "\u00AD", StringComparison.CurrentCulture);
- FindInString(s3, "\u00AD", StringComparison.Ordinal);
- }
-
- private static void FindInString(string s, string substring, StringComparison options)
- {
- int result = s.IndexOf(substring, options);
- if (result != -1)
- Console.WriteLine($"'{substring}' found in {s} at position {result}");
- else
- Console.WriteLine($"'{substring}' not found in {s}");
- }
-}
-// The example displays the following output:
-// 'oe' found in œufs at position 0
-// 'oe' not found in œufs
-// 'œu' found in oeufs at position 0
-// 'œu' not found in oeufs
-//
-// '' found in cooperative at position 0
-// '' found in cooperative at position 2
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare4.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare4.cs
deleted file mode 100644
index 8aa8cbae65f5d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/compare4.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class CompareStringSample
-{
- public static void Main()
- {
- string str1 = "Apple";
- string str2 = "Æble";
- string str3 = "AEble";
-
- // Set the current culture to Danish in Denmark.
- Thread.CurrentThread.CurrentCulture = new CultureInfo("da-DK");
- Console.WriteLine($"Current culture: {CultureInfo.CurrentCulture.Name}");
- Console.WriteLine($"Comparison of {str1} with {str2}: {String.Compare(str1, str2)}");
- Console.WriteLine($"Comparison of {str2} with {str3}: {String.Compare(str2, str3)}\n");
-
- // Set the current culture to English in the U.S.
- Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
- Console.WriteLine($"Current culture: {CultureInfo.CurrentCulture.Name}");
- Console.WriteLine($"Comparison of {str1} with {str2}: {String.Compare(str1, str2)}");
- Console.WriteLine($"Comparison of {str2} with {str3}: {String.Compare(str2, str3)}\n");
-
- // Perform an ordinal comparison.
- Console.WriteLine("Ordinal comparison");
- Console.WriteLine($"Comparison of {str1} with {str2}: {String.Compare(str1, str2, StringComparison.Ordinal)}");
- Console.WriteLine($"Comparison of {str2} with {str3}: {String.Compare(str2, str3, StringComparison.Ordinal)}");
- }
-}
-// The example displays the following output:
-// Current culture: da-DK
-// Comparison of Apple with Æble: -1
-// Comparison of Æble with AEble: 1
-//
-// Current culture: en-US
-// Comparison of Apple with Æble: 1
-// Comparison of Æble with AEble: 0
-//
-// Ordinal comparison
-// Comparison of Apple with Æble: -133
-// Comparison of Æble with AEble: 133
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/equality1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/equality1.cs
deleted file mode 100644
index dd7b9583e7a8c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/equality1.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class Example4
-{
- public static void Main()
- {
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("tr-TR");
-
- string filePath = "file://c:/notes.txt";
-
- Console.WriteLine("Culture-sensitive test for equality:");
- if (! TestForEquality(filePath, StringComparison.CurrentCultureIgnoreCase))
- Console.WriteLine($"Access to {filePath} is allowed.");
- else
- Console.WriteLine($"Access to {filePath} is not allowed.");
-
- Console.WriteLine("\nOrdinal test for equality:");
- if (! TestForEquality(filePath, StringComparison.OrdinalIgnoreCase))
- Console.WriteLine($"Access to {filePath} is allowed.");
- else
- Console.WriteLine($"Access to {filePath} is not allowed.");
- }
-
- private static bool TestForEquality(string str, StringComparison cmp)
- {
- int position = str.IndexOf("://");
- if (position < 0) return false;
-
- string substring = str.Substring(0, position);
- return substring.Equals("FILE", cmp);
- }
-}
-// The example displays the following output:
-// Culture-sensitive test for equality:
-// Access to file://c:/notes.txt is allowed.
-//
-// Ordinal test for equality:
-// Access to file://c:/notes.txt is not allowed.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/format1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/format1.cs
deleted file mode 100644
index 2690ca050b86f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/format1.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example9
-{
- public static void Main()
- {
- DateTime date = new DateTime(2011, 3, 1);
- CultureInfo[] cultures = { CultureInfo.InvariantCulture,
- new CultureInfo("en-US"),
- new CultureInfo("fr-FR") };
-
- foreach (var culture in cultures)
- Console.WriteLine("{0,-12} {1}", String.IsNullOrEmpty(culture.Name) ?
- "Invariant" : culture.Name,
- date.ToString("d", culture));
- }
-}
-// The example displays the following output:
-// Invariant 03/01/2011
-// en-US 3/1/2011
-// fr-FR 01/03/2011
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/grapheme1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/grapheme1.cs
deleted file mode 100644
index 50bfad1bcb431..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/grapheme1.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.IO;
-
-public class Example5
-{
- public static void Main()
- {
- StreamWriter sw = new StreamWriter(@".\graphemes.txt");
- string grapheme = "\u0061\u0308";
- sw.WriteLine(grapheme);
-
- string singleChar = "\u00e4";
- sw.WriteLine(singleChar);
-
- sw.WriteLine("{0} = {1} (Culture-sensitive): {2}", grapheme, singleChar,
- String.Equals(grapheme, singleChar,
- StringComparison.CurrentCulture));
- sw.WriteLine("{0} = {1} (Ordinal): {2}", grapheme, singleChar,
- String.Equals(grapheme, singleChar,
- StringComparison.Ordinal));
- sw.WriteLine("{0} = {1} (Normalized Ordinal): {2}", grapheme, singleChar,
- String.Equals(grapheme.Normalize(),
- singleChar.Normalize(),
- StringComparison.Ordinal));
- sw.Close();
- }
-}
-// The example produces the following output:
-// ä
-// ä
-// ä = ä (Culture-sensitive): True
-// ä = ä (Ordinal): False
-// ä = ä (Normalized Ordinal): True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/immutable.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/immutable.cs
deleted file mode 100644
index a5524dc496fd9..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/immutable.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Text;
-
-public class Example6
-{
- public static void Main()
- {
- Random rnd = new Random();
-
- string str = String.Empty;
- StreamWriter sw = new StreamWriter(@".\StringFile.txt",
- false, Encoding.Unicode);
-
- for (int ctr = 0; ctr <= 1000; ctr++) {
- str += (char)rnd.Next(1, 0x0530);
- if (str.Length % 60 == 0)
- str += Environment.NewLine;
- }
- sw.Write(str);
- sw.Close();
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/immutable1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/immutable1.cs
deleted file mode 100644
index 3678100ed7b0b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/immutable1.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-using System;
-using System.IO;
-using System.Text;
-
-public class Example10
-{
- public static void Main()
- {
- Random rnd = new Random();
- StringBuilder sb = new StringBuilder();
- StreamWriter sw = new StreamWriter(@".\StringFile.txt",
- false, Encoding.Unicode);
-
- for (int ctr = 0; ctr <= 1000; ctr++) {
- sb.Append((char)rnd.Next(1, 0x0530));
- if (sb.Length % 60 == 0)
- sb.AppendLine();
- }
- sw.Write(sb.ToString());
- sw.Close();
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/index11.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/index11.cs
deleted file mode 100644
index 8085b2d874edb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/index11.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-
-public class Example7
-{
- public static void Main()
- {
- //
- string s1 = "This string consists of a single short sentence.";
- int nWords = 0;
-
- s1 = s1.Trim();
- for (int ctr = 0; ctr < s1.Length; ctr++) {
- if (Char.IsPunctuation(s1[ctr]) | Char.IsWhiteSpace(s1[ctr]))
- nWords++;
- }
- Console.WriteLine($"""
- The sentence
- {s1}
- has {nWords} words.
- """);
- // The example displays the following output:
- // The sentence
- // This string consists of a single short sentence.
- // has 8 words.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/index2.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/index2.cs
deleted file mode 100644
index 2d7275d20daa2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/index2.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-
-public class Example11
-{
- public static void Main()
- {
- //
- string s1 = "This string consists of a single short sentence.";
- int nWords = 0;
-
- s1 = s1.Trim();
- foreach (var ch in s1) {
- if (Char.IsPunctuation(ch) | Char.IsWhiteSpace(ch))
- nWords++;
- }
- Console.WriteLine($"""
- The sentence
- {s1}
- has {nWords} words.
- """);
- // The example displays the following output:
- // The sentence
- // This string consists of a single short sentence.
- // has 8 words.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/index3.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/index3.cs
deleted file mode 100644
index 5f3d64f43d1d4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/index3.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-public class Example12
-{
- public static void Main()
- {
- //
- // First sentence of The Mystery of the Yellow Room, by Leroux.
- string opening = "Ce n'est pas sans une certaine émotion que "+
- "je commence à raconter ici les aventures " +
- "extraordinaires de Joseph Rouletabille.";
- // Character counters.
- int nChars = 0;
- // Objects to store word count.
- List chars = new List();
- List elements = new List();
-
- foreach (var ch in opening) {
- // Skip the ' character.
- if (ch == '\u0027') continue;
-
- if (Char.IsWhiteSpace(ch) | (Char.IsPunctuation(ch))) {
- chars.Add(nChars);
- nChars = 0;
- }
- else {
- nChars++;
- }
- }
-
- System.Globalization.TextElementEnumerator te =
- System.Globalization.StringInfo.GetTextElementEnumerator(opening);
- while (te.MoveNext()) {
- string s = te.GetTextElement();
- // Skip the ' character.
- if (s == "\u0027") continue;
- if ( String.IsNullOrEmpty(s.Trim()) | (s.Length == 1 && Char.IsPunctuation(Convert.ToChar(s)))) {
- elements.Add(nChars);
- nChars = 0;
- }
- else {
- nChars++;
- }
- }
-
- // Display character counts.
- Console.WriteLine("{0,6} {1,20} {2,20}",
- "Word #", "Char Objects", "Characters");
- for (int ctr = 0; ctr < chars.Count; ctr++)
- Console.WriteLine("{0,6} {1,20} {2,20}",
- ctr, chars[ctr], elements[ctr]);
- // The example displays the following output:
- // Word # Char Objects Characters
- // 0 2 2
- // 1 4 4
- // 2 3 3
- // 3 4 4
- // 4 3 3
- // 5 8 8
- // 6 8 7
- // 7 3 3
- // 8 2 2
- // 9 8 8
- // 10 2 1
- // 11 8 8
- // 12 3 3
- // 13 3 3
- // 14 9 9
- // 15 15 15
- // 16 2 2
- // 17 6 6
- // 18 12 12
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/normalize1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/normalize1.cs
deleted file mode 100644
index df24366355326..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/normalize1.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.IO;
-using System.Text;
-
-public class Example13
-{
- private static StreamWriter sw;
-
- public static void Main()
- {
- sw = new StreamWriter(@".\TestNorm1.txt");
-
- // Define three versions of the same word.
- string s1 = "sống"; // create word with U+1ED1
- string s2 = "s\u00F4\u0301ng";
- string s3 = "so\u0302\u0301ng";
-
- TestForEquality(s1, s2, s3);
- sw.WriteLine();
-
- // Normalize and compare strings using each normalization form.
- foreach (string formName in Enum.GetNames(typeof(NormalizationForm)))
- {
- sw.WriteLine("Normalization {0}:\n", formName);
- NormalizationForm nf = (NormalizationForm) Enum.Parse(typeof(NormalizationForm), formName);
- string[] sn = NormalizeStrings(nf, s1, s2, s3);
- TestForEquality(sn);
- sw.WriteLine("\n");
- }
-
- sw.Close();
- }
-
- private static void TestForEquality(params string[] words)
- {
- for (int ctr = 0; ctr <= words.Length - 2; ctr++)
- for (int ctr2 = ctr + 1; ctr2 <= words.Length - 1; ctr2++)
- sw.WriteLine("{0} ({1}) = {2} ({3}): {4}",
- words[ctr], ShowBytes(words[ctr]),
- words[ctr2], ShowBytes(words[ctr2]),
- words[ctr].Equals(words[ctr2], StringComparison.Ordinal));
- }
-
- private static string ShowBytes(string str)
- {
- string result = null;
- foreach (var ch in str)
- result += $"{(ushort)ch:X4} ";
- return result.Trim();
- }
-
- private static string[] NormalizeStrings(NormalizationForm nf, params string[] words)
- {
- for (int ctr = 0; ctr < words.Length; ctr++)
- if (! words[ctr].IsNormalized(nf))
- words[ctr] = words[ctr].Normalize(nf);
- return words;
- }
-}
-// The example displays the following output:
-// sống (0073 1ED1 006E 0067) = sống (0073 00F4 0301 006E 0067): False
-// sống (0073 1ED1 006E 0067) = sống (0073 006F 0302 0301 006E 0067): False
-// sống (0073 00F4 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): False
-//
-// Normalization FormC:
-//
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-//
-//
-// Normalization FormD:
-//
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-//
-//
-// Normalization FormKC:
-//
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-//
-//
-// Normalization FormKD:
-//
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/nullorempty1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/nullorempty1.cs
deleted file mode 100644
index 074d632f36604..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/nullorempty1.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-using System;
-using System.Globalization;
-
-public class Example14
-{
- public static void Main()
- {
- TestForIsNullOrEmpty();
- Console.WriteLine("-----");
- TestForIsNullOrEmptyOrWhitespaceOnly();
- }
-
- private static void TestForIsNullOrEmpty()
- {
- string str = "";
- //
- if (str == null || str.Equals(String.Empty))
- //
- Console.WriteLine("Bad string!");
- else
- Console.WriteLine("Good string!");
- }
-
- private static void TestForIsNullOrEmptyOrWhitespaceOnly()
- {
- string str = null;
- //
- if (str == null || str.Equals(String.Empty) || str.Trim().Equals(String.Empty))
- //
- Console.WriteLine("Bad string!");
- else
- Console.WriteLine("Good string!");
- }
-}
-
-public class Temperature : IFormattable
-{
- double temp;
-
- public Temperature(double temp)
- {
- this.temp = temp;
- }
-
- public override string ToString()
- {
- return this.ToString("G", CultureInfo.CurrentCulture);
- }
-
- public string ToString(string format)
- {
- return this.ToString(format, CultureInfo.CurrentCulture);
- }
-
- //
- public string ToString(string format, IFormatProvider provider)
- {
- if (String.IsNullOrEmpty(format)) format = "G";
- if (provider == null) provider = CultureInfo.CurrentCulture;
-
- switch (format.ToUpperInvariant())
- {
- // Return degrees in Celsius.
- case "G":
- case "C":
- return temp.ToString("F2", provider) + "°C";
- // Return degrees in Fahrenheit.
- case "F":
- return (temp * 9 / 5 + 32).ToString("F2", provider) + "°F";
- // Return degrees in Kelvin.
- case "K":
- return (temp + 273.15).ToString();
- default:
- throw new FormatException(
- String.Format("The {0} format string is not supported.",
- format));
- }
- }
- //
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/parse1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/parse1.cs
deleted file mode 100644
index 096364312103d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/parse1.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example15
-{
- public static void Main()
- {
- string dateString = "07/10/2011";
- CultureInfo[] cultures = { CultureInfo.InvariantCulture,
- CultureInfo.CreateSpecificCulture("en-GB"),
- CultureInfo.CreateSpecificCulture("en-US") };
- Console.WriteLine("{0,-12} {1,10} {2,8} {3,8}\n", "Date String", "Culture",
- "Month", "Day");
- foreach (var culture in cultures) {
- DateTime date = DateTime.Parse(dateString, culture);
- Console.WriteLine("{0,-12} {1,10} {2,8} {3,8}", dateString,
- String.IsNullOrEmpty(culture.Name) ?
- "Invariant" : culture.Name,
- date.Month, date.Day);
- }
- }
-}
-// The example displays the following output:
-// Date String Culture Month Day
-//
-// 07/10/2011 Invariant 7 10
-// 07/10/2011 en-GB 10 7
-// 07/10/2011 en-US 7 10
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/program.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/program.cs
deleted file mode 100644
index 342d923f6c125..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/program.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-using System;
-
-public class Example16
-{
- public static void Main()
- {
- InstantiateByAssignment();
- Console.WriteLine("-----");
- CallConstructors();
- Console.WriteLine("-----");
- Concatenate();
- Console.WriteLine("-----");
- ExtractString();
- Console.WriteLine("-----");
- Formatting();
- }
-
- private static void InstantiateByAssignment()
- {
- //
- string string1 = "This is a string created by assignment.";
- Console.WriteLine(string1);
- string string2a = "The path is C:\\PublicDocuments\\Report1.doc";
- Console.WriteLine(string2a);
- string string2b = @"The path is C:\PublicDocuments\Report1.doc";
- Console.WriteLine(string2b);
- // The example displays the following output:
- // This is a string created by assignment.
- // The path is C:\PublicDocuments\Report1.doc
- // The path is C:\PublicDocuments\Report1.doc
- //
- }
-
- private static void CallConstructors()
- {
- //
- char[] chars = { 'w', 'o', 'r', 'd' };
- sbyte[] bytes = { 0x41, 0x42, 0x43, 0x44, 0x45, 0x00 };
-
- // Create a string from a character array.
- string string1 = new string(chars);
- Console.WriteLine(string1);
-
- // Create a string that consists of a character repeated 20 times.
- string string2 = new string('c', 20);
- Console.WriteLine(string2);
-
- string stringFromBytes = null;
- string stringFromChars = null;
- unsafe
- {
- fixed (sbyte* pbytes = bytes)
- {
- // Create a string from a pointer to a signed byte array.
- stringFromBytes = new string(pbytes);
- }
- fixed (char* pchars = chars)
- {
- // Create a string from a pointer to a character array.
- stringFromChars = new string(pchars);
- }
- }
- Console.WriteLine(stringFromBytes);
- Console.WriteLine(stringFromChars);
- // The example displays the following output:
- // word
- // cccccccccccccccccccc
- // ABCDE
- // word
- //
- }
-
- private static void Concatenate()
- {
- //
- string string1 = "Today is " + DateTime.Now.ToString("D") + ".";
- Console.WriteLine(string1);
-
- string string2 = "This is one sentence. " + "This is a second. ";
- string2 += "This is a third sentence.";
- Console.WriteLine(string2);
- // The example displays output like the following:
- // Today is Tuesday, July 06, 2011.
- // This is one sentence. This is a second. This is a third sentence.
- //
- }
-
- private static void ExtractString()
- {
- //
- string sentence = "This sentence has five words.";
- // Extract the second word.
- int startPosition = sentence.IndexOf(" ") + 1;
- string word2 = sentence.Substring(startPosition,
- sentence.IndexOf(" ", startPosition) - startPosition);
- Console.WriteLine("Second word: " + word2);
- // The example displays the following output:
- // Second word: sentence
- //
- }
-
- private static void Formatting()
- {
- //
- DateTime dateAndTime = new DateTime(2011, 7, 6, 7, 32, 0);
- double temperature = 68.3;
- string result = String.Format("At {0:t} on {0:D}, the temperature was {1:F1} degrees Fahrenheit.",
- dateAndTime, temperature);
- Console.WriteLine(result);
- // The example displays the following output:
- // At 7:32 AM on Wednesday, July 06, 2011, the temperature was 68.3 degrees Fahrenheit.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/search1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/search1.cs
deleted file mode 100644
index b2828ea6c9395..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/search1.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-using System;
-using System.Globalization;
-
-public class Example17
-{
- public static void Main()
- {
- String[] cultureNames = { "da-DK", "en-US" };
- CompareInfo ci;
- String str = "aerial";
- Char ch = 'æ'; // U+00E6
-
- Console.Write("Ordinal comparison -- ");
- Console.WriteLine($"Position of '{ch}' in {str}: {str.IndexOf(ch)}");
-
- foreach (var cultureName in cultureNames) {
- ci = CultureInfo.CreateSpecificCulture(cultureName).CompareInfo;
- Console.Write("{0} cultural comparison -- ", cultureName);
- Console.WriteLine($"Position of '{ch}' in {str}: {ci.IndexOf(str, ch)}");
- }
- }
-}
-// The example displays the following output:
-// Ordinal comparison -- Position of 'æ' in aerial: -1
-// da-DK cultural comparison -- Position of 'æ' in aerial: -1
-// en-US cultural comparison -- Position of 'æ' in aerial: 0
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/sort1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/sort1.cs
deleted file mode 100644
index fd1eaf9bd1eea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/sort1.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-using System;
-using System.Globalization;
-using System.Threading;
-
-public class ArraySort
-{
- public static void Main(String[] args)
- {
- // Create and initialize a new array to store the strings.
- string[] stringArray = { "Apple", "Æble", "Zebra"};
-
- // Display the values of the array.
- Console.WriteLine( "The original string array:");
- PrintIndexAndValues(stringArray);
-
- // Set the CurrentCulture to "en-US".
- Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
- // Sort the values of the array.
- Array.Sort(stringArray);
-
- // Display the values of the array.
- Console.WriteLine("After sorting for the culture \"en-US\":");
- PrintIndexAndValues(stringArray);
-
- // Set the CurrentCulture to "da-DK".
- Thread.CurrentThread.CurrentCulture = new CultureInfo("da-DK");
- // Sort the values of the Array.
- Array.Sort(stringArray);
-
- // Display the values of the array.
- Console.WriteLine("After sorting for the culture \"da-DK\":");
- PrintIndexAndValues(stringArray);
- }
- public static void PrintIndexAndValues(string[] myArray)
- {
- for (int i = myArray.GetLowerBound(0); i <=
- myArray.GetUpperBound(0); i++ )
- Console.WriteLine($"[{i}]: {myArray[i]}");
- Console.WriteLine();
- }
-}
-// The example displays the following output:
-// The original string array:
-// [0]: Apple
-// [1]: Æble
-// [2]: Zebra
-//
-// After sorting for the "en-US" culture:
-// [0]: Æble
-// [1]: Apple
-// [2]: Zebra
-//
-// After sorting for the culture "da-DK":
-// [0]: Apple
-// [1]: Zebra
-// [2]: Æble
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/surrogate1.cs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/surrogate1.cs
deleted file mode 100644
index 18b5cd6f57768..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/csharp/surrogate1.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-
-public class Example18
-{
- public static void Main()
- {
- //
- string surrogate = "\uD800\uDC03";
- for (int ctr = 0; ctr < surrogate.Length; ctr++)
- Console.Write($"U+{(ushort)surrogate[ctr]:X2} ");
-
- Console.WriteLine();
- Console.WriteLine($" Is Surrogate Pair: {Char.IsSurrogatePair(surrogate[0], surrogate[1])}");
- // The example displays the following output:
- // U+D800 U+DC03
- // Is Surrogate Pair: True
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/case1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/case1.fs
deleted file mode 100644
index 986325c41de8e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/case1.fs
+++ /dev/null
@@ -1,47 +0,0 @@
-module case1.fs
-//
-open System
-open System.Globalization
-open System.IO
-
-let showHexValue (s: string) =
- let mutable retval = ""
- for ch in s do
- let bytes = BitConverter.GetBytes ch
- retval <- retval + String.Format("{0:X2} {1:X2} ", bytes[1], bytes[0])
- retval
-
-do
- use sw = new StreamWriter(@".\case.txt")
- let words = [| "file"; "sıfır"; "Dženana" |]
- let cultures =
- [| CultureInfo.InvariantCulture
- CultureInfo "en-US"
- CultureInfo "tr-TR" |]
-
- for word in words do
- sw.WriteLine("{0}:", word)
- for culture in cultures do
- let name =
- if String.IsNullOrEmpty culture.Name then "Invariant" else culture.Name
- let upperWord = word.ToUpper culture
- sw.WriteLine(" {0,10}: {1,7} {2, 38}", name, upperWord, showHexValue upperWord)
- sw.WriteLine()
- sw.Close()
-
-// The example displays the following output:
-// file:
-// Invariant: FILE 00 46 00 49 00 4C 00 45
-// en-US: FILE 00 46 00 49 00 4C 00 45
-// tr-TR: FİLE 00 46 01 30 00 4C 00 45
-//
-// sıfır:
-// Invariant: SıFıR 00 53 01 31 00 46 01 31 00 52
-// en-US: SIFIR 00 53 00 49 00 46 00 49 00 52
-// tr-TR: SIFIR 00 53 00 49 00 46 00 49 00 52
-//
-// Dženana:
-// Invariant: DžENANA 01 C5 00 45 00 4E 00 41 00 4E 00 41
-// en-US: DŽENANA 01 C4 00 45 00 4E 00 41 00 4E 00 41
-// tr-TR: DŽENANA 01 C4 00 45 00 4E 00 41 00 4E 00 41
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/case2.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/case2.fs
deleted file mode 100644
index 044f74ce5d8aa..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/case2.fs
+++ /dev/null
@@ -1,37 +0,0 @@
-module case2.fs
-//
-open System
-open System.Globalization
-open System.Threading
-
-let disallowed = "file"
-
-let isAccessAllowed (resource: string) =
- let cultures =
- [| CultureInfo.CreateSpecificCulture "en-US"
- CultureInfo.CreateSpecificCulture "tr-TR" |]
- let index = resource.IndexOfAny [| '\\'; '/' |]
- let scheme =
- if index > 0 then
- resource.Substring(0, index - 1)
- else
- null
-
- // Change the current culture and perform the comparison.
- for culture in cultures do
- Thread.CurrentThread.CurrentCulture <- culture
- printfn $"Culture: {CultureInfo.CurrentCulture.DisplayName}"
- printfn $"{resource}"
- printfn $"Access allowed: {String.Equals(disallowed, scheme, StringComparison.CurrentCultureIgnoreCase) |> not}"
- printfn ""
-
-isAccessAllowed @"FILE:\\\c:\users\user001\documents\FinancialInfo.txt"
-// The example displays the following output:
-// Culture: English (United States)
-// FILE:\\\c:\users\user001\documents\FinancialInfo.txt
-// Access allowed: False
-//
-// Culture: Turkish (Turkey)
-// FILE:\\\c:\users\user001\documents\FinancialInfo.txt
-// Access allowed: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare11.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare11.fs
deleted file mode 100644
index a0fb709fc7e29..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare11.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module compare11.fs
-//
-open System
-open System.Globalization
-open System.Threading
-
-Thread.CurrentThread.CurrentCulture <- CultureInfo.CreateSpecificCulture "en-US"
-printfn $"""{String.Compare("A", "a", StringComparison.CurrentCulture)}"""
-printfn $"""{String.Compare("A", "a", StringComparison.Ordinal)}"""
-// The example displays the following output:
-// 1
-// -32
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare2.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare2.fs
deleted file mode 100644
index 3281cc9501930..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare2.fs
+++ /dev/null
@@ -1,45 +0,0 @@
-module compare2.fs
-//
-open System
-open System.Collections.Generic
-open System.Globalization
-
-// IComparer implementation to perform string sort using an F# object expression.
-let scompare =
- { new IComparer with
- member _.Compare(x, y) =
- CultureInfo.CurrentCulture.CompareInfo.Compare(x, y, CompareOptions.StringSort) }
-
-let strings = [| "coop"; "co-op"; "cooperative"; "co\u00ADoperative"; "cœur"; "coeur" |]
-
-// Perform a word sort using the current (en-US) culture.
-let current = Array.copy strings
-Array.Sort(current, StringComparer.CurrentCulture)
-
-// Perform a word sort using the invariant culture.
-let invariant = Array.copy strings
-Array.Sort(invariant, StringComparer.InvariantCulture)
-
-// Perform an ordinal sort.
-let ordinal = Array.copy strings
-Array.Sort(ordinal, StringComparer.Ordinal)
-
-// Perform a string sort using the current culture.
-let stringSort = Array.copy strings
-Array.Sort(stringSort, scompare)
-
-// Display array values
-printfn "%13s %13s %15s %13s %13s\n" "Original" "Word Sort" "Invariant Word" "Ordinal Sort" "String Sort"
-for i = 0 to strings.Length - 1 do
- printfn "%13s %13s %15s %13s %13s\n" strings[i] current[i] invariant[i] ordinal[i] stringSort[i]
-
-// The example displays the following output:
-// Original Word Sort Invariant Word Ordinal Sort String Sort
-//
-// coop cœur cœur co-op co-op
-// co-op coeur coeur coeur cœur
-// cooperative coop coop coop coeur
-// cooperative co-op co-op cooperative coop
-// cœur cooperative cooperative cooperative cooperative
-// coeur cooperative cooperative cœur cooperative
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare3.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare3.fs
deleted file mode 100644
index 7b3833ca1661d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare3.fs
+++ /dev/null
@@ -1,33 +0,0 @@
-module compare3.fs
-//
-open System
-
-let findInString (s: string) (substring: string) (options: StringComparison) =
- let result = s.IndexOf(substring, options)
- if result <> -1 then
- printfn $"'{substring}' found in {s} at position {result}"
- else
- printfn $"'{substring}' not found in {s}"
-
-// Search for "oe" and "œu" in "œufs" and "oeufs".
-let s1 = "œufs"
-let s2 = "oeufs"
-findInString s1 "oe" StringComparison.CurrentCulture
-findInString s1 "oe" StringComparison.Ordinal
-findInString s2 "œu" StringComparison.CurrentCulture
-findInString s2 "œu" StringComparison.Ordinal
-printfn ""
-
-let s3 = "co\u00ADoperative"
-findInString s3 "\u00AD" StringComparison.CurrentCulture
-findInString s3 "\u00AD" StringComparison.Ordinal
-
-// The example displays the following output:
-// 'oe' found in œufs at position 0
-// 'oe' not found in œufs
-// 'œu' found in oeufs at position 0
-// 'œu' not found in oeufs
-//
-// '' found in cooperative at position 0
-// '' found in cooperative at position 2
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare4.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare4.fs
deleted file mode 100644
index 0f577ab026be7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/compare4.fs
+++ /dev/null
@@ -1,39 +0,0 @@
-module compare4.fs
-//
-open System
-open System.Globalization
-open System.Threading
-
-let str1 = "Apple"
-let str2 = "Æble"
-let str3 = "AEble"
-
-// Set the current culture to Danish in Denmark.
-Thread.CurrentThread.CurrentCulture <- CultureInfo "da-DK"
-printfn $"Current culture: {CultureInfo.CurrentCulture.Name}"
-printfn $"Comparison of {str1} with {str2}: {String.Compare(str1, str2)}"
-printfn $"Comparison of {str2} with {str3}: {String.Compare(str2, str3)}\n"
-
-// Set the current culture to English in the U.S.
-Thread.CurrentThread.CurrentCulture <- CultureInfo "en-US"
-printfn $"Current culture: {CultureInfo.CurrentCulture.Name}"
-printfn $"Comparison of {str1} with {str2}: {String.Compare(str1, str2)}"
-printfn $"Comparison of {str2} with {str3}: {String.Compare(str2, str3)}\n"
-
-// Perform an ordinal comparison.
-printfn "Ordinal comparison"
-printfn $"Comparison of {str1} with {str2}: {String.Compare(str1, str2, StringComparison.Ordinal)}"
-printfn $"Comparison of {str2} with {str3}: {String.Compare(str2, str3, StringComparison.Ordinal)}"
-// The example displays the following output:
-// Current culture: da-DK
-// Comparison of Apple with Æble: -1
-// Comparison of Æble with AEble: 1
-//
-// Current culture: en-US
-// Comparison of Apple with Æble: 1
-// Comparison of Æble with AEble: 0
-//
-// Ordinal comparison
-// Comparison of Apple with Æble: -133
-// Comparison of Æble with AEble: 133
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/equality1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/equality1.fs
deleted file mode 100644
index b3499ad6b01b2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/equality1.fs
+++ /dev/null
@@ -1,36 +0,0 @@
-module equality1.fs
-//
-open System
-open System.Globalization
-open System.Threading
-
-let testForEquality (str: string) (cmp: StringComparison) =
- let position = str.IndexOf "://"
- if position < 0 then false
- else
- let substring = str.Substring(0, position)
- substring.Equals("FILE", cmp)
-
-Thread.CurrentThread.CurrentCulture <- CultureInfo.CreateSpecificCulture "tr-TR"
-
-let filePath = "file://c:/notes.txt"
-
-printfn "Culture-sensitive test for equality:"
-if not (testForEquality filePath StringComparison.CurrentCultureIgnoreCase) then
- printfn $"Access to {filePath} is allowed."
-else
- printfn $"Access to {filePath} is not allowed."
-
-printfn "\nOrdinal test for equality:"
-if not (testForEquality filePath StringComparison.OrdinalIgnoreCase) then
- printfn $"Access to {filePath} is allowed."
-else
- printfn $"Access to {filePath} is not allowed."
-
-// The example displays the following output:
-// Culture-sensitive test for equality:
-// Access to file://c:/notes.txt is allowed.
-//
-// Ordinal test for equality:
-// Access to file://c:/notes.txt is not allowed.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/format1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/format1.fs
deleted file mode 100644
index b0fdb141e7821..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/format1.fs
+++ /dev/null
@@ -1,18 +0,0 @@
-module format1.fs
-//
-open System
-open System.Globalization
-
-let date = DateTime(2011, 3, 1)
-let cultures =
- [| CultureInfo.InvariantCulture
- CultureInfo "en-US"
- CultureInfo "fr-FR" |]
-
-for culture in cultures do
- printfn $"""{(if String.IsNullOrEmpty culture.Name then "Invariant" else culture.Name),-12} {date.ToString("d", culture)}"""
-// The example displays the following output:
-// Invariant 03/01/2011
-// en-US 3/1/2011
-// fr-FR 01/03/2011
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/grapheme1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/grapheme1.fs
deleted file mode 100644
index 2612a218c82eb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/grapheme1.fs
+++ /dev/null
@@ -1,30 +0,0 @@
-module grapheme1.fs
-//
-open System
-open System.IO
-
-do
- use sw = new StreamWriter(@".\graphemes.txt")
- let grapheme = "\u0061\u0308"
- sw.WriteLine grapheme
-
- let singleChar = "\u00e4"
- sw.WriteLine singleChar
-
- sw.WriteLine("{0} = {1} (Culture-sensitive): {2}", grapheme, singleChar,
- String.Equals(grapheme, singleChar,
- StringComparison.CurrentCulture))
- sw.WriteLine("{0} = {1} (Ordinal): {2}", grapheme, singleChar,
- String.Equals(grapheme, singleChar,
- StringComparison.Ordinal))
- sw.WriteLine("{0} = {1} (Normalized Ordinal): {2}", grapheme, singleChar,
- String.Equals(grapheme.Normalize(),
- singleChar.Normalize(),
- StringComparison.Ordinal))
-// The example produces the following output:
-// ä
-// ä
-// ä = ä (Culture-sensitive): True
-// ä = ä (Ordinal): False
-// ä = ä (Normalized Ordinal): True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/immutable.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/immutable.fs
deleted file mode 100644
index caff5a4a14c32..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/immutable.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module immutable.fs
-//
-open System
-open System.IO
-open System.Text
-
-do
- let rnd = Random()
-
- let mutable str = String.Empty
- use sw = new StreamWriter(@".\StringFile.txt", false, Encoding.Unicode)
- for _ = 0 to 1000 do
- str <- str + (rnd.Next(1, 0x0530) |> char |> string)
- if str.Length % 60 = 0 then
- str <- str + Environment.NewLine
- sw.Write str
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/immutable1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/immutable1.fs
deleted file mode 100644
index 3021b909a6bfb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/immutable1.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module immutable1.fs
-//
-open System
-open System.IO
-open System.Text
-
-do
- let rnd = Random()
- let sb = StringBuilder()
- use sw = new StreamWriter(@".\StringFile.txt", false, Encoding.Unicode)
-
- for _ = 0 to 1000 do
- sb.Append(rnd.Next(1, 0x0530) |> char) |> ignore
- if sb.Length % 60 = 0 then
- sb.AppendLine() |> ignore
- sw.Write(string sb)
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/index11.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/index11.fs
deleted file mode 100644
index 1aba2fa8603b4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/index11.fs
+++ /dev/null
@@ -1,16 +0,0 @@
-module index11.fs
-open System
-
-//
-let s1 = "This string consists of a single short sentence."
-let mutable nWords = 0
-
-for i = 0 to s1.Length - 1 do
- if Char.IsPunctuation s1[i] || Char.IsWhiteSpace s1[i] then
- nWords <- nWords + 1
-printfn $"The sentence\n {s1}\nhas {nWords} words."
-// The example displays the following output:
-// The sentence
-// This string consists of a single short sentence.
-// has 8 words.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/index2.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/index2.fs
deleted file mode 100644
index a17e38e19d548..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/index2.fs
+++ /dev/null
@@ -1,16 +0,0 @@
-module index2.fs
-open System
-
-//
-let s1 = "This string consists of a single short sentence."
-let mutable nWords = 0
-
-for ch in s1 do
- if Char.IsPunctuation ch || Char.IsWhiteSpace ch then
- nWords <- nWords + 1
-printfn $"The sentence\n {s1}\nhas {nWords} words."
-// The example displays the following output:
-// The sentence
-// This string consists of a single short sentence.
-// has 8 words.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/index3.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/index3.fs
deleted file mode 100644
index 31cc98bceaf68..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/index3.fs
+++ /dev/null
@@ -1,59 +0,0 @@
-module index3.fs
-//
-open System
-open System.Globalization
-
-// First sentence of The Mystery of the Yellow Room, by Leroux.
-let opening = "Ce n'est pas sans une certaine émotion que je commence à raconter ici les aventures extraordinaires de Joseph Rouletabille."
-// Character counters.
-let mutable nChars = 0
-// Objects to store word count.
-let chars = ResizeArray()
-let elements = ResizeArray()
-
-for ch in opening do
- // Skip the ' character.
- if ch <> '\u0027' then
- if Char.IsWhiteSpace ch || Char.IsPunctuation ch then
- chars.Add nChars
- nChars <- 0
- else
- nChars <- nChars + 1
-
-let te = StringInfo.GetTextElementEnumerator opening
-while te.MoveNext() do
- let s = te.GetTextElement()
- // Skip the ' character.
- if s <> "\u0027" then
- if String.IsNullOrEmpty(s.Trim()) || (s.Length = 1 && Char.IsPunctuation(Convert.ToChar s)) then
- elements.Add nChars
- nChars <- 0
- else
- nChars <- nChars + 1
-
-// Display character counts.
-printfn "%6s %20s %20s" "Word #" "Char Objects " "Characters"
-for i = 0 to chars.Count - 1 do
- printfn "%6d %20d %20d" i chars[i] elements[i]
-// The example displays the following output:
-// Word # Char Objects Characters
-// 0 2 2
-// 1 4 4
-// 2 3 3
-// 3 4 4
-// 4 3 3
-// 5 8 8
-// 6 8 7
-// 7 3 3
-// 8 2 2
-// 9 8 8
-// 10 2 1
-// 11 8 8
-// 12 3 3
-// 13 3 3
-// 14 9 9
-// 15 15 15
-// 16 2 2
-// 17 6 6
-// 18 12 12
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/normalize1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/normalize1.fs
deleted file mode 100644
index 177ecfdf36829..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/normalize1.fs
+++ /dev/null
@@ -1,77 +0,0 @@
-module normalize1.fs
-//
-open System
-open System.IO
-open System.Text
-
-do
- use sw = new StreamWriter(@".\TestNorm1.txt")
-
- let showBytes (str: string) =
- let mutable result = ""
- for ch in str do
- result <- result + $"{uint16 ch:X4} "
- result.Trim()
-
- let testForEquality (words: string[]) =
- for ctr = 0 to words.Length - 2 do
- for ctr2 = ctr + 1 to words.Length - 1 do
- sw.WriteLine("{0} ({1}) = {2} ({3}): {4}",
- words[ctr], showBytes(words[ctr]),
- words[ctr2], showBytes(words[ctr2]),
- words[ctr].Equals(words[ctr2], StringComparison.Ordinal))
-
- let normalizeStrings nf (words: string[]) =
- for i = 0 to words.Length - 1 do
- if not (words[i].IsNormalized nf) then
- words[i] <- words[i].Normalize nf
- words
-
- // Define three versions of the same word.
- let s1 = "sống" // create word with U+1ED1
- let s2 = "s\u00F4\u0301ng"
- let s3 = "so\u0302\u0301ng"
-
- testForEquality [| s1; s2; s3 |]
- sw.WriteLine()
-
- // Normalize and compare strings using each normalization form.
- for formName in Enum.GetNames typeof do
- sw.WriteLine("Normalization {0}:\n", formName)
- let nf = Enum.Parse(typeof, formName) :?> NormalizationForm
- let sn = normalizeStrings nf [| s1; s2; s3|]
- testForEquality sn
- sw.WriteLine "\n"
-
-// The example displays the following output:
-// sống (0073 1ED1 006E 0067) = sống (0073 00F4 0301 006E 0067): False
-// sống (0073 1ED1 006E 0067) = sống (0073 006F 0302 0301 006E 0067): False
-// sống (0073 00F4 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): False
-//
-// Normalization FormC:
-//
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-//
-//
-// Normalization FormD:
-//
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-//
-//
-// Normalization FormKC:
-//
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-// sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-//
-//
-// Normalization FormKD:
-//
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-// sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/nullorempty1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/nullorempty1.fs
deleted file mode 100644
index 8f128c0948bde..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/nullorempty1.fs
+++ /dev/null
@@ -1,57 +0,0 @@
-module nullorempty1.fs
-open System
-open System.Globalization
-
-let testForIsNullOrEmpty () =
- let str = ""
- //
- if str = null || str.Equals String.Empty then
- //
- printfn "Bad string!"
- else
- printfn "Good string!"
-
-let testForIsNullOrEmptyOrWhitespaceOnly () =
- let str: string = null
- //
- if str = null || str.Equals String.Empty || str.Trim().Equals String.Empty then
- //
- printfn "Bad string!"
- else
- printfn "Good string!"
-
-type Temperature(temp: double) =
- override this.ToString() =
- (this :> IFormattable).ToString("G", CultureInfo.CurrentCulture :> IFormatProvider)
-
- member this.ToString(format) =
- (this :> IFormattable).ToString(format, CultureInfo.CurrentCulture)
-
- interface IFormattable with
- //
- member _.ToString(format: string, provider: IFormatProvider) =
- let format =
- if String.IsNullOrEmpty format then "G" else format
-
- let provider: IFormatProvider =
- if provider = null then CultureInfo.CurrentCulture else provider
-
- match format.ToUpperInvariant() with
- // Return degrees in Celsius.
- | "G"
- | "C" ->
- temp.ToString("F2", provider) + "°C"
- // Return degrees in Fahrenheit.
- | "F" ->
- (temp * 9. / 5. + 32.).ToString("F2", provider) + "°F"
- // Return degrees in Kelvin.
- | "K" ->
- (temp + 273.15).ToString()
- | _ ->
- raise (FormatException(String.Format("The {0} format string is not supported.",format)))
- //
-
-
-testForIsNullOrEmpty ()
-printfn "-----"
-testForIsNullOrEmptyOrWhitespaceOnly ()
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/parse1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/parse1.fs
deleted file mode 100644
index a9c5bdb63d1cb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/parse1.fs
+++ /dev/null
@@ -1,21 +0,0 @@
-module parse1.fs
-//
-open System
-open System.Globalization
-
-let dateString = "07/10/2011"
-let cultures =
- [| CultureInfo.InvariantCulture
- CultureInfo.CreateSpecificCulture "en-GB"
- CultureInfo.CreateSpecificCulture "en-US" |]
-printfn $"""{"Date String",-12} {"Culture",10} {"Month",8} {"Day",8}\n"""
-for culture in cultures do
- let date = DateTime.Parse(dateString, culture)
- printfn $"""{dateString,-12} {(if String.IsNullOrEmpty culture.Name then "Invariant" else culture.Name),10} {date.Month,8} {date.Day,8}"""
-// The example displays the following output:
-// Date String Culture Month Day
-//
-// 07/10/2011 Invariant 7 10
-// 07/10/2011 en-GB 10 7
-// 07/10/2011 en-US 7 10
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/program.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/program.fs
deleted file mode 100644
index 12315c45ca34f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/program.fs
+++ /dev/null
@@ -1,92 +0,0 @@
-module program.fs
-#nowarn "9"
-open System
-let instantiateByAssignment () =
- //
- let string1 = "This is a string created by assignment."
- printfn "%s" string1
- let string2a = "The path is C:\\PublicDocuments\\Report1.doc"
- printfn "%s" string2a
- let string2b = @"The path is C:\PublicDocuments\Report1.doc"
- printfn "%s" string2b
- // The example displays the following output:
- // This is a string created by assignment.
- // The path is C:\PublicDocuments\Report1.doc
- // The path is C:\PublicDocuments\Report1.doc
- //
-
-let callConstructors () =
- //
- let chars = [| 'w'; 'o'; 'r'; 'd' |]
- let bytes = [| 0x41y; 0x42y; 0x43y; 0x44y; 0x45y; 0x00y |]
-
- // Create a string from a character array.
- let string1 = String chars
- printfn "%s" string1
-
- // Create a string that consists of a character repeated 20 times.
- let string2 = String('c', 20)
- printfn "%s" string2
-
- let stringFromBytes =
- // Create a string from a pointer to a signed byte array.
- use pbytes = fixed bytes
- String pbytes
- let stringFromChars =
- // Create a string from a pointer to a character array.
- use pchars = fixed chars
- String pchars
-
- printfn $"{stringFromBytes}"
- printfn $"{stringFromChars}"
- // The example displays the following output:
- // word
- // cccccccccccccccccccc
- // ABCDE
- // word
- //
-
-let concatenate () =
- //
- let string1 = "Today is " + DateTime.Now.ToString("D") + "."
- printfn $"{string1}"
-
- let string2 = "This is one sentence. " + "This is a second. "
- let string2 = string2 + "This is a third sentence."
- printfn $"{string2}"
- // The example displays output like the following:
- // Today is Tuesday, July 06, 2011.
- // This is one sentence. This is a second. This is a third sentence.
- //
-
-let extractString () =
- //
- let sentence = "This sentence has five words."
- // Extract the second word.
- let startPosition = sentence.IndexOf " " + 1
- let word2 =
- sentence.Substring(startPosition, sentence.IndexOf(" ", startPosition) - startPosition)
- printfn $"Second word: {word2}"
- // The example displays the following output:
- // Second word: sentence
- //
-
-let formatting () =
- //
- let dateAndTime = DateTime(2011, 7, 6, 7, 32, 0)
- let temperature = 68.3
- String.Format("At {0:t} on {0:D}, the temperature was {1:F1} degrees Fahrenheit.", dateAndTime, temperature)
- |> printfn "%s"
- // The example displays the following output:
- // At 7:32 AM on Wednesday, July 06, 2011, the temperature was 68.3 degrees Fahrenheit.
- //
-
-instantiateByAssignment ()
-printfn "-----"
-callConstructors ()
-printfn "-----"
-concatenate ()
-printfn "-----"
-extractString ()
-printfn "-----"
-formatting ()
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/search1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/search1.fs
deleted file mode 100644
index 67b1d7360c6c7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/search1.fs
+++ /dev/null
@@ -1,20 +0,0 @@
-module search1.fs
-//
-open System.Globalization
-
-let cultureNames = [| "da-DK"; "en-US" |]
-let str = "aerial"
-let ch = 'æ' // U+00E6
-
-printf "Ordinal comparison -- "
-printfn $"Position of '{ch}' in {str}: {str.IndexOf ch}"
-
-for cultureName in cultureNames do
- let ci = CultureInfo.CreateSpecificCulture(cultureName).CompareInfo
- printf $"{cultureName} cultural comparison -- "
- printfn $"Position of '{ch}' in {str}: {ci.IndexOf(str, ch)}"
-// The example displays the following output:
-// Ordinal comparison -- Position of 'æ' in aerial: -1
-// da-DK cultural comparison -- Position of 'æ' in aerial: -1
-// en-US cultural comparison -- Position of 'æ' in aerial: 0
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/sort1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/sort1.fs
deleted file mode 100644
index f0a07b74a1e2f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/sort1.fs
+++ /dev/null
@@ -1,51 +0,0 @@
-module sort1.fs
-//
-open System
-open System.Globalization
-open System.Threading
-
-let printIndexAndValues (myArray: string[]) =
- for i = myArray.GetLowerBound 0 to myArray.GetUpperBound 0 do
- printfn $"[{i}]: {myArray[i]}"
- printfn ""
-
-// Create and initialize a new array to store the strings.
-let stringArray = [| "Apple"; "Æble"; "Zebra" |]
-
-// Display the values of the array.
-printfn "The original string array:"
-printIndexAndValues stringArray
-
-// Set the CurrentCulture to "en-US".
-Thread.CurrentThread.CurrentCulture <- CultureInfo "en-US"
-// Sort the values of the array.
-Array.Sort stringArray
-
-// Display the values of the array.
-printfn "After sorting for the culture \"en-US\":"
-printIndexAndValues stringArray
-
-// Set the CurrentCulture to "da-DK".
-Thread.CurrentThread.CurrentCulture <- CultureInfo "da-DK"
-// Sort the values of the Array.
-Array.Sort stringArray
-
-// Display the values of the array.
-printfn "After sorting for the culture \"da-DK\":"
-printIndexAndValues stringArray
-// The example displays the following output:
-// The original string array:
-// [0]: Apple
-// [1]: Æble
-// [2]: Zebra
-//
-// After sorting for the "en-US" culture:
-// [0]: Æble
-// [1]: Apple
-// [2]: Zebra
-//
-// After sorting for the culture "da-DK":
-// [0]: Apple
-// [1]: Zebra
-// [2]: Æble
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/surrogate1.fs b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/surrogate1.fs
deleted file mode 100644
index 0a8f88e6af0fe..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/surrogate1.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module surrogate1.fs
-//
-open System
-
-let surrogate = "\uD800\uDC03"
-for i = 0 to surrogate.Length - 1 do
- printf $"U+{uint16 surrogate[i]:X2} "
-
-printfn $"\n Is Surrogate Pair: {Char.IsSurrogatePair(surrogate[0], surrogate[1])}"
-// The example displays the following output:
-// U+D800 U+DC03
-// Is Surrogate Pair: True
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/case1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/case1.vb
deleted file mode 100644
index 3c508dc5a1b5b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/case1.vb
+++ /dev/null
@@ -1,57 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-Option Infer On
-
-'
-Imports System.Globalization
-Imports System.IO
-
-Module Example1
- Public Sub Main()
- Dim sw As New StreamWriter(".\case.txt")
- Dim words As String() = {"file", "sıfır", "Dženana"}
- Dim cultures() As CultureInfo = {CultureInfo.InvariantCulture,
- New CultureInfo("en-US"),
- New CultureInfo("tr-TR")}
-
- For Each word In words
- sw.WriteLine("{0}:", word)
- For Each culture In cultures
- Dim name As String = If(String.IsNullOrEmpty(culture.Name),
- "Invariant", culture.Name)
- Dim upperWord As String = word.ToUpper(culture)
- sw.WriteLine(" {0,10}: {1,7} {2, 38}", name,
- upperWord, ShowHexValue(upperWord))
-
- Next
- sw.WriteLine()
- Next
- sw.Close()
- End Sub
-
- Private Function ShowHexValue(s As String) As String
- Dim retval As String = Nothing
- For Each ch In s
- Dim bytes() As Byte = BitConverter.GetBytes(ch)
- retval += String.Format("{0:X2} {1:X2} ", bytes(1), bytes(0))
- Next
- Return retval
- End Function
-End Module
-' The example displays the following output:
-' file:
-' Invariant: FILE 00 46 00 49 00 4C 00 45
-' en-US: FILE 00 46 00 49 00 4C 00 45
-' tr-TR: FİLE 00 46 01 30 00 4C 00 45
-'
-' sıfır:
-' Invariant: SıFıR 00 53 01 31 00 46 01 31 00 52
-' en-US: SIFIR 00 53 00 49 00 46 00 49 00 52
-' tr-TR: SIFIR 00 53 00 49 00 46 00 49 00 52
-'
-' Dženana:
-' Invariant: DžENANA 01 C5 00 45 00 4E 00 41 00 4E 00 41
-' en-US: DŽENANA 01 C4 00 45 00 4E 00 41 00 4E 00 41
-' tr-TR: DŽENANA 01 C4 00 45 00 4E 00 41 00 4E 00 41
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/case2.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/case2.vb
deleted file mode 100644
index 72954381ab8cb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/case2.vb
+++ /dev/null
@@ -1,41 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Threading
-
-Module Example2
- Const disallowed = "file"
-
- Public Sub Main()
- IsAccessAllowed("FILE:\\\c:\users\user001\documents\FinancialInfo.txt")
- End Sub
-
- Private Sub IsAccessAllowed(resource As String)
- Dim cultures() As CultureInfo = {CultureInfo.CreateSpecificCulture("en-US"),
- CultureInfo.CreateSpecificCulture("tr-TR")}
- Dim scheme As String = Nothing
- Dim index As Integer = resource.IndexOfAny({"\"c, "/"c})
- If index > 0 Then scheme = resource.Substring(0, index - 1)
-
- ' Change the current culture and perform the comparison.
- For Each culture In cultures
- Thread.CurrentThread.CurrentCulture = culture
- Console.WriteLine("Culture: {0}", CultureInfo.CurrentCulture.DisplayName)
- Console.WriteLine(resource)
- Console.WriteLine("Access allowed: {0}",
- Not String.Equals(disallowed, scheme, StringComparison.CurrentCultureIgnoreCase))
- Console.WriteLine()
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Culture: English (United States)
-' FILE:\\\c:\users\user001\documents\FinancialInfo.txt
-' Access allowed: False
-'
-' Culture: Turkish (Turkey)
-' FILE:\\\c:\users\user001\documents\FinancialInfo.txt
-' Access allowed: True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare1.vb
deleted file mode 100644
index 3ddd13df07594..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare1.vb
+++ /dev/null
@@ -1,18 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Threading
-
-Module Example3
- Public Sub Main()
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US")
- Console.WriteLine(String.Compare("A", "a", StringComparison.CurrentCulture))
- Console.WriteLine(String.Compare("A", "a", StringComparison.Ordinal))
- End Sub
-End Module
-' The example displays the following output:
-' 1
-' -32
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare2.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare2.vb
deleted file mode 100644
index 13abcbc847a85..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare2.vb
+++ /dev/null
@@ -1,66 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Collections
-Imports System.Collections.Generic
-Imports System.Globalization
-
-Module Example4
- Public Sub Main()
- Dim strings() As String = {"coop", "co-op", "cooperative",
- "co" + ChrW(&HAD) + "operative",
- "cœur", "coeur"}
-
- ' Perform a word sort using the current (en-US) culture.
- Dim current(strings.Length - 1) As String
- strings.CopyTo(current, 0)
- Array.Sort(current, StringComparer.CurrentCulture)
-
- ' Perform a word sort using the invariant culture.
- Dim invariant(strings.Length - 1) As String
- strings.CopyTo(invariant, 0)
- Array.Sort(invariant, StringComparer.InvariantCulture)
-
- ' Perform an ordinal sort.
- Dim ordinal(strings.Length - 1) As String
- strings.CopyTo(ordinal, 0)
- Array.Sort(ordinal, StringComparer.Ordinal)
-
- ' Perform a string sort using the current culture.
- Dim stringSort(strings.Length - 1) As String
- strings.CopyTo(stringSort, 0)
- Array.Sort(stringSort, New SCompare())
-
- ' Display array values
- Console.WriteLine("{0,13} {1,13} {2,15} {3,13} {4,13}",
- "Original", "Word Sort", "Invariant Word",
- "Ordinal Sort", "String Sort")
- Console.WriteLine()
-
- For ctr As Integer = 0 To strings.Length - 1
- Console.WriteLine("{0,13} {1,13} {2,15} {3,13} {4,13}",
- strings(ctr), current(ctr), invariant(ctr),
- ordinal(ctr), stringSort(ctr))
- Next
- End Sub
-End Module
-
-' IComparer implementation to perform string sort.
-Friend Class SCompare : Implements IComparer(Of String)
- Public Function Compare(x As String, y As String) As Integer _
- Implements IComparer(Of String).Compare
- Return CultureInfo.CurrentCulture.CompareInfo.Compare(x, y, CompareOptions.StringSort)
- End Function
-End Class
-' The example displays the following output:
-' Original Word Sort Invariant Word Ordinal Sort String Sort
-'
-' coop cœur cœur co-op co-op
-' co-op coeur coeur coeur cœur
-' cooperative coop coop coop coeur
-' cooperative co-op co-op cooperative coop
-' cœur cooperative cooperative cooperative cooperative
-' coeur cooperative cooperative cœur cooperative
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare3.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare3.vb
deleted file mode 100644
index c8529fc8a23fe..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare3.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example5
- Public Sub Main()
- ' Search for "oe" and "œu" in "œufs" and "oeufs".
- Dim s1 As String = "œufs"
- Dim s2 As String = "oeufs"
- FindInString(s1, "oe", StringComparison.CurrentCulture)
- FindInString(s1, "oe", StringComparison.Ordinal)
- FindInString(s2, "œu", StringComparison.CurrentCulture)
- FindInString(s2, "œu", StringComparison.Ordinal)
- Console.WriteLine()
-
- Dim softHyphen As String = ChrW(&HAD)
- Dim s3 As String = "co" + softHyphen + "operative"
- FindInString(s3, softHyphen, StringComparison.CurrentCulture)
- FindInString(s3, softHyphen, StringComparison.Ordinal)
- End Sub
-
- Private Sub FindInString(s As String, substring As String,
- options As StringComparison)
- Dim result As Integer = s.IndexOf(substring, options)
- If result <> -1 Then
- Console.WriteLine("'{0}' found in {1} at position {2}",
- substring, s, result)
- Else
- Console.WriteLine("'{0}' not found in {1}",
- substring, s)
- End If
- End Sub
-End Module
-' The example displays the following output:
-' 'oe' found in œufs at position 0
-' 'oe' not found in œufs
-' 'œu' found in oeufs at position 0
-' 'œu' not found in oeufs
-'
-' '' found in cooperative at position 0
-' '' found in cooperative at position 2
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare4.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare4.vb
deleted file mode 100644
index b7816e2d1a6ec..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/compare4.vb
+++ /dev/null
@@ -1,53 +0,0 @@
-'
-Imports System.Globalization
-Imports System.Threading
-
-Public Module Example6
- Public Sub Main()
- Dim str1 As String = "Apple"
- Dim str2 As String = "Æble"
- Dim str3 As String = "AEble"
-
- ' Set the current culture to Danish in Denmark.
- Thread.CurrentThread.CurrentCulture = New CultureInfo("da-DK")
- Console.WriteLine("Current culture: {0}",
- CultureInfo.CurrentCulture.Name)
- Console.WriteLine("Comparison of {0} with {1}: {2}",
- str1, str2, String.Compare(str1, str2))
- Console.WriteLine("Comparison of {0} with {1}: {2}",
- str2, str3, String.Compare(str2, str3))
- Console.WriteLine()
-
- ' Set the current culture to English in the U.S.
- Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
- Console.WriteLine("Current culture: {0}",
- CultureInfo.CurrentCulture.Name)
- Console.WriteLine("Comparison of {0} with {1}: {2}",
- str1, str2, String.Compare(str1, str2))
- Console.WriteLine("Comparison of {0} with {1}: {2}",
- str2, str3, String.Compare(str2, str3))
- Console.WriteLine()
-
- ' Perform an ordinal comparison.
- Console.WriteLine("Ordinal comparison")
- Console.WriteLine("Comparison of {0} with {1}: {2}",
- str1, str2,
- String.Compare(str1, str2, StringComparison.Ordinal))
- Console.WriteLine("Comparison of {0} with {1}: {2}",
- str2, str3,
- String.Compare(str2, str3, StringComparison.Ordinal))
- End Sub
-End Module
-' The example displays the following output:
-' Current culture: da-DK
-' Comparison of Apple with Æble: -1
-' Comparison of Æble with AEble: 1
-'
-' Current culture: en-US
-' Comparison of Apple with Æble: 1
-' Comparison of Æble with AEble: 0
-'
-' Ordinal comparison
-' Comparison of Apple with Æble: -133
-' Comparison of Æble with AEble: 133
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/equality1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/equality1.vb
deleted file mode 100644
index 9f547d867cfea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/equality1.vb
+++ /dev/null
@@ -1,45 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.Threading
-
-Module Example7
- Public Sub Main()
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("tr-TR")
-
- Dim filePath As String = "file://c:/notes.txt"
-
- Console.WriteLine("Culture-sensitive test for equality:")
- If Not TestForEquality(filePath, StringComparison.CurrentCultureIgnoreCase) Then
- Console.WriteLine("Access to {0} is allowed.", filePath)
- Else
- Console.WriteLine("Access to {0} is not allowed.", filePath)
- End If
- Console.WriteLine()
-
- Console.WriteLine("Ordinal test for equality:")
- If Not TestForEquality(filePath, StringComparison.OrdinalIgnoreCase) Then
- Console.WriteLine("Access to {0} is allowed.", filePath)
- Else
- Console.WriteLine("Access to {0} is not allowed.", filePath)
- End If
- End Sub
-
- Private Function TestForEquality(str As String, cmp As StringComparison) As Boolean
- Dim position As Integer = str.IndexOf("://")
- If position < 0 Then Return False
-
- Dim substring As String = str.Substring(0, position)
- Return substring.Equals("FILE", cmp)
- End Function
-End Module
-' The example displays the following output:
-' Culture-sensitive test for equality:
-' Access to file://c:/notes.txt is allowed.
-'
-' Ordinal test for equality:
-' Access to file://c:/notes.txt is not allowed.
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/format1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/format1.vb
deleted file mode 100644
index 193ff79431810..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/format1.vb
+++ /dev/null
@@ -1,26 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-Option Infer On
-
-'
-Imports System.Globalization
-
-Module Example8
- Public Sub Main()
- Dim dat As Date = #3/1/2011#
- Dim cultures() As CultureInfo = {CultureInfo.InvariantCulture,
- New CultureInfo("en-US"),
- New CultureInfo("fr-FR")}
-
- For Each culture In cultures
- Console.WriteLine("{0,-12} {1}", If(String.IsNullOrEmpty(culture.Name),
- "Invariant", culture.Name),
- dat.ToString("d", culture))
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Invariant 03/01/2011
-' en-US 3/1/2011
-' fr-FR 01/03/2011
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/grapheme1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/grapheme1.vb
deleted file mode 100644
index 4bd322a327823..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/grapheme1.vb
+++ /dev/null
@@ -1,36 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.IO
-
-Module Example9
- Public Sub Main()
- Dim sw As New StreamWriter(".\graphemes.txt")
- Dim grapheme As String = ChrW(&H61) + ChrW(&H308)
- sw.WriteLine(grapheme)
-
- Dim singleChar As String = ChrW(&HE4)
- sw.WriteLine(singleChar)
-
- sw.WriteLine("{0} = {1} (Culture-sensitive): {2}", grapheme, singleChar,
- String.Equals(grapheme, singleChar,
- StringComparison.CurrentCulture))
- sw.WriteLine("{0} = {1} (Ordinal): {2}", grapheme, singleChar,
- String.Equals(grapheme, singleChar,
- StringComparison.Ordinal))
- sw.WriteLine("{0} = {1} (Normalized Ordinal): {2}", grapheme, singleChar,
- String.Equals(grapheme.Normalize(),
- singleChar.Normalize(),
- StringComparison.Ordinal))
- sw.Close()
- End Sub
-End Module
-' The example produces the following output:
-' ä
-' ä
-' ä = ä (Culture-sensitive): True
-' ä = ä (Ordinal): False
-' ä = ä (Normalized Ordinal): True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/immutable.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/immutable.vb
deleted file mode 100644
index 279b9af029ab5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/immutable.vb
+++ /dev/null
@@ -1,26 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-Imports System.Text
-
-Module Example10
- Public Sub Main()
- Dim rnd As New Random()
-
- Dim str As String = String.Empty
- Dim sw As New StreamWriter(".\StringFile.txt",
- False, Encoding.Unicode)
-
- For ctr As Integer = 0 To 1000
- str += ChrW(rnd.Next(1, &H530))
- If str.Length Mod 60 = 0 Then str += vbCrLf
- Next
- sw.Write(str)
- sw.Close()
- End Sub
-End Module
-'
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/immutable1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/immutable1.vb
deleted file mode 100644
index bcd5f0abc1913..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/immutable1.vb
+++ /dev/null
@@ -1,24 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.IO
-Imports System.Text
-
-Module Example11
- Public Sub Main()
- Dim rnd As New Random()
- Dim sb As New StringBuilder()
- Dim sw As New StreamWriter(".\StringFile.txt",
- False, Encoding.Unicode)
-
- For ctr As Integer = 0 To 1000
- sb.Append(ChrW(rnd.Next(1, &H530)))
- If sb.Length Mod 60 = 0 Then sb.AppendLine()
- Next
- sw.Write(sb.ToString())
- sw.Close()
- End Sub
-End Module
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/index1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/index1.vb
deleted file mode 100644
index 80b45c6a808ba..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/index1.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-'
-Module Example12
- Public Sub Main()
- Dim s1 As String = "This string consists of a single short sentence."
- Dim nWords As Integer = 0
-
- s1 = s1.Trim()
- For ctr As Integer = 0 To s1.Length - 1
- If Char.IsPunctuation(s1(ctr)) Or Char.IsWhiteSpace(s1(ctr)) Then
- nWords += 1
- End If
- Next
- Console.WriteLine("The sentence{2} {0}{2}has {1} words.",
- s1, nWords, vbCrLf)
- End Sub
-End Module
-' The example displays the following output:
-' The sentence
-' This string consists of a single short sentence.
-' has 8 words.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/index2.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/index2.vb
deleted file mode 100644
index 37efc190d9afc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/index2.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-'
-Module Example13
- Public Sub Main()
- Dim s1 As String = "This string consists of a single short sentence."
- Dim nWords As Integer = 0
-
- s1 = s1.Trim()
- For Each ch In s1
- If Char.IsPunctuation(ch) Or Char.IsWhiteSpace(ch) Then
- nWords += 1
- End If
- Next
- Console.WriteLine("The sentence{2} {0}{2}has {1} words.",
- s1, nWords, vbCrLf)
- End Sub
-End Module
-' The example displays the following output:
-' The sentence
-' This string consists of a single short sentence.
-' has 8 words.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/index3.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/index3.vb
deleted file mode 100644
index 3a121ab0f1c7e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/index3.vb
+++ /dev/null
@@ -1,76 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-Option Infer On
-
-'
-Imports System.Collections.Generic
-Imports System.Globalization
-
-Module Example14
- Public Sub Main()
- ' First sentence of The Mystery of the Yellow Room, by Leroux.
- Dim opening As String = "Ce n'est pas sans une certaine émotion que " +
- "je commence à raconter ici les aventures " +
- "extraordinaires de Joseph Rouletabille."
- ' Character counters.
- Dim nChars As Integer = 0
- ' Objects to store word count.
- Dim chars As New List(Of Integer)()
- Dim elements As New List(Of Integer)()
-
- For Each ch In opening
- ' Skip the ' character.
- If ch = ChrW(&H27) Then Continue For
-
- If Char.IsWhiteSpace(ch) Or Char.IsPunctuation(ch) Then
- chars.Add(nChars)
- nChars = 0
- Else
- nChars += 1
- End If
- Next
-
- Dim te As TextElementEnumerator = StringInfo.GetTextElementEnumerator(opening)
- Do While te.MoveNext()
- Dim s As String = te.GetTextElement()
- ' Skip the ' character.
- If s = ChrW(&H27) Then Continue Do
- If String.IsNullOrEmpty(s.Trim()) Or (s.Length = 1 AndAlso Char.IsPunctuation(Convert.ToChar(s))) Then
- elements.Add(nChars)
- nChars = 0
- Else
- nChars += 1
- End If
- Loop
-
- ' Display character counts.
- Console.WriteLine("{0,6} {1,20} {2,20}",
- "Word #", "Char Objects", "Characters")
- For ctr As Integer = 0 To chars.Count - 1
- Console.WriteLine("{0,6} {1,20} {2,20}",
- ctr, chars(ctr), elements(ctr))
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Word # Char Objects Characters
-' 0 2 2
-' 1 4 4
-' 2 3 3
-' 3 4 4
-' 4 3 3
-' 5 8 8
-' 6 8 7
-' 7 3 3
-' 8 2 2
-' 9 8 8
-' 10 2 1
-' 11 8 8
-' 12 3 3
-' 13 3 3
-' 14 9 9
-' 15 15 15
-' 16 2 2
-' 17 6 6
-' 18 12 12
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/instantiate1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/instantiate1.vb
deleted file mode 100644
index 7dab99bae971f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/instantiate1.vb
+++ /dev/null
@@ -1,84 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example15
- Public Sub Main()
- InstantiateByAssignment()
- Console.WriteLine("-----")
- CallConstructors()
- Console.WriteLine("-----")
- Concatenate()
- Console.WriteLine("-----")
- ExtractString()
- Console.WriteLine("-----")
- Formatting()
- End Sub
-
- Private Sub InstantiateByAssignment()
- '
- Dim string1 As String = "This is a string created by assignment."
- Console.WriteLine(string1)
- Dim string2 As String = "The path is C:\PublicDocuments\Report1.doc"
- Console.WriteLine(string2)
- ' The example displays the following output:
- ' This is a string created by assignment.
- ' The path is C:\PublicDocuments\Report1.doc
- '
- End Sub
-
- Private Sub CallConstructors()
- '
- Dim chars() As Char = {"w"c, "o"c, "r"c, "d"c}
-
- ' Create a string from a character array.
- Dim string1 As New String(chars)
- Console.WriteLine(string1)
-
- ' Create a string that consists of a character repeated 20 times.
- Dim string2 As New String("c"c, 20)
- Console.WriteLine(string2)
- ' The example displays the following output:
- ' word
- ' cccccccccccccccccccc
- '
- End Sub
-
- Private Sub Concatenate()
- '
- Dim string1 As String = "Today is " + Date.Now.ToString("D") + "."
- Console.WriteLine(string1)
- Dim string2 As String = "This is one sentence. " + "This is a second. "
- string2 += "This is a third sentence."
- Console.WriteLine(string2)
- ' The example displays output like the following:
- ' Today is Tuesday, July 06, 2011.
- ' This is one sentence. This is a second. This is a third sentence.
- '
- End Sub
-
- Private Sub ExtractString()
- '
- Dim sentence As String = "This sentence has five words."
- ' Extract the second word.
- Dim startPosition As Integer = sentence.IndexOf(" ") + 1
- Dim word2 As String = sentence.Substring(startPosition,
- sentence.IndexOf(" ", startPosition) - startPosition)
- Console.WriteLine("Second word: " + word2)
- ' The example displays the following output:
- ' Second word: sentence
- '
- End Sub
-
- Private Sub Formatting()
- '
- Dim dateAndTime As DateTime = #07/06/2011 7:32:00AM#
- Dim temperature As Double = 68.3
- Dim result As String = String.Format("At {0:t} on {0:D}, the temperature was {1:F1} degrees Fahrenheit.",
- dateAndTime, temperature)
- Console.WriteLine(result)
- ' The example displays the following output:
- ' At 7:32 AM on Wednesday, July 06, 2011, the temperature was 68.3 degrees Fahrenheit.
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/normalize1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/normalize1.vb
deleted file mode 100644
index 5aab63cf3631a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/normalize1.vb
+++ /dev/null
@@ -1,96 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-Imports System.IO
-Imports System.Text
-
-Module Example16
- Private sw As StreamWriter
-
- Public Sub Main()
- sw = New StreamWriter(".\TestNorm1.txt")
-
- ' Define three versions of the same word.
- Dim s1 As String = "sống" ' create word with U+1ED1
- Dim s2 As String = "s" + ChrW(&HF4) + ChrW(&H301) + "ng"
- Dim s3 As String = "so" + ChrW(&H302) + ChrW(&H301) + "ng"
-
- TestForEquality(s1, s2, s3)
- sw.WriteLine()
-
- ' Normalize and compare strings using each normalization form.
- For Each formName In [Enum].GetNames(GetType(NormalizationForm))
- sw.WriteLine("Normalization {0}:", formName)
- Dim nf As NormalizationForm = CType([Enum].Parse(GetType(NormalizationForm), formName),
- NormalizationForm)
- Dim sn() As String = NormalizeStrings(nf, s1, s2, s3)
- TestForEquality(sn)
- sw.WriteLine(vbCrLf)
- Next
-
- sw.Close()
- End Sub
-
- Private Sub TestForEquality(ParamArray words As String())
- For ctr As Integer = 0 To words.Length - 2
- For ctr2 As Integer = ctr + 1 To words.Length - 1
- sw.WriteLine("{0} ({1}) = {2} ({3}): {4}",
- words(ctr), ShowBytes(words(ctr)),
- words(ctr2), ShowBytes(words(ctr2)),
- words(ctr).Equals(words(ctr2), StringComparison.Ordinal))
- Next
- Next
- End Sub
-
- Private Function ShowBytes(str As String) As String
- Dim result As String = Nothing
- For Each ch In str
- result += String.Format("{0} ", Convert.ToUInt16(ch).ToString("X4"))
- Next
- Return result.Trim()
- End Function
-
- Private Function NormalizeStrings(nf As NormalizationForm, ParamArray words() As String) As String()
- For ctr As Integer = 0 To words.Length - 1
- If Not words(ctr).IsNormalized(nf) Then
- words(ctr) = words(ctr).Normalize(nf)
- End If
- Next
- Return words
- End Function
-End Module
-' The example displays the following output:
-' sống (0073 1ED1 006E 0067) = sống (0073 00F4 0301 006E 0067): False
-' sống (0073 1ED1 006E 0067) = sống (0073 006F 0302 0301 006E 0067): False
-' sống (0073 00F4 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): False
-'
-' Normalization FormC:
-'
-' sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-' sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-' sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-'
-'
-' Normalization FormD:
-'
-' sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-' sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-' sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-'
-'
-' Normalization FormKC:
-'
-' sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-' sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-' sống (0073 1ED1 006E 0067) = sống (0073 1ED1 006E 0067): True
-'
-'
-' Normalization FormKD:
-'
-' sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-' sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-' sống (0073 006F 0302 0301 006E 0067) = sống (0073 006F 0302 0301 006E 0067): True
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/nullorempty1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/nullorempty1.vb
deleted file mode 100644
index 00973e644edea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/nullorempty1.vb
+++ /dev/null
@@ -1,74 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Globalization
-
-Module Example17
- Public Sub Main()
- TestForIsNullOrEmpty()
- Console.WriteLine("-----")
- TestForIsNullOrEmptyOrWhitespaceOnly()
- End Sub
-
- Private Sub TestForIsNullOrEmpty()
- Dim str As String = Nothing
- '
- If str Is Nothing OrElse str.Equals(String.Empty) Then
- '
-
- Else
-
- End If
- End Sub
-
- Private Sub TestForIsNullOrEmptyOrWhitespaceOnly()
- Dim str As String = " "
- '
- If str Is Nothing OrElse str.Equals(String.Empty) OrElse str.Trim().Equals(String.Empty) Then
- '
- Console.WriteLine("Bad!")
- Else
- Console.WriteLine("Good!")
- End If
- End Sub
-End Module
-
-Public Class Temperature : Implements IFormattable
- Dim temp As Double
-
- Public Sub New(temp As Double)
- Me.temp = temp
- End Sub
-
- Public Overrides Function ToString() As String
- Return Me.ToString("G", CultureInfo.CurrentCulture)
- End Function
-
- Public Overloads Function ToString(fmt As String) As String
- Return Me.ToString(fmt, CultureInfo.CurrentCulture)
- End Function
-
- '
- Public Overloads Function ToString(fmt As String, provider As IFormatProvider) As String _
- Implements IFormattable.ToString
- If String.IsNullOrEmpty(fmt) Then fmt = "G"
- If provider Is Nothing Then provider = CultureInfo.CurrentCulture
-
- Select Case fmt.ToUpperInvariant()
- ' Return degrees in Celsius.
- Case "G", "C"
- Return temp.ToString("F2", provider) + "°C"
- ' Return degrees in Fahrenheit.
- Case "F"
- Return (temp * 9 / 5 + 32).ToString("F2", provider) + "°F"
- ' Return degrees in Kelvin.
- Case "K"
- Return (temp + 273.15).ToString()
- Case Else
- Throw New FormatException(
- String.Format("The {0} format string is not supported.",
- fmt))
- End Select
- End Function
- '
-End Class
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/parse1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/parse1.vb
deleted file mode 100644
index 939154de35873..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/parse1.vb
+++ /dev/null
@@ -1,33 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-Option Infer On
-
-'
-Imports System.Globalization
-
-Module Example18
- Public Sub Main()
- Dim dateString As String = "07/10/2011"
- Dim cultures() As CultureInfo = {CultureInfo.InvariantCulture,
- CultureInfo.CreateSpecificCulture("en-GB"),
- CultureInfo.CreateSpecificCulture("en-US")}
- Console.WriteLine("{0,-12} {1,10} {2,8} {3,8}", "Date String", "Culture",
- "Month", "Day")
- Console.WriteLine()
- For Each culture In cultures
- Dim dat As Date = DateTime.Parse(dateString, culture)
- Console.WriteLine("{0,-12} {1,10} {2,8} {3,8}", dateString,
- If(String.IsNullOrEmpty(culture.Name),
- "Invariant", culture.Name),
- dat.Month, dat.Day)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Date String Culture Month Day
-'
-' 07/10/2011 Invariant 7 10
-' 07/10/2011 en-GB 10 7
-' 07/10/2011 en-US 7 10
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/search1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/search1.vb
deleted file mode 100644
index 7b6b60f162360..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/search1.vb
+++ /dev/null
@@ -1,30 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Globalization
-
-Module Example19
- Public Sub Main()
- Dim cultureNames() As String = {"da-DK", "en-US"}
- Dim ci As CompareInfo
- Dim str As String = "aerial"
- Dim ch As Char = "æ"c ' U+00E6
-
- Console.Write("Ordinal comparison -- ")
- Console.WriteLine("Position of '{0}' in {1}: {2}", ch, str,
- str.IndexOf(ch))
-
- For Each cultureName In cultureNames
- ci = CultureInfo.CreateSpecificCulture(cultureName).CompareInfo
- Console.Write("{0} cultural comparison -- ", cultureName)
- Console.WriteLine("Position of '{0}' in {1}: {2}", ch, str,
- ci.IndexOf(str, ch))
- Next
- End Sub
-End Module
-' The example displays the following output:
-' Ordinal comparison -- Position of 'æ' in aerial: -1
-' da-DK cultural comparison -- Position of 'æ' in aerial: -1
-' en-US cultural comparison -- Position of 'æ' in aerial: 0
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/sort1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/sort1.vb
deleted file mode 100644
index 3dd6966da04e6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/sort1.vb
+++ /dev/null
@@ -1,57 +0,0 @@
-'
-Imports System.Globalization
-Imports System.IO
-Imports System.Threading
-
-Public Class TextToFile
- Public Shared Sub Main()
- ' Creates and initializes a new array to store
- ' these date/time objects.
- Dim stringArray() As String = { "Apple", "Æble", "Zebra"}
-
- ' Displays the values of the array.
- Console.WriteLine("The original string array:")
- PrintIndexAndValues(stringArray)
-
- ' Set the CurrentCulture to "en-US".
- Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
- ' Sort the values of the Array.
- Array.Sort(stringArray)
-
- ' Display the values of the array.
- Console.WriteLine("After sorting for the ""en-US"" culture:")
- PrintIndexAndValues(stringArray)
-
- ' Set the CurrentCulture to "da-DK".
- Thread.CurrentThread.CurrentCulture = New CultureInfo("da-DK")
- ' Sort the values of the Array.
- Array.Sort(stringArray)
-
- ' Displays the values of the Array.
- Console.WriteLine("After sorting for the culture ""da-DK"":")
- PrintIndexAndValues(stringArray)
- End Sub
-
- Public Shared Sub PrintIndexAndValues(myArray() As String)
- For i As Integer = myArray.GetLowerBound(0) To myArray.GetUpperBound(0)
- Console.WriteLine("[{0}]: {1}", i, myArray(i))
- Next
- Console.WriteLine()
- End Sub
-End Class
-' The example displays the following output:
-' The original string array:
-' [0]: Apple
-' [1]: Æble
-' [2]: Zebra
-'
-' After sorting for the "en-US" culture:
-' [0]: Æble
-' [1]: Apple
-' [2]: Zebra
-'
-' After sorting for the culture "da-DK":
-' [0]: Apple
-' [1]: Zebra
-' [2]: Æble
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/surrogate1.vb b/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/surrogate1.vb
deleted file mode 100644
index 9c09c965190fc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/String/Overview/vb/surrogate1.vb
+++ /dev/null
@@ -1,20 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example20
- Public Sub Main()
- Dim surrogate As String = ChrW(&HD800) + ChrW(&HDC03)
- For ctr As Integer = 0 To surrogate.Length - 1
- Console.Write("U+{0:X2} ", Convert.ToUInt16(surrogate(ctr)))
- Next
- Console.WriteLine()
- Console.WriteLine(" Is Surrogate Pair: {0}",
- Char.IsSurrogatePair(surrogate(0), surrogate(1)))
- End Sub
-End Module
-
-' The example displays the following output:
-' U+D800 U+DC03
-' Is Surrogate Pair: True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/Project.csproj
deleted file mode 100644
index ed40953e21b35..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net481
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/instantiate1.cs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/instantiate1.cs
deleted file mode 100644
index c93d7f0128538..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/instantiate1.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using System;
-
-public class Example
-{
- public static void Main()
- {
- Implicit();
- Console.WriteLine();
- Explicit();
- Console.WriteLine();
- TimeSpanOperation();
- Console.WriteLine();
- Parse();
- Console.WriteLine();
- }
-
- private static void Implicit()
- {
- //
- TimeSpan interval = new TimeSpan();
- Console.WriteLine(interval.Equals(TimeSpan.Zero)); // Displays "True".
- //
- }
-
- private static void Explicit()
- {
- //
- TimeSpan interval = new TimeSpan(2, 14, 18);
- Console.WriteLine(interval.ToString());
-
- // Displays "02:14:18".
- //
- }
-
- private static void TimeSpanOperation()
- {
- //
- DateTime departure = new DateTime(2010, 6, 12, 18, 32, 0);
- DateTime arrival = new DateTime(2010, 6, 13, 22, 47, 0);
- TimeSpan travelTime = arrival - departure;
- Console.WriteLine($"{arrival} - {departure} = {travelTime}");
-
- // The example displays the following output:
- // 6/13/2010 10:47:00 PM - 6/12/2010 6:32:00 PM = 1.04:15:00
- //
- }
-
- private static void Parse()
- {
- //
- string[] values = { "12", "31.", "5.8:32:16", "12:12:15.95", ".12"};
- foreach (string value in values)
- {
- try {
- TimeSpan ts = TimeSpan.Parse(value);
- Console.WriteLine($"'{value}' --> {ts}");
- }
- catch (FormatException) {
- Console.WriteLine($"Unable to parse '{value}'");
- }
- catch (OverflowException) {
- Console.WriteLine($"'{value}' is outside the range of a TimeSpan.");
- }
- }
-
- // The example displays the following output:
- // '12' --> 12.00:00:00
- // Unable to parse '31.'
- // '5.8:32:16' --> 5.08:32:16
- // '12:12:15.95' --> 12:12:15.9500000
- // Unable to parse '.12'
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/legacycode1.cs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/legacycode1.cs
deleted file mode 100644
index 80ea800b80002..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/legacycode1.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-
-public class Example1
-{
- public static void Main()
- {
- //
- ShowFormattingCode();
- // Output from .NET Framework 3.5 and earlier versions:
- // 12:30:45
- // Output from .NET Framework 4:
- // Invalid Format
-
- Console.WriteLine("---");
-
- ShowParsingCode();
- // Output:
- // 000000006 --> 6.00:00:00
-
- void ShowFormattingCode()
- {
- TimeSpan interval = new TimeSpan(12, 30, 45);
- string output;
- try
- {
- output = String.Format("{0:r}", interval);
- }
- catch (FormatException)
- {
- output = "Invalid Format";
- }
- Console.WriteLine(output);
- }
-
- void ShowParsingCode()
- {
- string value = "000000006";
- try
- {
- TimeSpan interval = TimeSpan.Parse(value);
- Console.WriteLine($"{value} --> {interval}");
- }
- catch (FormatException)
- {
- Console.WriteLine($"{value}: Bad Format");
- }
- catch (OverflowException)
- {
- Console.WriteLine($"{value}: Overflow");
- }
- }
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/perappdomain1.cs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/perappdomain1.cs
deleted file mode 100644
index c59d58654c1e6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/perappdomain1.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-using System;
-
-public class Example2
-{
- public static void Main()
- {
- AppDomainSetup appSetup = new AppDomainSetup();
- appSetup.SetCompatibilitySwitches(new string[] { "NetFx40_TimeSpanLegacyFormatMode" });
- AppDomain legacyDomain = AppDomain.CreateDomain("legacyDomain",
- null, appSetup);
- legacyDomain.ExecuteAssembly("ShowTimeSpan.exe");
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/showtimespan.cs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/showtimespan.cs
deleted file mode 100644
index c66763b97b461..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/showtimespan.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-using System;
-
-public class Example3
-{
- public static void Main()
- {
- TimeSpan interval = DateTime.Now - DateTime.Now.Date;
- string msg = String.Format("Elapsed Time Today: {0:d} hours.",
- interval);
- Console.WriteLine(msg);
- }
-}
-// The example displays the following output:
-// Elapsed Time Today: 01:40:52.2524662 hours.
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/zero1.cs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/zero1.cs
deleted file mode 100644
index 50334405583fb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/csharp/zero1.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-
-public class Example4
-{
- public static void Main()
- {
- //
- Random rnd = new Random();
-
- TimeSpan timeSpent = TimeSpan.Zero;
-
- timeSpent += GetTimeBeforeLunch();
- timeSpent += GetTimeAfterLunch();
-
- Console.WriteLine($"Total time: {timeSpent}");
-
- TimeSpan GetTimeBeforeLunch()
- {
- return new TimeSpan(rnd.Next(3, 6), 0, 0);
- }
-
- TimeSpan GetTimeAfterLunch()
- {
- return new TimeSpan(rnd.Next(3, 6), 0, 0);
- }
-
- // The example displays output like the following:
- // Total time: 08:00:00
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/instantiate1.fs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/instantiate1.fs
deleted file mode 100644
index 50016f720b93c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/instantiate1.fs
+++ /dev/null
@@ -1,59 +0,0 @@
-module instantiate1
-
-open System
-
-let implicit () =
- //
- let interval = TimeSpan()
- printfn $"{interval.Equals TimeSpan.Zero}" // Displays "True".
- //
-
-let explicit () =
- //
- let interval = TimeSpan(2, 14, 18)
- printfn $"{interval}"
-
- // Displays "02:14:18".
- //
-
-let timeSpanOperation () =
- //
- let departure = DateTime(2010, 6, 12, 18, 32, 0)
- let arrival = DateTime(2010, 6, 13, 22, 47, 0)
- let travelTime = arrival - departure
- printfn $"{arrival} - {departure} = {travelTime}"
-
- // The example displays the following output:
- // 6/13/2010 10:47:00 PM - 6/12/2010 6:32:00 PM = 1.04:15:00
- //
-
-let parse () =
- //
- let values = [| "12"; "31."; "5.8:32:16"; "12:12:15.95"; ".12" |]
- for value in values do
- try
- let ts = TimeSpan.Parse value
- printfn $"'{value}' --> {ts}"
- with
- | :? FormatException ->
- printfn $"Unable to parse '{value}'"
- | :? OverflowException ->
- printfn $"'{value}' is outside the range of a TimeSpan."
-
- // The example displays the following output:
- // '12' --> 12.00:00:00
- // Unable to parse '31.'
- // '5.8:32:16' --> 5.08:32:16
- // '12:12:15.95' --> 12:12:15.9500000
- // Unable to parse '.12'
- //
-
-
-implicit ()
-printfn ""
-explicit ()
-printfn ""
-timeSpanOperation ()
-printfn ""
-parse ()
-printfn ""
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/legacycode1.fs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/legacycode1.fs
deleted file mode 100644
index 69be56c0f5aea..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/legacycode1.fs
+++ /dev/null
@@ -1,37 +0,0 @@
-module legacycode1
-
-open System
-
-//
-let showFormattingCode () =
- let interval = TimeSpan(12, 30, 45)
- try
- $"{interval:r}"
- with :? FormatException ->
- "Invalid Format"
- |> printfn "%s"
-
-let showParsingCode () =
- let value = "000000006"
- try
- let interval = TimeSpan.Parse value
- printfn $"{value} --> {interval}"
- with
- | :? FormatException ->
- printfn $"{value}: Bad Format"
- | :? OverflowException ->
- printfn $"{value}: Overflow"
-
-showFormattingCode ()
-// Output from .NET Framework 3.5 and earlier versions:
-// 12:30:45
-// Output from .NET Framework 4:
-// Invalid Format
-
-printfn "---"
-
-showParsingCode ()
-// Output:
-// 000000006 --> 6.00:00:00
-
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/perappdomain1.fs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/perappdomain1.fs
deleted file mode 100644
index a0c611ba3ce09..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/perappdomain1.fs
+++ /dev/null
@@ -1,10 +0,0 @@
-module perappdomain1
-
-//
-open System
-
-let appSetup = AppDomainSetup()
-appSetup.SetCompatibilitySwitches [| "NetFx40_TimeSpanLegacyFormatMode" |]
-let legacyDomain = AppDomain.CreateDomain("legacyDomain", null, appSetup)
-legacyDomain.ExecuteAssembly "ShowTimeSpan.exe" |> ignore
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/showtimespan.fs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/showtimespan.fs
deleted file mode 100644
index 7c0fa6da583ec..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/showtimespan.fs
+++ /dev/null
@@ -1,10 +0,0 @@
-module showtimespan
-
-//
-open System
-
-let interval = DateTime.Now - DateTime.Now.Date
-printfn $"Elapsed Time Today: {interval:d} hours."
-// The example displays the following output:
-// Elapsed Time Today: 01:40:52.2524662 hours.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/zero1.fs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/zero1.fs
deleted file mode 100644
index 671295d0b5d5f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/fsharp/zero1.fs
+++ /dev/null
@@ -1,25 +0,0 @@
-module zero1
-
-//
-open System
-
-let rnd = Random()
-
-let getTimeBeforeLunch () =
- TimeSpan(rnd.Next(3, 6), 0, 0)
-
-let getTimeAfterLunch() =
- TimeSpan(rnd.Next(3, 6), 0, 0)
-
-do
- let timeSpent = TimeSpan.Zero
-
- let timeSpent = timeSpent + getTimeBeforeLunch ()
- let timeSpent = timeSpent + getTimeAfterLunch ()
-
- printfn $"Total time: {timeSpent}"
-
-
-// The example displays output like the following:
-// Total time: 08:00:00
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/Project.vbproj
deleted file mode 100644
index 531d891cd55d7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net48
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/instantiate1.vb b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/instantiate1.vb
deleted file mode 100644
index ba36f342218ca..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/instantiate1.vb
+++ /dev/null
@@ -1,66 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example1
- Public Sub Main()
- Implicit()
- Console.WriteLine()
- Explicit()
- Console.WriteLine()
- TimeSpanOperation()
- Console.WriteLine()
- Parse()
- Console.WriteLine()
- End Sub
-
- Private Sub Implicit()
- '
- Dim interval As New TimeSpan()
- Console.WriteLine(interval.Equals(TimeSpan.Zero)) ' Displays "True".
- '
- End Sub
-
- Private Sub Explicit()
- '
- Dim interval As New TimeSpan(2, 14, 18)
- Console.WriteLine(interval.ToString()) ' Displays "02:14:18".
- '
- End Sub
-
- Private Sub TimeSpanOperation()
- '
- Dim departure As DateTime = #06/12/2010 6:32PM#
- Dim arrival As DateTime = #06/13/2010 10:47PM#
- Dim travelTime As TimeSpan = arrival - departure
- Console.WriteLine("{0} - {1} = {2}", arrival, departure, travelTime)
- ' The example displays the following output:
- ' 6/13/2010 10:47:00 PM - 6/12/2010 6:32:00 PM = 1.04:15:00
- '
- End Sub
-
- Private Sub Parse()
- '
- Dim values() As String = {"12", "31.", "5.8:32:16", "12:12:15.95", ".12"}
- For Each value As String In values
- Try
- Dim ts As TimeSpan = TimeSpan.Parse(value)
- Console.WriteLine("'{0}' --> {1}", value, ts)
- Catch e As FormatException
- Console.WriteLine("Unable to parse '{0}'", value)
- Catch e As OverflowException
- Console.WriteLine("'{0}' is outside the range of a TimeSpan.", value)
- End Try
- Next
- ' The example displays the following output:
- ' '12' --> 12.00:00:00
- ' Unable to parse '31.'
- ' '5.8:32:16' --> 5.08:32:16
- ' '12:12:15.95' --> 12:12:15.9500000
- ' Unable to parse '.12'
- '
- End Sub
-End Module
-
-' 02:10:21
-'
-' 22:26:43
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/legacycode1.vb b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/legacycode1.vb
deleted file mode 100644
index ccc4e0ebf5ce2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/legacycode1.vb
+++ /dev/null
@@ -1,47 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example2
- Public Sub Main()
- ShowFormattingCode()
- Console.WriteLine("---")
- ShowParsingCode()
- End Sub
-
- Private Sub ShowFormattingCode()
- '
- Dim interval As New TimeSpan(12, 30, 45)
- Dim output As String
- Try
- output = String.Format("{0:r}", interval)
- Catch e As FormatException
- output = "Invalid Format"
- End Try
- Console.WriteLine(output)
- ' Output from .NET Framework 3.5 and earlier versions:
- ' 12:30:45
- ' Output from .NET Framework 4:
- ' Invalid Format
- '
- End Sub
-
- Private Sub ShowParsingCode()
- Dim values() As String = {"000000006", "12.12:12:12.12345678"}
- For Each value As String In values
- Try
- Dim interval As TimeSpan = TimeSpan.Parse(value)
- Console.WriteLine("{0} --> {1}", value, interval)
- Catch e As FormatException
- Console.WriteLine("{0}: Bad Format", value)
- Catch e As OverflowException
- Console.WriteLine("{0}: Overflow", value)
- End Try
- Next
- ' Output from .NET Framework 3.5 and earlier versions:
-
- ' Output from .NET Framework 4:
- ' 000000006: Overflow
- End Sub
-End Module
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/perappdomain1.vb b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/perappdomain1.vb
deleted file mode 100644
index a938d364144f3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/perappdomain1.vb
+++ /dev/null
@@ -1,13 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-'
-Module Example3
- Public Sub Main()
- Dim appSetup As New AppDomainSetup()
- appSetup.SetCompatibilitySwitches({"NetFx40_TimeSpanLegacyFormatMode"})
- Dim legacyDomain As AppDomain = AppDomain.CreateDomain("legacyDomain",
- Nothing, appSetup)
- legacyDomain.ExecuteAssembly("ShowTimeSpan.exe")
- End Sub
-End Module
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/showtimespan.vb b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/showtimespan.vb
deleted file mode 100644
index cb0373de763ca..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/showtimespan.vb
+++ /dev/null
@@ -1,15 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example4
- Public Sub Main()
- Dim interval As TimeSpan = Date.Now - Date.Now.Date
- Dim msg As String = String.Format("Elapsed Time Today: {0:d} hours.",
- interval)
- Console.WriteLine(msg)
- End Sub
-End Module
-' The example displays output like the following:
-' Elapsed Time Today: 01:40:52.2524662 hours.
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/zero1.vb b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/zero1.vb
deleted file mode 100644
index 80ef92f8e1867..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Overview/vb/zero1.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Dim rnd As New Random()
-
- Public Sub Main()
- Dim timeSpent As TimeSpan = TimeSpan.Zero
-
- timeSpent += GetTimeBeforeLunch()
- timeSpent += GetTimeAfterLunch()
-
- Console.WriteLine("Total time: {0}", timeSpent)
- End Sub
-
- Private Function GetTimeBeforeLunch() As TimeSpan
- Return New TimeSpan(rnd.Next(3, 6), 0, 0)
- End Function
-
- Private Function GetTimeAfterLunch() As TimeSpan
- Return New TimeSpan(rnd.Next(3, 6), 0, 0)
- End Function
-End Module
-' The example displays output like the following:
-' Total time: 08:00:00
-'
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/csharp/parsefailure1.cs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/csharp/parsefailure1.cs
deleted file mode 100644
index a39e989f2b017..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/csharp/parsefailure1.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-
-public class Example
-{
- public static void Main()
- {
- //
- string[] values = { "000000006", "12.12:12:12.12345678" };
- foreach (string value in values)
- {
- try {
- TimeSpan interval = TimeSpan.Parse(value);
- Console.WriteLine($"{value} --> {interval}");
- }
- catch (FormatException) {
- Console.WriteLine($"{value}: Bad Format");
- }
- catch (OverflowException) {
- Console.WriteLine($"{value}: Overflow");
- }
- }
-
- // Output from .NET Framework 3.5 and earlier versions:
- // 000000006 --> 6.00:00:00
- // 12.12:12:12.12345678: Bad Format
- // Output from .NET Framework 4 and later versions or .NET Core:
- // 000000006: Overflow
- // 12.12:12:12.12345678: Overflow
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/fsharp/parsefailure1.fs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/fsharp/parsefailure1.fs
deleted file mode 100644
index 54ff371765d17..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/fsharp/parsefailure1.fs
+++ /dev/null
@@ -1,23 +0,0 @@
-module parsefailure1
-
-//
-open System
-
-let values = [| "000000006"; "12.12:12:12.12345678" |]
-for value in values do
- try
- let interval = TimeSpan.Parse value
- printfn $"{value} --> {interval}"
- with
- | :? FormatException ->
- printfn $"{value}: Bad Format"
- | :? OverflowException ->
- printfn $"{value}: Overflow"
-
-// Output from .NET Framework 3.5 and earlier versions:
-// 000000006 --> 6.00:00:00
-// 12.12:12:12.12345678: Bad Format
-// Output from .NET Framework 4 and later versions or .NET Core:
-// 000000006: Overflow
-// 12.12:12:12.12345678: Overflow
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/vb/parsefailure1.vb b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/vb/parsefailure1.vb
deleted file mode 100644
index 9aeb188c916a2..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/Parse/vb/parsefailure1.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example
- Public Sub Main()
- '
- Dim values() As String = { "000000006", "12.12:12:12.12345678" }
- For Each value As String In values
- Try
- Dim interval As TimeSpan = TimeSpan.Parse(value)
- Console.WriteLine("{0} --> {1}", value, interval)
- Catch e As FormatException
- Console.WriteLine("{0}: Bad Format", value)
- Catch e As OverflowException
- Console.WriteLine("{0}: Overflow", value)
- End Try
- Next
- ' Output from .NET Framework 3.5 and earlier versions:
- ' 000000006 --> 6.00:00:00
- ' 12.12:12:12.12345678: Bad Format
- ' Output from .NET Framework 4:
- ' 000000006: Overflow
- ' 12.12:12:12.12345678: Overflow
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/csharp/tryparsefailure1.cs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/csharp/tryparsefailure1.cs
deleted file mode 100644
index 1eb14f20926aa..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/csharp/tryparsefailure1.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-
-public class Example
-{
- public static void Main()
- {
- //
- string value = "000000006";
- TimeSpan interval;
- if (TimeSpan.TryParse(value, out interval))
- Console.WriteLine($"{value} --> {interval}");
- else
- Console.WriteLine($"Unable to parse '{value}'");
-
- // Output from .NET Framework 3.5 and earlier versions:
- // 000000006 --> 6.00:00:00
- // Output from .NET Framework 4:
- // Unable to parse //000000006//
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/fsharp/tryparsefailure1.fs b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/fsharp/tryparsefailure1.fs
deleted file mode 100644
index 8072ecefe2708..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/fsharp/tryparsefailure1.fs
+++ /dev/null
@@ -1,17 +0,0 @@
-module tryparsefailure
-
-open System
-
-//
-let value = "000000006"
-match TimeSpan.TryParse value with
-| true, interval ->
- printfn $"{value} --> {interval}"
-| _ ->
- printfn $"Unable to parse '{value}'"
-
-// Output from .NET Framework 3.5 and earlier versions:
-// 000000006 --> 6.00:00:00
-// Output from .NET Framework 4:
-// Unable to parse //000000006//
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/vb/tryparsefailure1.vb b/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/vb/tryparsefailure1.vb
deleted file mode 100644
index 892c56a694fec..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TimeSpan/TryParse/vb/tryparsefailure1.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example
- Public Sub Main()
- '
- Dim value As String = "000000006"
- Dim interval As TimeSpan
- If TimeSpan.TryParse(value, interval) Then
- Console.WriteLine("{0} --> {1}", value, interval)
- Else
- Console.WriteLine("Unable to parse '{0}'", value)
- End If
- ' Output from .NET Framework 3.5 and earlier versions:
- ' 000000006 --> 6.00:00:00
- ' Output from .NET Framework 4:
- ' Unable to parse '000000006'
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/GetType/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Type/GetType/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/GetType/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/GetType/csharp/source.cs b/docs/fundamentals/runtime-libraries/snippets/System/Type/GetType/csharp/source.cs
deleted file mode 100644
index c78a3b0df8a0d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/GetType/csharp/source.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;
-using System.Reflection;
-
-class Example
-{ static void Main()
- {
- string test = "System.Collections.Generic.Dictionary`2[System.String,[MyNamespace.MyType, MyAssembly]]";
- //
- Type t = Type.GetType(test,
- (aName) => aName.Name == "MyAssembly" ?
- Assembly.LoadFrom(@".\MyPath\v5.0\MyAssembly.dll") : null,
- (assem, name, ignore) => assem == null ?
- Type.GetType(name, false, ignore) :
- assem.GetType(name, false, ignore)
- );
- //
- Console.WriteLine(t);
-
- test = "System.Collections.Generic.Dictionary`2[[YourNamespace.YourType, YourAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], [MyNamespace.MyType, MyAssembly]]";
- //
- Type t2 = Type.GetType(test,
- (aName) => aName.Name == "MyAssembly" ?
- Assembly.LoadFrom(@".\MyPath\v5.0\MyAssembly.dll") :
- Assembly.Load(aName),
- (assem, name, ignore) => assem == null ?
- Type.GetType(name, false, ignore) :
- assem.GetType(name, false, ignore), true
- );
- //
- Console.WriteLine(t2);
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/GetType/fsharp/source.fs b/docs/fundamentals/runtime-libraries/snippets/System/Type/GetType/fsharp/source.fs
deleted file mode 100644
index 9ec4c20280148..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/GetType/fsharp/source.fs
+++ /dev/null
@@ -1,37 +0,0 @@
-module source
-
-open System
-open System.Reflection
-
-do
- let test = "System.Collections.Generic.Dictionary`2[System.String,[MyNamespace.MyType, MyAssembly]]"
- //
- let t =
- Type.GetType(test,
- (fun aName ->
- if aName.Name = "MyAssembly" then
- Assembly.LoadFrom @".\MyPath\v5.0\MyAssembly.dll"
- else null),
- fun assem name ignr ->
- if assem = null then
- Type.GetType(name, false, ignr)
- else
- assem.GetType(name, false, ignr))
- //
- printfn $"{t}"
-
- let test = "System.Collections.Generic.Dictionary`2[[YourNamespace.YourType, YourAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], [MyNamespace.MyType, MyAssembly]]"
- //
- let t2 =
- Type.GetType(test,
- (fun aName ->
- if aName.Name = "MyAssembly" then
- Assembly.LoadFrom @".\MyPath\v5.0\MyAssembly.dll"
- else Assembly.Load aName),
- (fun assem name ignr ->
- if assem = null then
- Type.GetType(name, false, ignr)
- else
- assem.GetType(name, false, ignr)), true)
- //
- printfn $"{t2}"
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/csharp/remarks.cs b/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/csharp/remarks.cs
deleted file mode 100644
index a9f8c04adb2fe..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/csharp/remarks.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-
-//
-public class Base { }
-public class Derived : Base { }
-//
-
-//
-public class Outermost
-{
- public class Inner
- {
- public class Innermost1 {}
- public class Innermost2 {}
- }
-}
-//
-
-class ProgStubClass
-{
- public static void Main() {}
-}
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/fsharp/remarks.fs b/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/fsharp/remarks.fs
deleted file mode 100644
index bece475149a0a..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/fsharp/remarks.fs
+++ /dev/null
@@ -1,5 +0,0 @@
-module remarks
-//
-type Base<'T, 'U>() = class end
-type Derived<'V>() = inherit Base()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/vb/remarks.vb b/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/vb/remarks.vb
deleted file mode 100644
index 718a6eba3d1e0..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/MakeGenericType/vb/remarks.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-'
-Public Class Base(Of T, U)
-End Class
-Public Class Derived(Of V)
- Inherits Base(Of Integer, V)
-End Class
-'
-
-'
-Public Class Outermost(Of T)
- Public Class Inner(Of U)
- Public Class Innermost1(Of V)
- End Class
- Public Class Innermost2
- End Class
- End Class
-End Class
-'
-
-Public Class ProgStubClass
- Shared Sub Main()
- End Sub
-End Class
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/csharp/Equals1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/csharp/Equals1.cs
deleted file mode 100644
index 47792afadb8e3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/csharp/Equals1.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-
-public class Example
-{
- public static void Main()
- {
- //
- long number1 = 1635429;
- int number2 = 16203;
- double number3 = 1639.41;
- long number4 = 193685412;
-
- // Get the type of number1.
- Type t = number1.GetType();
-
- // Compare types of all objects with number1.
- Console.WriteLine($"Type of number1 and number2 are equal: {Object.ReferenceEquals(t, number2.GetType())}");
- Console.WriteLine($"Type of number1 and number3 are equal: {Object.ReferenceEquals(t, number3.GetType())}");
- Console.WriteLine($"Type of number1 and number4 are equal: {Object.ReferenceEquals(t, number4.GetType())}");
-
- // The example displays the following output:
- // Type of number1 and number2 are equal: False
- // Type of number1 and number3 are equal: False
- // Type of number1 and number4 are equal: True
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/csharp/GetType1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/csharp/GetType1.cs
deleted file mode 100644
index b304b9c666cbb..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/csharp/GetType1.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-public class Example1
-{
- public static void Main()
- {
- //
- object[] values = { "word", true, 120, 136.34, 'a' };
- foreach (var value in values)
- Console.WriteLine($"{value} - type {value.GetType().Name}");
-
- // The example displays the following output:
- // word - type String
- // True - type Boolean
- // 120 - type Int32
- // 136.34 - type Double
- // a - type Char
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/csharp/Project.csproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/fsharp/Equals1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/fsharp/Equals1.fs
deleted file mode 100644
index 5c02f7f9dc42b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/fsharp/Equals1.fs
+++ /dev/null
@@ -1,23 +0,0 @@
-module Equals1
-
-open System
-
-//
-let number1 = 1635429L
-let number2 = 16203
-let number3 = 1639.41
-let number4 = 193685412L
-
-// Get the type of number1.
-let t = number1.GetType()
-
-// Compare types of all objects with number1.
-printfn $"Type of number1 and number2 are equal: {Object.ReferenceEquals(t, number2.GetType())}"
-printfn $"Type of number1 and number3 are equal: {Object.ReferenceEquals(t, number3.GetType())}"
-printfn $"Type of number1 and number4 are equal: {Object.ReferenceEquals(t, number4.GetType())}"
-
-// The example displays the following output:
-// Type of number1 and number2 are equal: False
-// Type of number1 and number3 are equal: False
-// Type of number1 and number4 are equal: True
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/fsharp/GetType1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/fsharp/GetType1.fs
deleted file mode 100644
index c0ef02ad5626f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/fsharp/GetType1.fs
+++ /dev/null
@@ -1,13 +0,0 @@
-module GetType1
-//
-let values: obj[] = [| "word"; true; 120; 136.34; 'a' |]
-for value in values do
- printfn $"{value} - type {value.GetType().Name}"
-
-// The example displays the following output:
-// word - type String
-// True - type Boolean
-// 120 - type Int32
-// 136.34 - type Double
-// a - type Char
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/vb/Equals1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/vb/Equals1.vb
deleted file mode 100644
index b5d3f5661ddc8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/vb/Equals1.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example
- Public Sub Main()
- Dim number1 As Long = 1635429
- Dim number2 As Integer = 16203
- Dim number3 As Double = 1639.41
- Dim number4 As Long = 193685412
-
- ' Get the type of number1.
- Dim t As Type = number1.GetType()
-
- ' Compare types of all objects with number1.
- Console.WriteLine("Type of number1 and number2 are equal: {0}",
- Object.ReferenceEquals(t, number2.GetType()))
- Console.WriteLine("Type of number1 and number3 are equal: {0}",
- Object.ReferenceEquals(t, number3.GetType()))
- Console.WriteLine("Type of number1 and number4 are equal: {0}",
- Object.ReferenceEquals(t, number4.GetType()))
- End Sub
-End Module
-' The example displays the following output:
-' Type of number1 and number2 are equal: False
-' Type of number1 and number3 are equal: False
-' Type of number1 and number4 are equal: True
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/vb/GetType1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/vb/GetType1.vb
deleted file mode 100644
index 3b2e05951bee6..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/vb/GetType1.vb
+++ /dev/null
@@ -1,20 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example1
- Public Sub Main()
- Dim values() As Object = { "word", True, 120, 136.34, "a"c }
- For Each value In values
- Console.WriteLine("{0} - type {1}", value,
- value.GetType().Name)
- Next
- End Sub
-End Module
-' The example displays the following output:
-' word - type String
-' True - type Boolean
-' 120 - type Int32
-' 136.34 - type Double
-' a - type Char
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Type/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/Missing1.cs b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/Missing1.cs
deleted file mode 100644
index b6d72e3e23719..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/Missing1.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-using System;
-
-public class MissingEx1
-{
- public static void Main()
- {
- Person p = new Person("John", "Doe");
- Console.WriteLine(p);
- }
-}
-
-public class Person
-{
- static readonly InfoModule s_infoModule;
-
- readonly string _fName;
- readonly string _lName;
-
- static Person()
- {
- s_infoModule = new InfoModule(DateTime.UtcNow);
- }
-
- public Person(string fName, string lName)
- {
- _fName = fName;
- _lName = lName;
- s_infoModule.Increment();
- }
-
- public override string ToString()
- {
- return string.Format("{0} {1}", _fName, _lName);
- }
-}
-// The example displays the following output if missing1a.dll is renamed or removed:
-// Unhandled Exception: System.TypeInitializationException:
-// The type initializer for 'Person' threw an exception. --->
-// System.IO.FileNotFoundException: Could not load file or assembly
-// 'Missing1a, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
-// or one of its dependencies. The system cannot find the file specified.
-// at Person..cctor()
-// --- End of inner exception stack trace ---
-// at Person..ctor(String fName, String lName)
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/Missing1a.cs b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/Missing1a.cs
deleted file mode 100644
index 56903779fbaac..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/Missing1a.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-using System;
-
-public class InfoModule
-{
- private DateTime firstUse;
- private int ctr = 0;
-
- public InfoModule(DateTime dat)
- {
- firstUse = dat;
- }
-
- public int Increment()
- {
- return ++ctr;
- }
-
- public DateTime GetInitializationTime()
- {
- return firstUse;
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/Regex1.cs b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/Regex1.cs
deleted file mode 100644
index 9d541e4240b85..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/Regex1.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-using System;
-using System.Text.RegularExpressions;
-
-public class RegexEx1
-{
- public static void Main()
- {
- AppDomain domain = AppDomain.CurrentDomain;
- // Set a timeout interval of -2 seconds.
- domain.SetData("REGEX_DEFAULT_MATCH_TIMEOUT", TimeSpan.FromSeconds(-2));
-
- Regex rgx = new Regex("[aeiouy]");
- Console.WriteLine($"Regular expression pattern: {rgx.ToString()}");
- Console.WriteLine($"Timeout interval for this regex: {rgx.MatchTimeout.TotalSeconds} seconds");
- }
-}
-// The example displays the following output:
-// Unhandled Exception: System.TypeInitializationException:
-// The type initializer for 'System.Text.RegularExpressions.Regex' threw an exception. --->
-// System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
-// Parameter name: AppDomain data 'REGEX_DEFAULT_MATCH_TIMEOUT' contains an invalid value or
-// object for specifying a default matching timeout for System.Text.RegularExpressions.Regex.
-// at System.Text.RegularExpressions.Regex.InitDefaultMatchTimeout()
-// at System.Text.RegularExpressions.Regex..cctor()
-// --- End of inner exception stack trace ---
-// at System.Text.RegularExpressions.Regex..ctor(String pattern)
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/ctorException1.cs b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/ctorException1.cs
deleted file mode 100644
index ac866e104437d..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/ctorException1.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-using System;
-
-public class Example
-{
- private static TestClass test = new TestClass(3);
-
- public static void Main()
- {
- Example ex = new Example();
- Console.WriteLine(test.Value);
- }
-}
-
-public class TestClass
-{
- public readonly int Value;
-
- public TestClass(int value)
- {
- if (value < 0 || value > 1) throw new ArgumentOutOfRangeException(nameof(value));
- Value = value;
- }
-}
-// The example displays the following output:
-// Unhandled Exception: System.TypeInitializationException:
-// The type initializer for 'Example' threw an exception. --->
-// System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
-// at TestClass..ctor(Int32 value)
-// at Example..cctor()
-// --- End of inner exception stack trace ---
-// at Example.Main()
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/project.csproj
deleted file mode 100644
index f10875eb5aa0f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/csharp/project.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net481
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/fsharp/Missing1.fs b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/fsharp/Missing1.fs
deleted file mode 100644
index 97310086c979e..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/fsharp/Missing1.fs
+++ /dev/null
@@ -1,27 +0,0 @@
-module Missing1
-
-open Missing1a
-//
-open System
-
-type Person(fName, lName) =
- static let infoModule = InfoModule DateTime.UtcNow
-
- do infoModule.Increment() |> ignore
-
- override _.ToString() =
- $"{fName} {lName}"
-let p = Person("John", "Doe")
-
-printfn $"{p}"
-// The example displays the following output if missing1a.dll is renamed or removed:
-// Unhandled Exception: System.TypeInitializationException:
-// The type initializer for 'Person' threw an exception. --->
-// System.IO.FileNotFoundException: Could not load file or assembly
-// 'Missing1a, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
-// or one of its dependencies. The system cannot find the file specified.
-// at Person..cctor()
-// --- End of inner exception stack trace ---
-// at Person..ctor(String fName, String lName)
-// at Example.Main()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/fsharp/Missing1a.fs b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/fsharp/Missing1a.fs
deleted file mode 100644
index 39c91e6d9e76f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/fsharp/Missing1a.fs
+++ /dev/null
@@ -1,15 +0,0 @@
-module Missing1a
-
-//
-open System
-
-type InfoModule(firstUse: DateTime) =
- let mutable ctr = 0
-
- member _.Increment() =
- ctr <- ctr + 1
- ctr
-
- member _.GetInitializationTime() =
- firstUse
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/fsharp/Regex1.fs b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/fsharp/Regex1.fs
deleted file mode 100644
index 1e3fc8481a766..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/fsharp/Regex1.fs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-open System
-open System.Text.RegularExpressions
-
-let domain = AppDomain.CurrentDomain
-// Set a timeout interval of -2 seconds.
-domain.SetData("REGEX_DEFAULT_MATCH_TIMEOUT", TimeSpan.FromSeconds -2)
-
-let rgx = Regex "[aeiouy]"
-printfn $"Regular expression pattern: {rgx}"
-printfn $"Timeout interval for this regex: {rgx.MatchTimeout.TotalSeconds} seconds"
-// The example displays the following output:
-// Unhandled Exception: System.TypeInitializationException:
-// The type initializer for 'System.Text.RegularExpressions.Regex' threw an exception. --->
-// System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
-// Parameter name: AppDomain data 'REGEX_DEFAULT_MATCH_TIMEOUT' contains an invalid value or
-// object for specifying a default matching timeout for System.Text.RegularExpressions.Regex.
-// at System.Text.RegularExpressions.Regex.InitDefaultMatchTimeout()
-// at System.Text.RegularExpressions.Regex..cctor()
-// --- End of inner exception stack trace ---
-// at System.Text.RegularExpressions.Regex..ctor(String pattern)
-// at Example.Main()
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/CtorException1.vb b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/CtorException1.vb
deleted file mode 100644
index 38b374616017b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/CtorException1.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Class Example1
- Shared test As New TestClass(3)
-
- Public Shared Sub Main()
- Dim ex As New Example1()
- Console.WriteLine(test.Value)
- End Sub
-End Class
-
-Public Class TestClass
- Public ReadOnly Value As Integer
-
- Public Sub New(value As Integer)
- If value < 0 Or value > 1 Then Throw New ArgumentOutOfRangeException(NameOf(value))
- value = value
- End Sub
-End Class
-' The example displays the following output:
-' Unhandled Exception: System.TypeInitializationException:
-' The type initializer for 'Example' threw an exception. --->
-' System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
-' at TestClass..ctor(Int32 value)
-' at Example..cctor()
-' --- End of inner exception stack trace ---
-' at Example.Main()
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/GettingVersions1.vb b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/GettingVersions1.vb
deleted file mode 100644
index e2576f1835812..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/GettingVersions1.vb
+++ /dev/null
@@ -1,64 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Imports System.Reflection
-
-
-Module modMain
-
- Public Sub Main()
- GetOsVersion()
- Console.WriteLine()
- GetClrVersion()
- Console.WriteLine()
- GetSpecificAssemblyVersion()
- Console.WriteLine()
- Example2.GetExecutingAssemblyVersion()
- Console.WriteLine()
- GetApplicationVersion()
- End Sub
-
- Private Sub GetOsVersion()
- '
- ' Get the operating system version.
- Dim os As OperatingSystem = Environment.OSVersion
- Dim ver As Version = os.Version
- Console.WriteLine("Operating System: {0} ({1})", os.VersionString, ver.ToString())
- '
- End Sub
-
- Private Sub GetClrVersion()
- '
- ' Get the common language runtime version.
- Dim ver As Version = Environment.Version
- Console.WriteLine("CLR Version {0}", ver.ToString())
- '
- End Sub
-
- Private Sub GetSpecificAssemblyVersion()
- ' Get the version of a specific assembly.
- Dim filename As String = ".\StringLibrary.dll"
- Dim assem As Assembly = Assembly.ReflectionOnlyLoadFrom(filename)
- Dim assemName As AssemblyName = assem.GetName()
- Dim ver As Version = assemName.Version
- Console.WriteLine("{0}, Version {1}", assemName.Name, ver.ToString())
- End Sub
-
- Private Sub GetApplicationVersion()
- ' Get the version of the executing assembly (that is, this assembly).
- Dim assem As Assembly = Assembly.GetEntryAssembly()
- Dim assemName As AssemblyName = assem.GetName()
- Dim ver As Version = assemName.Version
- Console.WriteLine("Application {0}, Version {1}", assemName.Name, ver.ToString())
- End Sub
-End Module
-
-Public Module Example2
- Public Sub GetExecutingAssemblyVersion()
- ' Get the version of the current assembly.
- Dim assem As Assembly = Assembly.GetExecutingAssembly()
- Dim assemName As AssemblyName = assem.GetName()
- Dim ver As Version = assemName.Version
- Console.WriteLine("{0}, Version {1}", assemName.Name, ver.ToString())
- End Sub
-End Module
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Missing1.vb b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Missing1.vb
deleted file mode 100644
index 8568b653323a3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Missing1.vb
+++ /dev/null
@@ -1,43 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Module Example3
- Public Sub Main()
- Dim p As New Person("John", "Doe")
- Console.WriteLine(p)
- End Sub
-End Module
-
-Public Class Person
- Shared infoModule As InfoModule
-
- Dim fName As String
- Dim mName As String
- Dim lName As String
-
- Shared Sub New()
- infoModule = New InfoModule(DateTime.UtcNow)
- End Sub
-
- Public Sub New(fName As String, lName As String)
- Me.fName = fName
- Me.lName = lName
- infoModule.Increment()
- End Sub
-
- Public Overrides Function ToString() As String
- Return String.Format("{0} {1}", fName, lName)
- End Function
-End Class
-' The example displays the following output if missing1a.dll is renamed or removed:
-' Unhandled Exception: System.TypeInitializationException:
-' The type initializer for 'Person' threw an exception. --->
-' System.IO.FileNotFoundException: Could not load file or assembly
-' 'Missing1a, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
-' or one of its dependencies. The system cannot find the file specified.
-' at Person..cctor()
-' --- End of inner exception stack trace ---
-' at Person..ctor(String fName, String lName)
-' at Example.Main()
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Missing1a.vb b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Missing1a.vb
deleted file mode 100644
index 1ee7064e804bf..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Missing1a.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Class InfoModule
- Private firstUse As DateTime
- Private ctr As Integer = 0
-
- Public Sub New(dat As DateTime)
- firstUse = dat
- End Sub
-
- Public Function Increment() As Integer
- ctr += 1
- Return ctr
- End Function
-
- Public Function GetInitializationTime() As DateTime
- Return firstUse
- End Function
-End Class
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Project.vbproj
deleted file mode 100644
index 874c98f34776c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net10.0
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Regex1.vb b/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Regex1.vb
deleted file mode 100644
index 2799d477a72ca..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/TypeInitializationException/Overview/vb/Regex1.vb
+++ /dev/null
@@ -1,30 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Text.RegularExpressions
-
-Module Example4
- Public Sub Main()
- Dim domain As AppDomain = AppDomain.CurrentDomain
- ' Set a timeout interval of -2 seconds.
- domain.SetData("REGEX_DEFAULT_MATCH_TIMEOUT", TimeSpan.FromSeconds(-2))
-
- Dim rgx As New Regex("[aeiouy]")
- Console.WriteLine("Regular expression pattern: {0}", rgx.ToString())
- Console.WriteLine("Timeout interval for this regex: {0} seconds",
- rgx.MatchTimeout.TotalSeconds)
- End Sub
-End Module
-' The example displays the following output:
-' Unhandled Exception: System.TypeInitializationException:
-' The type initializer for 'System.Text.RegularExpressions.Regex' threw an exception. --->
-' System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
-' Parameter name: AppDomain data 'REGEX_DEFAULT_MATCH_TIMEOUT' contains an invalid value or
-' object for specifying a default matching timeout for System.Text.RegularExpressions.Regex.
-' at System.Text.RegularExpressions.Regex.InitDefaultMatchTimeout()
-' at System.Text.RegularExpressions.Regex..cctor()
-' --- End of inner exception stack trace ---
-' at System.Text.RegularExpressions.Regex..ctor(String pattern)
-' at Example.Main()
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/GettingVersions1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/GettingVersions1.cs
deleted file mode 100644
index 7f3c7d773cc6f..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/GettingVersions1.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-using System;
-using System.Reflection;
-
-[assembly: CLSCompliant(true)]
-public class Class1
-{
- public static void Main()
- {
- Example1 ex1 = new Example1();
-
- GetOsVersion();
- Console.WriteLine();
- GetClrVersion();
- Console.WriteLine();
- GetSpecificAssemblyVersion();
- Console.WriteLine();
- Example1.GetExecutingAssemblyVersion();
- Console.WriteLine();
- GetApplicationVersion();
- }
-
- private static void GetOsVersion()
- {
- //
- // Get the operating system version.
- OperatingSystem os = Environment.OSVersion;
- Version ver = os.Version;
- Console.WriteLine($"Operating System: {os.VersionString} ({ver.ToString()})");
- //
- }
-
- private static void GetClrVersion()
- {
- //
- // Get the common language runtime version.
- Version ver = Environment.Version;
- Console.WriteLine($"CLR Version {ver.ToString()}");
- //
- }
-
- private static void GetSpecificAssemblyVersion()
- {
- // Get the version of a specific assembly.
- string filename = @".\StringLibrary.dll";
- Assembly assem = Assembly.ReflectionOnlyLoadFrom(filename);
- AssemblyName assemName = assem.GetName();
- Version ver = assemName.Version;
- Console.WriteLine("{0}, Version {1}", assemName.Name, ver.ToString());
- }
-
- private static void GetApplicationVersion()
- {
- // Get the version of the executing assembly (that is, this assembly).
- Assembly assem = Assembly.GetEntryAssembly();
- AssemblyName assemName = assem.GetName();
- Version ver = assemName.Version;
- Console.WriteLine("Application {0}, Version {1}", assemName.Name, ver.ToString());
- }
-}
-
-public class Example1
-{
- public static void GetExecutingAssemblyVersion()
- {
- // Get the version of the current application.
- Assembly assem = typeof(Example1).Assembly;
- AssemblyName assemName = assem.GetName();
- Version ver = assemName.Version;
- Console.WriteLine("{0}, Version {1}", assemName.Name, ver.ToString());
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/Project.csproj
deleted file mode 100644
index 7e7c9153235df..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/Project.csproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- Library
- net481
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/clickonce.cs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/clickonce.cs
deleted file mode 100644
index cf0bcd4cb442b..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/clickonce.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-using System;
-using System.Deployment.Application;
-
-public class Example
-{
- public static void Main()
- {
- Version ver = ApplicationDeployment.CurrentDeployment.CurrentVersion;
- Console.WriteLine($"ClickOnce Publish Version: {ver}");
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/comparisons1.cs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/comparisons1.cs
deleted file mode 100644
index d50e6800846c4..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/comparisons1.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-
-public class Example7
-{
- public static void Main()
- {
- CompareSimple();
- }
-
- private static void CompareSimple()
- {
- //
- Version v1 = new Version(2, 0);
- Version v2 = new Version("2.1");
- Console.Write("Version {0} is ", v1);
- switch(v1.CompareTo(v2))
- {
- case 0:
- Console.Write("the same as");
- break;
- case 1:
- Console.Write("later than");
- break;
- case -1:
- Console.Write("earlier than");
- break;
- }
- Console.WriteLine($" Version {v2}.");
- // The example displays the following output:
- // Version 2.0 is earlier than Version 2.1.
- //
- }
-}
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/comparisons2.cs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/comparisons2.cs
deleted file mode 100644
index a0b01047657fc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/comparisons2.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-using System;
-
-enum VersionTime {Earlier = -1, Same = 0, Later = 1 };
-
-public class Example2
-{
- public static void Main()
- {
- Version v1 = new Version(1, 1);
- Version v1a = new Version("1.1.0");
- ShowRelationship(v1, v1a);
-
- Version v1b = new Version(1, 1, 0, 0);
- ShowRelationship(v1b, v1a);
- }
-
- private static void ShowRelationship(Version v1, Version v2)
- {
- Console.WriteLine($"Relationship of {v1} to {v2}: {(VersionTime) v1.CompareTo(v2)}");
- }
-}
-// The example displays the following output:
-// Relationship of 1.1 to 1.1.0: Earlier
-// Relationship of 1.1.0.0 to 1.1.0: Later
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/currentapp.cs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/currentapp.cs
deleted file mode 100644
index 0a932351d50f8..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/currentapp.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-using System;
-using System.Reflection;
-
-public class Example4
-{
- public static void Main()
- {
- // Get the version of the executing assembly (that is, this assembly).
- Assembly assem = Assembly.GetEntryAssembly();
- AssemblyName assemName = assem.GetName();
- Version ver = assemName.Version;
- Console.WriteLine("Application {0}, Version {1}", assemName.Name, ver.ToString());
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/currentassem.cs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/currentassem.cs
deleted file mode 100644
index 6bae687263322..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/currentassem.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-using System;
-using System.Reflection;
-
-public class Example3
-{
- public static void Main()
- {
- // Get the version of the current assembly.
- Assembly assem = typeof(Example).Assembly;
- AssemblyName assemName = assem.GetName();
- Version ver = assemName.Version;
- Console.WriteLine("{0}, Version {1}", assemName.Name, ver.ToString());
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/specificassem.cs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/specificassem.cs
deleted file mode 100644
index d7a587dc2b58c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/csharp/specificassem.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-using System;
-using System.Reflection;
-
-public class Example5
-{
- public static void Main()
- {
- // Get the version of a specific assembly.
- string filename = @".\StringLibrary.dll";
- Assembly assem = Assembly.ReflectionOnlyLoadFrom(filename);
- AssemblyName assemName = assem.GetName();
- Version ver = assemName.Version;
- Console.WriteLine("{0}, Version {1}", assemName.Name, ver.ToString());
- }
-}
-//
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/GettingVersions1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/GettingVersions1.fs
deleted file mode 100644
index f1f4282466bd7..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/GettingVersions1.fs
+++ /dev/null
@@ -1,22 +0,0 @@
-module GettingVersions1
-
-open System
-
-let getOsVersion () =
- //
- // Get the operating system version.
- let os = Environment.OSVersion
- let ver = os.Version
- printfn $"Operating System: {os.VersionString} ({ver})"
- //
-
-let getClrVersion () =
- //
- // Get the common language runtime version.
- let ver = Environment.Version
- printfn $"CLR Version {ver}"
- //
-
-getOsVersion ()
-printfn ""
-getClrVersion ()
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/comparisons1.fs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/comparisons1.fs
deleted file mode 100644
index 774fa60d1363c..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/comparisons1.fs
+++ /dev/null
@@ -1,19 +0,0 @@
-module comparisons1
-
-//
-open System
-
-let v1 = Version(2, 0)
-let v2 = Version "2.1"
-
-printf $"Version {v1} is "
-
-match v1.CompareTo v2 with
-| 0 -> printf "the same as"
-| 1 -> printf "later than"
-| _ -> printf "earlier than"
-
-printf $" Version {v2}."
-// The example displays the following output:
-// Version 2.0 is earlier than Version 2.1.
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/comparisons2.fs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/comparisons2.fs
deleted file mode 100644
index 19b247609b787..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/comparisons2.fs
+++ /dev/null
@@ -1,24 +0,0 @@
-module comparisons2
-
-//
-open System
-
-type VersionTime =
- | Earlier = -1
- | Same = 0
- | Later = 1
-
-let showRelationship (v1: Version) (v2: Version) =
- printfn $"Relationship of {v1} to {v2}: {v1.CompareTo v2 |> enum}"
-
-let v1 = Version(1, 1)
-let v1a = Version "1.1.0"
-showRelationship v1 v1a
-
-let v1b = Version(1, 1, 0, 0)
-showRelationship v1b v1a
-
-// The example displays the following output:
-// Relationship of 1.1 to 1.1.0: Earlier
-// Relationship of 1.1.0.0 to 1.1.0: Later
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/currentapp.fs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/currentapp.fs
deleted file mode 100644
index 073c1288229dd..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/currentapp.fs
+++ /dev/null
@@ -1,11 +0,0 @@
-module currentapp
-
-//
-open System.Reflection
-
-// Get the version of the executing assembly (that is, this assembly).
-let assem = Assembly.GetEntryAssembly()
-let assemName = assem.GetName()
-let ver = assemName.Version
-printfn $"Application {assemName.Name}, Version {ver}"
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/currentassem.fs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/currentassem.fs
deleted file mode 100644
index f655819671945..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/currentassem.fs
+++ /dev/null
@@ -1,11 +0,0 @@
-module currentassem
-
-//
-type Example = class end
-
-// Get the version of the current assembly.
-let assem = typeof.Assembly
-let assemName = assem.GetName()
-let ver = assemName.Version
-printfn $"{assemName.Name}, Version {ver}"
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/specificassem.fs b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/specificassem.fs
deleted file mode 100644
index f930a4460da39..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/fsharp/specificassem.fs
+++ /dev/null
@@ -1,12 +0,0 @@
-module specificassem
-
-//
-open System.Reflection
-
-// Get the version of a specific assembly.
-let filename = @".\StringLibrary.dll"
-let assem = Assembly.ReflectionOnlyLoadFrom filename
-let assemName = assem.GetName()
-let ver = assemName.Version
-printfn $"{assemName.Name}, Version {ver}"
-//
\ No newline at end of file
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/Project.vbproj
deleted file mode 100644
index 0a86d93d4ebb3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/Project.vbproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- Library
- net48
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/clickonce.vb b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/clickonce.vb
deleted file mode 100644
index 1e374a801dbed..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/clickonce.vb
+++ /dev/null
@@ -1,13 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Deployment.Application
-
-Module Example0
- Public Sub Main()
- Dim ver As Version = ApplicationDeployment.CurrentDeployment.CurrentVersion
- Console.WriteLine("ClickOnce Publish Version: {0}", ver)
- End Sub
-End Module
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/comparisons1.vb b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/comparisons1.vb
deleted file mode 100644
index f955dc5688b50..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/comparisons1.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-Module Example
- Public Sub Main()
- CompareSimple()
- End Sub
-
- Private Sub CompareSimple()
- '
- Dim v1 As New Version(2,0)
- Dim v2 As New Version("2.1")
- Console.Write("Version {0} is ", v1)
- Select Case v1.CompareTo(v2)
- Case 0
- Console.Write("the same as")
- Case 1
- Console.Write("later than")
- Case -1
- Console.Write("earlier than")
- End Select
- Console.WriteLine(" Version {0}.", v2)
- ' The example displays the following output:
- ' Version 2.0 is earlier than Version 2.1.
- '
- End Sub
-End Module
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/comparisons2.vb b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/comparisons2.vb
deleted file mode 100644
index 5d3923dff89e5..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/comparisons2.vb
+++ /dev/null
@@ -1,29 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Public Enum VersionTime
- Earlier = -1
- Same = 0
- Later = 1
-End Enum
-
-Module Example2
- Public Sub Main()
- Dim v1 As New Version(1, 1)
- Dim v1a As New Version("1.1.0")
- ShowRelationship(v1, v1a)
-
- Dim v1b As New Version(1, 1, 0, 0)
- ShowRelationship(v1b, v1a)
- End Sub
-
- Private Sub ShowRelationship(v1 As Version, v2 As Version)
- Console.WriteLine("Relationship of {0} to {1}: {2}",
- v1, v2, CType(v1.CompareTo(v2), VersionTime))
- End Sub
-End Module
-' The example displays the following output:
-' Relationship of 1.1 to 1.1.0: Earlier
-' Relationship of 1.1.0.0 to 1.1.0: Later
-'
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/currentapp.vb b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/currentapp.vb
deleted file mode 100644
index d4786b97b6be3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/currentapp.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Reflection
-
-Module Example3
- Public Sub Main()
- ' Get the version of the executing assembly (that is, this assembly).
- Dim assem As Assembly = Assembly.GetEntryAssembly()
- Dim assemName As AssemblyName = assem.GetName()
- Dim ver As Version = assemName.Version
- Console.WriteLine("Application {0}, Version {1}", assemName.Name, ver.ToString())
- End Sub
-End Module
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/currentassem.vb b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/currentassem.vb
deleted file mode 100644
index 582089051b0f3..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/currentassem.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-
-'
-Imports System.Reflection
-
-Module Example1
- Public Sub Main()
- ' Get the version of the current assembly.
- Dim assem As Assembly = GetType(Example).Assembly
- Dim assemName As AssemblyName = assem.GetName()
- Dim ver As Version = assemName.Version
- Console.WriteLine("{0}, Version {1}", assemName.Name, ver.ToString())
- End Sub
-End Module
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/specificassem.vb b/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/specificassem.vb
deleted file mode 100644
index a7d9479f04ebc..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/System/Version/Overview/vb/specificassem.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-' Visual Basic .NET Document
-Option Strict On
-'
-Imports System.Reflection
-
-Module Example4
- Public Sub Main()
- ' Get the version of a specific assembly.
- Dim filename As String = ".\StringLibrary.dll"
- Dim assem As Assembly = Assembly.ReflectionOnlyLoadFrom(filename)
- Dim assemName As AssemblyName = assem.GetName()
- Dim ver As Version = assemName.Version
- Console.WriteLine("{0}, Version {1}", assemName.Name, ver.ToString())
- End Sub
-End Module
-'
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/system-reflection-context-customreflectioncontext/csharp/CustomReflectionContextExample.csproj b/docs/fundamentals/runtime-libraries/snippets/system-reflection-context-customreflectioncontext/csharp/CustomReflectionContextExample.csproj
deleted file mode 100644
index c1471653bed76..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/system-reflection-context-customreflectioncontext/csharp/CustomReflectionContextExample.csproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- Exe
- net10.0
-
-
-
-
-
-
-
diff --git a/docs/fundamentals/runtime-libraries/snippets/system-reflection-context-customreflectioncontext/csharp/program.cs b/docs/fundamentals/runtime-libraries/snippets/system-reflection-context-customreflectioncontext/csharp/program.cs
deleted file mode 100644
index 4527a78c7d647..0000000000000
--- a/docs/fundamentals/runtime-libraries/snippets/system-reflection-context-customreflectioncontext/csharp/program.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Reflection.Context;
-
-namespace ConsoleApplication1
-{
- //
- //A blank example attribute.
- class MyAttribute : Attribute
- {
- }
-
- //Reflection context with custom rules.
- class MyCustomReflectionContext : CustomReflectionContext
- {
- //Called whenever the reflection context checks for custom attributes.
- protected override IEnumerable
-}
diff --git a/docs/fundamentals/runtime-libraries/system-accessviolationexception.md b/docs/fundamentals/runtime-libraries/system-accessviolationexception.md
deleted file mode 100644
index 3883e2df177c9..0000000000000
--- a/docs/fundamentals/runtime-libraries/system-accessviolationexception.md
+++ /dev/null
@@ -1,36 +0,0 @@
----
-title: System.AccessViolationException class
-description: Learn about the System.AccessViolationException class.
-ms.date: 05/28/2025
----
-# System.AccessViolationException class
-
-[!INCLUDE [context](includes/context.md)]
-
-An access violation occurs in unmanaged or unsafe code when the code attempts to read or write to memory that has not been allocated, or to which it does not have access. This usually occurs because a pointer has a bad value. Not all reads or writes through bad pointers lead to access violations, so an access violation usually indicates that several reads or writes have occurred through bad pointers, and that memory might be corrupted. Thus, access violations almost always indicate serious programming errors. An clearly identifies these serious errors.
-
-In programs that consist entirely of verifiable managed code, all references are either valid or null, and access violations are impossible. Any operation that attempts to reference a null reference in verifiable code throws a exception. An occurs only when verifiable managed code interacts with unmanaged code or with unsafe managed code.
-
-## Troubleshoot AccessViolationException exceptions
-
-An exception can occur only in unsafe managed code or when verifiable managed code interacts with unmanaged code:
-
-- An access violation that occurs in unsafe managed code can be expressed as either a exception or an exception, depending on the platform.
-- An access violation in unmanaged code that bubbles up to managed code is always wrapped in an exception.
-
-In either case, you can identify and correct the cause of the exception as follows:
-
-- Make sure that the memory that you're attempting to access has been allocated. An exception is always thrown by an attempt to access protected memory—that is, to access memory that's not allocated or that's not owned by a process.
-
- Automatic memory management is one of the services that the .NET runtime provides. If managed code provides the same functionality as your unmanaged code, consider moving to managed code to take advantage of this functionality. For more information, see [Automatic memory management](../../standard/automatic-memory-management.md).
-
-- Make sure that the memory that you're attempting to access hasn't been corrupted. If several read or write operations have occurred through bad pointers, memory might be corrupted. This typically occurs when reading or writing to addresses outside of a predefined buffer.
-
-## AccessViolationException and try/catch blocks
-
- exceptions thrown by the .NET runtime aren't handled by the `catch` statement in a structured exception handler if the exception occurs outside of the memory reserved by the runtime.
-
-**.NET Framework only**: To handle such an exception, apply the attribute to the method in which the exception is thrown. This change does not affect exceptions thrown by user code, which can continue to be caught by a `catch` statement.
-
-> [!CAUTION]
-> The [HandleProcessCorruptedStateExceptions attribute](xref:System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptionsAttribute) is obsolete in current .NET versions. Recovery from corrupted process state–exceptions isn't supported, and the attribute, if present, is ignored.
diff --git a/docs/fundamentals/runtime-libraries/system-appcontext.md b/docs/fundamentals/runtime-libraries/system-appcontext.md
deleted file mode 100644
index d76b16b288eef..0000000000000
--- a/docs/fundamentals/runtime-libraries/system-appcontext.md
+++ /dev/null
@@ -1,129 +0,0 @@
----
-title: System.AppContext class
-description: Learn about the System.AppContext class through these additional API remarks.
-ms.date: 01/02/2024
-dev_langs:
- - CSharp
- - FSharp
- - VB
----
-# System.AppContext class
-
-[!INCLUDE [context](includes/context.md)]
-
-The class enables library writers to provide a uniform opt-out mechanism for new functionality for their users. It establishes a loosely coupled contract between components in order to communicate an opt-out request. This capability is typically important when a change is made to existing functionality. Conversely, there is already an implicit opt-in for new functionality.
-
-## AppContext for library developers
-
-Libraries use the class to define and expose compatibility switches, while library users can set those switches to affect the library behavior. By default, libraries provide the new functionality, and they only alter it (that is, they provide the previous functionality) if the switch is set. This allows libraries to provide new behavior for an existing API while continuing to support callers who depend on the previous behavior.
-
-### Define the switch name
-
-The most common way to allow consumers of your library to opt out of a change of behavior is to define a named switch. Its `value` element is a name/value pair that consists of the name of a switch and its value. By default, the switch is always implicitly `false`, which provides the new behavior (and makes the new behavior opt-in by default). Setting the switch to `true` enables it, which provides the legacy behavior. Explicitly setting the switch to `false` also provides the new behavior.
-
-It's beneficial to use a consistent format for switch names, since they're a formal contract exposed by a library. The following are two obvious formats:
-
-- *Switch*.*namespace*.*switchname*
-- *Switch*.*library*.*switchname*
-
-Once you define and document the switch, callers can use it by calling the method programmatically. .NET Framework apps can also use the switch by adding an [``](../../framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md) element to their application configuration file or by using the registry. For more information about how callers use and set the value of configuration switches, see the [AppContext for library consumers](#appcontext-for-library-consumers) section.
-
-In .NET Framework, when the common language runtime runs an application, it automatically reads the registry's compatibility settings and loads the application configuration file to populate the application's instance. Because the instance is populated either programmatically by the caller or by the runtime, .NET Framework apps don't have to take any action, such as calling the method, to configure the instance.
-
-### Check the setting
-
-You can check if a consumer has declared the value of the switch and act appropriately by calling the method. The method returns `true` if the `switchName` argument is found, and its `isEnabled` argument indicates the value of the switch. Otherwise, the method returns `false`.
-
-### Example
-
-The following example illustrates the use of the class to allow the customer to choose the original behavior of a library method. The following is version 1.0 of a library named `StringLibrary`. It defines a `SubstringStartsAt` method that performs an ordinal comparison to determine the starting index of a substring within a larger string.
-
-:::code language="csharp" source="./snippets/System/AppContext/Overview/csharp/V1/Example4.cs" id="Snippet4":::
-:::code language="fsharp" source="./snippets/System/AppContext/Overview/fsharp/Example4.fs" id="Snippet4":::
-:::code language="vb" source="./snippets/System/AppContext/Overview/vb/V1/Example4.vb" id="Snippet4":::
-
-The following example then uses the library to find the starting index of the substring "archæ" in "The archaeologist". Because the method performs an ordinal comparison, the substring cannot be found.
-
-:::code language="csharp" source="./snippets/System/AppContext/Overview/csharp/V1/Example4.cs" id="Snippet5":::
-:::code language="fsharp" source="./snippets/System/AppContext/Overview/fsharp/Example4.fs" id="Snippet5":::
-:::code language="vb" source="./snippets/System/AppContext/Overview/vb/V1/Example4.vb" id="Snippet5":::
-
-Version 2.0 of the library, however, changes the `SubstringStartsAt` method to use culture-sensitive comparison.
-
-:::code language="csharp" source="./snippets/System/AppContext/Overview/csharp/V2/Example6.cs" id="Snippet6":::
-:::code language="fsharp" source="./snippets/System/AppContext/Overview/fsharp/Example6.fs" id="Snippet6":::
-:::code language="vb" source="./snippets/System/AppContext/Overview/vb/V2/Example6.vb" id="Snippet6":::
-
-When the app is recompiled to run against the new version of the library, it now reports that the substring "archæ" is found at index 4 in "The archaeologist".
-
-:::code language="csharp" source="./snippets/System/AppContext/Overview/csharp/V2/Example6.cs" id="Snippet7":::
-:::code language="fsharp" source="./snippets/System/AppContext/Overview/fsharp/Example6.fs" id="Snippet7":::
-:::code language="vb" source="./snippets/System/AppContext/Overview/vb/V2/Example6.vb" id="Snippet7":::
-
-This change can be prevented from breaking the applications that depend on the original behavior by defining a switch. In this case, the switch is named `StringLibrary.DoNotUseCultureSensitiveComparison`. Its default value, `false`, indicates that the library should perform its version 2.0 culture-sensitive comparison. `true` indicates that the library should perform its version 1.0 ordinal comparison. A slight modification of the previous code allows the library consumer to set the switch to determine the kind of comparison the method performs.
-
-:::code language="csharp" source="./snippets/System/AppContext/Overview/csharp/V3/Example8.cs" id="Snippet8":::
-:::code language="fsharp" source="./snippets/System/AppContext/Overview/fsharp/Example8.fs" id="Snippet8":::
-:::code language="vb" source="./snippets/System/AppContext/Overview/vb/V3/Example8.vb" id="Snippet8":::
-
-A .NET Framework application can then use the following configuration file to restore the version 1.0 behavior.
-
-```xml
-
-
-
-
-
-```
-
-When the application is run with the configuration file present, it produces the following output:
-
-```output
-'archæ' not found in 'The archaeologist'
-```
-
-## AppContext for library consumers
-
-If you're the consumer of a library, the class allows you to take advantage of a library or library method's opt-out mechanism for new functionality. Individual methods of the class library that you are calling define particular switches that enable or disable a new behavior. The value of the switch is a Boolean. If it is `false`, which is typically the default value, the new behavior is enabled; if it is `true`, the new behavior is disabled, and the member behaves as it did previously.
-
-You can set the value of a switch by calling the method in your code. The `switchName` argument defines the switch name, and the `isEnabled` property defines the value of the switch. Because is a static class, it is available on a per-application domain basis. Calling the has application scope; that is, it affects only the application.
-
-.NET Framework apps have additional ways to set the value of a switch:
-
-- By adding an `` element to the [``](../../framework/configure-apps/file-schema/runtime/runtime-element.md) section of the app.config file. The switch has a single attribute, `value`, whose value is a string that represents a key/value pair containing both the switch name and its value.
-
- To define multiple switches, separate each switch's key/value pair in the [``](../../framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md) element's `value` attribute with a semicolon. In that case, the `` element has the following format:
-
- ```xml
-
- ```
-
- Using the `` element to define a configuration setting has application scope; that is, it affects only the application.
-
- > [!NOTE]
- > For information on the switches defined by .NET Framework, see [`` element](../../framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md).
-
-- By adding an entry to the registry. Add a new string value to the **HKLM\SOFTWARE\Microsoft\\.NETFramework\AppContext** subkey. Set the name of the entry to the name of the switch. Set its value to one of the following options: `True`, `true`, `False`, or `false`. If the runtime encounters any other value, it ignores the switch.
-
- On a 64-bit operating system, you must also add the same entry to the **HKLM\SOFTWARE\Wow6432Node\Microsoft\\.NETFramework\AppContext** subkey.
-
- Using the registry to define an switch has machine scope; that is, it affects every application running on the machine.
-
-For ASP.NET and ASP.NET Core applications, you set a switch by adding an [``](../../framework/configure-apps/file-schema/appsettings/add-element-for-appsettings.md) element to the [``](../../framework/configure-apps/file-schema/appsettings/index.md) section of the web.config file. For example:
-
-```xml
-
-
-
-
-```
-
-If you set the same switch in more than one way, the order of precedence for determining which setting overrides the others is:
-
-1. The programmatic setting.
-2. The setting in the app.config file (for .NET Framework apps) or the web.config file (for ASP.NET Core apps).
-3. The registry setting (for .NET Framework apps only).
-
-## See also
-
-- [AppContext switch](../../framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md)
diff --git a/docs/fundamentals/runtime-libraries/system-appdomain-unhandledexception.md b/docs/fundamentals/runtime-libraries/system-appdomain-unhandledexception.md
deleted file mode 100644
index a5f4fdde13ec1..0000000000000
--- a/docs/fundamentals/runtime-libraries/system-appdomain-unhandledexception.md
+++ /dev/null
@@ -1,35 +0,0 @@
----
-title: System.AppDomain.UnhandledException event
-description: Learn about the System.AppDomain.UnhandledException event.
-ms.date: 01/24/2024
----
-# System.AppDomain.UnhandledException event
-
-[!INCLUDE [context](includes/context.md)]
-
-The event provides notification of uncaught exceptions. It allows the application to log information about the exception before the system default handler reports the exception to the user and terminates the application. If sufficient information about the state of the application is available, other actions may be undertaken - such as saving program data for later recovery. Caution is advised, because program data can become corrupted when exceptions are not handled. The handler will also be running while holding locks held when the exception was thrown, so care should be taken to avoid waiting on other resources which could introduce deadlocks.
-
-This event can be handled in any application domain. However, the event is not necessarily raised in the application domain where the exception occurred. An exception is unhandled only if the entire stack for the thread has been unwound without finding an applicable exception handler, so the first place the event can be raised is in the application domain where the thread originated.
-
-If the event is handled in the default application domain, it is raised there for any unhandled exception in any thread, no matter what application domain the thread started in. If the thread started in an application domain that has an event handler for , the event is raised in that application domain. If that application domain is not the default application domain, and there is also an event handler in the default application domain, the event is raised in both application domains.
-
-For example, suppose a thread starts in application domain "AD1", calls a method in application domain "AD2", and from there calls a method in application domain "AD3", where it throws an exception. The first application domain in which the event can be raised is "AD1". If that application domain is not the default application domain, the event can also be raised in the default application domain.
-
-> [!NOTE]
-> The common language runtime suspends thread aborts while event handlers for the event are executing.
-
-If the event handler has a attribute with the appropriate flags, the event handler is treated as a constrained execution region.
-
-Starting with .NET Framework 4, this event is not raised for exceptions that corrupt the state of the process, such as stack overflows or access violations, unless the event handler is security-critical and has the attribute.
-
-To register an event handler for this event, you must have the required permissions, or a is thrown.
-
-For more information about handling events, see [Handling and Raising Events](../../standard/events/index.md).
-
-## Other events for unhandled exceptions
-
-For certain application models, the event can be preempted by other events if the unhandled exception occurs in the main application thread.
-
-In applications that use Windows Forms, unhandled exceptions in the main application thread cause the event to be raised. If this event is handled, the default behavior is that the unhandled exception does not terminate the application, although the application is left in an unknown state. In that case, the event is not raised. This behavior can be changed by using the application configuration file, or by using the method to change the mode to before the event handler is hooked up. This applies only to the main application thread. The event is raised for unhandled exceptions thrown in other threads.
-
-The Visual Basic application framework provides another event for unhandled exceptions in the main application thread—the event. This event has an event arguments object with the same name as the event arguments object used by , but with different properties. In particular, this event arguments object has an property that allows the application to continue running, ignoring the unhandled exception (and leaving the application in an unknown state). In that case, the event is not raised.
diff --git a/docs/fundamentals/runtime-libraries/system-boolean.md b/docs/fundamentals/runtime-libraries/system-boolean.md
deleted file mode 100644
index e60ff362f75ee..0000000000000
--- a/docs/fundamentals/runtime-libraries/system-boolean.md
+++ /dev/null
@@ -1,156 +0,0 @@
----
-title: System.Boolean struct
-description: Learn about the System.Boolean struct through these additional API remarks.
-ms.date: 01/02/2024
-dev_langs:
- - CSharp
- - FSharp
- - VB
----
-# System.Boolean struct
-
-[!INCLUDE [context](includes/context.md)]
-
-A instance can have either of two values: `true` or `false`.
-
-The structure provides methods that support the following tasks:
-
-- Converting Boolean values to strings:
-- Parsing strings to convert them to Boolean values: and
-- Comparing values: and
-
-This article explains these tasks and other usage details.
-
-## Format Boolean values
-
-The string representation of a is either "True" for a `true` value or "False" for a `false` value. The string representation of a value is defined by the read-only and fields.
-
-You use the method to convert Boolean values to strings. The Boolean structure includes two overloads: the parameterless method and the method, which includes a parameter that controls formatting. However, because this parameter is ignored, the two overloads produce identical strings. The method does not support culture-sensitive formatting.
-
-The following example illustrates formatting with the method. Note that the C# and VB examples use the [composite formatting](../../standard/base-types/composite-formatting.md) feature, while the F# example uses [string interpolation](../../fsharp/language-reference/interpolated-strings.md). In both cases the method is called implicitly.
-
-:::code language="csharp" source="./snippets/System/Boolean/Overview/csharp/tostring1.cs" id="Snippet3":::
-:::code language="fsharp" source="./snippets/System/Boolean/Overview/fsharp/tostring1.fs" id="Snippet3":::
-:::code language="vb" source="./snippets/System/Boolean/Overview/vb/tostring1.vb" id="Snippet3":::
-
-Because the structure can have only two values, it is easy to add custom formatting. For simple custom formatting in which other string literals are substituted for "True" and "False", you can use any conditional evaluation feature supported by your language, such as the [conditional operator](../../csharp/language-reference/operators/conditional-operator.md) in C# or the [If operator](../../visual-basic/language-reference/operators/if-operator.md) in Visual Basic. The following example uses this technique to format values as "Yes" and "No" rather than "True" and "False".
-
-:::code language="csharp" source="./snippets/System/Boolean/Overview/csharp/tostring2.cs" id="Snippet4":::
-:::code language="vb" source="./snippets/System/Boolean/Overview/vb/tostring2.vb" id="Snippet4":::
-:::code language="fsharp" source="./snippets/System/Boolean/Overview/fsharp/tostring2.fs" id="Snippet4":::
-
-For more complex custom formatting operations, including culture-sensitive formatting, you can call the method and provide an implementation. The following example implements the and interfaces to provide culture-sensitive Boolean strings for the English (United States), French (France), and Russian (Russia) cultures.
-
-:::code language="csharp" source="./snippets/System/Boolean/Overview/csharp/format3.cs" id="Snippet5":::
-:::code language="fsharp" source="./snippets/System/Boolean/Overview/fsharp/format3.fs" id="Snippet5":::
-:::code language="vb" source="./snippets/System/Boolean/Overview/vb/format3.vb" id="Snippet5":::
-
-Optionally, you can use [resource files](/dotnet/framework/resources/) to define culture-specific Boolean strings.
-
-## Convert to and from Boolean values
-
-The structure implements the interface. As a result, you can use the class to perform conversions between a value and any other primitive type in .NET, or you can call the structure's explicit implementations. However, conversions between a and the following types are not supported, so the corresponding conversion methods throw an exception:
-
-- Conversion between and (the and methods).
-
-- Conversion between and (the and methods).
-
-All conversions from integral or floating-point numbers to Boolean values convert non-zero values to `true` and zero values to `false`. The following example illustrates this by calling selected overloads of the class.
-
-:::code language="csharp" source="./snippets/System/Boolean/Overview/csharp/conversion1.cs" id="Snippet6":::
-:::code language="fsharp" source="./snippets/System/Boolean/Overview/fsharp/conversion1.fs" id="Snippet6":::
-:::code language="vb" source="./snippets/System/Boolean/Overview/vb/conversion1.vb" id="Snippet6":::
-
-When converting from Boolean to numeric values, the conversion methods of the class convert `true` to 1 and `false` to 0. However, Visual Basic conversion functions convert `true` to either 255 (for conversions to values) or -1 (for all other numeric conversions). The following example converts `true` to numeric values by using a method, and, in the case of the Visual Basic example, by using the Visual Basic language's own conversion operator.
-
-:::code language="csharp" source="./snippets/System/Boolean/Overview/csharp/conversion3.cs" id="Snippet8":::
-:::code language="fsharp" source="./snippets/System/Boolean/Overview/fsharp/conversion3.fs" id="Snippet8":::
-:::code language="vb" source="./snippets/System/Boolean/Overview/vb/conversion3.vb" id="Snippet8":::
-
-For conversions from to string values, see the [Format Boolean values](#format-boolean-values) section. For conversions from strings to values, see the [Parse Boolean values](#parse-boolean-values) section.
-
-## Parse Boolean values
-
-The structure includes two static parsing methods,