From 1ad43ec93c87321f6d4e280e65ec7f7c744631d9 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 07:45:20 +0000
Subject: [PATCH 01/13] Initial plan for issue
From ce1e118c91e11fa346cdbff1f5a91313a8cd7ca3 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 07:56:21 +0000
Subject: [PATCH 02/13] Move DirectoryInfo.Root and List.IndexOf VB snippets to
new organization
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
.../ListT/IndexOf/Project.vbproj | 8 +++
.../ListT/IndexOf/source.vb | 53 +++++++++++++++++++
.../DirectoryInfo/Root/Project.vbproj | 8 +++
.../DirectoryInfo/Root/directoryinforoot2.vb | 28 ++++++++++
xml/System.Collections.Generic/List`1.xml | 2 +-
xml/System.IO/DirectoryInfo.xml | 2 +-
6 files changed, 99 insertions(+), 2 deletions(-)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/source.vb
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/Root/Project.vbproj
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/Root/directoryinforoot2.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj
new file mode 100644
index 00000000000..c02dc5044e7
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/source.vb
new file mode 100644
index 00000000000..4ea31ba7ed0
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/source.vb
@@ -0,0 +1,53 @@
+'
+Imports System.Collections.Generic
+
+Public Class Example
+
+ Public Shared Sub Main()
+
+ Dim dinosaurs As New List(Of String)
+
+ dinosaurs.Add("Tyrannosaurus")
+ dinosaurs.Add("Amargasaurus")
+ dinosaurs.Add("Mamenchisaurus")
+ dinosaurs.Add("Brachiosaurus")
+ dinosaurs.Add("Deinonychus")
+ dinosaurs.Add("Tyrannosaurus")
+ dinosaurs.Add("Compsognathus")
+
+ Console.WriteLine()
+ For Each dinosaur As String In dinosaurs
+ Console.WriteLine(dinosaur)
+ Next
+
+ Console.WriteLine(vbLf & _
+ "IndexOf(""Tyrannosaurus""): {0}", _
+ dinosaurs.IndexOf("Tyrannosaurus"))
+
+ Console.WriteLine(vbLf & _
+ "IndexOf(""Tyrannosaurus"", 3): {0}", _
+ dinosaurs.IndexOf("Tyrannosaurus", 3))
+
+ Console.WriteLine(vbLf & _
+ "IndexOf(""Tyrannosaurus"", 2, 2): {0}", _
+ dinosaurs.IndexOf("Tyrannosaurus", 2, 2))
+
+ End Sub
+End Class
+
+' This code example produces the following output:
+'
+'Tyrannosaurus
+'Amargasaurus
+'Mamenchisaurus
+'Brachiosaurus
+'Deinonychus
+'Tyrannosaurus
+'Compsognathus
+'
+'IndexOf("Tyrannosaurus"): 0
+'
+'IndexOf("Tyrannosaurus", 3): 5
+'
+'IndexOf("Tyrannosaurus", 2, 2): -1
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/Root/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/Root/Project.vbproj
new file mode 100644
index 00000000000..c02dc5044e7
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/Root/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/Root/directoryinforoot2.vb b/snippets/visualbasic/System.IO/DirectoryInfo/Root/directoryinforoot2.vb
new file mode 100644
index 00000000000..14c1de538a7
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/Root/directoryinforoot2.vb
@@ -0,0 +1,28 @@
+'
+Imports System.IO
+
+Module Module1
+
+ Sub Main()
+ Dim di1 As DirectoryInfo = New DirectoryInfo("\\tempshare\tempdir")
+ Dim di2 As DirectoryInfo = New DirectoryInfo("tempdir")
+ Dim di3 As DirectoryInfo = New DirectoryInfo("x:\tempdir")
+ Dim di4 As DirectoryInfo = New DirectoryInfo("c:\")
+
+ Console.WriteLine("The root path of '{0}' is '{1}'", di1.FullName, di1.Root)
+ Console.WriteLine("The root path of '{0}' is '{1}'", di2.FullName, di2.Root)
+ Console.WriteLine("The root path of '{0}' is '{1}'", di3.FullName, di3.Root)
+ Console.WriteLine("The root path of '{0}' is '{1}'", di4.FullName, di4.Root)
+ End Sub
+
+End Module
+
+' This code produces output similar to the following:
+
+' The root path of '\\tempshare\tempdir' is '\\tempshare\tempdir'
+' The root path of 'c:\Projects\ConsoleApplication1\ConsoleApplication1\bin\Debug\tempdir' is 'c:\'
+' The root path of 'x:\tempdir' is 'x:\'
+' The root path of 'c:\' is 'c:\'
+' Press any key to continue . . .
+
+'
diff --git a/xml/System.Collections.Generic/List`1.xml b/xml/System.Collections.Generic/List`1.xml
index 956b7817b9a..aeae10b3f32 100644
--- a/xml/System.Collections.Generic/List`1.xml
+++ b/xml/System.Collections.Generic/List`1.xml
@@ -2622,7 +2622,7 @@ Public Function StartsWith(e As Employee) As Boolean
The following example demonstrates all three overloads of the method. A of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the list from the beginning, and finds the first occurrence of the string. The method overload is used to search the list beginning with index location 3 and continuing to the end of the list, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/IndexOf/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_IndexOf/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/source.vb" id="Snippet1":::
]]>
diff --git a/xml/System.IO/DirectoryInfo.xml b/xml/System.IO/DirectoryInfo.xml
index 3416596fc4c..2909ae7dbad 100644
--- a/xml/System.IO/DirectoryInfo.xml
+++ b/xml/System.IO/DirectoryInfo.xml
@@ -3752,7 +3752,7 @@ The following example refers to the parent directory of a specified directory.
:::code language="csharp" source="~/snippets/csharp/System.IO/DirectoryInfo/Root/directoryinforoot2.cs" id="Snippet2":::
:::code language="fsharp" source="~/snippets/fsharp/System.IO/DirectoryInfo/Root/directoryinforoot2.fs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/directoryinforoot/VB/directoryinforoot2.vb" id="Snippet2":::
+ :::code language="vb" source="~/snippets/visualbasic/System.IO/DirectoryInfo/Root/directoryinforoot2.vb" id="Snippet2":::
]]>
From 3bc6f0b9d649ed0f068b983d3029f3a3263c9585 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 08:03:33 +0000
Subject: [PATCH 03/13] Move System.Collections.Generic VB snippets to new
organization
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
.../.ctor/Project.vbproj | 8 +
.../DictionaryTKey,TValue/.ctor/source.vb | 42 ++++
.../DictionaryTKey,TValue/.ctor/source2.vb | 35 +++
.../Overview/Project.vbproj | 8 +
.../Overview/Project.vbproj | 8 +
.../IDictionaryTKey,TValue/Overview/source.vb | 23 ++
.../ListT/Ranges/Project.vbproj | 8 +
.../ListT/Ranges/source.vb | 99 ++++++++
.../QueueT/Overview/Project.vbproj | 8 +
.../QueueT/Overview/source.vb | 92 ++++++++
.../.ctor/Project.vbproj | 8 +
.../.ctor/source.vb | 55 +++++
.../Overview/Project.vbproj | 8 +
.../Overview/source.vb | 164 +++++++++++++
.../.ctor/Project.vbproj | 8 +
.../SortedListTKey,TValue/.ctor/source.vb | 47 ++++
.../IDictionary/Project.vbproj | 8 +
.../IDictionary/source.vb | 216 ++++++++++++++++++
.../Overview/Project.vbproj | 8 +
.../StackT/Overview/Project.vbproj | 8 +
.../StackT/Overview/source.vb | 93 ++++++++
.../Dictionary`2.xml | 4 +-
.../IDictionary`2.xml | 2 +-
.../IReadOnlyDictionary`2.xml | 2 +-
xml/System.Collections.Generic/List`1.xml | 12 +-
xml/System.Collections.Generic/Queue`1.xml | 20 +-
.../SortedDictionary`2.xml | 34 +--
.../SortedList`2.xml | 46 ++--
xml/System.Collections.Generic/Stack`1.xml | 24 +-
29 files changed, 1026 insertions(+), 72 deletions(-)
create mode 100644 snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source.vb
create mode 100644 snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.vb
create mode 100644 snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/Ranges/source.vb
create mode 100644 snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source.vb
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/source.vb
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source.vb b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source.vb
new file mode 100644
index 00000000000..0333221534e
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source.vb
@@ -0,0 +1,42 @@
+'
+Imports System.Collections.Generic
+
+Public Class Example
+
+ Public Shared Sub Main()
+
+ ' Create a new sorted dictionary of strings, with string
+ ' keys and a case-insensitive comparer.
+ Dim openWith As New SortedDictionary(Of String, String)( _
+ StringComparer.CurrentCultureIgnoreCase)
+
+ ' Add some elements to the sorted dictionary.
+ openWith.Add("txt", "notepad.exe")
+ openWith.Add("Bmp", "paint.exe")
+ openWith.Add("DIB", "paint.exe")
+ openWith.Add("rtf", "wordpad.exe")
+
+ ' Create a Dictionary of strings with string keys and a
+ ' case-insensitive equality comparer, and initialize it
+ ' with the contents of the sorted dictionary.
+ Dim copy As New Dictionary(Of String, String)(openWith, _
+ StringComparer.CurrentCultureIgnoreCase)
+
+ ' List the contents of the copy.
+ Console.WriteLine()
+ For Each kvp As KeyValuePair(Of String, String) In copy
+ Console.WriteLine("Key = {0}, Value = {1}", _
+ kvp.Key, kvp.Value)
+ Next kvp
+
+ End Sub
+
+End Class
+
+' This code example produces the following output:
+'
+'Key = Bmp, Value = paint.exe
+'Key = DIB, Value = paint.exe
+'Key = rtf, Value = wordpad.exe
+'Key = txt, Value = notepad.exe
+'
diff --git a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.vb b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.vb
new file mode 100644
index 00000000000..cde9ec6a46e
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.vb
@@ -0,0 +1,35 @@
+'
+Imports System.Collections.Generic
+
+Public Class Example
+
+ Public Shared Sub Main()
+
+ ' Create a new dictionary of strings, with string keys and
+ ' an initial capacity of 4.
+ Dim openWith As New Dictionary(Of String, String)(4)
+
+ ' Add 4 elements to the dictionary.
+ openWith.Add("txt", "notepad.exe")
+ openWith.Add("bmp", "paint.exe")
+ openWith.Add("dib", "paint.exe")
+ openWith.Add("rtf", "wordpad.exe")
+
+ ' List the contents of the dictionary.
+ Console.WriteLine()
+ For Each kvp As KeyValuePair(Of String, String) In openWith
+ Console.WriteLine("Key = {0}, Value = {1}", _
+ kvp.Key, kvp.Value)
+ Next kvp
+
+ End Sub
+
+End Class
+
+' This code example produces the following output:
+'
+'Key = txt, Value = notepad.exe
+'Key = bmp, Value = paint.exe
+'Key = dib, Value = paint.exe
+'Key = rtf, Value = wordpad.exe
+'
diff --git a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb
new file mode 100644
index 00000000000..4c6beb76c93
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb
@@ -0,0 +1,23 @@
+Imports System.Collections.Generic
+
+Public Class Example
+ Public Shared Sub Main()
+ ' Create a new dictionary of strings, with string keys.
+ '
+ Dim exDictionary As New Dictionary(Of Integer, String)
+
+ ' Add some elements to the dictionary. There are no
+ ' duplicate keys, but some of the values are duplicates.
+ exDictionary.Add(0, "notepad.exe")
+ exDictionary.Add(1, "paint.exe")
+ exDictionary.Add(2, "paint.exe")
+ exDictionary.Add(3, "wordpad.exe")
+ Dim myDictionary As IDictionary(Of Integer, String) = exDictionary
+ '
+ For Each kvp As KeyValuePair(Of Integer, String) In myDictionary
+ Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value)
+ Next kvp
+ '
+ End Sub
+End Class
+
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/source.vb
new file mode 100644
index 00000000000..c3587257d3b
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/source.vb
@@ -0,0 +1,99 @@
+'
+Imports System.Collections.Generic
+
+Public Class Example
+
+ Public Shared Sub Main()
+
+ Dim input() As String = { "Brachiosaurus", _
+ "Amargasaurus", _
+ "Mamenchisaurus" }
+
+ Dim dinosaurs As New List(Of String)(input)
+
+ Console.WriteLine(vbLf & "Capacity: {0}", dinosaurs.Capacity)
+
+ Console.WriteLine()
+ For Each dinosaur As String In dinosaurs
+ Console.WriteLine(dinosaur)
+ Next
+
+ Console.WriteLine(vbLf & "AddRange(dinosaurs)")
+ dinosaurs.AddRange(dinosaurs)
+
+ Console.WriteLine()
+ For Each dinosaur As String In dinosaurs
+ Console.WriteLine(dinosaur)
+ Next
+
+ Console.WriteLine(vbLf & "RemoveRange(2, 2)")
+ dinosaurs.RemoveRange(2, 2)
+
+ Console.WriteLine()
+ For Each dinosaur As String In dinosaurs
+ Console.WriteLine(dinosaur)
+ Next
+
+ input = New String() { "Tyrannosaurus", _
+ "Deinonychus", _
+ "Velociraptor" }
+
+ Console.WriteLine(vbLf & "InsertRange(3, input)")
+ dinosaurs.InsertRange(3, input)
+
+ Console.WriteLine()
+ For Each dinosaur As String In dinosaurs
+ Console.WriteLine(dinosaur)
+ Next
+
+ Console.WriteLine(vbLf & "output = dinosaurs.GetRange(2, 3).ToArray")
+ Dim output() As String = dinosaurs.GetRange(2, 3).ToArray()
+
+ Console.WriteLine()
+ For Each dinosaur As String In output
+ Console.WriteLine(dinosaur)
+ Next
+
+ End Sub
+End Class
+
+' This code example produces the following output:
+'
+'Capacity: 3
+'
+'Brachiosaurus
+'Amargasaurus
+'Mamenchisaurus
+'
+'AddRange(dinosaurs)
+'
+'Brachiosaurus
+'Amargasaurus
+'Mamenchisaurus
+'Brachiosaurus
+'Amargasaurus
+'Mamenchisaurus
+'
+'RemoveRange(2, 2)
+'
+'Brachiosaurus
+'Amargasaurus
+'Amargasaurus
+'Mamenchisaurus
+'
+'InsertRange(3, input)
+'
+'Brachiosaurus
+'Amargasaurus
+'Amargasaurus
+'Tyrannosaurus
+'Deinonychus
+'Velociraptor
+'Mamenchisaurus
+'
+'output = dinosaurs.GetRange(2, 3).ToArray
+'
+'Amargasaurus
+'Tyrannosaurus
+'Deinonychus
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb b/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb
new file mode 100644
index 00000000000..fd75ab8784b
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb
@@ -0,0 +1,92 @@
+'
+Imports System.Collections.Generic
+
+Module Example
+
+ Sub Main
+
+ Dim numbers As New Queue(Of String)
+ numbers.Enqueue("one")
+ numbers.Enqueue("two")
+ numbers.Enqueue("three")
+ numbers.Enqueue("four")
+ numbers.Enqueue("five")
+
+ ' A queue can be enumerated without disturbing its contents.
+ For Each number As String In numbers
+ Console.WriteLine(number)
+ Next
+
+ Console.WriteLine(vbLf & "Dequeuing '{0}'", numbers.Dequeue())
+ Console.WriteLine("Peek at next item to dequeue: {0}", _
+ numbers.Peek())
+ Console.WriteLine("Dequeuing '{0}'", numbers.Dequeue())
+
+ ' Create a copy of the queue, using the ToArray method and the
+ ' constructor that accepts an IEnumerable(Of T).
+ Dim queueCopy As New Queue(Of String)(numbers.ToArray())
+
+ Console.WriteLine(vbLf & "Contents of the first copy:")
+ For Each number As String In queueCopy
+ Console.WriteLine(number)
+ Next
+
+ ' Create an array twice the size of the queue, compensating
+ ' for the fact that Visual Basic allocates an extra array
+ ' element. Copy the elements of the queue, starting at the
+ ' middle of the array.
+ Dim array2((numbers.Count * 2) - 1) As String
+ numbers.CopyTo(array2, numbers.Count)
+
+ ' Create a second queue, using the constructor that accepts an
+ ' IEnumerable(Of T).
+ Dim queueCopy2 As New Queue(Of String)(array2)
+
+ Console.WriteLine(vbLf & _
+ "Contents of the second copy, with duplicates and nulls:")
+ For Each number As String In queueCopy2
+ Console.WriteLine(number)
+ Next
+
+ Console.WriteLine(vbLf & "queueCopy.Contains(""four"") = {0}", _
+ queueCopy.Contains("four"))
+
+ Console.WriteLine(vbLf & "queueCopy.Clear()")
+ queueCopy.Clear()
+ Console.WriteLine(vbLf & "queueCopy.Count = {0}", _
+ queueCopy.Count)
+ End Sub
+End Module
+
+' This code example produces the following output:
+'
+'one
+'two
+'three
+'four
+'five
+'
+'Dequeuing 'one'
+'Peek at next item to dequeue: two
+'
+'Dequeuing 'two'
+'
+'Contents of the copy:
+'three
+'four
+'five
+'
+'Contents of the second copy, with duplicates and nulls:
+'
+'
+'
+'three
+'four
+'five
+'
+'queueCopy.Contains("four") = True
+'
+'queueCopy.Clear()
+'
+'queueCopy.Count = 0
+'
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source.vb
new file mode 100644
index 00000000000..6db4c4f8d6a
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source.vb
@@ -0,0 +1,55 @@
+'
+Imports System.Collections.Generic
+
+Public Class Example
+
+ Public Shared Sub Main()
+
+ ' Create a new Dictionary of strings, with string keys and
+ ' a case-insensitive equality comparer for the current
+ ' culture.
+ Dim openWith As New Dictionary(Of String, String)( _
+ StringComparer.CurrentCultureIgnoreCase)
+
+ ' Add some elements to the dictionary.
+ openWith.Add("txt", "notepad.exe")
+ openWith.Add("Bmp", "paint.exe")
+ openWith.Add("DIB", "paint.exe")
+ openWith.Add("rtf", "wordpad.exe")
+
+ ' List the contents of the Dictionary.
+ Console.WriteLine()
+ For Each kvp As KeyValuePair(Of String, String) In openWith
+ Console.WriteLine("Key = {0}, Value = {1}", _
+ kvp.Key, kvp.Value)
+ Next kvp
+
+ ' Create a SortedDictionary of strings with string keys and a
+ ' case-insensitive equality comparer for the current culture,
+ ' and initialize it with the contents of the Dictionary.
+ Dim copy As New SortedDictionary(Of String, String)(openWith, _
+ StringComparer.CurrentCultureIgnoreCase)
+
+ ' List the sorted contents of the copy.
+ Console.WriteLine()
+ For Each kvp As KeyValuePair(Of String, String) In copy
+ Console.WriteLine("Key = {0}, Value = {1}", _
+ kvp.Key, kvp.Value)
+ Next kvp
+
+ End Sub
+
+End Class
+
+' This code example produces the following output:
+'
+'Key = txt, Value = notepad.exe
+'Key = Bmp, Value = paint.exe
+'Key = DIB, Value = paint.exe
+'Key = rtf, Value = wordpad.exe
+'
+'Key = Bmp, Value = paint.exe
+'Key = DIB, Value = paint.exe
+'Key = rtf, Value = wordpad.exe
+'Key = txt, Value = notepad.exe
+'
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb
new file mode 100644
index 00000000000..3d39bc2facf
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb
@@ -0,0 +1,164 @@
+'
+Imports System.Collections.Generic
+
+Public Class Example
+
+ Public Shared Sub Main()
+
+ '
+ ' Create a new sorted dictionary of strings, with string
+ ' keys.
+ Dim openWith As New SortedDictionary(Of String, String)
+
+ ' Add some elements to the dictionary. There are no
+ ' duplicate keys, but some of the values are duplicates.
+ openWith.Add("txt", "notepad.exe")
+ openWith.Add("bmp", "paint.exe")
+ openWith.Add("dib", "paint.exe")
+ openWith.Add("rtf", "wordpad.exe")
+
+ ' The Add method throws an exception if the new key is
+ ' already in the dictionary.
+ Try
+ openWith.Add("txt", "winword.exe")
+ Catch
+ Console.WriteLine("An element with Key = ""txt"" already exists.")
+ End Try
+ '
+
+ '
+ ' The Item property is the default property, so you
+ ' can omit its name when accessing elements.
+ Console.WriteLine("For key = ""rtf"", value = {0}.", _
+ openWith("rtf"))
+
+ ' The default Item property can be used to change the value
+ ' associated with a key.
+ openWith("rtf") = "winword.exe"
+ Console.WriteLine("For key = ""rtf"", value = {0}.", _
+ openWith("rtf"))
+
+ ' If a key does not exist, setting the default Item property
+ ' for that key adds a new key/value pair.
+ openWith("doc") = "winword.exe"
+ '
+
+ '
+ ' The default Item property throws an exception if the requested
+ ' key is not in the dictionary.
+ Try
+ Console.WriteLine("For key = ""tif"", value = {0}.", _
+ openWith("tif"))
+ Catch
+ Console.WriteLine("Key = ""tif"" is not found.")
+ End Try
+ '
+
+ '
+ ' When a program often has to try keys that turn out not to
+ ' be in the dictionary, TryGetValue can be a more efficient
+ ' way to retrieve values.
+ Dim value As String = ""
+ If openWith.TryGetValue("tif", value) Then
+ Console.WriteLine("For key = ""tif"", value = {0}.", value)
+ Else
+ Console.WriteLine("Key = ""tif"" is not found.")
+ End If
+ '
+
+ '
+ ' ContainsKey can be used to test keys before inserting
+ ' them.
+ If Not openWith.ContainsKey("ht") Then
+ openWith.Add("ht", "hypertrm.exe")
+ Console.WriteLine("Value added for key = ""ht"": {0}", _
+ openWith("ht"))
+ End If
+ '
+
+ '
+ ' When you use foreach to enumerate dictionary elements,
+ ' the elements are retrieved as KeyValuePair objects.
+ Console.WriteLine()
+ For Each kvp As KeyValuePair(Of String, String) In openWith
+ Console.WriteLine("Key = {0}, Value = {1}", _
+ kvp.Key, kvp.Value)
+ Next kvp
+ '
+
+ '
+ ' To get the values alone, use the Values property.
+ Dim valueColl _
+ As SortedDictionary(Of String, String).ValueCollection = _
+ openWith.Values
+
+ ' The elements of the ValueCollection are strongly typed
+ ' with the type that was specified for dictionary values.
+ Console.WriteLine()
+ For Each s As String In valueColl
+ Console.WriteLine("Value = {0}", s)
+ Next s
+ '
+
+ '
+ ' To get the keys alone, use the Keys property.
+ Dim keyColl _
+ As SortedDictionary(Of String, String).KeyCollection = _
+ openWith.Keys
+
+ ' The elements of the KeyCollection are strongly typed
+ ' with the type that was specified for dictionary keys.
+ Console.WriteLine()
+ For Each s As String In keyColl
+ Console.WriteLine("Key = {0}", s)
+ Next s
+ '
+
+ '
+ ' Use the Remove method to remove a key/value pair.
+ Console.WriteLine(vbLf + "Remove(""doc"")")
+ openWith.Remove("doc")
+
+ If Not openWith.ContainsKey("doc") Then
+ Console.WriteLine("Key ""doc"" is not found.")
+ End If
+ '
+
+ End Sub
+
+End Class
+
+' This code example produces the following output:
+'
+'An element with Key = "txt" already exists.
+'For key = "rtf", value = wordpad.exe.
+'For key = "rtf", value = winword.exe.
+'Key = "tif" is not found.
+'Key = "tif" is not found.
+'Value added for key = "ht": hypertrm.exe
+'
+'Key = bmp, Value = paint.exe
+'Key = dib, Value = paint.exe
+'Key = doc, Value = winword.exe
+'Key = ht, Value = hypertrm.exe
+'Key = rtf, Value = winword.exe
+'Key = txt, Value = notepad.exe
+'
+'Value = paint.exe
+'Value = paint.exe
+'Value = winword.exe
+'Value = hypertrm.exe
+'Value = winword.exe
+'Value = notepad.exe
+'
+'Key = bmp
+'Key = dib
+'Key = doc
+'Key = ht
+'Key = rtf
+'Key = txt
+'
+'Remove("doc")
+'Key "doc" is not found.
+'
+'
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/source.vb
new file mode 100644
index 00000000000..9b1f61c701a
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/source.vb
@@ -0,0 +1,47 @@
+'
+Imports System.Collections.Generic
+
+Public Class Example
+
+ Public Shared Sub Main()
+
+ ' Create a new sorted list of strings, with string keys and
+ ' a case-insensitive comparer for the current culture.
+ Dim openWith As New SortedList(Of String, String)( _
+ StringComparer.CurrentCultureIgnoreCase)
+
+ ' Add some elements to the list.
+ openWith.Add("txt", "notepad.exe")
+ openWith.Add("bmp", "paint.exe")
+ openWith.Add("DIB", "paint.exe")
+ openWith.Add("rtf", "wordpad.exe")
+
+ ' Try to add a fifth element with a key that is the same
+ ' except for case; this would be allowed with the default
+ ' comparer.
+ Try
+ openWith.Add("BMP", "paint.exe")
+ Catch ex As ArgumentException
+ Console.WriteLine(vbLf & "BMP is already in the sorted list.")
+ End Try
+
+ ' List the contents of the sorted list.
+ Console.WriteLine()
+ For Each kvp As KeyValuePair(Of String, String) In openWith
+ Console.WriteLine("Key = {0}, Value = {1}", _
+ kvp.Key, kvp.Value)
+ Next kvp
+
+ End Sub
+
+End Class
+
+' This code example produces the following output:
+'
+'BMP is already in the sorted list.
+'
+'Key = bmp, Value = paint.exe
+'Key = DIB, Value = paint.exe
+'Key = rtf, Value = wordpad.exe
+'Key = txt, Value = notepad.exe
+'
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb
new file mode 100644
index 00000000000..d354c32a802
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb
@@ -0,0 +1,216 @@
+' Do not use snippets 31 & 32 with snippet 21; snippet 21 goes
+' with snippet 2, which already provides enough context. (2 and
+' 21 were originally one snippet, but had to be split when 31
+' was added, because I don't trust overlapping snippets any
+' more.)
+'
+' Note further that {2, 21} is NOT USED right now because
+' the complete sample (snippet 1) is located in IDictionary.Add.
+'
+' The groups are:
+' {2, 21} - Add
+' {31, 3, 4, 32} - Item
+' {31, 6, 32} - Contains
+' {31, 7, 32} - GetEnumerator
+' {31, 8, 7, 32} - Values
+' {31, 9, 7, 32} - Keys
+' {31, 10, 32} - Remove
+' -> PLS MAKE SURE THESE STAY IN SYNC WITH DESCRIPTION.TXT <-
+'
+'
+'
+Imports System.Collections
+Imports System.Collections.Generic
+
+Public Class Example
+
+ Public Shared Sub Main()
+
+ '
+ ' Create a new sorted list of strings, with string keys,
+ ' and access it using the IDictionary interface.
+ '
+ Dim openWith As IDictionary = _
+ New sortedList(Of String, String)
+
+ ' Add some elements to the sorted list. There are no
+ ' duplicate keys, but some of the values are duplicates.
+ ' IDictionary.Add throws an exception if incorrect types
+ ' are supplied for key or value.
+ openWith.Add("txt", "notepad.exe")
+ openWith.Add("bmp", "paint.exe")
+ openWith.Add("dib", "paint.exe")
+ openWith.Add("rtf", "wordpad.exe")
+ '
+'
+ '
+ Try
+ openWith.Add(42, New Example())
+ Catch ex As ArgumentException
+ Console.WriteLine("An exception was caught for " & _
+ "IDictionary.Add. Exception message:" & vbLf _
+ & vbTab & ex.Message & vbLf)
+ End Try
+
+ ' The Add method throws an exception if the new key is
+ ' already in the sorted list.
+ Try
+ openWith.Add("txt", "winword.exe")
+ Catch
+ Console.WriteLine("An element with Key = ""txt"" already exists.")
+ End Try
+ '
+
+ '
+ ' The Item property is the default property, so you
+ ' can omit its name when accessing elements.
+ Console.WriteLine("For key = ""rtf"", value = {0}.", _
+ openWith("rtf"))
+
+ ' The default Item property can be used to change the value
+ ' associated with a key.
+ openWith("rtf") = "winword.exe"
+ Console.WriteLine("For key = ""rtf"", value = {0}.", _
+ openWith("rtf"))
+
+ ' If a key does not exist, setting the default Item property
+ ' for that key adds a new key/value pair.
+ openWith("doc") = "winword.exe"
+
+ ' The default Item property returns Nothing if the key
+ ' is of the wrong data type.
+ Console.WriteLine("The default Item property returns Nothing" _
+ & " if the key is of the wrong type:")
+ Console.WriteLine("For key = 2, value = {0}.", _
+ openWith(2))
+
+ ' The default Item property throws an exception when setting
+ ' a value if the key is of the wrong data type.
+ Try
+ openWith(2) = "This does not get added."
+ Catch
+ Console.WriteLine("A key of the wrong type was specified" _
+ & " when setting the default Item property.")
+ End Try
+ '
+
+ '
+ ' Unlike the default Item property on the SortedList class
+ ' itself, IDictionary.Item does not throw an exception
+ ' if the requested key is not in the sorted list.
+ Console.WriteLine("For key = ""tif"", value = {0}.", _
+ openWith("tif"))
+ '
+
+ '
+ ' Contains can be used to test keys before inserting
+ ' them.
+ If Not openWith.Contains("ht") Then
+ openWith.Add("ht", "hypertrm.exe")
+ Console.WriteLine("Value added for key = ""ht"": {0}", _
+ openWith("ht"))
+ End If
+
+ ' IDictionary.Contains returns False if the wrong data
+ ' type is supplied.
+ Console.WriteLine("openWith.Contains(29.7) returns {0}", _
+ openWith.Contains(29.7))
+ '
+
+ '
+ ' When you use foreach to enumerate sorted list elements
+ ' with the IDictionary interface, the elements are retrieved
+ ' as DictionaryEntry objects instead of KeyValuePair objects.
+ Console.WriteLine()
+ For Each de As DictionaryEntry In openWith
+ Console.WriteLine("Key = {0}, Value = {1}", _
+ de.Key, de.Value)
+ Next
+ '
+
+ '
+ ' To get the values alone, use the Values property.
+ Dim icoll As ICollection = openWith.Values
+
+ ' The elements of the collection are strongly typed
+ ' with the type that was specified for sorted list values,
+ ' even though the ICollection interface is not strongly
+ ' typed.
+ Console.WriteLine()
+ For Each s As String In icoll
+ Console.WriteLine("Value = {0}", s)
+ Next s
+ '
+
+ '
+ ' To get the keys alone, use the Keys property.
+ icoll = openWith.Keys
+
+ ' The elements of the collection are strongly typed
+ ' with the type that was specified for sorted list keys,
+ ' even though the ICollection interface is not strongly
+ ' typed.
+ Console.WriteLine()
+ For Each s As String In icoll
+ Console.WriteLine("Key = {0}", s)
+ Next s
+ '
+
+ '
+ ' Use the Remove method to remove a key/value pair. No
+ ' exception is thrown if the wrong data type is supplied.
+ Console.WriteLine(vbLf + "Remove(""dib"")")
+ openWith.Remove("dib")
+
+ If Not openWith.Contains("dib") Then
+ Console.WriteLine("Key ""dib"" is not found.")
+ End If
+ '
+'
+
+ End Sub
+
+End Class
+'
+
+' This code example produces the following output:
+'
+'An exception was caught for IDictionary.Add. Exception message:
+' The value "42" is not of type "System.String" and cannot be used in this generic collection.
+'Parameter name: key
+'
+'An element with Key = "txt" already exists.
+'For key = "rtf", value = wordpad.exe.
+'For key = "rtf", value = winword.exe.
+'The default Item property returns Nothing if the key is of the wrong type:
+'For key = 2, value = .
+'A key of the wrong type was specified when setting the default Item property.
+'For key = "tif", value = .
+'Value added for key = "ht": hypertrm.exe
+'openWith.Contains(29.7) returns False
+'
+'Key = txt, Value = notepad.exe
+'Key = bmp, Value = paint.exe
+'Key = dib, Value = paint.exe
+'Key = rtf, Value = winword.exe
+'Key = doc, Value = winword.exe
+'Key = ht, Value = hypertrm.exe
+'
+'Value = notepad.exe
+'Value = paint.exe
+'Value = paint.exe
+'Value = winword.exe
+'Value = winword.exe
+'Value = hypertrm.exe
+'
+'Key = txt
+'Key = bmp
+'Key = dib
+'Key = rtf
+'Key = doc
+'Key = ht
+'
+'Remove("dib")
+'Key "dib" is not found.
+'
+'
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb b/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb
new file mode 100644
index 00000000000..246cb8678f5
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb
@@ -0,0 +1,93 @@
+'
+Imports System.Collections.Generic
+
+Module Example
+
+ Sub Main
+
+ Dim numbers As New Stack(Of String)
+ numbers.Push("one")
+ numbers.Push("two")
+ numbers.Push("three")
+ numbers.Push("four")
+ numbers.Push("five")
+
+ ' A stack can be enumerated without disturbing its contents.
+ For Each number As String In numbers
+ Console.WriteLine(number)
+ Next
+
+ Console.WriteLine(vbLf & "Popping '{0}'", numbers.Pop())
+ Console.WriteLine("Peek at next item to pop: {0}", _
+ numbers.Peek())
+ Console.WriteLine("Popping '{0}'", numbers.Pop())
+
+ ' Create another stack, using the ToArray method and the
+ ' constructor that accepts an IEnumerable(Of T). Note that
+ ' the order of items on the new stack is reversed.
+ Dim stack2 As New Stack(Of String)(numbers.ToArray())
+
+ Console.WriteLine(vbLf & "Contents of the first copy:")
+ For Each number As String In stack2
+ Console.WriteLine(number)
+ Next
+
+ ' Create an array twice the size of the stack, compensating
+ ' for the fact that Visual Basic allocates an extra array
+ ' element. Copy the elements of the stack, starting at the
+ ' middle of the array.
+ Dim array2((numbers.Count * 2) - 1) As String
+ numbers.CopyTo(array2, numbers.Count)
+
+ ' Create a second stack, using the constructor that accepts an
+ ' IEnumerable(Of T). The elements are reversed, with the null
+ ' elements appearing at the end of the stack when enumerated.
+ Dim stack3 As New Stack(Of String)(array2)
+
+ Console.WriteLine(vbLf & _
+ "Contents of the second copy, with duplicates and nulls:")
+ For Each number As String In stack3
+ Console.WriteLine(number)
+ Next
+
+ Console.WriteLine(vbLf & "stack2.Contains(""four"") = {0}", _
+ stack2.Contains("four"))
+
+ Console.WriteLine(vbLf & "stack2.Clear()")
+ stack2.Clear()
+ Console.WriteLine(vbLf & "stack2.Count = {0}", _
+ stack2.Count)
+ End Sub
+End Module
+
+' This code example produces the following output:
+'
+'five
+'four
+'three
+'two
+'one
+'
+'Popping 'five'
+'Peek at next item to pop: four
+'Popping 'four'
+'
+'Contents of the first copy:
+'one
+'two
+'three
+'
+'Contents of the second copy, with duplicates and nulls:
+'one
+'two
+'three
+'
+'
+'
+'
+'stack2.Contains("four") = False
+'
+'stack2.Clear()
+'
+'stack2.Count = 0
+'
diff --git a/xml/System.Collections.Generic/Dictionary`2.xml b/xml/System.Collections.Generic/Dictionary`2.xml
index 4cb0c0d8e47..4b25c109d70 100644
--- a/xml/System.Collections.Generic/Dictionary`2.xml
+++ b/xml/System.Collections.Generic/Dictionary`2.xml
@@ -526,7 +526,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source3.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source3.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.vb" id="Snippet1":::
]]>
@@ -612,7 +612,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source1.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source1.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Dictionary.ctor_IDicIEqC/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source.vb" id="Snippet1":::
]]>
diff --git a/xml/System.Collections.Generic/IDictionary`2.xml b/xml/System.Collections.Generic/IDictionary`2.xml
index 4f6592baddc..f42ae62b808 100644
--- a/xml/System.Collections.Generic/IDictionary`2.xml
+++ b/xml/System.Collections.Generic/IDictionary`2.xml
@@ -92,7 +92,7 @@
The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since each element of the is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is . For example:
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source2.cs" id="Snippet11":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source2.vb" id="Snippet11":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet11":::
The `foreach` statement is a wrapper around the enumerator, which only allows reading from, not writing to, the collection.
diff --git a/xml/System.Collections.Generic/IReadOnlyDictionary`2.xml b/xml/System.Collections.Generic/IReadOnlyDictionary`2.xml
index b009a8c414a..378d9ca31b7 100644
--- a/xml/System.Collections.Generic/IReadOnlyDictionary`2.xml
+++ b/xml/System.Collections.Generic/IReadOnlyDictionary`2.xml
@@ -90,7 +90,7 @@
The `foreach` statement of the C# language (`For Each` in Visual Basic) requires the type of each element in the collection. Because each element of the interface is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is , as the following example illustrates.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source2.cs" id="Snippet11":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source2.vb" id="Snippet11":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet11":::
The `foreach` statement is a wrapper around the enumerator; it allows only reading from the collection, not writing to the collection.
diff --git a/xml/System.Collections.Generic/List`1.xml b/xml/System.Collections.Generic/List`1.xml
index aeae10b3f32..09f2606fc08 100644
--- a/xml/System.Collections.Generic/List`1.xml
+++ b/xml/System.Collections.Generic/List`1.xml
@@ -248,7 +248,7 @@
The following example demonstrates the constructor and various methods of the class that act on ranges. An array of strings is created and passed to the constructor, populating the list with the elements of the array. The property is then displayed, to show that the initial capacity is exactly what is required to hold the input elements.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Ranges/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/source.vb" id="Snippet1":::
]]>
@@ -463,7 +463,7 @@
The following example demonstrates the method and various other methods of the class that act on ranges. An array of strings is created and passed to the constructor, populating the list with the elements of the array. The method is called, with the list as its argument. The result is that the current elements of the list are added to the end of the list, duplicating all the elements.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Ranges/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/source.vb" id="Snippet1":::
]]>
@@ -2589,7 +2589,7 @@ Public Function StartsWith(e As Employee) As Boolean
The following example demonstrates the method and other methods of the class that act on ranges. At the end of the example, the method is used to get three items from the list, beginning with index location 2. The method is called on the resulting , creating an array of three elements. The elements of the array are displayed.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Ranges/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/source.vb" id="Snippet1":::
]]>
@@ -2983,7 +2983,7 @@ Public Function StartsWith(e As Employee) As Boolean
The following example demonstrates method and various other methods of the class that act on ranges. After the list has been created and populated with the names of several peaceful plant-eating dinosaurs, the method is used to insert an array of three ferocious meat-eating dinosaurs into the list, beginning at index location 3.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Ranges/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/source.vb" id="Snippet1":::
]]>
@@ -3605,7 +3605,7 @@ Public Function StartsWith(e As Employee) As Boolean
The following example demonstrates the method and various other methods of the class that act on ranges. After the list has been created and modified, the method is used to remove two elements from the list, beginning at index location 2.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Ranges/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/source.vb" id="Snippet1":::
]]>
@@ -5172,7 +5172,7 @@ Retrieving the value of this property is an O(1) operation.
The following example demonstrates the method and other methods of the class that act on ranges. At the end of the example, the method is used to get three items from the list, beginning with index location 2. The method is called on the resulting , creating an array of three elements. The elements of the array are displayed.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Ranges/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/source.vb" id="Snippet1":::
]]>
diff --git a/xml/System.Collections.Generic/Queue`1.xml b/xml/System.Collections.Generic/Queue`1.xml
index 8cdbaae207d..a10771f6cf2 100644
--- a/xml/System.Collections.Generic/Queue`1.xml
+++ b/xml/System.Collections.Generic/Queue`1.xml
@@ -130,7 +130,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb" id="Snippet1":::
]]>
@@ -163,7 +163,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb" id="Snippet1":::
]]>
@@ -428,7 +428,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb" id="Snippet1":::
]]>
@@ -502,7 +502,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb" id="Snippet1":::
]]>
@@ -644,7 +644,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb" id="Snippet1":::
]]>
@@ -715,7 +715,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb" id="Snippet1":::
]]>
@@ -789,7 +789,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb" id="Snippet1":::
]]>
@@ -909,7 +909,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb" id="Snippet1":::
]]>
@@ -982,7 +982,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb" id="Snippet1":::
]]>
@@ -1410,7 +1410,7 @@ Retrieving the value of this property is an O(1) operation.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/source.vb" id="Snippet1":::
]]>
diff --git a/xml/System.Collections.Generic/SortedDictionary`2.xml b/xml/System.Collections.Generic/SortedDictionary`2.xml
index 17271b88623..66169c57c4a 100644
--- a/xml/System.Collections.Generic/SortedDictionary`2.xml
+++ b/xml/System.Collections.Generic/SortedDictionary`2.xml
@@ -149,7 +149,7 @@
Finally, the example demonstrates the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet1":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet1":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet1":::
]]>
@@ -230,7 +230,7 @@
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet2":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet2":::
]]>
@@ -452,7 +452,7 @@
The following code example shows how to use to create a case-insensitive sorted copy of the information in a case-insensitive , by passing the to the constructor. In this example, the case-insensitive comparers are for the current culture.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source2.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDicIComp/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source.vb" id="Snippet1":::
]]>
@@ -532,7 +532,7 @@
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet2":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet2":::
]]>
@@ -713,11 +713,11 @@
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet6":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet5":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet5":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet4":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet4":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet4":::
]]>
@@ -1053,11 +1053,11 @@
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet3":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet4":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet4":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet5":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet5":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet5":::
]]>
@@ -1124,9 +1124,9 @@
This code is part of a larger example that can be compiled and executed. See .
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet9":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet9":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet7":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet7":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet7":::
]]>
@@ -1197,7 +1197,7 @@
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet10":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet10":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet10":::
]]>
@@ -2677,9 +2677,9 @@ Getting the value of this property is an O(1) operation.
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet5":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet4":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet4":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet4":::
]]>
@@ -2746,9 +2746,9 @@ Getting the value of this property is an O(1) operation.
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet8":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet8":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet7":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb" id="Snippet7":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet7":::
]]>
diff --git a/xml/System.Collections.Generic/SortedList`2.xml b/xml/System.Collections.Generic/SortedList`2.xml
index 5b0a6664182..3842e163b3f 100644
--- a/xml/System.Collections.Generic/SortedList`2.xml
+++ b/xml/System.Collections.Generic/SortedList`2.xml
@@ -318,7 +318,7 @@
The following code example creates a sorted list with a case-insensitive comparer for the current culture. The example adds four elements, some with lower-case keys and some with upper-case keys. The example then attempts to add an element with a key that differs from an existing key only by case, catches the resulting exception, and displays an error message. Finally, the example displays the elements in case-insensitive sort order.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/.ctor/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_IComp/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/source.vb" id="Snippet1":::
]]>
@@ -2430,7 +2430,7 @@ Retrieving the value of this property is an O(1) operation.
The code example demonstrates the use of several other members of the interface.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet1":::
]]>
@@ -2511,11 +2511,11 @@ Retrieving the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet6":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet6":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
@@ -2597,11 +2597,11 @@ Retrieving the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet7":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet7":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet7":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
@@ -2801,13 +2801,13 @@ Retrieving the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet3":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet3":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet4":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet4":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
@@ -2885,13 +2885,13 @@ Retrieving the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet9":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet9":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet9":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet7":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet7":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet7":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
@@ -2958,11 +2958,11 @@ Retrieving the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet10":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet10":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet10":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
@@ -3035,13 +3035,13 @@ Retrieving the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet8":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet8":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet8":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet7":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet7":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet7":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
diff --git a/xml/System.Collections.Generic/Stack`1.xml b/xml/System.Collections.Generic/Stack`1.xml
index 9a57f63105a..4bdb0e8c5dc 100644
--- a/xml/System.Collections.Generic/Stack`1.xml
+++ b/xml/System.Collections.Generic/Stack`1.xml
@@ -138,7 +138,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
@@ -222,7 +222,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
@@ -296,7 +296,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
@@ -455,7 +455,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
@@ -528,7 +528,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
@@ -602,7 +602,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
@@ -688,7 +688,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
@@ -804,7 +804,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
@@ -877,7 +877,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
@@ -951,7 +951,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
@@ -1029,7 +1029,7 @@
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
@@ -1455,7 +1455,7 @@ Retrieving the value of this property is an O(1) operation.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/StackT/Overview/source.vb" id="Snippet1":::
]]>
From a05695ff7b37d79fdd02822e75a885df5ec42c69 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 08:08:31 +0000
Subject: [PATCH 04/13] Move System.IO VB snippets to new organization
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
.../CreateSubdirectory/Project.vbproj | 8 ++
.../directoryinfocreatesub.vb | 28 +++++++
.../DirectoryInfo/Delete/Project.vbproj | 8 ++
.../Delete/directoryinfodelete.vb | 29 +++++++
.../GetDirectories/Project.vbproj | 8 ++
.../directoryinfogetdirectories.vb | 18 +++++
.../DirectoryInfo/MoveTo/Project.vbproj | 8 ++
.../MoveTo/directoryinfomoveto.vb | 35 ++++++++
.../DirectoryInfo/Parent/Project.vbproj | 8 ++
.../Parent/directoryinfoparent.vb | 25 ++++++
.../System.IO/FileInfo/CopyTo/Project.vbproj | 8 ++
.../FileInfo/CopyTo/fileinfocopyto1.vb | 45 +++++++++++
.../FileInfo/GetAccessControl/Project.vbproj | 8 ++
.../FileInfo/GetAccessControl/sample.vb | 79 +++++++++++++++++++
.../FileInfo/IsReadOnly/Project.vbproj | 8 ++
.../System.IO/FileInfo/IsReadOnly/sample.vb | 48 +++++++++++
.../System.IO/Path/Combine/Project.vbproj | 8 ++
.../System.IO/Path/Combine/pathcombine.vb | 63 +++++++++++++++
xml/System.IO/DirectoryInfo.xml | 10 +--
xml/System.IO/FileInfo.xml | 8 +-
xml/System.IO/Path.xml | 2 +-
21 files changed, 452 insertions(+), 10 deletions(-)
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/Project.vbproj
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/directoryinfocreatesub.vb
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/Delete/Project.vbproj
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/Delete/directoryinfodelete.vb
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/Project.vbproj
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/directoryinfogetdirectories.vb
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/Project.vbproj
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/directoryinfomoveto.vb
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/Parent/Project.vbproj
create mode 100644 snippets/visualbasic/System.IO/DirectoryInfo/Parent/directoryinfoparent.vb
create mode 100644 snippets/visualbasic/System.IO/FileInfo/CopyTo/Project.vbproj
create mode 100644 snippets/visualbasic/System.IO/FileInfo/CopyTo/fileinfocopyto1.vb
create mode 100644 snippets/visualbasic/System.IO/FileInfo/GetAccessControl/Project.vbproj
create mode 100644 snippets/visualbasic/System.IO/FileInfo/GetAccessControl/sample.vb
create mode 100644 snippets/visualbasic/System.IO/FileInfo/IsReadOnly/Project.vbproj
create mode 100644 snippets/visualbasic/System.IO/FileInfo/IsReadOnly/sample.vb
create mode 100644 snippets/visualbasic/System.IO/Path/Combine/Project.vbproj
create mode 100644 snippets/visualbasic/System.IO/Path/Combine/pathcombine.vb
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/directoryinfocreatesub.vb b/snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/directoryinfocreatesub.vb
new file mode 100644
index 00000000000..5e3833dac50
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/directoryinfocreatesub.vb
@@ -0,0 +1,28 @@
+'
+Imports System.IO
+
+Public Class CreateSubTest
+
+ Public Shared Sub Main()
+ ' Make a reference to a directory.
+ Dim di As New DirectoryInfo("TempDir")
+
+ ' Create the directory only if it does not already exist.
+ If di.Exists = False Then
+ di.Create()
+ End If
+
+ ' Create a subdirectory in the directory just created.
+ Dim dis As DirectoryInfo = di.CreateSubdirectory("SubDir")
+
+ ' Process that directory as required.
+ ' ...
+
+ ' Delete the subdirectory.
+ dis.Delete(True)
+
+ ' Delete the directory.
+ di.Delete(True)
+ End Sub
+End Class
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/Delete/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/Delete/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/Delete/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/Delete/directoryinfodelete.vb b/snippets/visualbasic/System.IO/DirectoryInfo/Delete/directoryinfodelete.vb
new file mode 100644
index 00000000000..4def7a63eba
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/Delete/directoryinfodelete.vb
@@ -0,0 +1,29 @@
+'
+Imports System.IO
+
+Public Class DeleteTest
+
+ Public Shared Sub Main()
+ ' Make a reference to a directory.
+ Dim di As New DirectoryInfo("TempDir")
+
+ ' Create the directory only if it does not already exist.
+ If di.Exists = False Then
+ di.Create()
+ End If
+
+ Dim dis As DirectoryInfo = di.CreateSubdirectory("SubDir")
+ ' Create a subdirectory in the directory just created.
+
+ ' Process that directory as required.
+ ' ...
+
+ ' Delete the subdirectory. The true indicates that if subdirectories
+ ' or files are in this directory, they are to be deleted as well.
+ dis.Delete(True)
+
+ ' Delete the directory.
+ di.Delete(True)
+ End Sub
+End Class
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/directoryinfogetdirectories.vb b/snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/directoryinfogetdirectories.vb
new file mode 100644
index 00000000000..b9331d16fd7
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/directoryinfogetdirectories.vb
@@ -0,0 +1,18 @@
+'
+Imports System.IO
+
+Public Class GetDirectoriesTest
+
+ Public Shared Sub Main()
+ ' Make a reference to a directory.
+ Dim di As New DirectoryInfo("c:\")
+ ' Get a reference to each directory in that directory.
+ Dim diArr As DirectoryInfo() = di.GetDirectories()
+ ' Display the names of the directories.
+ Dim dri As DirectoryInfo
+ For Each dri In diArr
+ Console.WriteLine(dri.Name)
+ Next dri
+ End Sub
+End Class
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/directoryinfomoveto.vb b/snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/directoryinfomoveto.vb
new file mode 100644
index 00000000000..258ded11121
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/directoryinfomoveto.vb
@@ -0,0 +1,35 @@
+'
+Imports System.IO
+
+Public Class MoveToTest
+
+ Public Shared Sub Main()
+ ' Make a reference to a directory.
+ Dim di As New DirectoryInfo("TempDir")
+ ' Create the directory only if it does not already exist.
+ If di.Exists = False Then
+ di.Create()
+ End If
+
+ ' Create a subdirectory in the directory just created.
+ Dim dis As DirectoryInfo = di.CreateSubdirectory("SubDir")
+ If Directory.Exists("NewTempDir") = False Then
+ ' Move the main directory. Note that the contents move with the directory.
+ di.MoveTo("NewTempDir")
+ End If
+ Try
+ ' Attempt to delete the subdirectory. Note that because it has been
+ ' moved, an exception is thrown.
+ dis.Delete(True)
+ Catch
+ ' Handle this exception in some way, such as with the following code:
+ ' Console.WriteLine("That directory does not exist.");
+ ' Point the DirectoryInfo reference to the new directory.
+ ' di = New DirectoryInfo("NewTempDir")
+ ' Delete the directory.
+ ' di.Delete(True)
+ End Try
+
+ End Sub
+End Class
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/Parent/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/Parent/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/Parent/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/Parent/directoryinfoparent.vb b/snippets/visualbasic/System.IO/DirectoryInfo/Parent/directoryinfoparent.vb
new file mode 100644
index 00000000000..98098f3501a
--- /dev/null
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/Parent/directoryinfoparent.vb
@@ -0,0 +1,25 @@
+'
+Imports System.IO
+
+Public Class MoveToTest
+
+ Public Shared Sub Main()
+ ' Make a reference to a directory.
+ Dim di As New DirectoryInfo("TempDir")
+ ' Create the directory only if it does not already exist.
+ If di.Exists = False Then
+ di.Create()
+ End If
+
+ ' Create a subdirectory in the directory just created.
+ Dim dis As DirectoryInfo = di.CreateSubdirectory("SubDir")
+
+ ' Get a reference to the parent directory of the subdirectory you just made.
+ Dim parentDir As DirectoryInfo = dis.Parent
+ Console.WriteLine("The parent directory of '{0}' is '{1}'", dis.Name, parentDir.Name)
+
+ ' Delete the parent directory.
+ di.Delete(True)
+ End Sub
+End Class
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/FileInfo/CopyTo/Project.vbproj b/snippets/visualbasic/System.IO/FileInfo/CopyTo/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.IO/FileInfo/CopyTo/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.IO/FileInfo/CopyTo/fileinfocopyto1.vb b/snippets/visualbasic/System.IO/FileInfo/CopyTo/fileinfocopyto1.vb
new file mode 100644
index 00000000000..b4d6b3b248a
--- /dev/null
+++ b/snippets/visualbasic/System.IO/FileInfo/CopyTo/fileinfocopyto1.vb
@@ -0,0 +1,45 @@
+'
+Imports System.IO
+
+Public Class CopyToTest
+ Public Shared Sub Main()
+ Try
+ ' Create a reference to a file, which might or might not exist.
+ ' If it does not exist, it is not yet created.
+ Dim fi As New FileInfo("temp.txt")
+ ' Create a writer, ready to add entries to the file.
+ Dim sw As StreamWriter = fi.AppendText()
+ sw.WriteLine("Add as many lines as you like...")
+ sw.WriteLine("Add another line to the output...")
+ sw.Flush()
+ sw.Close()
+ ' Get the information out of the file and display it.
+ Dim sr As New StreamReader(fi.OpenRead())
+ Console.WriteLine("This is the information in the first file:")
+ While sr.Peek() <> -1
+ Console.WriteLine(sr.ReadLine())
+ End While
+ ' Copy this file to another file.
+ Dim newfi As FileInfo = fi.CopyTo("newTemp.txt")
+ ' Get the information out of the new file and display it.
+ sr = New StreamReader(newfi.OpenRead())
+ Console.WriteLine("{0}This is the information in the second file:", Environment.NewLine)
+ While sr.Peek() <> -1
+ Console.WriteLine(sr.ReadLine())
+ End While
+ Catch e As Exception
+ Console.WriteLine(e.Message)
+ End Try
+ End Sub
+End Class
+'This code produces output similar to the following;
+'results may vary based on the computer/file structure/etc.:
+'
+'This is the information in the first file:
+'Add as many lines as you like...
+'Add another line to the output...
+'
+'This is the information in the second file:
+'Add as many lines as you like...
+'Add another line to the output...
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/Project.vbproj b/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/sample.vb b/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/sample.vb
new file mode 100644
index 00000000000..39519deb1e9
--- /dev/null
+++ b/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/sample.vb
@@ -0,0 +1,79 @@
+'
+Imports System.IO
+Imports System.Security.AccessControl
+
+
+
+Module FileExample
+
+ Sub Main()
+ Try
+ Dim FileName As String = "c:\test.xml"
+
+ Console.WriteLine("Adding access control entry for " & FileName)
+
+ ' Add the access control entry to the file.
+ ' Before compiling this snippet, change MyDomain to your
+ ' domain name and MyAccessAccount to the name
+ ' you use to access your domain.
+ AddFileSecurity(FileName, "MyDomain\\MyAccessAccount", FileSystemRights.ReadData, AccessControlType.Allow)
+
+ Console.WriteLine("Removing access control entry from " & FileName)
+
+ ' Remove the access control entry from the file.
+ ' Before compiling this snippet, change MyDomain to your
+ ' domain name and MyAccessAccount to the name
+ ' you use to access your domain.
+ RemoveFileSecurity(FileName, "MyDomain\\MyAccessAccount", FileSystemRights.ReadData, AccessControlType.Allow)
+
+ Console.WriteLine("Done.")
+ Catch e As Exception
+ Console.WriteLine(e)
+ End Try
+
+ End Sub
+
+
+ ' Adds an ACL entry on the specified file for the specified account.
+ Sub AddFileSecurity(ByVal FileName As String, ByVal Account As String, ByVal Rights As FileSystemRights, ByVal ControlType As AccessControlType)
+ ' Create a new FileInfo object.
+ Dim fInfo As New FileInfo(FileName)
+
+ ' Get a FileSecurity object that represents the
+ ' current security settings.
+ Dim fSecurity As FileSecurity = fInfo.GetAccessControl()
+
+ ' Add the FileSystemAccessRule to the security settings.
+ fSecurity.AddAccessRule(New FileSystemAccessRule(Account, Rights, ControlType))
+
+ ' Set the new access settings.
+ fInfo.SetAccessControl(fSecurity)
+
+ End Sub
+
+
+ ' Removes an ACL entry on the specified file for the specified account.
+ Sub RemoveFileSecurity(ByVal FileName As String, ByVal Account As String, ByVal Rights As FileSystemRights, ByVal ControlType As AccessControlType)
+ ' Create a new FileInfo object.
+ Dim fInfo As New FileInfo(FileName)
+
+ ' Get a FileSecurity object that represents the
+ ' current security settings.
+ Dim fSecurity As FileSecurity = fInfo.GetAccessControl()
+
+ ' Add the FileSystemAccessRule to the security settings.
+ fSecurity.RemoveAccessRule(New FileSystemAccessRule(Account, Rights, ControlType))
+
+ ' Set the new access settings.
+ fInfo.SetAccessControl(fSecurity)
+
+ End Sub
+End Module
+'This code produces output similar to the following;
+'results may vary based on the computer/file structure/etc.:
+'
+'Adding access control entry for c:\test.xml
+'Removing access control entry from c:\test.xml
+'Done.
+'
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/FileInfo/IsReadOnly/Project.vbproj b/snippets/visualbasic/System.IO/FileInfo/IsReadOnly/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.IO/FileInfo/IsReadOnly/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.IO/FileInfo/IsReadOnly/sample.vb b/snippets/visualbasic/System.IO/FileInfo/IsReadOnly/sample.vb
new file mode 100644
index 00000000000..9e6caa46cfe
--- /dev/null
+++ b/snippets/visualbasic/System.IO/FileInfo/IsReadOnly/sample.vb
@@ -0,0 +1,48 @@
+'
+Imports System.IO
+
+Module FileExample
+
+ Sub Main()
+
+ ' Create a temporary file.
+ Dim filePath As String = Path.GetTempFileName()
+ Console.WriteLine($"Created a temp file at '{filePath}'.")
+
+ ' Create a new FileInfo object.
+ Dim fInfo As New FileInfo(filePath)
+
+ ' Get the read-only value for a file.
+ Dim isReadOnly As Boolean = fInfo.IsReadOnly
+
+ ' Display whether the file is read-only.
+ Console.WriteLine($"The file read-only value for '{fInfo.Name}' is {isReadOnly}.")
+
+ ' Set the file to read-only.
+ Console.WriteLine($"Setting the read-only value for '{fInfo.Name}' to true.")
+ fInfo.IsReadOnly = True
+
+ ' Get the read-only value for a file.
+ isReadOnly = fInfo.IsReadOnly
+
+ ' Display that the file is now read-only.
+ Console.WriteLine($"The file read-only value for '{fInfo.Name}' is {isReadOnly}.")
+
+ ' Make the file mutable again so it can be deleted.
+ fInfo.IsReadOnly = False
+
+ ' Delete the temporary file.
+ fInfo.Delete()
+ End Sub
+
+End Module
+
+' This code produces output similar to the following,
+' though results may vary based on the computer, file structure, etc.:
+'
+' Created a temp file at 'C:\Users\UserName\AppData\Local\Temp\tmpB438.tmp'.
+' The file read-only value for 'tmpB438.tmp' is False.
+' Setting the read-only value for 'tmpB438.tmp' to true.
+' The file read-only value for 'tmpB438.tmp' is True.
+'
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/Path/Combine/Project.vbproj b/snippets/visualbasic/System.IO/Path/Combine/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.IO/Path/Combine/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.IO/Path/Combine/pathcombine.vb b/snippets/visualbasic/System.IO/Path/Combine/pathcombine.vb
new file mode 100644
index 00000000000..64140f68b39
--- /dev/null
+++ b/snippets/visualbasic/System.IO/Path/Combine/pathcombine.vb
@@ -0,0 +1,63 @@
+'
+Imports System.IO
+
+Public Class ChangeExtensionTest
+
+
+ Public Shared Sub Main()
+ Dim path1 As String = "c:\temp"
+ Dim path2 As String = "subdir\file.txt"
+ Dim path3 As String = "c:\temp.txt"
+ Dim path4 As String = "c:^*&)(_=@#'\\^.*(.txt"
+ Dim path5 As String = ""
+ Dim path6 As String = Nothing
+
+ CombinePaths(path1, path2)
+ CombinePaths(path1, path3)
+ CombinePaths(path3, path2)
+ CombinePaths(path4, path2)
+ CombinePaths(path5, path2)
+ CombinePaths(path6, path2)
+ End Sub
+
+ Private Shared Sub CombinePaths(p1 As String, p2 As String)
+
+ Try
+ Dim combination As String = Path.Combine(p1, p2)
+
+ Console.WriteLine("When you combine '{0}' and '{1}', the result is: {2}'{3}'", p1, p2, Environment.NewLine, combination)
+ Catch e As Exception
+ If p1 = Nothing Then
+ p1 = "Nothing"
+ End If
+ If p2 = Nothing Then
+ p2 = "Nothing"
+ End If
+ Console.WriteLine("You cannot combine '{0}' and '{1}' because: {2}{3}", p1, p2, Environment.NewLine, e.Message)
+ End Try
+
+ Console.WriteLine()
+ End Sub
+End Class
+' This code produces output similar to the following:
+'
+' When you combine 'c:\temp' and 'subdir\file.txt', the result is:
+' 'c:\temp\subdir\file.txt'
+'
+' When you combine 'c:\temp' and 'c:\temp.txt', the result is:
+' 'c:\temp.txt'
+'
+' When you combine 'c:\temp.txt' and 'subdir\file.txt', the result is:
+' 'c:\temp.txt\subdir\file.txt'
+'
+' When you combine 'c:^*&)(_=@#'\^.*(.txt' and 'subdir\file.txt', the result is:
+' 'c:^*&)(_=@#'\^.*(.txt\subdir\file.txt'
+'
+' When you combine '' and 'subdir\file.txt', the result is:
+' 'subdir\file.txt'
+'
+' You cannot combine '' and 'subdir\file.txt' because:
+' Value cannot be null.
+' Parameter name: path1
+
+'
\ No newline at end of file
diff --git a/xml/System.IO/DirectoryInfo.xml b/xml/System.IO/DirectoryInfo.xml
index 2909ae7dbad..1da65276348 100644
--- a/xml/System.IO/DirectoryInfo.xml
+++ b/xml/System.IO/DirectoryInfo.xml
@@ -436,7 +436,7 @@ namespace ConsoleApp
:::code language="csharp" source="~/snippets/csharp/System.IO/DirectoryInfo/CreateSubdirectory/directoryinfocreatesub.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.IO/DirectoryInfo/CreateSubdirectory/directoryinfocreatesub.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/directoryinfocreatesub/VB/directoryinfocreatesub.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/directoryinfocreatesub.vb" id="Snippet1":::
]]>
@@ -694,7 +694,7 @@ namespace ConsoleApp
:::code language="csharp" source="~/snippets/csharp/System.IO/DirectoryInfo/Delete/directoryinfodelete.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.IO/DirectoryInfo/Delete/directoryinfodelete.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/directoryinfodelete/VB/directoryinfodelete.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.IO/DirectoryInfo/Delete/directoryinfodelete.vb" id="Snippet1":::
]]>
@@ -2255,7 +2255,7 @@ namespace ConsoleApp
:::code language="csharp" source="~/snippets/csharp/System.IO/DirectoryInfo/GetDirectories/directoryinfogetdirectories.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.IO/DirectoryInfo/GetDirectories/directoryinfogetdirectories.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/directoryinfogetdirectories/VB/directoryinfogetdirectories.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/directoryinfogetdirectories.vb" id="Snippet1":::
]]>
@@ -3510,7 +3510,7 @@ namespace ConsoleApp
:::code language="csharp" source="~/snippets/csharp/System.IO/DirectoryInfo/MoveTo/directoryinfomoveto.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.IO/DirectoryInfo/MoveTo/directoryinfomoveto.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/directoryinfomoveto/VB/directoryinfomoveto.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/directoryinfomoveto.vb" id="Snippet1":::
]]>
@@ -3685,7 +3685,7 @@ The following example refers to the parent directory of a specified directory.
:::code language="csharp" source="~/snippets/csharp/System.IO/DirectoryInfo/Parent/directoryinfoparent.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.IO/DirectoryInfo/Parent/directoryinfoparent.fs" id="Snippet1":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/directoryinfoparent/VB/directoryinfoparent.vb" id="Snippet1":::
+:::code language="vb" source="~/snippets/visualbasic/System.IO/DirectoryInfo/Parent/directoryinfoparent.vb" id="Snippet1":::
]]>
diff --git a/xml/System.IO/FileInfo.xml b/xml/System.IO/FileInfo.xml
index deac4a40d7d..590dbacce40 100644
--- a/xml/System.IO/FileInfo.xml
+++ b/xml/System.IO/FileInfo.xml
@@ -377,7 +377,7 @@ C:\Users\userName\AppData\Local\Temp\tmp70CB.tmp was successfully deleted.
The following example demonstrates copying one file to another file, throwing an exception if the destination file already exists.
:::code language="csharp" source="~/snippets/csharp/System.IO/FileInfo/CopyTo/fileinfocopyto1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/FileInfoCopyTo1/VB/fileinfocopyto1.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.IO/FileInfo/CopyTo/fileinfocopyto1.vb" id="Snippet1":::
]]>
@@ -1176,7 +1176,7 @@ C:\Users\userName\AppData\Local\Temp\tmp70CB.tmp was successfully deleted.
The following code example uses the method and the method to add and then remove an access control list (ACL) entry from a file. You must supply a valid user or group account to run this example.
:::code language="csharp" source="~/snippets/csharp/System.IO/FileInfo/GetAccessControl/sample.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/IO.FileInfo.GetAccessControl-SetAccessControl/VB/sample.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/sample.vb" id="Snippet1":::
]]>
@@ -1311,7 +1311,7 @@ C:\Users\userName\AppData\Local\Temp\tmp70CB.tmp was successfully deleted.
The following example creates a temporary file, uses the property to first check and then set its read-only status, and finally marks it as read-write in order to delete it.
:::code language="csharp" source="~/snippets/csharp/System.IO/FileInfo/IsReadOnly/sample.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/IO.FileInfo.isReadOnly/VB/sample.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.IO/FileInfo/IsReadOnly/sample.vb" id="Snippet1":::
]]>
@@ -2430,7 +2430,7 @@ The following example demonstrates moving a file to a different location and ren
The following code example uses the method and the method to add and then remove an ACL entry from a file. You must supply a valid user or group account to run this example.
:::code language="csharp" source="~/snippets/csharp/System.IO/FileInfo/GetAccessControl/sample.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/IO.FileInfo.GetAccessControl-SetAccessControl/VB/sample.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/sample.vb" id="Snippet1":::
]]>
diff --git a/xml/System.IO/Path.xml b/xml/System.IO/Path.xml
index 0ce1b191c3a..6f29640f947 100644
--- a/xml/System.IO/Path.xml
+++ b/xml/System.IO/Path.xml
@@ -509,7 +509,7 @@ If any element in `paths` but the last one is not a drive and does not end with
The following example demonstrates using the `Combine` method on Windows.
:::code language="csharp" source="~/snippets/csharp/System.IO/Path/Combine/pathcombine.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/pathcombine/VB/pathcombine.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.IO/Path/Combine/pathcombine.vb" id="Snippet1":::
]]>
From 3d46fc8a1829462b490503a4595bb5e4ab04a189 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 08:15:17 +0000
Subject: [PATCH 05/13] Complete VB snippet reorganization with System
namespace examples and documentation
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
snippets/visualbasic/REORGANIZATION.md | 139 ++++++++++++++++++
.../ArrayList/Overview/ArrayListSample.vb | 75 ++++++++++
.../ArrayList/Overview/Project.vbproj | 8 +
.../StringBuilder/Replace/Project.vbproj | 8 +
.../StringBuilder/Replace/replace.vb | 67 +++++++++
.../Thread/Abort/Project.vbproj | 8 +
.../Thread/Abort/threadabex.vb | 38 +++++
.../Thread/Sleep/Project.vbproj | 8 +
.../System.Threading/Thread/Sleep/example.vb | 27 ++++
.../Console/KeyAvailable/Project.vbproj | 8 +
.../System/Console/KeyAvailable/ka.vb | 39 +++++
.../System/Console/ReadKey/Project.vbproj | 8 +
.../visualbasic/System/Console/ReadKey/rk.vb | 33 +++++
.../System/DateTime/DayOfWeek/Project.vbproj | 8 +
.../System/DateTime/DayOfWeek/dow.vb | 19 +++
.../Environment/FailFast/Project.vbproj | 8 +
.../System/Environment/FailFast/ff.vb | 21 +++
.../System/Math/Max/Project.vbproj | 8 +
snippets/visualbasic/System/Math/Max/max.vb | 68 +++++++++
.../System/Math/Min/Project.vbproj | 8 +
snippets/visualbasic/System/Math/Min/min.vb | 68 +++++++++
xml/System.Text/StringBuilder.xml | 2 +-
xml/System.Threading/Thread.xml | 2 +-
xml/System.Threading/ThreadAbortException.xml | 2 +-
xml/System/Console.xml | 6 +-
xml/System/ConsoleKeyInfo.xml | 6 +-
xml/System/ConsoleModifiers.xml | 2 +-
xml/System/DateTime.xml | 2 +-
xml/System/DayOfWeek.xml | 2 +-
xml/System/Environment.xml | 2 +-
xml/System/Math.xml | 4 +-
xml/System/String.xml | 2 +-
32 files changed, 690 insertions(+), 16 deletions(-)
create mode 100644 snippets/visualbasic/REORGANIZATION.md
create mode 100644 snippets/visualbasic/System.Collections/ArrayList/Overview/ArrayListSample.vb
create mode 100644 snippets/visualbasic/System.Collections/ArrayList/Overview/Project.vbproj
create mode 100644 snippets/visualbasic/System.Text/StringBuilder/Replace/Project.vbproj
create mode 100644 snippets/visualbasic/System.Text/StringBuilder/Replace/replace.vb
create mode 100644 snippets/visualbasic/System.Threading/Thread/Abort/Project.vbproj
create mode 100644 snippets/visualbasic/System.Threading/Thread/Abort/threadabex.vb
create mode 100644 snippets/visualbasic/System.Threading/Thread/Sleep/Project.vbproj
create mode 100644 snippets/visualbasic/System.Threading/Thread/Sleep/example.vb
create mode 100644 snippets/visualbasic/System/Console/KeyAvailable/Project.vbproj
create mode 100644 snippets/visualbasic/System/Console/KeyAvailable/ka.vb
create mode 100644 snippets/visualbasic/System/Console/ReadKey/Project.vbproj
create mode 100644 snippets/visualbasic/System/Console/ReadKey/rk.vb
create mode 100644 snippets/visualbasic/System/DateTime/DayOfWeek/Project.vbproj
create mode 100644 snippets/visualbasic/System/DateTime/DayOfWeek/dow.vb
create mode 100644 snippets/visualbasic/System/Environment/FailFast/Project.vbproj
create mode 100644 snippets/visualbasic/System/Environment/FailFast/ff.vb
create mode 100644 snippets/visualbasic/System/Math/Max/Project.vbproj
create mode 100644 snippets/visualbasic/System/Math/Max/max.vb
create mode 100644 snippets/visualbasic/System/Math/Min/Project.vbproj
create mode 100644 snippets/visualbasic/System/Math/Min/min.vb
diff --git a/snippets/visualbasic/REORGANIZATION.md b/snippets/visualbasic/REORGANIZATION.md
new file mode 100644
index 00000000000..13dcc1c9ba9
--- /dev/null
+++ b/snippets/visualbasic/REORGANIZATION.md
@@ -0,0 +1,139 @@
+# Visual Basic Snippet Reorganization
+
+This document describes the reorganization of Visual Basic code snippets from the legacy `VS_Snippets_CLR` structure to a namespace-based organization that matches the C# snippet structure.
+
+## Overview
+
+Previously, VB snippets were organized under `snippets/visualbasic/VS_Snippets_CLR` with inconsistent naming patterns. They have been reorganized to match the C# snippet organization using namespace and API-based directory structures.
+
+## Reorganization Pattern
+
+### Before (Old Structure)
+```
+snippets/visualbasic/VS_Snippets_CLR/
+├── directoryinforoot/VB/directoryinforoot2.vb
+├── List`1_IndexOf/vb/source.vb
+├── Generic.SortedDictionary/VB/source.vb
+├── environment.FailFast/vb/ff.vb
+└── stringbuilder.replace/VB/replace.vb
+```
+
+### After (New Structure)
+```
+snippets/visualbasic/
+├── System.IO/DirectoryInfo/Root/directoryinforoot2.vb
+├── System.Collections.Generic/ListT/IndexOf/source.vb
+├── System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb
+├── System/Environment/FailFast/ff.vb
+└── System.Text/StringBuilder/Replace/replace.vb
+```
+
+## Naming Conventions
+
+### Namespace Mapping
+- `VS_Snippets_CLR` files are mapped to appropriate namespaces:
+ - Files starting with `Generic.` → `System.Collections.Generic`
+ - Files with `directoryinfo`, `fileinfo`, `path` → `System.IO`
+ - Files with `environment`, `console`, `datetime`, `string`, `array`, `math` → `System`
+ - Files with `stringbuilder`, `regex` → `System.Text`
+ - Files with `thread` → `System.Threading`
+
+### Type Name Mapping
+- Generic type names are converted to match C# patterns:
+ - `List`1` → `ListT`
+ - `Dictionary`2` → `DictionaryTKey,TValue`
+ - `SortedDictionary`2` → `SortedDictionaryTKey,TValue`
+ - `SortedList`2` → `SortedListTKey,TValue`
+ - `Queue`1` → `QueueT`
+ - `Stack`1` → `StackT`
+
+### Member/Method Mapping
+- Constructor examples → `.ctor`
+- Method-specific examples use the method name (e.g., `IndexOf`, `Contains`)
+- General class examples → `Overview`
+
+## Project Files
+
+Each snippet directory includes a `Project.vbproj` file for compilation:
+
+```xml
+
+
+ Library
+ net6.0
+
+
+```
+
+## XML Reference Updates
+
+All XML documentation files have been updated to reference the new snippet paths:
+
+### Before
+```xml
+:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_IndexOf/vb/source.vb" id="Snippet1":::
+```
+
+### After
+```xml
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/source.vb" id="Snippet1":::
+```
+
+## Moved Snippets Summary
+
+The following categories of snippets have been successfully reorganized:
+
+### System.Collections.Generic (13 files)
+- `ListT/IndexOf/` - List.IndexOf examples
+- `ListT/Ranges/` - List range operations
+- `QueueT/Overview/` - Queue general examples
+- `StackT/Overview/` - Stack general examples
+- `DictionaryTKey,TValue/.ctor/` - Dictionary constructors
+- `SortedDictionaryTKey,TValue/Overview/` - SortedDictionary examples
+- `SortedListTKey,TValue/IDictionary/` - SortedList as IDictionary
+- `IDictionaryTKey,TValue/Overview/` - IDictionary interface examples
+
+### System.IO (9 files)
+- `DirectoryInfo/Root/` - DirectoryInfo.Root property
+- `DirectoryInfo/GetDirectories/` - DirectoryInfo.GetDirectories method
+- `DirectoryInfo/CreateSubdirectory/` - Directory creation
+- `DirectoryInfo/Delete/` - Directory deletion
+- `DirectoryInfo/MoveTo/` - Directory moving
+- `DirectoryInfo/Parent/` - Parent directory access
+- `FileInfo/IsReadOnly/` - FileInfo.IsReadOnly property
+- `FileInfo/CopyTo/` - File copying
+- `FileInfo/GetAccessControl/` - File access control
+- `Path/Combine/` - Path.Combine method
+
+### System (7 files)
+- `Environment/FailFast/` - Environment.FailFast method
+- `Console/KeyAvailable/` - Console.KeyAvailable property
+- `Console/ReadKey/` - Console.ReadKey method
+- `DateTime/DayOfWeek/` - DateTime.DayOfWeek property
+- `Math/Max/` - Math.Max method
+- `Math/Min/` - Math.Min method
+
+### System.Collections (1 file)
+- `ArrayList/Overview/` - ArrayList general examples
+
+### System.Text (1 file)
+- `StringBuilder/Replace/` - StringBuilder.Replace method
+
+### System.Threading (2 files)
+- `Thread/Sleep/` - Thread.Sleep method
+- `Thread/Abort/` - Thread abortion examples
+
+## Validation
+
+All moved snippets:
+1. ✅ Build successfully with their project files
+2. ✅ Maintain their original snippet IDs and functionality
+3. ✅ Have updated XML references in documentation files
+4. ✅ Follow the established C# snippet organization pattern
+
+## Benefits
+
+1. **Consistency**: VB snippets now follow the same organization pattern as C# snippets
+2. **Discoverability**: Easier to find snippets by namespace and API
+3. **Maintainability**: Clearer structure for adding new snippets
+4. **Build Validation**: Each snippet can be independently compiled and validated
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Collections/ArrayList/Overview/ArrayListSample.vb b/snippets/visualbasic/System.Collections/ArrayList/Overview/ArrayListSample.vb
new file mode 100644
index 00000000000..2b11bf2d190
--- /dev/null
+++ b/snippets/visualbasic/System.Collections/ArrayList/Overview/ArrayListSample.vb
@@ -0,0 +1,75 @@
+'
+Imports System.Text
+Imports System.Collections
+
+
+
+Public Class SamplesArrayList
+
+
+ Public Shared Sub Main()
+ Dim myAL As New ArrayList()
+ '
+ ' Creates and initializes a new ArrayList.
+ myAL.Add("Eric")
+ myAL.Add("Mark")
+ myAL.Add("Lance")
+ myAL.Add("Rob")
+ myAL.Add("Kris")
+ myAL.Add("Brad")
+ myAL.Add("Kit")
+ myAL.Add("Bradley")
+ myAL.Add("Keith")
+ myAL.Add("Susan")
+
+ ' Displays the properties and values of the ArrayList.
+ Console.WriteLine("Count: {0}", myAL.Count)
+ '
+ PrintValues("Unsorted", myAL)
+ '
+ myAL.Sort()
+ PrintValues("Sorted", myAL)
+ '
+ '
+ Dim comp as New ReverseStringComparer
+ myAL.Sort(comp)
+ PrintValues("Reverse", myAL)
+
+ '
+ Dim names As String() = CType(myAL.ToArray(GetType(String)), String())
+ '
+ '
+ End Sub
+
+
+
+ '
+ Public Shared Sub PrintValues(title As String, myList As IEnumerable)
+ Console.Write("{0,10}: ", title)
+ Dim sb As New StringBuilder()
+ Dim s As String
+ For Each s In myList
+ sb.AppendFormat("{0}, ", s)
+ Next s
+ sb.Remove(sb.Length - 2, 2)
+ Console.WriteLine(sb)
+ End Sub
+'
+End Class
+
+'
+Public Class ReverseStringComparer
+ Implements IComparer
+
+ Function Compare(x As Object, y As Object) As Integer implements IComparer.Compare
+ Dim s1 As String = CStr (x)
+ Dim s2 As String = CStr (y)
+
+ 'negate the return value to get the reverse order
+ Return - [String].Compare(s1, s2)
+
+ End Function 'Compare
+End Class
+'
+
+'
diff --git a/snippets/visualbasic/System.Collections/ArrayList/Overview/Project.vbproj b/snippets/visualbasic/System.Collections/ArrayList/Overview/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Collections/ArrayList/Overview/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Text/StringBuilder/Replace/Project.vbproj b/snippets/visualbasic/System.Text/StringBuilder/Replace/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Text/StringBuilder/Replace/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Text/StringBuilder/Replace/replace.vb b/snippets/visualbasic/System.Text/StringBuilder/Replace/replace.vb
new file mode 100644
index 00000000000..26e8bb30799
--- /dev/null
+++ b/snippets/visualbasic/System.Text/StringBuilder/Replace/replace.vb
@@ -0,0 +1,67 @@
+' This example demonstrates StringBuilder.Replace()
+'
+Imports System.Text
+
+Class Sample
+ Public Shared Sub Main()
+ ' 0----+----1----+----2----+----3----+----4---
+ ' 01234567890123456789012345678901234567890123
+ Dim str As String = "The quick br!wn d#g jumps #ver the lazy cat."
+ Dim sb As New StringBuilder(str)
+
+ Console.WriteLine()
+ Console.WriteLine("StringBuilder.Replace method")
+ Console.WriteLine()
+
+ Console.WriteLine("Original value:")
+ Show(sb)
+
+ sb.Replace("#"c, "!"c, 15, 29) ' Some '#' -> '!'
+ Show(sb)
+ sb.Replace("!"c, "o"c) ' All '!' -> 'o'
+ Show(sb)
+ sb.Replace("cat", "dog") ' All "cat" -> "dog"
+ Show(sb)
+ sb.Replace("dog", "fox", 15, 20) ' Some "dog" -> "fox"
+ Console.WriteLine("Final value:")
+ Show(sb)
+ End Sub
+
+ Public Shared Sub Show(sbs As StringBuilder)
+ Dim rule1 As String = "0----+----1----+----2----+----3----+----4---"
+ Dim rule2 As String = "01234567890123456789012345678901234567890123"
+
+ Console.WriteLine(rule1)
+ Console.WriteLine(rule2)
+ Console.WriteLine("{0}", sbs.ToString())
+ Console.WriteLine()
+ End Sub
+End Class
+'
+'This example produces the following results:
+'
+'StringBuilder.Replace method
+'
+'Original value:
+'0----+----1----+----2----+----3----+----4---
+'01234567890123456789012345678901234567890123
+'The quick br!wn d#g jumps #ver the lazy cat.
+'
+'0----+----1----+----2----+----3----+----4---
+'01234567890123456789012345678901234567890123
+'The quick br!wn d!g jumps !ver the lazy cat.
+'
+'0----+----1----+----2----+----3----+----4---
+'01234567890123456789012345678901234567890123
+'The quick brown dog jumps over the lazy cat.
+'
+'0----+----1----+----2----+----3----+----4---
+'01234567890123456789012345678901234567890123
+'The quick brown dog jumps over the lazy dog.
+'
+'Final value:
+'0----+----1----+----2----+----3----+----4---
+'01234567890123456789012345678901234567890123
+'The quick brown fox jumps over the lazy dog.
+'
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Threading/Thread/Abort/Project.vbproj b/snippets/visualbasic/System.Threading/Thread/Abort/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Threading/Thread/Abort/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Threading/Thread/Abort/threadabex.vb b/snippets/visualbasic/System.Threading/Thread/Abort/threadabex.vb
new file mode 100644
index 00000000000..c583427ea6a
--- /dev/null
+++ b/snippets/visualbasic/System.Threading/Thread/Abort/threadabex.vb
@@ -0,0 +1,38 @@
+'
+Imports System.Threading
+Imports System.Security.Permissions
+
+
+Public Class ThreadWork
+ Public Shared Sub DoWork()
+ Try
+ Dim i As Integer
+ For i = 0 To 99
+ Console.WriteLine("Thread - working.")
+ Thread.Sleep(100)
+ Next i
+ Catch e As ThreadAbortException
+ Console.WriteLine("Thread - caught ThreadAbortException - resetting.")
+ Console.WriteLine("Exception message: {0}", e.Message)
+ Thread.ResetAbort()
+ End Try
+ Console.WriteLine("Thread - still alive and working.")
+ Thread.Sleep(1000)
+ Console.WriteLine("Thread - finished working.")
+ End Sub
+End Class
+
+
+Class ThreadAbortTest
+ Public Shared Sub Main()
+ Dim myThreadDelegate As New ThreadStart(AddressOf ThreadWork.DoWork)
+ Dim myThread As New Thread(myThreadDelegate)
+ myThread.Start()
+ Thread.Sleep(100)
+ Console.WriteLine("Main - aborting my thread.")
+ myThread.Abort()
+ myThread.Join()
+ Console.WriteLine("Main ending.")
+ End Sub
+End Class
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Threading/Thread/Sleep/Project.vbproj b/snippets/visualbasic/System.Threading/Thread/Sleep/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System.Threading/Thread/Sleep/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System.Threading/Thread/Sleep/example.vb b/snippets/visualbasic/System.Threading/Thread/Sleep/example.vb
new file mode 100644
index 00000000000..dbe7a82ba25
--- /dev/null
+++ b/snippets/visualbasic/System.Threading/Thread/Sleep/example.vb
@@ -0,0 +1,27 @@
+'
+Imports System.Threading
+
+Class Example
+
+ Shared Sub Main()
+
+ Dim interval As New TimeSpan(0, 0, 2)
+
+ For i As Integer = 0 To 4
+ Console.WriteLine("Sleep for 2 seconds.")
+ Thread.Sleep(interval)
+ Next
+
+ Console.WriteLine("Main thread exits.")
+ End Sub
+End Class
+
+' This example produces the following output:
+'
+'Sleep for 2 seconds.
+'Sleep for 2 seconds.
+'Sleep for 2 seconds.
+'Sleep for 2 seconds.
+'Sleep for 2 seconds.
+'Main thread exits.
+'
diff --git a/snippets/visualbasic/System/Console/KeyAvailable/Project.vbproj b/snippets/visualbasic/System/Console/KeyAvailable/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System/Console/KeyAvailable/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System/Console/KeyAvailable/ka.vb b/snippets/visualbasic/System/Console/KeyAvailable/ka.vb
new file mode 100644
index 00000000000..cbb605f3422
--- /dev/null
+++ b/snippets/visualbasic/System/Console/KeyAvailable/ka.vb
@@ -0,0 +1,39 @@
+'
+Imports System.Threading
+
+Class Sample
+ Public Shared Sub Main()
+ Dim cki As ConsoleKeyInfo
+
+ Do
+ Console.WriteLine(vbCrLf & "Press a key to display; press the 'x' key to quit.")
+
+ ' Your code could perform some useful task in the following loop. However,
+ ' for the sake of this example we'll merely pause for a quarter second.
+
+ While Console.KeyAvailable = False
+ Thread.Sleep(250) ' Loop until input is entered.
+ End While
+ cki = Console.ReadKey(True)
+ Console.WriteLine("You pressed the '{0}' key.", cki.Key)
+ Loop While cki.Key <> ConsoleKey.X
+ End Sub
+End Class
+'This example produces results similar to the following:
+'
+'Press a key to display; press the 'x' key to quit.
+'You pressed the 'H' key.
+'
+'Press a key to display; press the 'x' key to quit.
+'You pressed the 'E' key.
+'
+'Press a key to display; press the 'x' key to quit.
+'You pressed the 'PageUp' key.
+'
+'Press a key to display; press the 'x' key to quit.
+'You pressed the 'DownArrow' key.
+'
+'Press a key to display; press the 'x' key to quit.
+'You pressed the 'X' key.
+'
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System/Console/ReadKey/Project.vbproj b/snippets/visualbasic/System/Console/ReadKey/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System/Console/ReadKey/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System/Console/ReadKey/rk.vb b/snippets/visualbasic/System/Console/ReadKey/rk.vb
new file mode 100644
index 00000000000..b550835f1e4
--- /dev/null
+++ b/snippets/visualbasic/System/Console/ReadKey/rk.vb
@@ -0,0 +1,33 @@
+'
+Class Example
+ Public Shared Sub Main()
+ Dim cki As ConsoleKeyInfo
+ ' Prevent example from ending if CTL+C is pressed.
+ Console.TreatControlCAsInput = True
+
+ Console.WriteLine("Press any combination of CTL, ALT, and SHIFT, and a console key.")
+ Console.WriteLine("Press the Escape (Esc) key to quit: " + vbCrLf)
+ Do
+ cki = Console.ReadKey()
+ Console.Write(" --- You pressed ")
+ If (cki.Modifiers And ConsoleModifiers.Alt) <> 0 Then Console.Write("ALT+")
+ If (cki.Modifiers And ConsoleModifiers.Shift) <> 0 Then Console.Write("SHIFT+")
+ If (cki.Modifiers And ConsoleModifiers.Control) <> 0 Then Console.Write("CTL+")
+ Console.WriteLine(cki.Key.ToString)
+ Loop While cki.Key <> ConsoleKey.Escape
+ End Sub
+End Class
+' This example displays output similar to the following:
+' Press any combination of CTL, ALT, and SHIFT, and a console key.
+' Press the Escape (Esc) key to quit:
+'
+' a --- You pressed A
+' k --- You pressed ALT+K
+' ► --- You pressed CTL+P
+' --- You pressed RightArrow
+' R --- You pressed SHIFT+R
+' --- You pressed CTL+I
+' j --- You pressed ALT+J
+' O --- You pressed SHIFT+O
+' § --- You pressed CTL+U
+'
diff --git a/snippets/visualbasic/System/DateTime/DayOfWeek/Project.vbproj b/snippets/visualbasic/System/DateTime/DayOfWeek/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System/DateTime/DayOfWeek/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System/DateTime/DayOfWeek/dow.vb b/snippets/visualbasic/System/DateTime/DayOfWeek/dow.vb
new file mode 100644
index 00000000000..049c298672f
--- /dev/null
+++ b/snippets/visualbasic/System/DateTime/DayOfWeek/dow.vb
@@ -0,0 +1,19 @@
+'
+' This example demonstrates the DateTime.DayOfWeek property
+Class Sample
+ Public Shared Sub Main()
+ ' Assume the current culture is en-US.
+ ' Create a DateTime for the first of May, 2003.
+ Dim dt As New DateTime(2003, 5, 1)
+ Console.WriteLine("Is Thursday the day of the week for {0:d}?: {1}", _
+ dt, dt.DayOfWeek = DayOfWeek.Thursday)
+ Console.WriteLine("The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek)
+ End Sub
+End Class
+'
+'This example produces the following results:
+'
+'Is Thursday the day of the week for 5/1/2003?: True
+'The day of the week for 5/1/2003 is Thursday.
+'
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System/Environment/FailFast/Project.vbproj b/snippets/visualbasic/System/Environment/FailFast/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System/Environment/FailFast/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System/Environment/FailFast/ff.vb b/snippets/visualbasic/System/Environment/FailFast/ff.vb
new file mode 100644
index 00000000000..8e2da06d297
--- /dev/null
+++ b/snippets/visualbasic/System/Environment/FailFast/ff.vb
@@ -0,0 +1,21 @@
+'
+Module Example
+ Public Sub Main()
+ Dim causeOfFailure As String = "A catastrophic failure has occurred."
+ ' Assume your application has failed catastrophically and must
+ ' terminate immediately. The try-finally block is not executed
+ ' and is included only to demonstrate that instructions within
+ ' try-catch blocks and finalizers are not performed.
+
+ Try
+ Environment.FailFast(causeOfFailure)
+ Finally
+ Console.WriteLine("This finally block will not be executed.")
+ End Try
+ End Sub
+End Module
+'
+' The code example displays no output because the application is
+' terminated. However, an entry is made in the Windows Application event
+' log, and the log entry contains the text from the causeOfFailure variable.
+'
diff --git a/snippets/visualbasic/System/Math/Max/Project.vbproj b/snippets/visualbasic/System/Math/Max/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System/Math/Max/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System/Math/Max/max.vb b/snippets/visualbasic/System/Math/Max/max.vb
new file mode 100644
index 00000000000..d7786913126
--- /dev/null
+++ b/snippets/visualbasic/System/Math/Max/max.vb
@@ -0,0 +1,68 @@
+'
+' This example demonstrates Math.Max()
+Class Sample
+ Public Shared Sub Main()
+ Dim str As String = "{0}: The greater of {1,3} and {2,3} is {3}."
+ Dim nl As String = Environment.NewLine
+
+ Dim xByte1 As Byte = 1
+ Dim xByte2 As Byte = 51
+ Dim xShort1 As Short = - 2
+ Dim xShort2 As Short = 52
+ Dim xInt1 As Integer = - 3
+ Dim xInt2 As Integer = 53
+ Dim xLong1 As Long = - 4
+ Dim xLong2 As Long = 54
+ Dim xSingle1 As Single = 5F
+ Dim xSingle2 As Single = 55F
+ Dim xDouble1 As Double = 6.0
+ Dim xDouble2 As Double = 56.0
+ Dim xDecimal1 As [Decimal] = 7D
+ Dim xDecimal2 As [Decimal] = 57D
+
+ ' The following types are not CLS-compliant.
+ Dim xSByte1 As SByte = 101
+ Dim xSByte2 As SByte = 111
+ Dim xUShort1 As UShort = 102
+ Dim xUShort2 As UShort = 112
+ Dim xUint1 As UInteger = 103
+ Dim xUint2 As UInteger = 113
+ Dim xUlong1 As ULong = 104
+ Dim xUlong2 As ULong = 114
+
+ Console.WriteLine("{0}Display the greater of two values:{0}", nl)
+ Console.WriteLine(str, "Byte ", xByte1, xByte2, Math.Max(xByte1, xByte2))
+ Console.WriteLine(str, "Int16 ", xShort1, xShort2, Math.Max(xShort1, xShort2))
+ Console.WriteLine(str, "Int32 ", xInt1, xInt2, Math.Max(xInt1, xInt2))
+ Console.WriteLine(str, "Int64 ", xLong1, xLong2, Math.Max(xLong1, xLong2))
+ Console.WriteLine(str, "Single ", xSingle1, xSingle2, Math.Max(xSingle1, xSingle2))
+ Console.WriteLine(str, "Double ", xDouble1, xDouble2, Math.Max(xDouble1, xDouble2))
+ Console.WriteLine(str, "Decimal", xDecimal1, xDecimal2, Math.Max(xDecimal1, xDecimal2))
+ '
+ Console.WriteLine("{0}(The following types are not CLS-compliant.){0}", nl)
+ Console.WriteLine(str, "SByte ", xSByte1, xSByte2, Math.Max(xSByte1, xSByte2))
+ Console.WriteLine(str, "UInt16 ", xUShort1, xUShort2, Math.Max(xUShort1, xUShort2))
+ Console.WriteLine(str, "UInt32 ", xUint1, xUint2, Math.Max(xUint1, xUint2))
+ Console.WriteLine(str, "UInt64 ", xUlong1, xUlong2, Math.Max(xUlong1, xUlong2))
+ End Sub
+End Class
+'
+'This example produces the following results:
+'
+'Display the greater of two values:
+'
+'Byte : The greater of 1 and 51 is 51.
+'Int16 : The greater of -2 and 52 is 52.
+'Int32 : The greater of -3 and 53 is 53.
+'Int64 : The greater of -4 and 54 is 54.
+'Single : The greater of 5 and 55 is 55.
+'Double : The greater of 6 and 56 is 56.
+'Decimal: The greater of 7 and 57 is 57.
+'
+' (The following types are not CLS-compliant.)
+'
+' SByte : The greater of 101 and 111 is 111.
+' UInt16 : The greater of 102 and 112 is 112.
+' UInt32 : The greater of 103 and 113 is 113.
+' UInt64 : The greater of 104 and 114 is 114.
+'
diff --git a/snippets/visualbasic/System/Math/Min/Project.vbproj b/snippets/visualbasic/System/Math/Min/Project.vbproj
new file mode 100644
index 00000000000..0735dba1f6d
--- /dev/null
+++ b/snippets/visualbasic/System/Math/Min/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Library
+ net6.0
+
+
+
diff --git a/snippets/visualbasic/System/Math/Min/min.vb b/snippets/visualbasic/System/Math/Min/min.vb
new file mode 100644
index 00000000000..0a6ccf5225a
--- /dev/null
+++ b/snippets/visualbasic/System/Math/Min/min.vb
@@ -0,0 +1,68 @@
+'
+' This example demonstrates Math.Min()
+Class Sample
+ Public Shared Sub Main()
+ Dim str As String = "{0}: The lesser of {1,3} and {2,3} is {3}."
+ Dim nl As String = Environment.NewLine
+
+ Dim xByte1 As Byte = 1
+ Dim xByte2 As Byte = 51
+ Dim xShort1 As Short = - 2
+ Dim xShort2 As Short = 52
+ Dim xInt1 As Integer = - 3
+ Dim xInt2 As Integer = 53
+ Dim xLong1 As Long = - 4
+ Dim xLong2 As Long = 54
+ Dim xSingle1 As Single = 5F
+ Dim xSingle2 As Single = 55F
+ Dim xDouble1 As Double = 6.0
+ Dim xDouble2 As Double = 56.0
+ Dim xDecimal1 As [Decimal] = 7D
+ Dim xDecimal2 As [Decimal] = 57D
+
+ ' The following types are not CLS-compliant.
+ Dim xSbyte1 As SByte = 101
+ Dim xSbyte2 As SByte = 111
+ Dim xUshort1 As UShort = 102
+ Dim xUshort2 As UShort = 112
+ Dim xUint1 As UInteger = 103
+ Dim xUint2 As UInteger = 113
+ Dim xUlong1 As ULong = 104
+ Dim xUlong2 As ULong = 114
+
+ Console.WriteLine("{0}Display the lesser of two values:{0}", nl)
+ Console.WriteLine(str, "Byte ", xByte1, xByte2, Math.Min(xByte1, xByte2))
+ Console.WriteLine(str, "Int16 ", xShort1, xShort2, Math.Min(xShort1, xShort2))
+ Console.WriteLine(str, "Int32 ", xInt1, xInt2, Math.Min(xInt1, xInt2))
+ Console.WriteLine(str, "Int64 ", xLong1, xLong2, Math.Min(xLong1, xLong2))
+ Console.WriteLine(str, "Single ", xSingle1, xSingle2, Math.Min(xSingle1, xSingle2))
+ Console.WriteLine(str, "Double ", xDouble1, xDouble2, Math.Min(xDouble1, xDouble2))
+ Console.WriteLine(str, "Decimal", xDecimal1, xDecimal2, Math.Min(xDecimal1, xDecimal2))
+ '
+ Console.WriteLine("{0}The following types are not CLS-compliant:{0}", nl)
+ Console.WriteLine(str, "SByte ", xSbyte1, xSbyte2, Math.Min(xSbyte1, xSbyte2))
+ Console.WriteLine(str, "UInt16 ", xUshort1, xUshort2, Math.Min(xUshort1, xUshort2))
+ Console.WriteLine(str, "UInt32 ", xUint1, xUInt2, Math.Min(xUInt1, xUInt2))
+ Console.WriteLine(str, "UInt64 ", xUlong1, xUlong2, Math.Min(xUlong1, xUlong2))
+ End Sub
+End Class
+'
+' This example produces the following results:
+'
+' Display the lesser of two values:
+'
+' Byte : The lesser of 1 and 51 is 1.
+' Int16 : The lesser of -2 and 52 is -2.
+' Int32 : The lesser of -3 and 53 is -3.
+' Int64 : The lesser of -4 and 54 is -4.
+' Single : The lesser of 5 and 55 is 5.
+' Double : The lesser of 6 and 56 is 6.
+' Decimal: The lesser of 7 and 57 is 7.
+'
+' The following types are not CLS-compliant:
+'
+' SByte : The lesser of 101 and 111 is 101.
+' UInt16 : The lesser of 102 and 112 is 102.
+' UInt32 : The lesser of 103 and 113 is 103.
+' UInt64 : The lesser of 104 and 114 is 104.
+'
diff --git a/xml/System.Text/StringBuilder.xml b/xml/System.Text/StringBuilder.xml
index f4059a81161..f9f7ee85756 100644
--- a/xml/System.Text/StringBuilder.xml
+++ b/xml/System.Text/StringBuilder.xml
@@ -6946,7 +6946,7 @@ In .NET Core and in the .NET Framework 4.0 and later versions, when you instanti
:::code language="csharp" source="~/snippets/csharp/System.Text/StringBuilder/Replace/replace.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Text/StringBuilder/Replace/replace.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/stringbuilder.replace/VB/replace.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Text/StringBuilder/Replace/replace.vb" id="Snippet1":::
]]>
diff --git a/xml/System.Threading/Thread.xml b/xml/System.Threading/Thread.xml
index 53841a6e077..94b17d4d003 100644
--- a/xml/System.Threading/Thread.xml
+++ b/xml/System.Threading/Thread.xml
@@ -3524,7 +3524,7 @@ The value is not guaranteed to be a zero-based processor number.
:::code language="csharp" source="~/snippets/csharp/System.Threading/Thread/Sleep/example1.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Threading/Thread/Sleep/example1.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/thread.sleep_timespan/vb/example.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Threading/Thread/Sleep/example.vb" id="Snippet1":::
]]>
diff --git a/xml/System.Threading/ThreadAbortException.xml b/xml/System.Threading/ThreadAbortException.xml
index 71e607515ff..9d1ccb27755 100644
--- a/xml/System.Threading/ThreadAbortException.xml
+++ b/xml/System.Threading/ThreadAbortException.xml
@@ -79,7 +79,7 @@
The following example demonstrates aborting a thread. The thread that receives the `ThreadAbortException` uses the method to cancel the abort request and continue executing.
:::code language="csharp" source="~/snippets/csharp/System.Threading/ThreadAbortException/Overview/threadabex.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/ThreadAbEx/VB/threadabex.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Threading/Thread/Abort/threadabex.vb" id="Snippet1":::
This code produces the following output:
diff --git a/xml/System/Console.xml b/xml/System/Console.xml
index f5401098e5e..c1ba1d40238 100644
--- a/xml/System/Console.xml
+++ b/xml/System/Console.xml
@@ -1716,7 +1716,7 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to
:::code language="csharp" source="~/snippets/csharp/System/Console/KeyAvailable/ka.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.keyavailable/FS/ka.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/console.keyavailable/VB/ka.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System/Console/KeyAvailable/ka.vb" id="Snippet1":::
]]>
@@ -2862,7 +2862,7 @@ This method can be used to reacquire the standard output stream after it has bee
:::code language="csharp" source="~/snippets/csharp/System/Console/ReadKey/rk.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.readkey1/FS/rk.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/console.readkey1/VB/rk.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadKey/rk.vb" id="Snippet1":::
]]>
@@ -3946,7 +3946,7 @@ This method can be used to reacquire the standard output stream after it has bee
:::code language="csharp" source="~/snippets/csharp/System/Console/ReadKey/rk.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.readkey1/FS/rk.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/console.readkey1/VB/rk.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadKey/rk.vb" id="Snippet1":::
]]>
diff --git a/xml/System/ConsoleKeyInfo.xml b/xml/System/ConsoleKeyInfo.xml
index 891effcec0d..d9dde6476e6 100644
--- a/xml/System/ConsoleKeyInfo.xml
+++ b/xml/System/ConsoleKeyInfo.xml
@@ -78,7 +78,7 @@
:::code language="csharp" source="~/snippets/csharp/System/Console/ReadKey/rk.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.readkey1/FS/rk.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/console.readkey1/VB/rk.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadKey/rk.vb" id="Snippet1":::
]]>
@@ -392,7 +392,7 @@
:::code language="csharp" source="~/snippets/csharp/System/Console/ReadKey/rk.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.readkey1/FS/rk.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/console.readkey1/VB/rk.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadKey/rk.vb" id="Snippet1":::
]]>
@@ -501,7 +501,7 @@
:::code language="csharp" source="~/snippets/csharp/System/Console/ReadKey/rk.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.readkey1/FS/rk.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/console.readkey1/VB/rk.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadKey/rk.vb" id="Snippet1":::
]]>
diff --git a/xml/System/ConsoleModifiers.xml b/xml/System/ConsoleModifiers.xml
index 909239a9869..e09a3543c61 100644
--- a/xml/System/ConsoleModifiers.xml
+++ b/xml/System/ConsoleModifiers.xml
@@ -66,7 +66,7 @@
:::code language="csharp" source="~/snippets/csharp/System/Console/ReadKey/rk.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.readkey1/FS/rk.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/console.readkey1/VB/rk.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadKey/rk.vb" id="Snippet1":::
]]>
diff --git a/xml/System/DateTime.xml b/xml/System/DateTime.xml
index 699302793be..dce54dfaddc 100644
--- a/xml/System/DateTime.xml
+++ b/xml/System/DateTime.xml
@@ -2767,7 +2767,7 @@ The value parameter is rounded to the nearest integer.
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.DayOfWeek/FS/dow.fs" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System/DateTime/DayOfWeek/dow.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/DateTime.DayOfWeek/VB/dow.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System/DateTime/DayOfWeek/dow.vb" id="Snippet1":::
]]>
diff --git a/xml/System/DayOfWeek.xml b/xml/System/DayOfWeek.xml
index f070ca8c127..fbb1656cb98 100644
--- a/xml/System/DayOfWeek.xml
+++ b/xml/System/DayOfWeek.xml
@@ -74,7 +74,7 @@
:::code language="csharp" source="~/snippets/csharp/System/DateTime/DayOfWeek/dow.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.DayOfWeek/FS/dow.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/DateTime.DayOfWeek/VB/dow.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System/DateTime/DayOfWeek/dow.vb" id="Snippet1":::
]]>
diff --git a/xml/System/Environment.xml b/xml/System/Environment.xml
index 25144566d31..2a50200fb33 100644
--- a/xml/System/Environment.xml
+++ b/xml/System/Environment.xml
@@ -688,7 +688,7 @@ Calling the `Environment.FailFast` method to terminate execution of an applicati
:::code language="csharp" source="~/snippets/csharp/System/Environment/FailFast/ff.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/Environment/FailFast/ff.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/environment.FailFast/vb/ff.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System/Environment/FailFast/ff.vb" id="Snippet1":::
]]>
diff --git a/xml/System/Math.xml b/xml/System/Math.xml
index 33faeae01b8..3efebe12b79 100644
--- a/xml/System/Math.xml
+++ b/xml/System/Math.xml
@@ -4416,7 +4416,7 @@ The following example demonstrates how to use the meth
:::code language="csharp" source="~/snippets/csharp/System/Math/Max/max.cs" interactive="try-dotnet-method" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/Math/Max/max.fs" id="Snippet1":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/math.max/VB/max.vb" id="Snippet1":::
+:::code language="vb" source="~/snippets/visualbasic/System/Math/Max/max.vb" id="Snippet1":::
]]>
@@ -5309,7 +5309,7 @@ The following example demonstrates how to use the meth
:::code language="csharp" source="~/snippets/csharp/System/Math/Min/min.cs" interactive="try-dotnet-method" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/Math/Min/min.fs" id="Snippet1":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/math.min/VB/min.vb" id="Snippet1":::
+:::code language="vb" source="~/snippets/visualbasic/System/Math/Min/min.vb" id="Snippet1":::
]]>
diff --git a/xml/System/String.xml b/xml/System/String.xml
index 9226df9fb58..5b49f81cd61 100644
--- a/xml/System/String.xml
+++ b/xml/System/String.xml
@@ -1036,7 +1036,7 @@ In the following example, the `ReverseStringComparer` class demonstrates how you
:::code language="csharp" source="~/snippets/csharp/System/String/Compare/ArrayListSample.cs" interactive="try-dotnet" id="Snippet7":::
:::code language="fsharp" source="~/snippets/fsharp/System/String/Compare/ArrayListSample.fs" id="Snippet7":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/ArrayList/VB/ArrayListSample.vb" id="Snippet7":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections/ArrayList/Overview/ArrayListSample.vb" id="Snippet7":::
]]>
From 0b9c731881c49c9885cb751c1036a3139649c431 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 08:25:18 +0000
Subject: [PATCH 06/13] Address PR feedback: delete REORGANIZATION.md, update
to net9.0, remove old snippets
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
snippets/visualbasic/REORGANIZATION.md | 139 -----------
.../.ctor/Project.vbproj | 2 +-
.../Overview/Project.vbproj | 2 +-
.../Overview/Project.vbproj | 2 +-
.../ListT/IndexOf/Project.vbproj | 2 +-
.../ListT/Ranges/Project.vbproj | 2 +-
.../QueueT/Overview/Project.vbproj | 2 +-
.../.ctor/Project.vbproj | 2 +-
.../Overview/Project.vbproj | 2 +-
.../.ctor/Project.vbproj | 2 +-
.../IDictionary/Project.vbproj | 2 +-
.../Overview/Project.vbproj | 2 +-
.../StackT/Overview/Project.vbproj | 2 +-
.../ArrayList/Overview/Project.vbproj | 2 +-
.../SystemDateTimeReference.vbproj | 2 +-
.../GetShortestDayName/Project.vbproj | 2 +-
.../Deflate/Deflate.vbproj | 2 +-
.../System.IO.Compression/GZip/GZip.vbproj | 2 +-
.../CreateSubdirectory/Project.vbproj | 2 +-
.../DirectoryInfo/Delete/Project.vbproj | 2 +-
.../GetDirectories/Project.vbproj | 2 +-
.../DirectoryInfo/MoveTo/Project.vbproj | 2 +-
.../DirectoryInfo/Parent/Project.vbproj | 2 +-
.../DirectoryInfo/Root/Project.vbproj | 2 +-
.../System.IO/FileInfo/CopyTo/Project.vbproj | 2 +-
.../FileInfo/GetAccessControl/Project.vbproj | 2 +-
.../FileInfo/IsReadOnly/Project.vbproj | 2 +-
.../FileStreamOptionsExamples.vbproj | 2 +-
.../System.IO/Path/Combine/Project.vbproj | 2 +-
.../Path/GetRelativePath/Project.vbproj | 2 +-
.../System.Net.Security/ALPN/Project.vbproj | 2 +-
.../CryptoStream/Overview/project.vbproj | 2 +-
.../StringBuilder/Replace/Project.vbproj | 2 +-
.../Thread/Abort/Project.vbproj | 2 +-
.../Thread/Sleep/Project.vbproj | 2 +-
.../Console/KeyAvailable/Project.vbproj | 2 +-
.../System/Console/ReadKey/Project.vbproj | 2 +-
.../System/DateTime/DayOfWeek/Project.vbproj | 2 +-
.../Environment/FailFast/Project.vbproj | 2 +-
.../System/Math/Max/Project.vbproj | 2 +-
.../System/Math/Min/Project.vbproj | 2 +-
.../Object/MemberwiseClone/Project.vbproj | 2 +-
.../System/string.split/string.split.vbproj | 2 +-
.../ArrayList/VB/ArrayListSample.vb | 75 ------
.../DateTime.DayOfWeek/VB/dow.vb | 19 --
.../FileInfoCopyTo1/VB/fileinfocopyto1.vb | 45 ----
.../VB/source.vb | 42 ----
.../VB/source.vb | 35 ---
.../Generic.IDictionary/VB/source.vb | 161 -------------
.../Generic.IDictionary/VB/source2.vb | 23 --
.../Generic.Queue/vb/source.vb | 92 --------
.../VB/source.vb | 55 -----
.../Generic.SortedDictionary/VB/source.vb | 164 -------------
.../VB/source.vb | 216 ------------------
.../VB/source.vb | 47 ----
.../Generic.Stack/vb/source.vb | 93 --------
.../VB/sample.vb | 79 -------
.../IO.FileInfo.isReadOnly/VB/sample.vb | 48 ----
.../List`1_IndexOf/vb/source.vb | 53 -----
.../List`1_Ranges/vb/source.vb | 99 --------
.../ThreadAbEx/VB/threadabex.vb | 38 ---
.../console.keyavailable/VB/ka.vb | 39 ----
.../VS_Snippets_CLR/console.readkey1/VB/rk.vb | 33 ---
.../VB/directoryinfocreatesub.vb | 28 ---
.../VB/directoryinfodelete.vb | 29 ---
.../VB/directoryinfogetdirectories.vb | 18 --
.../VB/directoryinfomoveto.vb | 35 ---
.../VB/directoryinfoparent.vb | 25 --
.../VB/directoryinforoot2.vb | 28 ---
.../environment.FailFast/vb/ff.vb | 21 --
.../VS_Snippets_CLR/math.max/VB/max.vb | 68 ------
.../VS_Snippets_CLR/math.min/VB/min.vb | 68 ------
.../pathcombine/VB/pathcombine.vb | 63 -----
.../stringbuilder.replace/VB/replace.vb | 67 ------
.../thread.sleep_timespan/vb/example.vb | 27 ---
75 files changed, 42 insertions(+), 2114 deletions(-)
delete mode 100644 snippets/visualbasic/REORGANIZATION.md
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/ArrayList/VB/ArrayListSample.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/DateTime.DayOfWeek/VB/dow.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/FileInfoCopyTo1/VB/fileinfocopyto1.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/Generic.Dictionary.ctor_IDicIEqC/VB/source.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32/VB/source.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source2.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDicIComp/VB/source.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_IComp/VB/source.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/IO.FileInfo.GetAccessControl-SetAccessControl/VB/sample.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/IO.FileInfo.isReadOnly/VB/sample.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/List`1_IndexOf/vb/source.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/List`1_Ranges/vb/source.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/ThreadAbEx/VB/threadabex.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/console.keyavailable/VB/ka.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/console.readkey1/VB/rk.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/directoryinfocreatesub/VB/directoryinfocreatesub.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/directoryinfodelete/VB/directoryinfodelete.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/directoryinfogetdirectories/VB/directoryinfogetdirectories.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/directoryinfomoveto/VB/directoryinfomoveto.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/directoryinfoparent/VB/directoryinfoparent.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/directoryinforoot/VB/directoryinforoot2.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/environment.FailFast/vb/ff.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/math.max/VB/max.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/math.min/VB/min.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/pathcombine/VB/pathcombine.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/stringbuilder.replace/VB/replace.vb
delete mode 100644 snippets/visualbasic/VS_Snippets_CLR/thread.sleep_timespan/vb/example.vb
diff --git a/snippets/visualbasic/REORGANIZATION.md b/snippets/visualbasic/REORGANIZATION.md
deleted file mode 100644
index 13dcc1c9ba9..00000000000
--- a/snippets/visualbasic/REORGANIZATION.md
+++ /dev/null
@@ -1,139 +0,0 @@
-# Visual Basic Snippet Reorganization
-
-This document describes the reorganization of Visual Basic code snippets from the legacy `VS_Snippets_CLR` structure to a namespace-based organization that matches the C# snippet structure.
-
-## Overview
-
-Previously, VB snippets were organized under `snippets/visualbasic/VS_Snippets_CLR` with inconsistent naming patterns. They have been reorganized to match the C# snippet organization using namespace and API-based directory structures.
-
-## Reorganization Pattern
-
-### Before (Old Structure)
-```
-snippets/visualbasic/VS_Snippets_CLR/
-├── directoryinforoot/VB/directoryinforoot2.vb
-├── List`1_IndexOf/vb/source.vb
-├── Generic.SortedDictionary/VB/source.vb
-├── environment.FailFast/vb/ff.vb
-└── stringbuilder.replace/VB/replace.vb
-```
-
-### After (New Structure)
-```
-snippets/visualbasic/
-├── System.IO/DirectoryInfo/Root/directoryinforoot2.vb
-├── System.Collections.Generic/ListT/IndexOf/source.vb
-├── System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb
-├── System/Environment/FailFast/ff.vb
-└── System.Text/StringBuilder/Replace/replace.vb
-```
-
-## Naming Conventions
-
-### Namespace Mapping
-- `VS_Snippets_CLR` files are mapped to appropriate namespaces:
- - Files starting with `Generic.` → `System.Collections.Generic`
- - Files with `directoryinfo`, `fileinfo`, `path` → `System.IO`
- - Files with `environment`, `console`, `datetime`, `string`, `array`, `math` → `System`
- - Files with `stringbuilder`, `regex` → `System.Text`
- - Files with `thread` → `System.Threading`
-
-### Type Name Mapping
-- Generic type names are converted to match C# patterns:
- - `List`1` → `ListT`
- - `Dictionary`2` → `DictionaryTKey,TValue`
- - `SortedDictionary`2` → `SortedDictionaryTKey,TValue`
- - `SortedList`2` → `SortedListTKey,TValue`
- - `Queue`1` → `QueueT`
- - `Stack`1` → `StackT`
-
-### Member/Method Mapping
-- Constructor examples → `.ctor`
-- Method-specific examples use the method name (e.g., `IndexOf`, `Contains`)
-- General class examples → `Overview`
-
-## Project Files
-
-Each snippet directory includes a `Project.vbproj` file for compilation:
-
-```xml
-
-
- Library
- net6.0
-
-
-```
-
-## XML Reference Updates
-
-All XML documentation files have been updated to reference the new snippet paths:
-
-### Before
-```xml
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_IndexOf/vb/source.vb" id="Snippet1":::
-```
-
-### After
-```xml
-:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/source.vb" id="Snippet1":::
-```
-
-## Moved Snippets Summary
-
-The following categories of snippets have been successfully reorganized:
-
-### System.Collections.Generic (13 files)
-- `ListT/IndexOf/` - List.IndexOf examples
-- `ListT/Ranges/` - List range operations
-- `QueueT/Overview/` - Queue general examples
-- `StackT/Overview/` - Stack general examples
-- `DictionaryTKey,TValue/.ctor/` - Dictionary constructors
-- `SortedDictionaryTKey,TValue/Overview/` - SortedDictionary examples
-- `SortedListTKey,TValue/IDictionary/` - SortedList as IDictionary
-- `IDictionaryTKey,TValue/Overview/` - IDictionary interface examples
-
-### System.IO (9 files)
-- `DirectoryInfo/Root/` - DirectoryInfo.Root property
-- `DirectoryInfo/GetDirectories/` - DirectoryInfo.GetDirectories method
-- `DirectoryInfo/CreateSubdirectory/` - Directory creation
-- `DirectoryInfo/Delete/` - Directory deletion
-- `DirectoryInfo/MoveTo/` - Directory moving
-- `DirectoryInfo/Parent/` - Parent directory access
-- `FileInfo/IsReadOnly/` - FileInfo.IsReadOnly property
-- `FileInfo/CopyTo/` - File copying
-- `FileInfo/GetAccessControl/` - File access control
-- `Path/Combine/` - Path.Combine method
-
-### System (7 files)
-- `Environment/FailFast/` - Environment.FailFast method
-- `Console/KeyAvailable/` - Console.KeyAvailable property
-- `Console/ReadKey/` - Console.ReadKey method
-- `DateTime/DayOfWeek/` - DateTime.DayOfWeek property
-- `Math/Max/` - Math.Max method
-- `Math/Min/` - Math.Min method
-
-### System.Collections (1 file)
-- `ArrayList/Overview/` - ArrayList general examples
-
-### System.Text (1 file)
-- `StringBuilder/Replace/` - StringBuilder.Replace method
-
-### System.Threading (2 files)
-- `Thread/Sleep/` - Thread.Sleep method
-- `Thread/Abort/` - Thread abortion examples
-
-## Validation
-
-All moved snippets:
-1. ✅ Build successfully with their project files
-2. ✅ Maintain their original snippet IDs and functionality
-3. ✅ Have updated XML references in documentation files
-4. ✅ Follow the established C# snippet organization pattern
-
-## Benefits
-
-1. **Consistency**: VB snippets now follow the same organization pattern as C# snippets
-2. **Discoverability**: Easier to find snippets by namespace and API
-3. **Maintainability**: Clearer structure for adding new snippets
-4. **Build Validation**: Each snippet can be independently compiled and validated
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj
index c02dc5044e7..a3fb2ebcab0 100644
--- a/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Collections/ArrayList/Overview/Project.vbproj b/snippets/visualbasic/System.Collections/ArrayList/Overview/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Collections/ArrayList/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections/ArrayList/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.DateTime/SystemDateTimeReference.vbproj b/snippets/visualbasic/System.DateTime/SystemDateTimeReference.vbproj
index 41f1d5ad4b2..92e46ddaccf 100644
--- a/snippets/visualbasic/System.DateTime/SystemDateTimeReference.vbproj
+++ b/snippets/visualbasic/System.DateTime/SystemDateTimeReference.vbproj
@@ -2,7 +2,7 @@
Exe
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/GetShortestDayName/Project.vbproj b/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/GetShortestDayName/Project.vbproj
index a269962b552..92e46ddaccf 100644
--- a/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/GetShortestDayName/Project.vbproj
+++ b/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/GetShortestDayName/Project.vbproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ net9.0
diff --git a/snippets/visualbasic/System.IO.Compression/Deflate/Deflate.vbproj b/snippets/visualbasic/System.IO.Compression/Deflate/Deflate.vbproj
index 38c40ed3d30..16d5817ec65 100644
--- a/snippets/visualbasic/System.IO.Compression/Deflate/Deflate.vbproj
+++ b/snippets/visualbasic/System.IO.Compression/Deflate/Deflate.vbproj
@@ -2,7 +2,7 @@
Exe
- net6.0
+ net9.0
Deflate.MemoryWriteReadExample
diff --git a/snippets/visualbasic/System.IO.Compression/GZip/GZip.vbproj b/snippets/visualbasic/System.IO.Compression/GZip/GZip.vbproj
index e592b8dad3f..ea86074ff41 100644
--- a/snippets/visualbasic/System.IO.Compression/GZip/GZip.vbproj
+++ b/snippets/visualbasic/System.IO.Compression/GZip/GZip.vbproj
@@ -2,7 +2,7 @@
Exe
- net6.0
+ net9.0
GZip.MemoryWriteReadExample
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/Project.vbproj
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/CreateSubdirectory/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/Delete/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/Delete/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.IO/DirectoryInfo/Delete/Project.vbproj
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/Delete/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/Project.vbproj
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/GetDirectories/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/Project.vbproj
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/MoveTo/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/Parent/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/Parent/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.IO/DirectoryInfo/Parent/Project.vbproj
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/Parent/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.IO/DirectoryInfo/Root/Project.vbproj b/snippets/visualbasic/System.IO/DirectoryInfo/Root/Project.vbproj
index c02dc5044e7..a3fb2ebcab0 100644
--- a/snippets/visualbasic/System.IO/DirectoryInfo/Root/Project.vbproj
+++ b/snippets/visualbasic/System.IO/DirectoryInfo/Root/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/FileInfo/CopyTo/Project.vbproj b/snippets/visualbasic/System.IO/FileInfo/CopyTo/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.IO/FileInfo/CopyTo/Project.vbproj
+++ b/snippets/visualbasic/System.IO/FileInfo/CopyTo/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/Project.vbproj b/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/Project.vbproj
+++ b/snippets/visualbasic/System.IO/FileInfo/GetAccessControl/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.IO/FileInfo/IsReadOnly/Project.vbproj b/snippets/visualbasic/System.IO/FileInfo/IsReadOnly/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.IO/FileInfo/IsReadOnly/Project.vbproj
+++ b/snippets/visualbasic/System.IO/FileInfo/IsReadOnly/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.IO/FileStreamOptions/FileStreamOptionsExamples.vbproj b/snippets/visualbasic/System.IO/FileStreamOptions/FileStreamOptionsExamples.vbproj
index adbde6e0619..aee73149c05 100644
--- a/snippets/visualbasic/System.IO/FileStreamOptions/FileStreamOptionsExamples.vbproj
+++ b/snippets/visualbasic/System.IO/FileStreamOptions/FileStreamOptionsExamples.vbproj
@@ -2,7 +2,7 @@
Exe
- net6.0
+ net9.0
\ No newline at end of file
diff --git a/snippets/visualbasic/System.IO/Path/Combine/Project.vbproj b/snippets/visualbasic/System.IO/Path/Combine/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.IO/Path/Combine/Project.vbproj
+++ b/snippets/visualbasic/System.IO/Path/Combine/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.IO/Path/GetRelativePath/Project.vbproj b/snippets/visualbasic/System.IO/Path/GetRelativePath/Project.vbproj
index adbde6e0619..aee73149c05 100644
--- a/snippets/visualbasic/System.IO/Path/GetRelativePath/Project.vbproj
+++ b/snippets/visualbasic/System.IO/Path/GetRelativePath/Project.vbproj
@@ -2,7 +2,7 @@
Exe
- net6.0
+ net9.0
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Net.Security/ALPN/Project.vbproj b/snippets/visualbasic/System.Net.Security/ALPN/Project.vbproj
index adbde6e0619..aee73149c05 100644
--- a/snippets/visualbasic/System.Net.Security/ALPN/Project.vbproj
+++ b/snippets/visualbasic/System.Net.Security/ALPN/Project.vbproj
@@ -2,7 +2,7 @@
Exe
- net6.0
+ net9.0
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Security.Cryptography/CryptoStream/Overview/project.vbproj b/snippets/visualbasic/System.Security.Cryptography/CryptoStream/Overview/project.vbproj
index d50c0e10aeb..aee73149c05 100644
--- a/snippets/visualbasic/System.Security.Cryptography/CryptoStream/Overview/project.vbproj
+++ b/snippets/visualbasic/System.Security.Cryptography/CryptoStream/Overview/project.vbproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ net9.0
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Text/StringBuilder/Replace/Project.vbproj b/snippets/visualbasic/System.Text/StringBuilder/Replace/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Text/StringBuilder/Replace/Project.vbproj
+++ b/snippets/visualbasic/System.Text/StringBuilder/Replace/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Threading/Thread/Abort/Project.vbproj b/snippets/visualbasic/System.Threading/Thread/Abort/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Threading/Thread/Abort/Project.vbproj
+++ b/snippets/visualbasic/System.Threading/Thread/Abort/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System.Threading/Thread/Sleep/Project.vbproj b/snippets/visualbasic/System.Threading/Thread/Sleep/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System.Threading/Thread/Sleep/Project.vbproj
+++ b/snippets/visualbasic/System.Threading/Thread/Sleep/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System/Console/KeyAvailable/Project.vbproj b/snippets/visualbasic/System/Console/KeyAvailable/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System/Console/KeyAvailable/Project.vbproj
+++ b/snippets/visualbasic/System/Console/KeyAvailable/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System/Console/ReadKey/Project.vbproj b/snippets/visualbasic/System/Console/ReadKey/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System/Console/ReadKey/Project.vbproj
+++ b/snippets/visualbasic/System/Console/ReadKey/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System/DateTime/DayOfWeek/Project.vbproj b/snippets/visualbasic/System/DateTime/DayOfWeek/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System/DateTime/DayOfWeek/Project.vbproj
+++ b/snippets/visualbasic/System/DateTime/DayOfWeek/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System/Environment/FailFast/Project.vbproj b/snippets/visualbasic/System/Environment/FailFast/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System/Environment/FailFast/Project.vbproj
+++ b/snippets/visualbasic/System/Environment/FailFast/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System/Math/Max/Project.vbproj b/snippets/visualbasic/System/Math/Max/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System/Math/Max/Project.vbproj
+++ b/snippets/visualbasic/System/Math/Max/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System/Math/Min/Project.vbproj b/snippets/visualbasic/System/Math/Min/Project.vbproj
index 0735dba1f6d..ffa6c9960f8 100644
--- a/snippets/visualbasic/System/Math/Min/Project.vbproj
+++ b/snippets/visualbasic/System/Math/Min/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net6.0
+ net9.0
diff --git a/snippets/visualbasic/System/Object/MemberwiseClone/Project.vbproj b/snippets/visualbasic/System/Object/MemberwiseClone/Project.vbproj
index aa9fd2ecaaf..325ccd545c2 100644
--- a/snippets/visualbasic/System/Object/MemberwiseClone/Project.vbproj
+++ b/snippets/visualbasic/System/Object/MemberwiseClone/Project.vbproj
@@ -2,7 +2,7 @@
Exe
- net6.0
+ net9.0
\ No newline at end of file
diff --git a/snippets/visualbasic/System/string.split/string.split.vbproj b/snippets/visualbasic/System/string.split/string.split.vbproj
index 81221ba8618..adc1492d1e3 100644
--- a/snippets/visualbasic/System/string.split/string.split.vbproj
+++ b/snippets/visualbasic/System/string.split/string.split.vbproj
@@ -3,7 +3,7 @@
Exe
split
- net8
+ net9.0
diff --git a/snippets/visualbasic/VS_Snippets_CLR/ArrayList/VB/ArrayListSample.vb b/snippets/visualbasic/VS_Snippets_CLR/ArrayList/VB/ArrayListSample.vb
deleted file mode 100644
index 2b11bf2d190..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/ArrayList/VB/ArrayListSample.vb
+++ /dev/null
@@ -1,75 +0,0 @@
-'
-Imports System.Text
-Imports System.Collections
-
-
-
-Public Class SamplesArrayList
-
-
- Public Shared Sub Main()
- Dim myAL As New ArrayList()
- '
- ' Creates and initializes a new ArrayList.
- myAL.Add("Eric")
- myAL.Add("Mark")
- myAL.Add("Lance")
- myAL.Add("Rob")
- myAL.Add("Kris")
- myAL.Add("Brad")
- myAL.Add("Kit")
- myAL.Add("Bradley")
- myAL.Add("Keith")
- myAL.Add("Susan")
-
- ' Displays the properties and values of the ArrayList.
- Console.WriteLine("Count: {0}", myAL.Count)
- '
- PrintValues("Unsorted", myAL)
- '
- myAL.Sort()
- PrintValues("Sorted", myAL)
- '
- '
- Dim comp as New ReverseStringComparer
- myAL.Sort(comp)
- PrintValues("Reverse", myAL)
-
- '
- Dim names As String() = CType(myAL.ToArray(GetType(String)), String())
- '
- '
- End Sub
-
-
-
- '
- Public Shared Sub PrintValues(title As String, myList As IEnumerable)
- Console.Write("{0,10}: ", title)
- Dim sb As New StringBuilder()
- Dim s As String
- For Each s In myList
- sb.AppendFormat("{0}, ", s)
- Next s
- sb.Remove(sb.Length - 2, 2)
- Console.WriteLine(sb)
- End Sub
-'
-End Class
-
-'
-Public Class ReverseStringComparer
- Implements IComparer
-
- Function Compare(x As Object, y As Object) As Integer implements IComparer.Compare
- Dim s1 As String = CStr (x)
- Dim s2 As String = CStr (y)
-
- 'negate the return value to get the reverse order
- Return - [String].Compare(s1, s2)
-
- End Function 'Compare
-End Class
-'
-
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/DateTime.DayOfWeek/VB/dow.vb b/snippets/visualbasic/VS_Snippets_CLR/DateTime.DayOfWeek/VB/dow.vb
deleted file mode 100644
index 049c298672f..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/DateTime.DayOfWeek/VB/dow.vb
+++ /dev/null
@@ -1,19 +0,0 @@
-'
-' This example demonstrates the DateTime.DayOfWeek property
-Class Sample
- Public Shared Sub Main()
- ' Assume the current culture is en-US.
- ' Create a DateTime for the first of May, 2003.
- Dim dt As New DateTime(2003, 5, 1)
- Console.WriteLine("Is Thursday the day of the week for {0:d}?: {1}", _
- dt, dt.DayOfWeek = DayOfWeek.Thursday)
- Console.WriteLine("The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek)
- End Sub
-End Class
-'
-'This example produces the following results:
-'
-'Is Thursday the day of the week for 5/1/2003?: True
-'The day of the week for 5/1/2003 is Thursday.
-'
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/FileInfoCopyTo1/VB/fileinfocopyto1.vb b/snippets/visualbasic/VS_Snippets_CLR/FileInfoCopyTo1/VB/fileinfocopyto1.vb
deleted file mode 100644
index b4d6b3b248a..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/FileInfoCopyTo1/VB/fileinfocopyto1.vb
+++ /dev/null
@@ -1,45 +0,0 @@
-'
-Imports System.IO
-
-Public Class CopyToTest
- Public Shared Sub Main()
- Try
- ' Create a reference to a file, which might or might not exist.
- ' If it does not exist, it is not yet created.
- Dim fi As New FileInfo("temp.txt")
- ' Create a writer, ready to add entries to the file.
- Dim sw As StreamWriter = fi.AppendText()
- sw.WriteLine("Add as many lines as you like...")
- sw.WriteLine("Add another line to the output...")
- sw.Flush()
- sw.Close()
- ' Get the information out of the file and display it.
- Dim sr As New StreamReader(fi.OpenRead())
- Console.WriteLine("This is the information in the first file:")
- While sr.Peek() <> -1
- Console.WriteLine(sr.ReadLine())
- End While
- ' Copy this file to another file.
- Dim newfi As FileInfo = fi.CopyTo("newTemp.txt")
- ' Get the information out of the new file and display it.
- sr = New StreamReader(newfi.OpenRead())
- Console.WriteLine("{0}This is the information in the second file:", Environment.NewLine)
- While sr.Peek() <> -1
- Console.WriteLine(sr.ReadLine())
- End While
- Catch e As Exception
- Console.WriteLine(e.Message)
- End Try
- End Sub
-End Class
-'This code produces output similar to the following;
-'results may vary based on the computer/file structure/etc.:
-'
-'This is the information in the first file:
-'Add as many lines as you like...
-'Add another line to the output...
-'
-'This is the information in the second file:
-'Add as many lines as you like...
-'Add another line to the output...
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.Dictionary.ctor_IDicIEqC/VB/source.vb b/snippets/visualbasic/VS_Snippets_CLR/Generic.Dictionary.ctor_IDicIEqC/VB/source.vb
deleted file mode 100644
index 0333221534e..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.Dictionary.ctor_IDicIEqC/VB/source.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-'
-Imports System.Collections.Generic
-
-Public Class Example
-
- Public Shared Sub Main()
-
- ' Create a new sorted dictionary of strings, with string
- ' keys and a case-insensitive comparer.
- Dim openWith As New SortedDictionary(Of String, String)( _
- StringComparer.CurrentCultureIgnoreCase)
-
- ' Add some elements to the sorted dictionary.
- openWith.Add("txt", "notepad.exe")
- openWith.Add("Bmp", "paint.exe")
- openWith.Add("DIB", "paint.exe")
- openWith.Add("rtf", "wordpad.exe")
-
- ' Create a Dictionary of strings with string keys and a
- ' case-insensitive equality comparer, and initialize it
- ' with the contents of the sorted dictionary.
- Dim copy As New Dictionary(Of String, String)(openWith, _
- StringComparer.CurrentCultureIgnoreCase)
-
- ' List the contents of the copy.
- Console.WriteLine()
- For Each kvp As KeyValuePair(Of String, String) In copy
- Console.WriteLine("Key = {0}, Value = {1}", _
- kvp.Key, kvp.Value)
- Next kvp
-
- End Sub
-
-End Class
-
-' This code example produces the following output:
-'
-'Key = Bmp, Value = paint.exe
-'Key = DIB, Value = paint.exe
-'Key = rtf, Value = wordpad.exe
-'Key = txt, Value = notepad.exe
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32/VB/source.vb b/snippets/visualbasic/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32/VB/source.vb
deleted file mode 100644
index cde9ec6a46e..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32/VB/source.vb
+++ /dev/null
@@ -1,35 +0,0 @@
-'
-Imports System.Collections.Generic
-
-Public Class Example
-
- Public Shared Sub Main()
-
- ' Create a new dictionary of strings, with string keys and
- ' an initial capacity of 4.
- Dim openWith As New Dictionary(Of String, String)(4)
-
- ' Add 4 elements to the dictionary.
- openWith.Add("txt", "notepad.exe")
- openWith.Add("bmp", "paint.exe")
- openWith.Add("dib", "paint.exe")
- openWith.Add("rtf", "wordpad.exe")
-
- ' List the contents of the dictionary.
- Console.WriteLine()
- For Each kvp As KeyValuePair(Of String, String) In openWith
- Console.WriteLine("Key = {0}, Value = {1}", _
- kvp.Key, kvp.Value)
- Next kvp
-
- End Sub
-
-End Class
-
-' This code example produces the following output:
-'
-'Key = txt, Value = notepad.exe
-'Key = bmp, Value = paint.exe
-'Key = dib, Value = paint.exe
-'Key = rtf, Value = wordpad.exe
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb b/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb
deleted file mode 100644
index e94a3057802..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb
+++ /dev/null
@@ -1,161 +0,0 @@
-'
-Imports System.Collections.Generic
-
-Public Class Example
-
- Public Shared Sub Main()
-
- '
- ' Create a new dictionary of strings, with string keys,
- ' and access it through the IDictionary generic interface.
- Dim openWith As IDictionary(Of String, String) = _
- New Dictionary(Of String, String)
-
- ' Add some elements to the dictionary. There are no
- ' duplicate keys, but some of the values are duplicates.
- openWith.Add("txt", "notepad.exe")
- openWith.Add("bmp", "paint.exe")
- openWith.Add("dib", "paint.exe")
- openWith.Add("rtf", "wordpad.exe")
-
- ' The Add method throws an exception if the new key is
- ' already in the dictionary.
- Try
- openWith.Add("txt", "winword.exe")
- Catch
- Console.WriteLine("An element with Key = ""txt"" already exists.")
- End Try
- '
-
- '
- ' The Item property is the default property, so you
- ' can omit its name when accessing elements.
- Console.WriteLine("For key = ""rtf"", value = {0}.", _
- openWith("rtf"))
-
- ' The default Item property can be used to change the value
- ' associated with a key.
- openWith("rtf") = "winword.exe"
- Console.WriteLine("For key = ""rtf"", value = {0}.", _
- openWith("rtf"))
-
- ' If a key does not exist, setting the default item property
- ' for that key adds a new key/value pair.
- openWith("doc") = "winword.exe"
- '
-
- '
- ' The default Item property throws an exception if the requested
- ' key is not in the dictionary.
- Try
- Console.WriteLine("For key = ""tif"", value = {0}.", _
- openWith("tif"))
- Catch
- Console.WriteLine("Key = ""tif"" is not found.")
- End Try
- '
-
- '
- ' When a program often has to try keys that turn out not to
- ' be in the dictionary, TryGetValue can be a more efficient
- ' way to retrieve values.
- Dim value As String = ""
- If openWith.TryGetValue("tif", value) Then
- Console.WriteLine("For key = ""tif"", value = {0}.", value)
- Else
- Console.WriteLine("Key = ""tif"" is not found.")
- End If
- '
-
- '
- ' ContainsKey can be used to test keys before inserting
- ' them.
- If Not openWith.ContainsKey("ht") Then
- openWith.Add("ht", "hypertrm.exe")
- Console.WriteLine("Value added for key = ""ht"": {0}", _
- openWith("ht"))
- End If
- '
-
- '
- ' When you use foreach to enumerate dictionary elements,
- ' the elements are retrieved as KeyValuePair objects.
- Console.WriteLine()
- For Each kvp As KeyValuePair(Of String, String) In openWith
- Console.WriteLine("Key = {0}, Value = {1}", _
- kvp.Key, kvp.Value)
- Next kvp
- '
-
- '
- ' To get the values alone, use the Values property.
- Dim icoll As ICollection(Of String) = openWith.Values
-
- ' The elements of the ValueCollection are strongly typed
- ' with the type that was specified for dictionary values.
- Console.WriteLine()
- For Each s As String In icoll
- Console.WriteLine("Value = {0}", s)
- Next s
- '
-
- '
- ' To get the keys alone, use the Keys property.
- icoll = openWith.Keys
-
- ' The elements of the ValueCollection are strongly typed
- ' with the type that was specified for dictionary values.
- Console.WriteLine()
- For Each s As String In icoll
- Console.WriteLine("Key = {0}", s)
- Next s
- '
-
- '
- ' Use the Remove method to remove a key/value pair.
- Console.WriteLine(vbLf + "Remove(""doc"")")
- openWith.Remove("doc")
-
- If Not openWith.ContainsKey("doc") Then
- Console.WriteLine("Key ""doc"" is not found.")
- End If
- '
-
- End Sub
-
-End Class
-
-' This code example produces the following output:
-'
-'An element with Key = "txt" already exists.
-'For key = "rtf", value = wordpad.exe.
-'For key = "rtf", value = winword.exe.
-'Key = "tif" is not found.
-'Key = "tif" is not found.
-'Value added for key = "ht": hypertrm.exe
-'
-'Key = txt, Value = notepad.exe
-'Key = bmp, Value = paint.exe
-'Key = dib, Value = paint.exe
-'Key = rtf, Value = winword.exe
-'Key = doc, Value = winword.exe
-'Key = ht, Value = hypertrm.exe
-'
-'Value = notepad.exe
-'Value = paint.exe
-'Value = paint.exe
-'Value = winword.exe
-'Value = winword.exe
-'Value = hypertrm.exe
-'
-'Key = txt
-'Key = bmp
-'Key = dib
-'Key = rtf
-'Key = doc
-'Key = ht
-'
-'Remove("doc")
-'Key "doc" is not found.
-'
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source2.vb b/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source2.vb
deleted file mode 100644
index 4c6beb76c93..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source2.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-Imports System.Collections.Generic
-
-Public Class Example
- Public Shared Sub Main()
- ' Create a new dictionary of strings, with string keys.
- '
- Dim exDictionary As New Dictionary(Of Integer, String)
-
- ' Add some elements to the dictionary. There are no
- ' duplicate keys, but some of the values are duplicates.
- exDictionary.Add(0, "notepad.exe")
- exDictionary.Add(1, "paint.exe")
- exDictionary.Add(2, "paint.exe")
- exDictionary.Add(3, "wordpad.exe")
- Dim myDictionary As IDictionary(Of Integer, String) = exDictionary
- '
- For Each kvp As KeyValuePair(Of Integer, String) In myDictionary
- Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value)
- Next kvp
- '
- End Sub
-End Class
-
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb b/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb
deleted file mode 100644
index fd75ab8784b..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.Queue/vb/source.vb
+++ /dev/null
@@ -1,92 +0,0 @@
-'
-Imports System.Collections.Generic
-
-Module Example
-
- Sub Main
-
- Dim numbers As New Queue(Of String)
- numbers.Enqueue("one")
- numbers.Enqueue("two")
- numbers.Enqueue("three")
- numbers.Enqueue("four")
- numbers.Enqueue("five")
-
- ' A queue can be enumerated without disturbing its contents.
- For Each number As String In numbers
- Console.WriteLine(number)
- Next
-
- Console.WriteLine(vbLf & "Dequeuing '{0}'", numbers.Dequeue())
- Console.WriteLine("Peek at next item to dequeue: {0}", _
- numbers.Peek())
- Console.WriteLine("Dequeuing '{0}'", numbers.Dequeue())
-
- ' Create a copy of the queue, using the ToArray method and the
- ' constructor that accepts an IEnumerable(Of T).
- Dim queueCopy As New Queue(Of String)(numbers.ToArray())
-
- Console.WriteLine(vbLf & "Contents of the first copy:")
- For Each number As String In queueCopy
- Console.WriteLine(number)
- Next
-
- ' Create an array twice the size of the queue, compensating
- ' for the fact that Visual Basic allocates an extra array
- ' element. Copy the elements of the queue, starting at the
- ' middle of the array.
- Dim array2((numbers.Count * 2) - 1) As String
- numbers.CopyTo(array2, numbers.Count)
-
- ' Create a second queue, using the constructor that accepts an
- ' IEnumerable(Of T).
- Dim queueCopy2 As New Queue(Of String)(array2)
-
- Console.WriteLine(vbLf & _
- "Contents of the second copy, with duplicates and nulls:")
- For Each number As String In queueCopy2
- Console.WriteLine(number)
- Next
-
- Console.WriteLine(vbLf & "queueCopy.Contains(""four"") = {0}", _
- queueCopy.Contains("four"))
-
- Console.WriteLine(vbLf & "queueCopy.Clear()")
- queueCopy.Clear()
- Console.WriteLine(vbLf & "queueCopy.Count = {0}", _
- queueCopy.Count)
- End Sub
-End Module
-
-' This code example produces the following output:
-'
-'one
-'two
-'three
-'four
-'five
-'
-'Dequeuing 'one'
-'Peek at next item to dequeue: two
-'
-'Dequeuing 'two'
-'
-'Contents of the copy:
-'three
-'four
-'five
-'
-'Contents of the second copy, with duplicates and nulls:
-'
-'
-'
-'three
-'four
-'five
-'
-'queueCopy.Contains("four") = True
-'
-'queueCopy.Clear()
-'
-'queueCopy.Count = 0
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDicIComp/VB/source.vb b/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDicIComp/VB/source.vb
deleted file mode 100644
index 6db4c4f8d6a..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDicIComp/VB/source.vb
+++ /dev/null
@@ -1,55 +0,0 @@
-'
-Imports System.Collections.Generic
-
-Public Class Example
-
- Public Shared Sub Main()
-
- ' Create a new Dictionary of strings, with string keys and
- ' a case-insensitive equality comparer for the current
- ' culture.
- Dim openWith As New Dictionary(Of String, String)( _
- StringComparer.CurrentCultureIgnoreCase)
-
- ' Add some elements to the dictionary.
- openWith.Add("txt", "notepad.exe")
- openWith.Add("Bmp", "paint.exe")
- openWith.Add("DIB", "paint.exe")
- openWith.Add("rtf", "wordpad.exe")
-
- ' List the contents of the Dictionary.
- Console.WriteLine()
- For Each kvp As KeyValuePair(Of String, String) In openWith
- Console.WriteLine("Key = {0}, Value = {1}", _
- kvp.Key, kvp.Value)
- Next kvp
-
- ' Create a SortedDictionary of strings with string keys and a
- ' case-insensitive equality comparer for the current culture,
- ' and initialize it with the contents of the Dictionary.
- Dim copy As New SortedDictionary(Of String, String)(openWith, _
- StringComparer.CurrentCultureIgnoreCase)
-
- ' List the sorted contents of the copy.
- Console.WriteLine()
- For Each kvp As KeyValuePair(Of String, String) In copy
- Console.WriteLine("Key = {0}, Value = {1}", _
- kvp.Key, kvp.Value)
- Next kvp
-
- End Sub
-
-End Class
-
-' This code example produces the following output:
-'
-'Key = txt, Value = notepad.exe
-'Key = Bmp, Value = paint.exe
-'Key = DIB, Value = paint.exe
-'Key = rtf, Value = wordpad.exe
-'
-'Key = Bmp, Value = paint.exe
-'Key = DIB, Value = paint.exe
-'Key = rtf, Value = wordpad.exe
-'Key = txt, Value = notepad.exe
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb b/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb
deleted file mode 100644
index 3d39bc2facf..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary/VB/source.vb
+++ /dev/null
@@ -1,164 +0,0 @@
-'
-Imports System.Collections.Generic
-
-Public Class Example
-
- Public Shared Sub Main()
-
- '
- ' Create a new sorted dictionary of strings, with string
- ' keys.
- Dim openWith As New SortedDictionary(Of String, String)
-
- ' Add some elements to the dictionary. There are no
- ' duplicate keys, but some of the values are duplicates.
- openWith.Add("txt", "notepad.exe")
- openWith.Add("bmp", "paint.exe")
- openWith.Add("dib", "paint.exe")
- openWith.Add("rtf", "wordpad.exe")
-
- ' The Add method throws an exception if the new key is
- ' already in the dictionary.
- Try
- openWith.Add("txt", "winword.exe")
- Catch
- Console.WriteLine("An element with Key = ""txt"" already exists.")
- End Try
- '
-
- '
- ' The Item property is the default property, so you
- ' can omit its name when accessing elements.
- Console.WriteLine("For key = ""rtf"", value = {0}.", _
- openWith("rtf"))
-
- ' The default Item property can be used to change the value
- ' associated with a key.
- openWith("rtf") = "winword.exe"
- Console.WriteLine("For key = ""rtf"", value = {0}.", _
- openWith("rtf"))
-
- ' If a key does not exist, setting the default Item property
- ' for that key adds a new key/value pair.
- openWith("doc") = "winword.exe"
- '
-
- '
- ' The default Item property throws an exception if the requested
- ' key is not in the dictionary.
- Try
- Console.WriteLine("For key = ""tif"", value = {0}.", _
- openWith("tif"))
- Catch
- Console.WriteLine("Key = ""tif"" is not found.")
- End Try
- '
-
- '
- ' When a program often has to try keys that turn out not to
- ' be in the dictionary, TryGetValue can be a more efficient
- ' way to retrieve values.
- Dim value As String = ""
- If openWith.TryGetValue("tif", value) Then
- Console.WriteLine("For key = ""tif"", value = {0}.", value)
- Else
- Console.WriteLine("Key = ""tif"" is not found.")
- End If
- '
-
- '
- ' ContainsKey can be used to test keys before inserting
- ' them.
- If Not openWith.ContainsKey("ht") Then
- openWith.Add("ht", "hypertrm.exe")
- Console.WriteLine("Value added for key = ""ht"": {0}", _
- openWith("ht"))
- End If
- '
-
- '
- ' When you use foreach to enumerate dictionary elements,
- ' the elements are retrieved as KeyValuePair objects.
- Console.WriteLine()
- For Each kvp As KeyValuePair(Of String, String) In openWith
- Console.WriteLine("Key = {0}, Value = {1}", _
- kvp.Key, kvp.Value)
- Next kvp
- '
-
- '
- ' To get the values alone, use the Values property.
- Dim valueColl _
- As SortedDictionary(Of String, String).ValueCollection = _
- openWith.Values
-
- ' The elements of the ValueCollection are strongly typed
- ' with the type that was specified for dictionary values.
- Console.WriteLine()
- For Each s As String In valueColl
- Console.WriteLine("Value = {0}", s)
- Next s
- '
-
- '
- ' To get the keys alone, use the Keys property.
- Dim keyColl _
- As SortedDictionary(Of String, String).KeyCollection = _
- openWith.Keys
-
- ' The elements of the KeyCollection are strongly typed
- ' with the type that was specified for dictionary keys.
- Console.WriteLine()
- For Each s As String In keyColl
- Console.WriteLine("Key = {0}", s)
- Next s
- '
-
- '
- ' Use the Remove method to remove a key/value pair.
- Console.WriteLine(vbLf + "Remove(""doc"")")
- openWith.Remove("doc")
-
- If Not openWith.ContainsKey("doc") Then
- Console.WriteLine("Key ""doc"" is not found.")
- End If
- '
-
- End Sub
-
-End Class
-
-' This code example produces the following output:
-'
-'An element with Key = "txt" already exists.
-'For key = "rtf", value = wordpad.exe.
-'For key = "rtf", value = winword.exe.
-'Key = "tif" is not found.
-'Key = "tif" is not found.
-'Value added for key = "ht": hypertrm.exe
-'
-'Key = bmp, Value = paint.exe
-'Key = dib, Value = paint.exe
-'Key = doc, Value = winword.exe
-'Key = ht, Value = hypertrm.exe
-'Key = rtf, Value = winword.exe
-'Key = txt, Value = notepad.exe
-'
-'Value = paint.exe
-'Value = paint.exe
-'Value = winword.exe
-'Value = hypertrm.exe
-'Value = winword.exe
-'Value = notepad.exe
-'
-'Key = bmp
-'Key = dib
-'Key = doc
-'Key = ht
-'Key = rtf
-'Key = txt
-'
-'Remove("doc")
-'Key "doc" is not found.
-'
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb b/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb
deleted file mode 100644
index d354c32a802..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.IDictionary/VB/source.vb
+++ /dev/null
@@ -1,216 +0,0 @@
-' Do not use snippets 31 & 32 with snippet 21; snippet 21 goes
-' with snippet 2, which already provides enough context. (2 and
-' 21 were originally one snippet, but had to be split when 31
-' was added, because I don't trust overlapping snippets any
-' more.)
-'
-' Note further that {2, 21} is NOT USED right now because
-' the complete sample (snippet 1) is located in IDictionary.Add.
-'
-' The groups are:
-' {2, 21} - Add
-' {31, 3, 4, 32} - Item
-' {31, 6, 32} - Contains
-' {31, 7, 32} - GetEnumerator
-' {31, 8, 7, 32} - Values
-' {31, 9, 7, 32} - Keys
-' {31, 10, 32} - Remove
-' -> PLS MAKE SURE THESE STAY IN SYNC WITH DESCRIPTION.TXT <-
-'
-'
-'
-Imports System.Collections
-Imports System.Collections.Generic
-
-Public Class Example
-
- Public Shared Sub Main()
-
- '
- ' Create a new sorted list of strings, with string keys,
- ' and access it using the IDictionary interface.
- '
- Dim openWith As IDictionary = _
- New sortedList(Of String, String)
-
- ' Add some elements to the sorted list. There are no
- ' duplicate keys, but some of the values are duplicates.
- ' IDictionary.Add throws an exception if incorrect types
- ' are supplied for key or value.
- openWith.Add("txt", "notepad.exe")
- openWith.Add("bmp", "paint.exe")
- openWith.Add("dib", "paint.exe")
- openWith.Add("rtf", "wordpad.exe")
- '
-'
- '
- Try
- openWith.Add(42, New Example())
- Catch ex As ArgumentException
- Console.WriteLine("An exception was caught for " & _
- "IDictionary.Add. Exception message:" & vbLf _
- & vbTab & ex.Message & vbLf)
- End Try
-
- ' The Add method throws an exception if the new key is
- ' already in the sorted list.
- Try
- openWith.Add("txt", "winword.exe")
- Catch
- Console.WriteLine("An element with Key = ""txt"" already exists.")
- End Try
- '
-
- '
- ' The Item property is the default property, so you
- ' can omit its name when accessing elements.
- Console.WriteLine("For key = ""rtf"", value = {0}.", _
- openWith("rtf"))
-
- ' The default Item property can be used to change the value
- ' associated with a key.
- openWith("rtf") = "winword.exe"
- Console.WriteLine("For key = ""rtf"", value = {0}.", _
- openWith("rtf"))
-
- ' If a key does not exist, setting the default Item property
- ' for that key adds a new key/value pair.
- openWith("doc") = "winword.exe"
-
- ' The default Item property returns Nothing if the key
- ' is of the wrong data type.
- Console.WriteLine("The default Item property returns Nothing" _
- & " if the key is of the wrong type:")
- Console.WriteLine("For key = 2, value = {0}.", _
- openWith(2))
-
- ' The default Item property throws an exception when setting
- ' a value if the key is of the wrong data type.
- Try
- openWith(2) = "This does not get added."
- Catch
- Console.WriteLine("A key of the wrong type was specified" _
- & " when setting the default Item property.")
- End Try
- '
-
- '
- ' Unlike the default Item property on the SortedList class
- ' itself, IDictionary.Item does not throw an exception
- ' if the requested key is not in the sorted list.
- Console.WriteLine("For key = ""tif"", value = {0}.", _
- openWith("tif"))
- '
-
- '
- ' Contains can be used to test keys before inserting
- ' them.
- If Not openWith.Contains("ht") Then
- openWith.Add("ht", "hypertrm.exe")
- Console.WriteLine("Value added for key = ""ht"": {0}", _
- openWith("ht"))
- End If
-
- ' IDictionary.Contains returns False if the wrong data
- ' type is supplied.
- Console.WriteLine("openWith.Contains(29.7) returns {0}", _
- openWith.Contains(29.7))
- '
-
- '
- ' When you use foreach to enumerate sorted list elements
- ' with the IDictionary interface, the elements are retrieved
- ' as DictionaryEntry objects instead of KeyValuePair objects.
- Console.WriteLine()
- For Each de As DictionaryEntry In openWith
- Console.WriteLine("Key = {0}, Value = {1}", _
- de.Key, de.Value)
- Next
- '
-
- '
- ' To get the values alone, use the Values property.
- Dim icoll As ICollection = openWith.Values
-
- ' The elements of the collection are strongly typed
- ' with the type that was specified for sorted list values,
- ' even though the ICollection interface is not strongly
- ' typed.
- Console.WriteLine()
- For Each s As String In icoll
- Console.WriteLine("Value = {0}", s)
- Next s
- '
-
- '
- ' To get the keys alone, use the Keys property.
- icoll = openWith.Keys
-
- ' The elements of the collection are strongly typed
- ' with the type that was specified for sorted list keys,
- ' even though the ICollection interface is not strongly
- ' typed.
- Console.WriteLine()
- For Each s As String In icoll
- Console.WriteLine("Key = {0}", s)
- Next s
- '
-
- '
- ' Use the Remove method to remove a key/value pair. No
- ' exception is thrown if the wrong data type is supplied.
- Console.WriteLine(vbLf + "Remove(""dib"")")
- openWith.Remove("dib")
-
- If Not openWith.Contains("dib") Then
- Console.WriteLine("Key ""dib"" is not found.")
- End If
- '
-'
-
- End Sub
-
-End Class
-'
-
-' This code example produces the following output:
-'
-'An exception was caught for IDictionary.Add. Exception message:
-' The value "42" is not of type "System.String" and cannot be used in this generic collection.
-'Parameter name: key
-'
-'An element with Key = "txt" already exists.
-'For key = "rtf", value = wordpad.exe.
-'For key = "rtf", value = winword.exe.
-'The default Item property returns Nothing if the key is of the wrong type:
-'For key = 2, value = .
-'A key of the wrong type was specified when setting the default Item property.
-'For key = "tif", value = .
-'Value added for key = "ht": hypertrm.exe
-'openWith.Contains(29.7) returns False
-'
-'Key = txt, Value = notepad.exe
-'Key = bmp, Value = paint.exe
-'Key = dib, Value = paint.exe
-'Key = rtf, Value = winword.exe
-'Key = doc, Value = winword.exe
-'Key = ht, Value = hypertrm.exe
-'
-'Value = notepad.exe
-'Value = paint.exe
-'Value = paint.exe
-'Value = winword.exe
-'Value = winword.exe
-'Value = hypertrm.exe
-'
-'Key = txt
-'Key = bmp
-'Key = dib
-'Key = rtf
-'Key = doc
-'Key = ht
-'
-'Remove("dib")
-'Key "dib" is not found.
-'
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_IComp/VB/source.vb b/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_IComp/VB/source.vb
deleted file mode 100644
index 9b1f61c701a..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_IComp/VB/source.vb
+++ /dev/null
@@ -1,47 +0,0 @@
-'
-Imports System.Collections.Generic
-
-Public Class Example
-
- Public Shared Sub Main()
-
- ' Create a new sorted list of strings, with string keys and
- ' a case-insensitive comparer for the current culture.
- Dim openWith As New SortedList(Of String, String)( _
- StringComparer.CurrentCultureIgnoreCase)
-
- ' Add some elements to the list.
- openWith.Add("txt", "notepad.exe")
- openWith.Add("bmp", "paint.exe")
- openWith.Add("DIB", "paint.exe")
- openWith.Add("rtf", "wordpad.exe")
-
- ' Try to add a fifth element with a key that is the same
- ' except for case; this would be allowed with the default
- ' comparer.
- Try
- openWith.Add("BMP", "paint.exe")
- Catch ex As ArgumentException
- Console.WriteLine(vbLf & "BMP is already in the sorted list.")
- End Try
-
- ' List the contents of the sorted list.
- Console.WriteLine()
- For Each kvp As KeyValuePair(Of String, String) In openWith
- Console.WriteLine("Key = {0}, Value = {1}", _
- kvp.Key, kvp.Value)
- Next kvp
-
- End Sub
-
-End Class
-
-' This code example produces the following output:
-'
-'BMP is already in the sorted list.
-'
-'Key = bmp, Value = paint.exe
-'Key = DIB, Value = paint.exe
-'Key = rtf, Value = wordpad.exe
-'Key = txt, Value = notepad.exe
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb b/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb
deleted file mode 100644
index 246cb8678f5..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.Stack/vb/source.vb
+++ /dev/null
@@ -1,93 +0,0 @@
-'
-Imports System.Collections.Generic
-
-Module Example
-
- Sub Main
-
- Dim numbers As New Stack(Of String)
- numbers.Push("one")
- numbers.Push("two")
- numbers.Push("three")
- numbers.Push("four")
- numbers.Push("five")
-
- ' A stack can be enumerated without disturbing its contents.
- For Each number As String In numbers
- Console.WriteLine(number)
- Next
-
- Console.WriteLine(vbLf & "Popping '{0}'", numbers.Pop())
- Console.WriteLine("Peek at next item to pop: {0}", _
- numbers.Peek())
- Console.WriteLine("Popping '{0}'", numbers.Pop())
-
- ' Create another stack, using the ToArray method and the
- ' constructor that accepts an IEnumerable(Of T). Note that
- ' the order of items on the new stack is reversed.
- Dim stack2 As New Stack(Of String)(numbers.ToArray())
-
- Console.WriteLine(vbLf & "Contents of the first copy:")
- For Each number As String In stack2
- Console.WriteLine(number)
- Next
-
- ' Create an array twice the size of the stack, compensating
- ' for the fact that Visual Basic allocates an extra array
- ' element. Copy the elements of the stack, starting at the
- ' middle of the array.
- Dim array2((numbers.Count * 2) - 1) As String
- numbers.CopyTo(array2, numbers.Count)
-
- ' Create a second stack, using the constructor that accepts an
- ' IEnumerable(Of T). The elements are reversed, with the null
- ' elements appearing at the end of the stack when enumerated.
- Dim stack3 As New Stack(Of String)(array2)
-
- Console.WriteLine(vbLf & _
- "Contents of the second copy, with duplicates and nulls:")
- For Each number As String In stack3
- Console.WriteLine(number)
- Next
-
- Console.WriteLine(vbLf & "stack2.Contains(""four"") = {0}", _
- stack2.Contains("four"))
-
- Console.WriteLine(vbLf & "stack2.Clear()")
- stack2.Clear()
- Console.WriteLine(vbLf & "stack2.Count = {0}", _
- stack2.Count)
- End Sub
-End Module
-
-' This code example produces the following output:
-'
-'five
-'four
-'three
-'two
-'one
-'
-'Popping 'five'
-'Peek at next item to pop: four
-'Popping 'four'
-'
-'Contents of the first copy:
-'one
-'two
-'three
-'
-'Contents of the second copy, with duplicates and nulls:
-'one
-'two
-'three
-'
-'
-'
-'
-'stack2.Contains("four") = False
-'
-'stack2.Clear()
-'
-'stack2.Count = 0
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/IO.FileInfo.GetAccessControl-SetAccessControl/VB/sample.vb b/snippets/visualbasic/VS_Snippets_CLR/IO.FileInfo.GetAccessControl-SetAccessControl/VB/sample.vb
deleted file mode 100644
index 39519deb1e9..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/IO.FileInfo.GetAccessControl-SetAccessControl/VB/sample.vb
+++ /dev/null
@@ -1,79 +0,0 @@
-'
-Imports System.IO
-Imports System.Security.AccessControl
-
-
-
-Module FileExample
-
- Sub Main()
- Try
- Dim FileName As String = "c:\test.xml"
-
- Console.WriteLine("Adding access control entry for " & FileName)
-
- ' Add the access control entry to the file.
- ' Before compiling this snippet, change MyDomain to your
- ' domain name and MyAccessAccount to the name
- ' you use to access your domain.
- AddFileSecurity(FileName, "MyDomain\\MyAccessAccount", FileSystemRights.ReadData, AccessControlType.Allow)
-
- Console.WriteLine("Removing access control entry from " & FileName)
-
- ' Remove the access control entry from the file.
- ' Before compiling this snippet, change MyDomain to your
- ' domain name and MyAccessAccount to the name
- ' you use to access your domain.
- RemoveFileSecurity(FileName, "MyDomain\\MyAccessAccount", FileSystemRights.ReadData, AccessControlType.Allow)
-
- Console.WriteLine("Done.")
- Catch e As Exception
- Console.WriteLine(e)
- End Try
-
- End Sub
-
-
- ' Adds an ACL entry on the specified file for the specified account.
- Sub AddFileSecurity(ByVal FileName As String, ByVal Account As String, ByVal Rights As FileSystemRights, ByVal ControlType As AccessControlType)
- ' Create a new FileInfo object.
- Dim fInfo As New FileInfo(FileName)
-
- ' Get a FileSecurity object that represents the
- ' current security settings.
- Dim fSecurity As FileSecurity = fInfo.GetAccessControl()
-
- ' Add the FileSystemAccessRule to the security settings.
- fSecurity.AddAccessRule(New FileSystemAccessRule(Account, Rights, ControlType))
-
- ' Set the new access settings.
- fInfo.SetAccessControl(fSecurity)
-
- End Sub
-
-
- ' Removes an ACL entry on the specified file for the specified account.
- Sub RemoveFileSecurity(ByVal FileName As String, ByVal Account As String, ByVal Rights As FileSystemRights, ByVal ControlType As AccessControlType)
- ' Create a new FileInfo object.
- Dim fInfo As New FileInfo(FileName)
-
- ' Get a FileSecurity object that represents the
- ' current security settings.
- Dim fSecurity As FileSecurity = fInfo.GetAccessControl()
-
- ' Add the FileSystemAccessRule to the security settings.
- fSecurity.RemoveAccessRule(New FileSystemAccessRule(Account, Rights, ControlType))
-
- ' Set the new access settings.
- fInfo.SetAccessControl(fSecurity)
-
- End Sub
-End Module
-'This code produces output similar to the following;
-'results may vary based on the computer/file structure/etc.:
-'
-'Adding access control entry for c:\test.xml
-'Removing access control entry from c:\test.xml
-'Done.
-'
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/IO.FileInfo.isReadOnly/VB/sample.vb b/snippets/visualbasic/VS_Snippets_CLR/IO.FileInfo.isReadOnly/VB/sample.vb
deleted file mode 100644
index 9e6caa46cfe..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/IO.FileInfo.isReadOnly/VB/sample.vb
+++ /dev/null
@@ -1,48 +0,0 @@
-'
-Imports System.IO
-
-Module FileExample
-
- Sub Main()
-
- ' Create a temporary file.
- Dim filePath As String = Path.GetTempFileName()
- Console.WriteLine($"Created a temp file at '{filePath}'.")
-
- ' Create a new FileInfo object.
- Dim fInfo As New FileInfo(filePath)
-
- ' Get the read-only value for a file.
- Dim isReadOnly As Boolean = fInfo.IsReadOnly
-
- ' Display whether the file is read-only.
- Console.WriteLine($"The file read-only value for '{fInfo.Name}' is {isReadOnly}.")
-
- ' Set the file to read-only.
- Console.WriteLine($"Setting the read-only value for '{fInfo.Name}' to true.")
- fInfo.IsReadOnly = True
-
- ' Get the read-only value for a file.
- isReadOnly = fInfo.IsReadOnly
-
- ' Display that the file is now read-only.
- Console.WriteLine($"The file read-only value for '{fInfo.Name}' is {isReadOnly}.")
-
- ' Make the file mutable again so it can be deleted.
- fInfo.IsReadOnly = False
-
- ' Delete the temporary file.
- fInfo.Delete()
- End Sub
-
-End Module
-
-' This code produces output similar to the following,
-' though results may vary based on the computer, file structure, etc.:
-'
-' Created a temp file at 'C:\Users\UserName\AppData\Local\Temp\tmpB438.tmp'.
-' The file read-only value for 'tmpB438.tmp' is False.
-' Setting the read-only value for 'tmpB438.tmp' to true.
-' The file read-only value for 'tmpB438.tmp' is True.
-'
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_IndexOf/vb/source.vb b/snippets/visualbasic/VS_Snippets_CLR/List`1_IndexOf/vb/source.vb
deleted file mode 100644
index 4ea31ba7ed0..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/List`1_IndexOf/vb/source.vb
+++ /dev/null
@@ -1,53 +0,0 @@
-'
-Imports System.Collections.Generic
-
-Public Class Example
-
- Public Shared Sub Main()
-
- Dim dinosaurs As New List(Of String)
-
- dinosaurs.Add("Tyrannosaurus")
- dinosaurs.Add("Amargasaurus")
- dinosaurs.Add("Mamenchisaurus")
- dinosaurs.Add("Brachiosaurus")
- dinosaurs.Add("Deinonychus")
- dinosaurs.Add("Tyrannosaurus")
- dinosaurs.Add("Compsognathus")
-
- Console.WriteLine()
- For Each dinosaur As String In dinosaurs
- Console.WriteLine(dinosaur)
- Next
-
- Console.WriteLine(vbLf & _
- "IndexOf(""Tyrannosaurus""): {0}", _
- dinosaurs.IndexOf("Tyrannosaurus"))
-
- Console.WriteLine(vbLf & _
- "IndexOf(""Tyrannosaurus"", 3): {0}", _
- dinosaurs.IndexOf("Tyrannosaurus", 3))
-
- Console.WriteLine(vbLf & _
- "IndexOf(""Tyrannosaurus"", 2, 2): {0}", _
- dinosaurs.IndexOf("Tyrannosaurus", 2, 2))
-
- End Sub
-End Class
-
-' This code example produces the following output:
-'
-'Tyrannosaurus
-'Amargasaurus
-'Mamenchisaurus
-'Brachiosaurus
-'Deinonychus
-'Tyrannosaurus
-'Compsognathus
-'
-'IndexOf("Tyrannosaurus"): 0
-'
-'IndexOf("Tyrannosaurus", 3): 5
-'
-'IndexOf("Tyrannosaurus", 2, 2): -1
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_Ranges/vb/source.vb b/snippets/visualbasic/VS_Snippets_CLR/List`1_Ranges/vb/source.vb
deleted file mode 100644
index c3587257d3b..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/List`1_Ranges/vb/source.vb
+++ /dev/null
@@ -1,99 +0,0 @@
-'
-Imports System.Collections.Generic
-
-Public Class Example
-
- Public Shared Sub Main()
-
- Dim input() As String = { "Brachiosaurus", _
- "Amargasaurus", _
- "Mamenchisaurus" }
-
- Dim dinosaurs As New List(Of String)(input)
-
- Console.WriteLine(vbLf & "Capacity: {0}", dinosaurs.Capacity)
-
- Console.WriteLine()
- For Each dinosaur As String In dinosaurs
- Console.WriteLine(dinosaur)
- Next
-
- Console.WriteLine(vbLf & "AddRange(dinosaurs)")
- dinosaurs.AddRange(dinosaurs)
-
- Console.WriteLine()
- For Each dinosaur As String In dinosaurs
- Console.WriteLine(dinosaur)
- Next
-
- Console.WriteLine(vbLf & "RemoveRange(2, 2)")
- dinosaurs.RemoveRange(2, 2)
-
- Console.WriteLine()
- For Each dinosaur As String In dinosaurs
- Console.WriteLine(dinosaur)
- Next
-
- input = New String() { "Tyrannosaurus", _
- "Deinonychus", _
- "Velociraptor" }
-
- Console.WriteLine(vbLf & "InsertRange(3, input)")
- dinosaurs.InsertRange(3, input)
-
- Console.WriteLine()
- For Each dinosaur As String In dinosaurs
- Console.WriteLine(dinosaur)
- Next
-
- Console.WriteLine(vbLf & "output = dinosaurs.GetRange(2, 3).ToArray")
- Dim output() As String = dinosaurs.GetRange(2, 3).ToArray()
-
- Console.WriteLine()
- For Each dinosaur As String In output
- Console.WriteLine(dinosaur)
- Next
-
- End Sub
-End Class
-
-' This code example produces the following output:
-'
-'Capacity: 3
-'
-'Brachiosaurus
-'Amargasaurus
-'Mamenchisaurus
-'
-'AddRange(dinosaurs)
-'
-'Brachiosaurus
-'Amargasaurus
-'Mamenchisaurus
-'Brachiosaurus
-'Amargasaurus
-'Mamenchisaurus
-'
-'RemoveRange(2, 2)
-'
-'Brachiosaurus
-'Amargasaurus
-'Amargasaurus
-'Mamenchisaurus
-'
-'InsertRange(3, input)
-'
-'Brachiosaurus
-'Amargasaurus
-'Amargasaurus
-'Tyrannosaurus
-'Deinonychus
-'Velociraptor
-'Mamenchisaurus
-'
-'output = dinosaurs.GetRange(2, 3).ToArray
-'
-'Amargasaurus
-'Tyrannosaurus
-'Deinonychus
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/ThreadAbEx/VB/threadabex.vb b/snippets/visualbasic/VS_Snippets_CLR/ThreadAbEx/VB/threadabex.vb
deleted file mode 100644
index c583427ea6a..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/ThreadAbEx/VB/threadabex.vb
+++ /dev/null
@@ -1,38 +0,0 @@
-'
-Imports System.Threading
-Imports System.Security.Permissions
-
-
-Public Class ThreadWork
- Public Shared Sub DoWork()
- Try
- Dim i As Integer
- For i = 0 To 99
- Console.WriteLine("Thread - working.")
- Thread.Sleep(100)
- Next i
- Catch e As ThreadAbortException
- Console.WriteLine("Thread - caught ThreadAbortException - resetting.")
- Console.WriteLine("Exception message: {0}", e.Message)
- Thread.ResetAbort()
- End Try
- Console.WriteLine("Thread - still alive and working.")
- Thread.Sleep(1000)
- Console.WriteLine("Thread - finished working.")
- End Sub
-End Class
-
-
-Class ThreadAbortTest
- Public Shared Sub Main()
- Dim myThreadDelegate As New ThreadStart(AddressOf ThreadWork.DoWork)
- Dim myThread As New Thread(myThreadDelegate)
- myThread.Start()
- Thread.Sleep(100)
- Console.WriteLine("Main - aborting my thread.")
- myThread.Abort()
- myThread.Join()
- Console.WriteLine("Main ending.")
- End Sub
-End Class
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/console.keyavailable/VB/ka.vb b/snippets/visualbasic/VS_Snippets_CLR/console.keyavailable/VB/ka.vb
deleted file mode 100644
index cbb605f3422..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/console.keyavailable/VB/ka.vb
+++ /dev/null
@@ -1,39 +0,0 @@
-'
-Imports System.Threading
-
-Class Sample
- Public Shared Sub Main()
- Dim cki As ConsoleKeyInfo
-
- Do
- Console.WriteLine(vbCrLf & "Press a key to display; press the 'x' key to quit.")
-
- ' Your code could perform some useful task in the following loop. However,
- ' for the sake of this example we'll merely pause for a quarter second.
-
- While Console.KeyAvailable = False
- Thread.Sleep(250) ' Loop until input is entered.
- End While
- cki = Console.ReadKey(True)
- Console.WriteLine("You pressed the '{0}' key.", cki.Key)
- Loop While cki.Key <> ConsoleKey.X
- End Sub
-End Class
-'This example produces results similar to the following:
-'
-'Press a key to display; press the 'x' key to quit.
-'You pressed the 'H' key.
-'
-'Press a key to display; press the 'x' key to quit.
-'You pressed the 'E' key.
-'
-'Press a key to display; press the 'x' key to quit.
-'You pressed the 'PageUp' key.
-'
-'Press a key to display; press the 'x' key to quit.
-'You pressed the 'DownArrow' key.
-'
-'Press a key to display; press the 'x' key to quit.
-'You pressed the 'X' key.
-'
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/console.readkey1/VB/rk.vb b/snippets/visualbasic/VS_Snippets_CLR/console.readkey1/VB/rk.vb
deleted file mode 100644
index b550835f1e4..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/console.readkey1/VB/rk.vb
+++ /dev/null
@@ -1,33 +0,0 @@
-'
-Class Example
- Public Shared Sub Main()
- Dim cki As ConsoleKeyInfo
- ' Prevent example from ending if CTL+C is pressed.
- Console.TreatControlCAsInput = True
-
- Console.WriteLine("Press any combination of CTL, ALT, and SHIFT, and a console key.")
- Console.WriteLine("Press the Escape (Esc) key to quit: " + vbCrLf)
- Do
- cki = Console.ReadKey()
- Console.Write(" --- You pressed ")
- If (cki.Modifiers And ConsoleModifiers.Alt) <> 0 Then Console.Write("ALT+")
- If (cki.Modifiers And ConsoleModifiers.Shift) <> 0 Then Console.Write("SHIFT+")
- If (cki.Modifiers And ConsoleModifiers.Control) <> 0 Then Console.Write("CTL+")
- Console.WriteLine(cki.Key.ToString)
- Loop While cki.Key <> ConsoleKey.Escape
- End Sub
-End Class
-' This example displays output similar to the following:
-' Press any combination of CTL, ALT, and SHIFT, and a console key.
-' Press the Escape (Esc) key to quit:
-'
-' a --- You pressed A
-' k --- You pressed ALT+K
-' ► --- You pressed CTL+P
-' --- You pressed RightArrow
-' R --- You pressed SHIFT+R
-' --- You pressed CTL+I
-' j --- You pressed ALT+J
-' O --- You pressed SHIFT+O
-' § --- You pressed CTL+U
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/directoryinfocreatesub/VB/directoryinfocreatesub.vb b/snippets/visualbasic/VS_Snippets_CLR/directoryinfocreatesub/VB/directoryinfocreatesub.vb
deleted file mode 100644
index 5e3833dac50..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/directoryinfocreatesub/VB/directoryinfocreatesub.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-'
-Imports System.IO
-
-Public Class CreateSubTest
-
- Public Shared Sub Main()
- ' Make a reference to a directory.
- Dim di As New DirectoryInfo("TempDir")
-
- ' Create the directory only if it does not already exist.
- If di.Exists = False Then
- di.Create()
- End If
-
- ' Create a subdirectory in the directory just created.
- Dim dis As DirectoryInfo = di.CreateSubdirectory("SubDir")
-
- ' Process that directory as required.
- ' ...
-
- ' Delete the subdirectory.
- dis.Delete(True)
-
- ' Delete the directory.
- di.Delete(True)
- End Sub
-End Class
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/directoryinfodelete/VB/directoryinfodelete.vb b/snippets/visualbasic/VS_Snippets_CLR/directoryinfodelete/VB/directoryinfodelete.vb
deleted file mode 100644
index 4def7a63eba..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/directoryinfodelete/VB/directoryinfodelete.vb
+++ /dev/null
@@ -1,29 +0,0 @@
-'
-Imports System.IO
-
-Public Class DeleteTest
-
- Public Shared Sub Main()
- ' Make a reference to a directory.
- Dim di As New DirectoryInfo("TempDir")
-
- ' Create the directory only if it does not already exist.
- If di.Exists = False Then
- di.Create()
- End If
-
- Dim dis As DirectoryInfo = di.CreateSubdirectory("SubDir")
- ' Create a subdirectory in the directory just created.
-
- ' Process that directory as required.
- ' ...
-
- ' Delete the subdirectory. The true indicates that if subdirectories
- ' or files are in this directory, they are to be deleted as well.
- dis.Delete(True)
-
- ' Delete the directory.
- di.Delete(True)
- End Sub
-End Class
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/directoryinfogetdirectories/VB/directoryinfogetdirectories.vb b/snippets/visualbasic/VS_Snippets_CLR/directoryinfogetdirectories/VB/directoryinfogetdirectories.vb
deleted file mode 100644
index b9331d16fd7..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/directoryinfogetdirectories/VB/directoryinfogetdirectories.vb
+++ /dev/null
@@ -1,18 +0,0 @@
-'
-Imports System.IO
-
-Public Class GetDirectoriesTest
-
- Public Shared Sub Main()
- ' Make a reference to a directory.
- Dim di As New DirectoryInfo("c:\")
- ' Get a reference to each directory in that directory.
- Dim diArr As DirectoryInfo() = di.GetDirectories()
- ' Display the names of the directories.
- Dim dri As DirectoryInfo
- For Each dri In diArr
- Console.WriteLine(dri.Name)
- Next dri
- End Sub
-End Class
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/directoryinfomoveto/VB/directoryinfomoveto.vb b/snippets/visualbasic/VS_Snippets_CLR/directoryinfomoveto/VB/directoryinfomoveto.vb
deleted file mode 100644
index 258ded11121..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/directoryinfomoveto/VB/directoryinfomoveto.vb
+++ /dev/null
@@ -1,35 +0,0 @@
-'
-Imports System.IO
-
-Public Class MoveToTest
-
- Public Shared Sub Main()
- ' Make a reference to a directory.
- Dim di As New DirectoryInfo("TempDir")
- ' Create the directory only if it does not already exist.
- If di.Exists = False Then
- di.Create()
- End If
-
- ' Create a subdirectory in the directory just created.
- Dim dis As DirectoryInfo = di.CreateSubdirectory("SubDir")
- If Directory.Exists("NewTempDir") = False Then
- ' Move the main directory. Note that the contents move with the directory.
- di.MoveTo("NewTempDir")
- End If
- Try
- ' Attempt to delete the subdirectory. Note that because it has been
- ' moved, an exception is thrown.
- dis.Delete(True)
- Catch
- ' Handle this exception in some way, such as with the following code:
- ' Console.WriteLine("That directory does not exist.");
- ' Point the DirectoryInfo reference to the new directory.
- ' di = New DirectoryInfo("NewTempDir")
- ' Delete the directory.
- ' di.Delete(True)
- End Try
-
- End Sub
-End Class
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/directoryinfoparent/VB/directoryinfoparent.vb b/snippets/visualbasic/VS_Snippets_CLR/directoryinfoparent/VB/directoryinfoparent.vb
deleted file mode 100644
index 98098f3501a..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/directoryinfoparent/VB/directoryinfoparent.vb
+++ /dev/null
@@ -1,25 +0,0 @@
-'
-Imports System.IO
-
-Public Class MoveToTest
-
- Public Shared Sub Main()
- ' Make a reference to a directory.
- Dim di As New DirectoryInfo("TempDir")
- ' Create the directory only if it does not already exist.
- If di.Exists = False Then
- di.Create()
- End If
-
- ' Create a subdirectory in the directory just created.
- Dim dis As DirectoryInfo = di.CreateSubdirectory("SubDir")
-
- ' Get a reference to the parent directory of the subdirectory you just made.
- Dim parentDir As DirectoryInfo = dis.Parent
- Console.WriteLine("The parent directory of '{0}' is '{1}'", dis.Name, parentDir.Name)
-
- ' Delete the parent directory.
- di.Delete(True)
- End Sub
-End Class
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/directoryinforoot/VB/directoryinforoot2.vb b/snippets/visualbasic/VS_Snippets_CLR/directoryinforoot/VB/directoryinforoot2.vb
deleted file mode 100644
index 14c1de538a7..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/directoryinforoot/VB/directoryinforoot2.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-'
-Imports System.IO
-
-Module Module1
-
- Sub Main()
- Dim di1 As DirectoryInfo = New DirectoryInfo("\\tempshare\tempdir")
- Dim di2 As DirectoryInfo = New DirectoryInfo("tempdir")
- Dim di3 As DirectoryInfo = New DirectoryInfo("x:\tempdir")
- Dim di4 As DirectoryInfo = New DirectoryInfo("c:\")
-
- Console.WriteLine("The root path of '{0}' is '{1}'", di1.FullName, di1.Root)
- Console.WriteLine("The root path of '{0}' is '{1}'", di2.FullName, di2.Root)
- Console.WriteLine("The root path of '{0}' is '{1}'", di3.FullName, di3.Root)
- Console.WriteLine("The root path of '{0}' is '{1}'", di4.FullName, di4.Root)
- End Sub
-
-End Module
-
-' This code produces output similar to the following:
-
-' The root path of '\\tempshare\tempdir' is '\\tempshare\tempdir'
-' The root path of 'c:\Projects\ConsoleApplication1\ConsoleApplication1\bin\Debug\tempdir' is 'c:\'
-' The root path of 'x:\tempdir' is 'x:\'
-' The root path of 'c:\' is 'c:\'
-' Press any key to continue . . .
-
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/environment.FailFast/vb/ff.vb b/snippets/visualbasic/VS_Snippets_CLR/environment.FailFast/vb/ff.vb
deleted file mode 100644
index 8e2da06d297..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/environment.FailFast/vb/ff.vb
+++ /dev/null
@@ -1,21 +0,0 @@
-'
-Module Example
- Public Sub Main()
- Dim causeOfFailure As String = "A catastrophic failure has occurred."
- ' Assume your application has failed catastrophically and must
- ' terminate immediately. The try-finally block is not executed
- ' and is included only to demonstrate that instructions within
- ' try-catch blocks and finalizers are not performed.
-
- Try
- Environment.FailFast(causeOfFailure)
- Finally
- Console.WriteLine("This finally block will not be executed.")
- End Try
- End Sub
-End Module
-'
-' The code example displays no output because the application is
-' terminated. However, an entry is made in the Windows Application event
-' log, and the log entry contains the text from the causeOfFailure variable.
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/math.max/VB/max.vb b/snippets/visualbasic/VS_Snippets_CLR/math.max/VB/max.vb
deleted file mode 100644
index d7786913126..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/math.max/VB/max.vb
+++ /dev/null
@@ -1,68 +0,0 @@
-'
-' This example demonstrates Math.Max()
-Class Sample
- Public Shared Sub Main()
- Dim str As String = "{0}: The greater of {1,3} and {2,3} is {3}."
- Dim nl As String = Environment.NewLine
-
- Dim xByte1 As Byte = 1
- Dim xByte2 As Byte = 51
- Dim xShort1 As Short = - 2
- Dim xShort2 As Short = 52
- Dim xInt1 As Integer = - 3
- Dim xInt2 As Integer = 53
- Dim xLong1 As Long = - 4
- Dim xLong2 As Long = 54
- Dim xSingle1 As Single = 5F
- Dim xSingle2 As Single = 55F
- Dim xDouble1 As Double = 6.0
- Dim xDouble2 As Double = 56.0
- Dim xDecimal1 As [Decimal] = 7D
- Dim xDecimal2 As [Decimal] = 57D
-
- ' The following types are not CLS-compliant.
- Dim xSByte1 As SByte = 101
- Dim xSByte2 As SByte = 111
- Dim xUShort1 As UShort = 102
- Dim xUShort2 As UShort = 112
- Dim xUint1 As UInteger = 103
- Dim xUint2 As UInteger = 113
- Dim xUlong1 As ULong = 104
- Dim xUlong2 As ULong = 114
-
- Console.WriteLine("{0}Display the greater of two values:{0}", nl)
- Console.WriteLine(str, "Byte ", xByte1, xByte2, Math.Max(xByte1, xByte2))
- Console.WriteLine(str, "Int16 ", xShort1, xShort2, Math.Max(xShort1, xShort2))
- Console.WriteLine(str, "Int32 ", xInt1, xInt2, Math.Max(xInt1, xInt2))
- Console.WriteLine(str, "Int64 ", xLong1, xLong2, Math.Max(xLong1, xLong2))
- Console.WriteLine(str, "Single ", xSingle1, xSingle2, Math.Max(xSingle1, xSingle2))
- Console.WriteLine(str, "Double ", xDouble1, xDouble2, Math.Max(xDouble1, xDouble2))
- Console.WriteLine(str, "Decimal", xDecimal1, xDecimal2, Math.Max(xDecimal1, xDecimal2))
- '
- Console.WriteLine("{0}(The following types are not CLS-compliant.){0}", nl)
- Console.WriteLine(str, "SByte ", xSByte1, xSByte2, Math.Max(xSByte1, xSByte2))
- Console.WriteLine(str, "UInt16 ", xUShort1, xUShort2, Math.Max(xUShort1, xUShort2))
- Console.WriteLine(str, "UInt32 ", xUint1, xUint2, Math.Max(xUint1, xUint2))
- Console.WriteLine(str, "UInt64 ", xUlong1, xUlong2, Math.Max(xUlong1, xUlong2))
- End Sub
-End Class
-'
-'This example produces the following results:
-'
-'Display the greater of two values:
-'
-'Byte : The greater of 1 and 51 is 51.
-'Int16 : The greater of -2 and 52 is 52.
-'Int32 : The greater of -3 and 53 is 53.
-'Int64 : The greater of -4 and 54 is 54.
-'Single : The greater of 5 and 55 is 55.
-'Double : The greater of 6 and 56 is 56.
-'Decimal: The greater of 7 and 57 is 57.
-'
-' (The following types are not CLS-compliant.)
-'
-' SByte : The greater of 101 and 111 is 111.
-' UInt16 : The greater of 102 and 112 is 112.
-' UInt32 : The greater of 103 and 113 is 113.
-' UInt64 : The greater of 104 and 114 is 114.
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/math.min/VB/min.vb b/snippets/visualbasic/VS_Snippets_CLR/math.min/VB/min.vb
deleted file mode 100644
index 0a6ccf5225a..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/math.min/VB/min.vb
+++ /dev/null
@@ -1,68 +0,0 @@
-'
-' This example demonstrates Math.Min()
-Class Sample
- Public Shared Sub Main()
- Dim str As String = "{0}: The lesser of {1,3} and {2,3} is {3}."
- Dim nl As String = Environment.NewLine
-
- Dim xByte1 As Byte = 1
- Dim xByte2 As Byte = 51
- Dim xShort1 As Short = - 2
- Dim xShort2 As Short = 52
- Dim xInt1 As Integer = - 3
- Dim xInt2 As Integer = 53
- Dim xLong1 As Long = - 4
- Dim xLong2 As Long = 54
- Dim xSingle1 As Single = 5F
- Dim xSingle2 As Single = 55F
- Dim xDouble1 As Double = 6.0
- Dim xDouble2 As Double = 56.0
- Dim xDecimal1 As [Decimal] = 7D
- Dim xDecimal2 As [Decimal] = 57D
-
- ' The following types are not CLS-compliant.
- Dim xSbyte1 As SByte = 101
- Dim xSbyte2 As SByte = 111
- Dim xUshort1 As UShort = 102
- Dim xUshort2 As UShort = 112
- Dim xUint1 As UInteger = 103
- Dim xUint2 As UInteger = 113
- Dim xUlong1 As ULong = 104
- Dim xUlong2 As ULong = 114
-
- Console.WriteLine("{0}Display the lesser of two values:{0}", nl)
- Console.WriteLine(str, "Byte ", xByte1, xByte2, Math.Min(xByte1, xByte2))
- Console.WriteLine(str, "Int16 ", xShort1, xShort2, Math.Min(xShort1, xShort2))
- Console.WriteLine(str, "Int32 ", xInt1, xInt2, Math.Min(xInt1, xInt2))
- Console.WriteLine(str, "Int64 ", xLong1, xLong2, Math.Min(xLong1, xLong2))
- Console.WriteLine(str, "Single ", xSingle1, xSingle2, Math.Min(xSingle1, xSingle2))
- Console.WriteLine(str, "Double ", xDouble1, xDouble2, Math.Min(xDouble1, xDouble2))
- Console.WriteLine(str, "Decimal", xDecimal1, xDecimal2, Math.Min(xDecimal1, xDecimal2))
- '
- Console.WriteLine("{0}The following types are not CLS-compliant:{0}", nl)
- Console.WriteLine(str, "SByte ", xSbyte1, xSbyte2, Math.Min(xSbyte1, xSbyte2))
- Console.WriteLine(str, "UInt16 ", xUshort1, xUshort2, Math.Min(xUshort1, xUshort2))
- Console.WriteLine(str, "UInt32 ", xUint1, xUInt2, Math.Min(xUInt1, xUInt2))
- Console.WriteLine(str, "UInt64 ", xUlong1, xUlong2, Math.Min(xUlong1, xUlong2))
- End Sub
-End Class
-'
-' This example produces the following results:
-'
-' Display the lesser of two values:
-'
-' Byte : The lesser of 1 and 51 is 1.
-' Int16 : The lesser of -2 and 52 is -2.
-' Int32 : The lesser of -3 and 53 is -3.
-' Int64 : The lesser of -4 and 54 is -4.
-' Single : The lesser of 5 and 55 is 5.
-' Double : The lesser of 6 and 56 is 6.
-' Decimal: The lesser of 7 and 57 is 7.
-'
-' The following types are not CLS-compliant:
-'
-' SByte : The lesser of 101 and 111 is 101.
-' UInt16 : The lesser of 102 and 112 is 102.
-' UInt32 : The lesser of 103 and 113 is 103.
-' UInt64 : The lesser of 104 and 114 is 104.
-'
diff --git a/snippets/visualbasic/VS_Snippets_CLR/pathcombine/VB/pathcombine.vb b/snippets/visualbasic/VS_Snippets_CLR/pathcombine/VB/pathcombine.vb
deleted file mode 100644
index 64140f68b39..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/pathcombine/VB/pathcombine.vb
+++ /dev/null
@@ -1,63 +0,0 @@
-'
-Imports System.IO
-
-Public Class ChangeExtensionTest
-
-
- Public Shared Sub Main()
- Dim path1 As String = "c:\temp"
- Dim path2 As String = "subdir\file.txt"
- Dim path3 As String = "c:\temp.txt"
- Dim path4 As String = "c:^*&)(_=@#'\\^.*(.txt"
- Dim path5 As String = ""
- Dim path6 As String = Nothing
-
- CombinePaths(path1, path2)
- CombinePaths(path1, path3)
- CombinePaths(path3, path2)
- CombinePaths(path4, path2)
- CombinePaths(path5, path2)
- CombinePaths(path6, path2)
- End Sub
-
- Private Shared Sub CombinePaths(p1 As String, p2 As String)
-
- Try
- Dim combination As String = Path.Combine(p1, p2)
-
- Console.WriteLine("When you combine '{0}' and '{1}', the result is: {2}'{3}'", p1, p2, Environment.NewLine, combination)
- Catch e As Exception
- If p1 = Nothing Then
- p1 = "Nothing"
- End If
- If p2 = Nothing Then
- p2 = "Nothing"
- End If
- Console.WriteLine("You cannot combine '{0}' and '{1}' because: {2}{3}", p1, p2, Environment.NewLine, e.Message)
- End Try
-
- Console.WriteLine()
- End Sub
-End Class
-' This code produces output similar to the following:
-'
-' When you combine 'c:\temp' and 'subdir\file.txt', the result is:
-' 'c:\temp\subdir\file.txt'
-'
-' When you combine 'c:\temp' and 'c:\temp.txt', the result is:
-' 'c:\temp.txt'
-'
-' When you combine 'c:\temp.txt' and 'subdir\file.txt', the result is:
-' 'c:\temp.txt\subdir\file.txt'
-'
-' When you combine 'c:^*&)(_=@#'\^.*(.txt' and 'subdir\file.txt', the result is:
-' 'c:^*&)(_=@#'\^.*(.txt\subdir\file.txt'
-'
-' When you combine '' and 'subdir\file.txt', the result is:
-' 'subdir\file.txt'
-'
-' You cannot combine '' and 'subdir\file.txt' because:
-' Value cannot be null.
-' Parameter name: path1
-
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/stringbuilder.replace/VB/replace.vb b/snippets/visualbasic/VS_Snippets_CLR/stringbuilder.replace/VB/replace.vb
deleted file mode 100644
index 26e8bb30799..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/stringbuilder.replace/VB/replace.vb
+++ /dev/null
@@ -1,67 +0,0 @@
-' This example demonstrates StringBuilder.Replace()
-'
-Imports System.Text
-
-Class Sample
- Public Shared Sub Main()
- ' 0----+----1----+----2----+----3----+----4---
- ' 01234567890123456789012345678901234567890123
- Dim str As String = "The quick br!wn d#g jumps #ver the lazy cat."
- Dim sb As New StringBuilder(str)
-
- Console.WriteLine()
- Console.WriteLine("StringBuilder.Replace method")
- Console.WriteLine()
-
- Console.WriteLine("Original value:")
- Show(sb)
-
- sb.Replace("#"c, "!"c, 15, 29) ' Some '#' -> '!'
- Show(sb)
- sb.Replace("!"c, "o"c) ' All '!' -> 'o'
- Show(sb)
- sb.Replace("cat", "dog") ' All "cat" -> "dog"
- Show(sb)
- sb.Replace("dog", "fox", 15, 20) ' Some "dog" -> "fox"
- Console.WriteLine("Final value:")
- Show(sb)
- End Sub
-
- Public Shared Sub Show(sbs As StringBuilder)
- Dim rule1 As String = "0----+----1----+----2----+----3----+----4---"
- Dim rule2 As String = "01234567890123456789012345678901234567890123"
-
- Console.WriteLine(rule1)
- Console.WriteLine(rule2)
- Console.WriteLine("{0}", sbs.ToString())
- Console.WriteLine()
- End Sub
-End Class
-'
-'This example produces the following results:
-'
-'StringBuilder.Replace method
-'
-'Original value:
-'0----+----1----+----2----+----3----+----4---
-'01234567890123456789012345678901234567890123
-'The quick br!wn d#g jumps #ver the lazy cat.
-'
-'0----+----1----+----2----+----3----+----4---
-'01234567890123456789012345678901234567890123
-'The quick br!wn d!g jumps !ver the lazy cat.
-'
-'0----+----1----+----2----+----3----+----4---
-'01234567890123456789012345678901234567890123
-'The quick brown dog jumps over the lazy cat.
-'
-'0----+----1----+----2----+----3----+----4---
-'01234567890123456789012345678901234567890123
-'The quick brown dog jumps over the lazy dog.
-'
-'Final value:
-'0----+----1----+----2----+----3----+----4---
-'01234567890123456789012345678901234567890123
-'The quick brown fox jumps over the lazy dog.
-'
-'
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/thread.sleep_timespan/vb/example.vb b/snippets/visualbasic/VS_Snippets_CLR/thread.sleep_timespan/vb/example.vb
deleted file mode 100644
index dbe7a82ba25..00000000000
--- a/snippets/visualbasic/VS_Snippets_CLR/thread.sleep_timespan/vb/example.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-'
-Imports System.Threading
-
-Class Example
-
- Shared Sub Main()
-
- Dim interval As New TimeSpan(0, 0, 2)
-
- For i As Integer = 0 To 4
- Console.WriteLine("Sleep for 2 seconds.")
- Thread.Sleep(interval)
- Next
-
- Console.WriteLine("Main thread exits.")
- End Sub
-End Class
-
-' This example produces the following output:
-'
-'Sleep for 2 seconds.
-'Sleep for 2 seconds.
-'Sleep for 2 seconds.
-'Sleep for 2 seconds.
-'Sleep for 2 seconds.
-'Main thread exits.
-'
From 13e60d7824668d6067a30411c85d2e374602adbc Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 08:46:08 +0000
Subject: [PATCH 07/13] Fix Snippets 5000 error by renaming Example class to
ThreadSleepExample
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
snippets/visualbasic/System.Threading/Thread/Sleep/example.vb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/snippets/visualbasic/System.Threading/Thread/Sleep/example.vb b/snippets/visualbasic/System.Threading/Thread/Sleep/example.vb
index dbe7a82ba25..b681f485d67 100644
--- a/snippets/visualbasic/System.Threading/Thread/Sleep/example.vb
+++ b/snippets/visualbasic/System.Threading/Thread/Sleep/example.vb
@@ -1,7 +1,7 @@
'
Imports System.Threading
-Class Example
+Class ThreadSleepExample
Shared Sub Main()
From 4c88c6119e0de4bfe6a88eaabd2b9b4b97131b1d Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 09:06:15 +0000
Subject: [PATCH 08/13] Fix naming conflict in DictionaryTKey,TValue
constructor snippet
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
.../DictionaryTKey,TValue/.ctor/source2.vb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.vb b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.vb
index cde9ec6a46e..a7cfd0eaaae 100644
--- a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.vb
+++ b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.vb
@@ -1,7 +1,7 @@
'
Imports System.Collections.Generic
-Public Class Example
+Public Class DictionaryCapacityExample
Public Shared Sub Main()
From fce6295c58bd6690c175848322043138132cdcf1 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 11:24:24 +0000
Subject: [PATCH 09/13] Fix code snippet not found warnings by moving
additional SortedDictionary VB snippets
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
.../IComparer/Project.vbproj | 8 ++++
.../IComparer}/source.vb | 2 +-
.../IDictionary/Project.vbproj | 8 ++++
.../IDictionary}/source.vb | 2 +-
.../IDictionaryCtor/Project.vbproj | 8 ++++
.../IDictionaryCtor}/source.vb | 2 +-
.../SortedDictionary`2.xml | 48 +++++++++----------
7 files changed, 51 insertions(+), 27 deletions(-)
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IComparer/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/Generic.SortedDictionary.ctor_IComp/VB => System.Collections.Generic/SortedDictionaryTKey,TValue/IComparer}/source.vb (99%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB => System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary}/source.vb (99%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionaryCtor/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDic/VB => System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionaryCtor}/source.vb (98%)
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IComparer/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IComparer/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IComparer/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IComp/VB/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IComparer/source.vb
similarity index 99%
rename from snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IComp/VB/source.vb
rename to snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IComparer/source.vb
index c66e1a4c41e..03e9fe17b74 100644
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IComp/VB/source.vb
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IComparer/source.vb
@@ -44,4 +44,4 @@ End Class
'Key = DIB, Value = paint.exe
'Key = rtf, Value = wordpad.exe
'Key = txt, Value = notepad.exe
-'
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb
similarity index 99%
rename from snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb
rename to snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb
index db4c58bc38b..a1bf487e700 100644
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb
@@ -213,4 +213,4 @@ End Class
'Remove("dib")
'Key "dib" is not found.
'
-'
+'
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionaryCtor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionaryCtor/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionaryCtor/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDic/VB/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionaryCtor/source.vb
similarity index 98%
rename from snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDic/VB/source.vb
rename to snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionaryCtor/source.vb
index 44a8b30fb64..8128155734a 100644
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDic/VB/source.vb
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionaryCtor/source.vb
@@ -36,4 +36,4 @@ End Class
'Key = dib, Value = paint.exe
'Key = rtf, Value = wordpad.exe
'Key = txt, Value = notepad.exe
-'
+'
\ No newline at end of file
diff --git a/xml/System.Collections.Generic/SortedDictionary`2.xml b/xml/System.Collections.Generic/SortedDictionary`2.xml
index 66169c57c4a..9be10207e28 100644
--- a/xml/System.Collections.Generic/SortedDictionary`2.xml
+++ b/xml/System.Collections.Generic/SortedDictionary`2.xml
@@ -302,7 +302,7 @@
The following code example creates a with a case-insensitive comparer for the current culture. The example adds four elements, some with lower-case keys and some with upper-case keys. The example then attempts to add an element with a key that differs from an existing key only by case, catches the resulting exception, and displays an error message. Finally, the example displays the elements in case-insensitive sort order.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IComp/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IComparer/source.vb" id="Snippet1":::
]]>
@@ -373,7 +373,7 @@
The following code example shows how to use to create a sorted copy of the information in a , by passing the to the constructor.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source1.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDic/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionaryCtor/source.vb" id="Snippet1":::
]]>
@@ -1915,7 +1915,7 @@ Getting the value of this property is an O(1) operation.
The code example demonstrates the use of several other members of the interface.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet1":::
]]>
@@ -1997,11 +1997,11 @@ Getting the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet6":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet6":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
@@ -2084,11 +2084,11 @@ Getting the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet7":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet7":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet7":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
@@ -2285,13 +2285,13 @@ Getting the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet3":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet3":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet4":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet4":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
@@ -2369,13 +2369,13 @@ Getting the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet9":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet9":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet9":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet7":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet7":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet7":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
@@ -2441,11 +2441,11 @@ Getting the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet10":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet10":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet10":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
@@ -2517,13 +2517,13 @@ Getting the value of this property is an O(1) operation.
The code example is part of a larger example, including output, provided for the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet31":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet31":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet8":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet8":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet8":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet7":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet7":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet7":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet32":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/VB/source.vb" id="Snippet32":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/IDictionary/source.vb" id="Snippet32":::
]]>
From e09fea2a6c8e6a6882dead4be029bc88b81657ea Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 13:29:40 +0000
Subject: [PATCH 10/13] Fix code snippet not found warnings by moving
additional List and SortedList VB snippets
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
.../.ctor/Project.vbproj | 2 +-
.../Overview/Project.vbproj | 2 +-
.../Overview/Project.vbproj | 2 +-
.../LinkedListT/Overview/Project.vbproj | 8 +++
.../LinkedListT/Overview}/source.vb | 0
.../ListT/AsReadOnly/Project.vbproj | 8 +++
.../ListT/AsReadOnly}/source.vb | 0
.../ListT/Class/Project.vbproj | 8 +++
.../ListT/Class}/source.vb | 0
.../ListT/ConvertAll/Project.vbproj | 12 +++++
.../ListT/ConvertAll}/source.vb | 0
.../ListT/CopyTo/Project.vbproj | 8 +++
.../ListT/CopyTo}/source.vb | 0
.../ListT/FindEtAl/Project.vbproj | 8 +++
.../ListT/FindEtAl}/source.vb | 0
.../ListT/IndexOf/Project.vbproj | 6 +--
.../ListT/LastIndexOf/Project.vbproj | 8 +++
.../ListT/LastIndexOf}/source.vb | 0
.../ListT/Ranges/Project.vbproj | 8 +--
.../ListT/Reverse/Project.vbproj | 8 +++
.../ListT/Reverse}/source.vb | 0
.../ListT/SortComparison/Project.vbproj | 8 +++
.../ListT/SortComparison}/source.vb | 0
.../ListT/SortSearch/Project.vbproj | 8 +++
.../ListT/SortSearch}/source.vb | 0
.../ListT/SortSearchComparer/Project.vbproj | 8 +++
.../ListT/SortSearchComparer}/source.vb | 0
.../SortSearchComparerRange/Project.vbproj | 8 +++
.../ListT/SortSearchComparerRange}/source.vb | 0
.../QueueT/Overview/Project.vbproj | 2 +-
.../.ctor/Project.vbproj | 2 +-
.../Overview/Project.vbproj | 2 +-
.../.ctor/Project.vbproj | 2 +-
.../Constructor/Project.vbproj | 8 +++
.../ConstructorIDictionary/Project.vbproj | 8 +++
.../ConstructorIDictionary}/source.vb | 0
.../Project.vbproj | 8 +++
.../source.vb | 0
.../ConstructorInt32/Project.vbproj | 8 +++
.../ConstructorInt32}/source.vb | 0
.../ConstructorInt32IComparer/Project.vbproj | 8 +++
.../ConstructorInt32IComparer}/source.vb | 0
.../IDictionary/Project.vbproj | 8 +--
.../Overview/Project.vbproj | 8 +--
.../Overview}/remarks.vb | 6 +--
.../SortedListTKey,TValue/Overview}/source.vb | 0
.../StackT/Overview/Project.vbproj | 2 +-
.../LinkedList`1.xml | 2 +-
xml/System.Collections.Generic/List`1.xml | 52 +++++++++----------
.../SortedList`2.xml | 48 ++++++++---------
xml/System/Comparison`1.xml | 2 +-
xml/System/Converter`2.xml | 2 +-
52 files changed, 219 insertions(+), 79 deletions(-)
create mode 100644 snippets/visualbasic/System.Collections.Generic/LinkedListT/Overview/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/Generic.LinkedList/vb => System.Collections.Generic/LinkedListT/Overview}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/AsReadOnly/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/List`1_AsReadOnly/vb => System.Collections.Generic/ListT/AsReadOnly}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/Class/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/List`1_Class/vb => System.Collections.Generic/ListT/Class}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/ConvertAll/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/List`1_ConvertAll/vb => System.Collections.Generic/ListT/ConvertAll}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/CopyTo/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/List`1_CopyTo/vb => System.Collections.Generic/ListT/CopyTo}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/FindEtAl/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/List`1_FindEtAl/vb => System.Collections.Generic/ListT/FindEtAl}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/LastIndexOf/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/List`1_LastIndexOf/vb => System.Collections.Generic/ListT/LastIndexOf}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/Reverse/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/List`1_Reverse/vb => System.Collections.Generic/ListT/Reverse}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/SortComparison/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/List`1_SortComparison/vb => System.Collections.Generic/ListT/SortComparison}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/SortSearch/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/List`1_SortSearch/vb => System.Collections.Generic/ListT/SortSearch}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparer/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/List`1_SortSearchComparer/vb => System.Collections.Generic/ListT/SortSearchComparer}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparerRange/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/List`1_SortSearchComparerRange/vb => System.Collections.Generic/ListT/SortSearchComparerRange}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Constructor/Project.vbproj
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionary/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/Generic.SortedList.ctor_IDic/VB => System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionary}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionaryIComparer/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/Generic.SortedList.ctor_IDicIComp/VB => System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionaryIComparer}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/Generic.SortedList.ctor_Int32/VB => System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32}/source.vb (100%)
create mode 100644 snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32IComparer/Project.vbproj
rename snippets/visualbasic/{VS_Snippets_CLR/Generic.SortedList.ctor_Int32IComp/VB => System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32IComparer}/source.vb (100%)
rename snippets/visualbasic/{VS_Snippets_CLR/Generic.SortedList/VB => System.Collections.Generic/SortedListTKey,TValue/Overview}/remarks.vb (89%)
rename snippets/visualbasic/{VS_Snippets_CLR/Generic.SortedList/VB => System.Collections.Generic/SortedListTKey,TValue/Overview}/source.vb (100%)
diff --git a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj
index ffa6c9960f8..2780795cb40 100644
--- a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/.ctor/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net9.0
+ net8.0
diff --git a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj
index ffa6c9960f8..2780795cb40 100644
--- a/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net9.0
+ net8.0
diff --git a/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj
index ffa6c9960f8..2780795cb40 100644
--- a/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net9.0
+ net8.0
diff --git a/snippets/visualbasic/System.Collections.Generic/LinkedListT/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/LinkedListT/Overview/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/LinkedListT/Overview/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.LinkedList/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/LinkedListT/Overview/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/Generic.LinkedList/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/LinkedListT/Overview/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/AsReadOnly/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/AsReadOnly/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/AsReadOnly/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_AsReadOnly/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/AsReadOnly/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/List`1_AsReadOnly/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/ListT/AsReadOnly/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/Class/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/Class/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/Class/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/ConvertAll/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/ConvertAll/Project.vbproj
new file mode 100644
index 00000000000..cd0a57df9ed
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/ConvertAll/Project.vbproj
@@ -0,0 +1,12 @@
+
+
+
+ Exe
+ net8.0
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_ConvertAll/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/ConvertAll/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/List`1_ConvertAll/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/ListT/ConvertAll/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/CopyTo/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/CopyTo/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/CopyTo/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_CopyTo/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/CopyTo/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/List`1_CopyTo/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/ListT/CopyTo/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/FindEtAl/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/FindEtAl/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/FindEtAl/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_FindEtAl/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/FindEtAl/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/List`1_FindEtAl/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/ListT/FindEtAl/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj
index a3fb2ebcab0..d50c0e10aeb 100644
--- a/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/Project.vbproj
@@ -1,8 +1,8 @@
- Library
- net9.0
+ Exe
+ net8.0
-
+
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/LastIndexOf/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/LastIndexOf/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/LastIndexOf/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_LastIndexOf/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/LastIndexOf/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/List`1_LastIndexOf/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/ListT/LastIndexOf/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj
index ffa6c9960f8..d50c0e10aeb 100644
--- a/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/Ranges/Project.vbproj
@@ -1,8 +1,8 @@
- Library
- net9.0
+ Exe
+ net8.0
-
-
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/Reverse/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/Reverse/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/Reverse/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_Reverse/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/Reverse/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/List`1_Reverse/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/ListT/Reverse/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/SortComparison/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/SortComparison/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/SortComparison/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_SortComparison/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/SortComparison/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/List`1_SortComparison/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/ListT/SortComparison/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/SortSearch/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/SortSearch/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/SortSearch/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearch/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/SortSearch/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearch/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/ListT/SortSearch/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparer/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparer/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparer/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearchComparer/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparer/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearchComparer/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparer/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparerRange/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparerRange/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparerRange/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearchComparerRange/vb/source.vb b/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparerRange/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearchComparerRange/vb/source.vb
rename to snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparerRange/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj
index ffa6c9960f8..2780795cb40 100644
--- a/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/QueueT/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net9.0
+ net8.0
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj
index ffa6c9960f8..2780795cb40 100644
--- a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net9.0
+ net8.0
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj
index ffa6c9960f8..2780795cb40 100644
--- a/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net9.0
+ net8.0
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj
index ffa6c9960f8..2780795cb40 100644
--- a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net9.0
+ net8.0
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Constructor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Constructor/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Constructor/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionary/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionary/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionary/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_IDic/VB/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionary/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_IDic/VB/source.vb
rename to snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionary/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionaryIComparer/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionaryIComparer/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionaryIComparer/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_IDicIComp/VB/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionaryIComparer/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_IDicIComp/VB/source.vb
rename to snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionaryIComparer/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_Int32/VB/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_Int32/VB/source.vb
rename to snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32IComparer/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32IComparer/Project.vbproj
new file mode 100644
index 00000000000..d50c0e10aeb
--- /dev/null
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32IComparer/Project.vbproj
@@ -0,0 +1,8 @@
+
+
+
+ Exe
+ net8.0
+
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_Int32IComp/VB/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32IComparer/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_Int32IComp/VB/source.vb
rename to snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32IComparer/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj
index ffa6c9960f8..d50c0e10aeb 100644
--- a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/IDictionary/Project.vbproj
@@ -1,8 +1,8 @@
- Library
- net9.0
+ Exe
+ net8.0
-
-
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj
index ffa6c9960f8..d50c0e10aeb 100644
--- a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/Project.vbproj
@@ -1,8 +1,8 @@
- Library
- net9.0
+ Exe
+ net8.0
-
-
+
+
\ No newline at end of file
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/remarks.vb b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.vb
similarity index 89%
rename from snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/remarks.vb
rename to snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.vb
index eb9a59ac6ef..ed10c8ccfb1 100644
--- a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/remarks.vb
+++ b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.vb
@@ -1,7 +1,7 @@
-Imports System.Collections.Generic
+Imports System.Collections.Generic
-Public Class Example
- Public Shared Sub Main()
+Public Class RemarksExample
+ Public Shared Sub DoRemarks()
' Create a new sorted list of strings, with string
' keys.
Dim mySortedList As New SortedList(Of Integer, String)()
diff --git a/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb
similarity index 100%
rename from snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb
rename to snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb
diff --git a/snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj
index ffa6c9960f8..2780795cb40 100644
--- a/snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj
+++ b/snippets/visualbasic/System.Collections.Generic/StackT/Overview/Project.vbproj
@@ -2,7 +2,7 @@
Library
- net9.0
+ net8.0
diff --git a/xml/System.Collections.Generic/LinkedList`1.xml b/xml/System.Collections.Generic/LinkedList`1.xml
index 7e1a3812fad..48140e7c28b 100644
--- a/xml/System.Collections.Generic/LinkedList`1.xml
+++ b/xml/System.Collections.Generic/LinkedList`1.xml
@@ -141,7 +141,7 @@
The following code example demonstrates many features of the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/LinkedListT/Overview/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.LinkedList/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/LinkedListT/Overview/source.vb" id="Snippet1":::
]]>
diff --git a/xml/System.Collections.Generic/List`1.xml b/xml/System.Collections.Generic/List`1.xml
index 09f2606fc08..0f3fcfe3340 100644
--- a/xml/System.Collections.Generic/List`1.xml
+++ b/xml/System.Collections.Generic/List`1.xml
@@ -190,7 +190,7 @@
The example adds, inserts, and removes items, showing how the capacity changes as these methods are used.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/List`1_Class/fs/listclass.fs" id="Snippet1":::
]]>
@@ -319,7 +319,7 @@
The following example demonstrates the constructor. A of strings with a capacity of 4 is created, because the ultimate size of the list is known to be exactly 4. The list is populated with four strings, and a read-only copy is created by using the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_AsReadOnly/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/AsReadOnly/source.vb" id="Snippet1":::
]]>
@@ -396,7 +396,7 @@
Other properties and methods are used to search for, insert, and remove elements from the list, and finally to clear the list.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/List`1_Class/fs/listclass.fs" id="Snippet1":::
]]>
@@ -531,7 +531,7 @@
An element of the original list is set to "Coelophysis" using the property (the indexer in C#), and the contents of the read-only list are displayed again to demonstrate that it is just a wrapper for the original list.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_AsReadOnly/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/AsReadOnly/source.vb" id="Snippet1":::
]]>
@@ -613,7 +613,7 @@
The method overload is then used to search for two strings that are not in the list, and the method is used to insert them. The return value of the method is negative in each case, because the strings are not in the list. Taking the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of this negative number produces the index of the first element in the list that is larger than the search string, and inserting at this location preserves the sort order. The second search string is larger than any element in the list, so the insertion position is at the end of the list.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source.cs" interactive="try-dotnet-method" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearch/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/SortSearch/source.vb" id="Snippet1":::
]]>
@@ -708,7 +708,7 @@
The method overload is then used to search for several strings that are not in the list, employing the alternate comparer. The method is used to insert the strings. These two methods are located in the function named `SearchAndInsert`, along with code to take the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by and use it as an index for inserting the new string.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source1.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearchComparer/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparer/source.vb" id="Snippet1":::
]]>
@@ -804,7 +804,7 @@
The method overload is then used to search only the range of herbivores for "Brachiosaurus". The string is not found, and the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by the method is used as an index for inserting the new string.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source2.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearchComparerRange/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparerRange/source.vb" id="Snippet1":::
]]>
@@ -892,7 +892,7 @@
The property is displayed again after the method is used to reduce the capacity to match the count. Finally, the method is used to remove all items from the list, and the and properties are displayed again.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/List`1_Class/fs/listclass.fs" id="Snippet1":::
]]>
@@ -961,7 +961,7 @@
The following example demonstrates the method and various other properties and methods of the generic class. The method is used at the end of the program, to remove all items from the list, and the and properties are then displayed.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/List`1_Class/fs/listclass.fs" id="Snippet1":::
]]>
@@ -1110,7 +1110,7 @@
The following example defines a method named `PointFToPoint` that converts a structure to a structure. The example then creates a of structures, creates a `Converter\` delegate (`Converter(Of PointF, Point)` in Visual Basic) to represent the `PointFToPoint` method, and passes the delegate to the method. The method passes each element of the input list to the `PointFToPoint` method and puts the converted elements into a new list of structures. Both lists are displayed.
:::code language="csharp" source="~/snippets/csharp/System/ConverterTInput,TOutput/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_ConvertAll/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/ConvertAll/source.vb" id="Snippet1":::
]]>
@@ -1135,7 +1135,7 @@
The following example demonstrates all three overloads of the method. A of strings is created and populated with 5 strings. An empty string array of 15 elements is created, and the method overload is used to copy all the elements of the list to the array beginning at the first element of the array. The method overload is used to copy all the elements of the list to the array beginning at array index 6 (leaving index 5 empty). Finally, the method overload is used to copy 3 elements from the list, beginning with index 2, to the array beginning at array index 12 (leaving index 11 empty). The contents of the array are then displayed.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/CopyTo/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_CopyTo/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/CopyTo/source.vb" id="Snippet1":::
]]>
@@ -1416,7 +1416,7 @@
The following example shows the value of the property at various points in the life of a list. After the list has been created and populated and its elements displayed, the and properties are displayed. These properties are displayed again after the method has been called, and again after the contents of the list are cleared.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/List`1_Class/fs/listclass.fs" id="Snippet1":::
]]>
@@ -1529,7 +1529,7 @@
> In C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Exists/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_FindEtAl/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/FindEtAl/source.vb" id="Snippet1":::
]]>
@@ -2905,7 +2905,7 @@ Public Function StartsWith(e As Employee) As Boolean
The following example demonstrates the method, along with various other properties and methods of the generic class. After the list is created, elements are added. The method is used to insert an item into the middle of the list. The item inserted is a duplicate, which is later removed using the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/List`1_Class/fs/listclass.fs" id="Snippet1":::
]]>
@@ -3076,9 +3076,9 @@ Public Function StartsWith(e As Employee) As Boolean
The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb" id="Snippet2":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb" id="Snippet3":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb" id="Snippet3":::
]]>
@@ -3107,7 +3107,7 @@ Public Function StartsWith(e As Employee) As Boolean
The following example demonstrates all three overloads of the method. A of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire list from the end, and finds the second occurrence of the string. The method overload is used to search the list backward beginning with index location 3 and continuing to the beginning of the list, so it finds the first occurrence of the string in the list. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/LastIndexOf/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_LastIndexOf/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/LastIndexOf/source.vb" id="Snippet1":::
]]>
@@ -3383,7 +3383,7 @@ Public Function StartsWith(e As Employee) As Boolean
The following example demonstrates method. Several properties and methods of the generic class are used to add, insert, and search the list. After these operations, the list contains a duplicate. The method is used to remove the first instance of the duplicate item, and the contents are displayed. The method always removes the first instance it encounters.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/List`1_Class/fs/listclass.fs" id="Snippet1":::
]]>
@@ -3461,7 +3461,7 @@ Public Function StartsWith(e As Employee) As Boolean
Finally, the method verifies that there are no strings in the list that end with "saurus".
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Exists/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_FindEtAl/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/FindEtAl/source.vb" id="Snippet1":::
]]>
@@ -3640,7 +3640,7 @@ Public Function StartsWith(e As Employee) As Boolean
The following example demonstrates both overloads of the method. The example creates a of strings and adds six strings. The method overload is used to reverse the list, and then the method overload is used to reverse the middle of the list, beginning with element 1 and encompassing four elements.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Reverse/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Reverse/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Reverse/source.vb" id="Snippet1":::
]]>
@@ -3888,7 +3888,7 @@ Public Function StartsWith(e As Employee) As Boolean
The method overload is then used to search for two strings that are not in the list, and the method is used to insert them. The return value of the method is negative in each case, because the strings are not in the list. Taking the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of this negative number produces the index of the first element in the list that is larger than the search string, and inserting at this location preserves the sort order. The second search string is larger than any element in the list, so the insertion position is at the end of the list.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source.cs" interactive="try-dotnet-method" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearch/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/SortSearch/source.vb" id="Snippet1":::
]]>
@@ -3976,7 +3976,7 @@ Public Function StartsWith(e As Employee) As Boolean
The method overload is then used to search for several strings that are not in the list, employing the alternate comparer. The method is used to insert the strings. These two methods are located in the function named `SearchAndInsert`, along with code to take the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by and use it as an index for inserting the new string.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source1.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearchComparer/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparer/source.vb" id="Snippet1":::
]]>
@@ -4061,7 +4061,7 @@ Public Function StartsWith(e As Employee) As Boolean
A of strings is created and populated with four strings, in no particular order. The list also includes an empty string and a null reference. The list is displayed, sorted using a generic delegate representing the `CompareDinosByLength` method, and displayed again.
:::code language="csharp" source="~/snippets/csharp/System/ComparisonT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_SortComparison/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/SortComparison/source.vb" id="Snippet1":::
]]>
@@ -4156,7 +4156,7 @@ Public Function StartsWith(e As Employee) As Boolean
The method overload is then used to search only the range of herbivores for "Brachiosaurus". The string is not found, and the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by the method is used as an index for inserting the new string.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source2.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_SortSearchComparerRange/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/SortSearchComparerRange/source.vb" id="Snippet1":::
]]>
@@ -5242,7 +5242,7 @@ Retrieving the value of this property is an O(1) operation.
The following example demonstrates the method. Several properties and methods of the class are used to add, insert, and remove items from a list of strings. Then the method is used to reduce the capacity to match the count, and the and properties are displayed. If the unused capacity had been less than 10 percent of total capacity, the list would not have been resized. Finally, the contents of the list are cleared.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_Class/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Class/source.vb" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/List`1_Class/fs/listclass.fs" id="Snippet1":::
]]>
@@ -5315,7 +5315,7 @@ Retrieving the value of this property is an O(1) operation.
> In C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Exists/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_FindEtAl/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/FindEtAl/source.vb" id="Snippet1":::
]]>
diff --git a/xml/System.Collections.Generic/SortedList`2.xml b/xml/System.Collections.Generic/SortedList`2.xml
index 3842e163b3f..befb6a0e1c6 100644
--- a/xml/System.Collections.Generic/SortedList`2.xml
+++ b/xml/System.Collections.Generic/SortedList`2.xml
@@ -128,7 +128,7 @@
Another difference between the and classes is that supports efficient indexed retrieval of keys and values through the collections returned by the and properties. It is not necessary to regenerate the lists when the properties are accessed, because the lists are just wrappers for the internal arrays of keys and values. The following code shows the use of the property for indexed retrieval of values from a sorted list of strings:
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.cs" id="Snippet11":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/remarks.vb" id="Snippet11":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.vb" id="Snippet11":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.fs" id="Snippet11":::
is implemented as an array of key/value pairs, sorted by the key. Each element can be retrieved as a object.
@@ -144,7 +144,7 @@
The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since the elements of the are key/value pairs, the element type is not the type of the key or the type of the value. Instead, the element type is . For example:
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.cs" id="Snippet12":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/remarks.vb" id="Snippet12":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.vb" id="Snippet12":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.fs" id="Snippet12":::
The `foreach` statement is a wrapper around the enumerator, which only allows reading from, not writing to, the collection.
@@ -163,7 +163,7 @@
Finally, the example demonstrates the method.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet1":::
]]>
@@ -242,7 +242,7 @@
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet2":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet2":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet2":::
]]>
@@ -390,7 +390,7 @@
The following code example shows how to use to create a sorted copy of the information in a , by passing the to the constructor.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/.ctor/source1.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_IDic/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionary/source.vb" id="Snippet1":::
]]>
@@ -464,7 +464,7 @@
The following code example creates a sorted list with an initial capacity of 4 and populates it with 4 entries.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/.ctor/source3.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_Int32/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32/source.vb" id="Snippet1":::
]]>
@@ -544,7 +544,7 @@
The following code example shows how to use to create a case-insensitive sorted copy of the information in a case-insensitive , by passing the to the constructor. In this example, the case-insensitive comparers are for the current culture.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/.ctor/source2.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_IDicIComp/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorIDictionaryIComparer/source.vb" id="Snippet1":::
]]>
@@ -631,7 +631,7 @@
The following code example creates a sorted list with an initial capacity of 5 and a case-insensitive comparer for the current culture. The example adds four elements, some with lower-case keys and some with upper-case keys. The example then attempts to add an element with a key that differs from an existing key only by case, catches the resulting exception, and displays an error message. Finally, the example displays the elements in case-insensitive sort order.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/.ctor/source4.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList.ctor_Int32IComp/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/ConstructorInt32IComparer/source.vb" id="Snippet1":::
]]>
@@ -710,7 +710,7 @@
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet2":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet2":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet2":::
]]>
@@ -956,13 +956,13 @@
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet6":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet6":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet5":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet5":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet5":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet4":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet4":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet4":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet4":::
]]>
@@ -1412,13 +1412,13 @@
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet3":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet3":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet4":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet4":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet4":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet5":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet5":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet5":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet5":::
]]>
@@ -1484,7 +1484,7 @@
The collection returned by the property provides an efficient way to retrieve keys by index. It is not necessary to regenerate the list when the property is accessed, because the list is just a wrapper for the internal array of keys. The following code shows the use of the property for indexed retrieval of keys from a sorted list of elements with string keys:
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.cs" id="Snippet11":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/remarks.vb" id="Snippet11":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.vb" id="Snippet11":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.fs" id="Snippet11":::
Retrieving the value of this property is an O(1) operation.
@@ -1499,10 +1499,10 @@
This code is part of a larger example that can be compiled and executed. See .
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet9":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet9":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet9":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet7":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet7":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet7":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet7":::
]]>
@@ -1571,7 +1571,7 @@
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet10":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet10":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet10":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet10":::
]]>
@@ -3251,10 +3251,10 @@ Retrieving the value of this property is an O(1) operation.
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet5":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet5":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet4":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet4":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet4":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet4":::
]]>
@@ -3322,7 +3322,7 @@ Retrieving the value of this property is an O(1) operation.
The collection returned by the property provides an efficient way to retrieve values by index. It is not necessary to regenerate the list when the property is accessed, because the list is just a wrapper for the internal array of values. The following code shows the use of the property for indexed retrieval of values from a sorted list of strings:
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.cs" id="Snippet11":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/remarks.vb" id="Snippet11":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.vb" id="Snippet11":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.fs" id="Snippet11":::
Retrieving the value of this property is an O(1) operation.
@@ -3337,10 +3337,10 @@ Retrieving the value of this property is an O(1) operation.
This code example is part of a larger example provided for the class.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet8":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet8":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet8":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet7":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.SortedList/VB/source.vb" id="Snippet7":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet7":::
:::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.fs" id="Snippet7":::
]]>
diff --git a/xml/System/Comparison`1.xml b/xml/System/Comparison`1.xml
index fa4e2613f88..60d67dc5e4d 100644
--- a/xml/System/Comparison`1.xml
+++ b/xml/System/Comparison`1.xml
@@ -110,7 +110,7 @@
:::code language="csharp" source="~/snippets/csharp/System/ComparisonT/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/List`1_SortComparison/fs/source.fs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_SortComparison/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/SortComparison/source.vb" id="Snippet1":::
The following example uses the delegate to sort the elements of a collection of `CityInfo` objects. `CityInfo` is an application-defined class that contains information about a city and its population. The example defines three methods, `CompareByName`, `CompareByPopulation`, and `CompareByNames`, that offer three different ways of ordering the `CityInfo` objects. Each method is assigned to the `comparison` argument of the method.
diff --git a/xml/System/Converter`2.xml b/xml/System/Converter`2.xml
index b4c5412d8ab..a23431eeda8 100644
--- a/xml/System/Converter`2.xml
+++ b/xml/System/Converter`2.xml
@@ -104,7 +104,7 @@
The following code example defines a method named `PointFToPoint` that converts a structure to a structure. The example then creates a of structures, creates a `Converter` delegate (`Converter(Of PointF, Point)` in Visual Basic) to represent the `PointFToPoint` method, and passes the delegate to the method. The method passes each element of the input list to the `PointFToPoint` method and puts the converted elements into a new list of structures. Both lists are displayed.
:::code language="csharp" source="~/snippets/csharp/System/ConverterTInput,TOutput/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/List`1_ConvertAll/vb/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/ConvertAll/source.vb" id="Snippet1":::
]]>
From 0f1d1a6e27915ea2903d5df38a1976bf9dae487c Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 13:45:27 +0000
Subject: [PATCH 11/13] Fix IDictionary`2.xml snippet references to point to
new VB snippet locations
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
.../IDictionaryTKey,TValue/Overview/source.vb | 135 +++++++++++++++++-
.../IDictionary`2.xml | 26 ++--
2 files changed, 145 insertions(+), 16 deletions(-)
diff --git a/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb
index 4c6beb76c93..8df9f8a8e48 100644
--- a/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb
+++ b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb
@@ -1,8 +1,135 @@
-Imports System.Collections.Generic
+'
+Imports System.Collections.Generic
Public Class Example
+
+ Public Shared Sub Main()
+
+ '
+ ' Create a new dictionary of strings, with string keys,
+ ' and access it through the IDictionary generic interface.
+ '
+ Dim openWith As IDictionary(Of String, String) = _
+ New Dictionary(Of String, String)
+
+ ' Add some elements to the dictionary. There are no
+ ' duplicate keys, but some of the values are duplicates.
+ openWith.Add("txt", "notepad.exe")
+ openWith.Add("bmp", "paint.exe")
+ openWith.Add("dib", "paint.exe")
+ openWith.Add("rtf", "wordpad.exe")
+
+ ' The Add method throws an exception if the new key is
+ ' already in the dictionary.
+ Try
+ openWith.Add("txt", "winword.exe")
+ Catch
+ Console.WriteLine("An element with Key = ""txt"" already exists.")
+ End Try
+ '
+
+ '
+ ' The Item property is the default property, so you
+ ' can omit its name when accessing elements.
+ Console.WriteLine("For key = ""rtf"", value = {0}.", _
+ openWith("rtf"))
+
+ ' The default Item property can be used to change the value
+ ' associated with a key.
+ openWith("rtf") = "winword.exe"
+ Console.WriteLine("For key = ""rtf"", value = {0}.", _
+ openWith("rtf"))
+
+ ' If a key does not exist, setting the default Item property
+ ' for that key adds a new key/value pair.
+ openWith("doc") = "winword.exe"
+ '
+
+ '
+ ' The default Item property throws a KeyNotFoundException
+ ' if the requested key is not in the dictionary.
+ Try
+ Console.WriteLine("For key = ""tif"", value = {0}.", _
+ openWith("tif"))
+ Catch
+ Console.WriteLine("Key = ""tif"" is not found.")
+ End Try
+ '
+
+ '
+ ' When a program often has to try keys that turn out not to
+ ' be in the dictionary, TryGetValue can be a more efficient
+ ' way to retrieve values.
+ Dim value As String = ""
+ If openWith.TryGetValue("tif", value) Then
+ Console.WriteLine("For key = ""tif"", value = {0}.", value)
+ Else
+ Console.WriteLine("Key = ""tif"" is not found.")
+ End If
+ '
+
+ '
+ ' ContainsKey can be used to test keys before inserting
+ ' them.
+ If Not openWith.ContainsKey("ht") Then
+ openWith.Add("ht", "hypertrm.exe")
+ Console.WriteLine("Value added for key = ""ht"": {0}", _
+ openWith("ht"))
+ End If
+ '
+
+ '
+ ' When you use foreach to enumerate dictionary elements,
+ ' the elements are retrieved as KeyValuePair objects.
+ Console.WriteLine()
+ For Each kvp As KeyValuePair(Of String, String) In openWith
+ Console.WriteLine("Key = {0}, Value = {1}", _
+ kvp.Key, kvp.Value)
+ Next
+ '
+
+ '
+ ' To get the values alone, use the Values property.
+ Dim ivals As ICollection(Of String) = openWith.Values
+
+ ' The elements of the ICollection(Of String) are strongly typed
+ ' with the type that was specified for dictionary values.
+ Console.WriteLine()
+ For Each s As String In ivals
+ Console.WriteLine("Value = {0}", s)
+ Next s
+ '
+
+ '
+ ' To get the keys alone, use the Keys property.
+ Dim ikeys As ICollection(Of String) = openWith.Keys
+
+ ' The elements of the ICollection(Of String) are strongly typed
+ ' with the type that was specified for dictionary keys.
+ Console.WriteLine()
+ For Each s As String In ikeys
+ Console.WriteLine("Key = {0}", s)
+ Next s
+ '
+
+ '
+ ' Use the Remove method to remove a key/value pair.
+ Console.WriteLine(vbLf + "Remove(""dib"")")
+ openWith.Remove("dib")
+
+ If Not openWith.ContainsKey("dib") Then
+ Console.WriteLine("Key ""dib"" is not found.")
+ End If
+ '
+
+ End Sub
+
+End Class
+
+' Example for Snippet11 - separate from main example
+Public Class Snippet11Example
Public Shared Sub Main()
- ' Create a new dictionary of strings, with string keys.
+ ' Create a new dictionary of strings, with integer keys.
'
Dim exDictionary As New Dictionary(Of Integer, String)
@@ -13,11 +140,13 @@ Public Class Example
exDictionary.Add(2, "paint.exe")
exDictionary.Add(3, "wordpad.exe")
Dim myDictionary As IDictionary(Of Integer, String) = exDictionary
+
'
For Each kvp As KeyValuePair(Of Integer, String) In myDictionary
Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value)
Next kvp
'
+
End Sub
End Class
-
+'
diff --git a/xml/System.Collections.Generic/IDictionary`2.xml b/xml/System.Collections.Generic/IDictionary`2.xml
index f42ae62b808..1c05e6f8a5c 100644
--- a/xml/System.Collections.Generic/IDictionary`2.xml
+++ b/xml/System.Collections.Generic/IDictionary`2.xml
@@ -113,7 +113,7 @@
Finally, the example shows how to enumerate the keys and values in the dictionary, and how to enumerate the values alone using the property.
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" interactive="try-dotnet" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet1":::
]]>
@@ -188,7 +188,7 @@
This code is part of a larger example that can be compiled and executed. See .
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet2":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet2":::
]]>
@@ -260,11 +260,11 @@
This code is part of a larger example that can be compiled and executed. See .
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet6":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet5":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet5":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet4":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet4":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet4":::
]]>
@@ -341,11 +341,11 @@
This code is part of a larger example that can be compiled and executed. See .
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet3":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet4":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet4":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet5":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet5":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet5":::
]]>
@@ -413,7 +413,7 @@
This code is part of a larger example that can be compiled and executed. See .
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet9":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet9":::
]]>
@@ -480,7 +480,7 @@
This code is part of a larger example that can be compiled and executed. See .
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet10":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet10":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet10":::
]]>
@@ -561,9 +561,9 @@
This code is part of a larger example that can be compiled and executed. See .
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet5":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet4":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet4":::
+:::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet4":::
]]>
@@ -628,7 +628,7 @@
This code is part of a larger example that can be compiled and executed. See .
:::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Generic.IDictionary/VB/source.vb" id="Snippet8":::
+ :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet8":::
]]>
From 353d350e7381c2784bb3214e78c82a061c84dce4 Mon Sep 17 00:00:00 2001
From: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Date: Fri, 20 Jun 2025 18:06:15 +0200
Subject: [PATCH 12/13] Reinstate snippet output
---
.../IDictionaryTKey,TValue/Overview/source.vb | 36 ++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb
index 8df9f8a8e48..b786c659469 100644
--- a/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb
+++ b/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb
@@ -126,6 +126,41 @@ Public Class Example
End Class
+' This code example produces the following output:
+'
+'An element with Key = "txt" already exists.
+'For key = "rtf", value = wordpad.exe.
+'For key = "rtf", value = winword.exe.
+'Key = "tif" is not found.
+'Key = "tif" is not found.
+'Value added for key = "ht": hypertrm.exe
+'
+'Key = txt, Value = notepad.exe
+'Key = bmp, Value = paint.exe
+'Key = dib, Value = paint.exe
+'Key = rtf, Value = winword.exe
+'Key = doc, Value = winword.exe
+'Key = ht, Value = hypertrm.exe
+'
+'Value = notepad.exe
+'Value = paint.exe
+'Value = paint.exe
+'Value = winword.exe
+'Value = winword.exe
+'Value = hypertrm.exe
+'
+'Key = txt
+'Key = bmp
+'Key = dib
+'Key = rtf
+'Key = doc
+'Key = ht
+'
+'Remove("doc")
+'Key "doc" is not found.
+
+'
+
' Example for Snippet11 - separate from main example
Public Class Snippet11Example
Public Shared Sub Main()
@@ -149,4 +184,3 @@ Public Class Snippet11Example
End Sub
End Class
-'
From fe3f607e3355dff8602d3b563f683173ce420639 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 20 Jun 2025 16:21:28 +0000
Subject: [PATCH 13/13] Fix build error by removing empty
SortedListTKey,TValue/Constructor directory
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
---
.../SortedListTKey,TValue/Constructor/Project.vbproj | 8 --------
1 file changed, 8 deletions(-)
delete mode 100644 snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Constructor/Project.vbproj
diff --git a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Constructor/Project.vbproj b/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Constructor/Project.vbproj
deleted file mode 100644
index d50c0e10aeb..00000000000
--- a/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Constructor/Project.vbproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Exe
- net8.0
-
-
-
\ No newline at end of file