From d0584fa6368c43517b2768ce10068aaaa17bf5ef Mon Sep 17 00:00:00 2001
From: albert-du <52804499+albert-du@users.noreply.github.com>
Date: Sun, 26 Dec 2021 21:16:04 -0800
Subject: [PATCH] System.Buffer F# snippets
---
.../system.Buffer.BlockCopy/FS/bcopy.fs | 132 ++++++++++++++++++
.../system.Buffer.BlockCopy/FS/buffer.fs | 55 ++++++++
.../system.Buffer.BlockCopy/FS/fs.fsproj | 11 ++
.../system.Buffer.BlockCopy/FS/overlap1.fs | 31 ++++
.../system.Buffer.Bytes/FS/bytelength.fs | 49 +++++++
.../system.Buffer.Bytes/FS/fs.fsproj | 11 ++
.../system.Buffer.Bytes/FS/getbyte.fs | 74 ++++++++++
.../system.Buffer.Bytes/FS/setbyte.fs | 60 ++++++++
xml/System/Buffer.xml | 7 +
9 files changed, 430 insertions(+)
create mode 100644 samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/bcopy.fs
create mode 100644 samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/buffer.fs
create mode 100644 samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/fs.fsproj
create mode 100644 samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/overlap1.fs
create mode 100644 samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/bytelength.fs
create mode 100644 samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/fs.fsproj
create mode 100644 samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/getbyte.fs
create mode 100644 samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/setbyte.fs
diff --git a/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/bcopy.fs b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/bcopy.fs
new file mode 100644
index 00000000000..e851b80a3a2
--- /dev/null
+++ b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/bcopy.fs
@@ -0,0 +1,132 @@
+module bcopy
+
+//
+open System
+
+// Display the individual bytes in the array in hexadecimal.
+let displayArray (arr: 'a []) (name: string) =
+ Console.WindowWidth <- 120
+ printf $"%11s{name}:"
+ for i = 0 to arr.Length - 1 do
+ let bytes =
+ match box arr with
+ | :? array ->
+ BitConverter.GetBytes(box arr[i] :?> int64)
+ | _ ->
+ BitConverter.GetBytes(box arr[i] :?> int16)
+ for byteValue in bytes do
+ printf $" %02X{byteValue}"
+ printfn ""
+
+// Display the individual array element values in hexadecimal.
+let inline displayArrayValues (arr: ^a []) name =
+ // Get the length of one element in the array.
+ let elementLength = Buffer.ByteLength arr / arr.Length
+ printf $"%11s{name}:"
+ for value in arr do
+ printf " %0*X" (2 * elementLength) value
+ printfn ""
+
+// These are the source and destination arrays for BlockCopy.
+let src =
+ [| 258s; 259s; 260s; 261s; 262s; 263s; 264s
+ 265s; 266s; 267s; 268s; 269s; 270s |]
+
+let dest =
+ [| 17L; 18L; 19L; 20L |]
+
+// Display the initial value of the arrays in memory.
+printfn "Initial values of arrays:"
+printfn " Array values as Bytes:"
+displayArray src "src"
+displayArray dest "dest"
+printfn " Array values:"
+displayArrayValues src "src"
+displayArrayValues dest "dest"
+printfn ""
+
+// Copy bytes 5-10 from source to index 7 in destination and display the result.
+Buffer.BlockCopy(src, 5, dest, 7, 6)
+printfn "Buffer.BlockCopy(src, 5, dest, 7, 6 )"
+printfn " Array values as Bytes:"
+displayArray src "src"
+displayArray dest "dest"
+printfn " Array values:"
+displayArrayValues src "src"
+displayArrayValues dest "dest"
+printfn ""
+
+// Copy bytes 16-20 from source to index 22 in destination and display the result.
+Buffer.BlockCopy(src, 16, dest, 22, 5)
+printfn "Buffer.BlockCopy(src, 16, dest, 22, 5)"
+printfn " Array values as Bytes:"
+displayArray src "src"
+displayArray dest "dest"
+printfn " Array values:"
+displayArrayValues src "src"
+displayArrayValues dest "dest"
+printfn ""
+
+// Copy overlapping range of bytes 4-10 to index 5 in source.
+Buffer.BlockCopy(src, 4, src, 5, 7)
+printfn "Buffer.BlockCopy(src, 4, src, 5, 7)"
+printfn " Array values as Bytes:"
+displayArray src "src"
+displayArray dest "dest"
+printfn " Array values:"
+displayArrayValues src "src"
+displayArrayValues dest "dest"
+printfn ""
+
+// Copy overlapping range of bytes 16-22 to index 15 in source.
+Buffer.BlockCopy(src, 16, src, 15, 7)
+printfn "Buffer.BlockCopy(src, 16, src, 15, 7)"
+printfn " Array values as Bytes:"
+displayArray src "src"
+displayArray dest "dest"
+printfn " Array values:"
+displayArrayValues src "src"
+displayArrayValues dest "dest"
+
+
+// The example displays the following output:
+// Initial values of arrays:
+// Array values as Bytes:
+// src: 02 01 03 01 04 01 05 01 06 01 07 01 08 01 09 01 0A 01 0B 01 0C 01 0D 01 0E 01
+// dest: 11 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00
+// Array values:
+// src: 0102 0103 0104 0105 0106 0107 0108 0109 010A 010B 010C 010D 010E
+// dest: 0000000000000011 0000000000000012 0000000000000013 0000000000000014
+//
+// Buffer.BlockCopy(src, 5, dest, 7, 6 )
+// Array values as Bytes:
+// src: 02 01 03 01 04 01 05 01 06 01 07 01 08 01 09 01 0A 01 0B 01 0C 01 0D 01 0E 01
+// dest: 11 00 00 00 00 00 00 01 05 01 06 01 07 00 00 00 13 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00
+// Array values:
+// src: 0102 0103 0104 0105 0106 0107 0108 0109 010A 010B 010C 010D 010E
+// dest: 0100000000000011 0000000701060105 0000000000000013 0000000000000014
+//
+// Buffer.BlockCopy(src, 16, dest, 22, 5)
+// Array values as Bytes:
+// src: 02 01 03 01 04 01 05 01 06 01 07 01 08 01 09 01 0A 01 0B 01 0C 01 0D 01 0E 01
+// dest: 11 00 00 00 00 00 00 01 05 01 06 01 07 00 00 00 13 00 00 00 00 00 0A 01 0B 01 0C 00 00 00 00 00
+// Array values:
+// src: 0102 0103 0104 0105 0106 0107 0108 0109 010A 010B 010C 010D 010E
+// dest: 0100000000000011 0000000701060105 010A000000000013 00000000000C010B
+//
+// Buffer.BlockCopy(src, 4, src, 5, 7)
+// Array values as Bytes:
+// src: 02 01 03 01 04 04 01 05 01 06 01 07 08 01 09 01 0A 01 0B 01 0C 01 0D 01 0E 01
+// dest: 11 00 00 00 00 00 00 01 05 01 06 01 07 00 00 00 13 00 00 00 00 00 0A 01 0B 01 0C 00 00 00 00 00
+// Array values:
+// src: 0102 0103 0404 0501 0601 0701 0108 0109 010A 010B 010C 010D 010E
+// dest: 0100000000000011 0000000701060105 010A000000000013 00000000000C010B
+//
+// Buffer.BlockCopy(src, 16, src, 15, 7)
+// Array values as Bytes:
+// src: 02 01 03 01 04 04 01 05 01 06 01 07 08 01 09 0A 01 0B 01 0C 01 0D 0D 01 0E 01
+// dest: 11 00 00 00 00 00 00 01 05 01 06 01 07 00 00 00 13 00 00 00 00 00 0A 01 0B 01 0C 00 00 00 00 00
+// Array values:
+// src: 0102 0103 0404 0501 0601 0701 0108 0A09 0B01 0C01 0D01 010D 010E
+// dest: 0100000000000011 0000000701060105 010A000000000013 00000000000C010B
+//
\ No newline at end of file
diff --git a/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/buffer.fs b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/buffer.fs
new file mode 100644
index 00000000000..8d144ee98a2
--- /dev/null
+++ b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/buffer.fs
@@ -0,0 +1,55 @@
+module buffer
+
+//
+open System
+
+// Display the array elements from right to left in hexadecimal.
+let displayArray (arr: int16 []) =
+ printf " arr:"
+ for i = arr.Length - 1 downto 0 do
+ printf $" {arr[i]:X4}"
+ printfn ""
+
+// This array is to be modified and displayed.
+let arr =
+ [| 258s; 259s; 260s; 261s; 262s; 263s; 264s
+ 265s; 266s; 267s; 268s; 269s; 270s; 271s |]
+
+printfn "This example of the Buffer class methods generates the following output.\nNote: The array is displayed from right to left.\n"
+printfn "Initial values of array:\n"
+
+// Display the initial array values and ByteLength.
+displayArray arr
+printfn $"\nBuffer.ByteLength(arr): {Buffer.ByteLength arr}"
+
+// Copy a region of the array; set a byte within the array.
+printfn "\nCall these methods: \n Buffer.BlockCopy(arr, 5, arr, 16, 9),\n Buffer.SetByte(arr, 7, 170).\n"
+
+Buffer.BlockCopy(arr, 5, arr, 16, 9)
+Buffer.SetByte(arr, 7, 170uy)
+
+// Display the array and a byte within the array.
+printfn "Final values of array:\n"
+displayArray arr
+printfn $"\nBuffer.GetByte(arr, 26): {Buffer.GetByte(arr, 26)}"
+
+
+// This example of the Buffer class methods generates the following output.
+// Note: The array is displayed from right to left.
+//
+// Initial values of array:
+//
+// arr: 010F 010E 010D 010C 010B 010A 0109 0108 0107 0106 0105 0104 0103 0102
+//
+// Buffer.ByteLength(arr): 28
+//
+// Call these methods:
+// Buffer.BlockCopy(arr, 5, arr, 16, 9),
+// Buffer.SetByte(arr, 7, 170).
+//
+// Final values of array:
+//
+// arr: 010F 0101 0801 0701 0601 0501 0109 0108 0107 0106 AA05 0104 0103 0102
+//
+// Buffer.GetByte(arr, 26): 15
+//
\ No newline at end of file
diff --git a/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/fs.fsproj b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/fs.fsproj
new file mode 100644
index 00000000000..f5651fa858b
--- /dev/null
+++ b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/fs.fsproj
@@ -0,0 +1,11 @@
+
+
+ Exe
+ net6.0
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/overlap1.fs b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/overlap1.fs
new file mode 100644
index 00000000000..017bf26542d
--- /dev/null
+++ b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/overlap1.fs
@@ -0,0 +1,31 @@
+module overlap1
+
+open System
+
+let copyUp () =
+ //
+ let intSize = 4
+ let arr = [| 2; 4; 6; 8; 10; 12; 14; 16; 18; 20 |]
+ Buffer.BlockCopy(arr, 0 * intSize, arr, 3 * intSize, 4 * intSize)
+ for value in arr do
+ printf $"{value} "
+
+ // The example displays the following output:
+ // 2 4 6 2 4 6 8 16 18 20
+ //
+
+let copyDown () =
+ //
+ let intSize = 4
+ let arr = [| 2; 4; 6; 8; 10; 12; 14; 16; 18; 20 |]
+ Buffer.BlockCopy(arr, 3 * intSize, arr, 0 * intSize, 4 * intSize)
+ for value in arr do
+ printf $"{value} "
+
+ // The example displays the following output:
+ // 8 10 12 14 10 12 14 16 18 20
+ //
+
+copyUp ()
+printfn ""
+copyDown ()
\ No newline at end of file
diff --git a/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/bytelength.fs b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/bytelength.fs
new file mode 100644
index 00000000000..c51d1d077f7
--- /dev/null
+++ b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/bytelength.fs
@@ -0,0 +1,49 @@
+module bytelength
+
+//
+open System
+
+let print obj1 obj2 obj3 obj4 =
+ printfn $"{obj1,10}{obj2,20}{obj3,9}{obj4,12}"
+
+let arrayInfo (arr: Array) name =
+ let byteLength = Buffer.ByteLength arr
+
+ // Display the array name, type, Length, and ByteLength.
+ print name (arr.GetType()) arr.Length byteLength
+
+let bytes = [| 1uy; 2uy; 3uy; 4uy; 5uy; 6uy; 7uy; 8uy; 9uy; 0uy |]
+let bools = [| true; false; true; false; true |]
+let chars = [| ' '; '$'; '\"'; 'A'; '{' |]
+let shorts = [| 258s; 259s; 260s; 261s; 262s; 263s |]
+let singles = [| 1f; 678f; 2.37E33f; 0.00415f; 8.9f |]
+let doubles = [| 2E-22; 0.003; 4.4E44; 555E55 |]
+let longs = [| 1L; 10L; 100L; 1000L; 10000L; 100000L |]
+
+printfn "This example of the Buffer.ByteLength(Array) \nmethod generates the following output.\n"
+print "Array name" "Array type" "Length" "ByteLength"
+print "----------" "----------" "------" "----------"
+
+// Display the Length and ByteLength for each array.
+arrayInfo bytes "bytes"
+arrayInfo bools "bools"
+arrayInfo chars "chars"
+arrayInfo shorts "shorts"
+arrayInfo singles "singles"
+arrayInfo doubles "doubles"
+arrayInfo longs "longs"
+
+
+// This example of the Buffer.ByteLength(Array)
+// method generates the following output.
+//
+// Array name Array type Length ByteLength
+// ---------- ---------- ------ ----------
+// bytes System.Byte[] 10 10
+// bools System.Boolean[] 5 5
+// chars System.Char[] 5 10
+// shorts System.Int16[] 6 12
+// singles System.Single[] 5 20
+// doubles System.Double[] 4 32
+// longs System.Int64[] 6 48
+//
\ No newline at end of file
diff --git a/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/fs.fsproj b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/fs.fsproj
new file mode 100644
index 00000000000..9442be046b8
--- /dev/null
+++ b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/fs.fsproj
@@ -0,0 +1,11 @@
+
+
+ Exe
+ net6.0
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/getbyte.fs b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/getbyte.fs
new file mode 100644
index 00000000000..580ba3976ad
--- /dev/null
+++ b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/getbyte.fs
@@ -0,0 +1,74 @@
+module getbyte
+
+//
+open System
+
+let print obj1 obj2 obj3 obj4 = printfn $"{obj1,10}{obj2,10}{obj3,9} {obj4}"
+
+// Display the array contents in hexadecimal.
+let inline displayArray (arr: ^a []) name =
+ // Get the array element width; format the formatting string.
+ let elemWidth = Buffer.ByteLength arr / arr.Length
+
+ // Display the array elements from right to left.
+ printf $"{name,5}:"
+ for i = arr.Length - 1 downto 0 do
+ printf " %0*X" (2 * elemWidth) arr[i]
+ printfn ""
+
+let arrayInfo (arr: Array) name index =
+ let value = Buffer.GetByte(arr, index)
+
+ // Display the array name, index, and byte to be viewed.
+ print name index value $"0x{value:X2}"
+
+// These are the arrays to be viewed with GetByte.
+let longs =
+ [| 333333333333333333L; 666666666666666666L; 999999999999999999L |]
+let ints =
+ [| 111111111; 222222222; 333333333; 444444444; 555555555 |]
+
+printfn "This example of the Buffer.GetByte(Array, int) \nmethod generates the following output.\nNote: The arrays are displayed from right to left.\n"
+printfn " Values of arrays:\n"
+
+// Display the values of the arrays.
+displayArray longs "longs"
+displayArray ints "ints"
+printfn ""
+
+print "Array" "index" "value" ""
+print "-----" "-----" "-----" "----"
+
+// Display the Length and ByteLength for each array.
+arrayInfo ints "ints" 0
+arrayInfo ints "ints" 7
+arrayInfo ints "ints" 10
+arrayInfo ints "ints" 17
+arrayInfo longs "longs" 0
+arrayInfo longs "longs" 6
+arrayInfo longs "longs" 10
+arrayInfo longs "longs" 17
+arrayInfo longs "longs" 21
+
+
+// This example of the Buffer.GetByte( Array, int )
+// method generates the following output.
+// Note: The arrays are displayed from right to left.
+//
+// Values of arrays:
+//
+// longs: 0DE0B6B3A763FFFF 094079CD1A42AAAA 04A03CE68D215555
+// ints: 211D1AE3 1A7DAF1C 13DE4355 0D3ED78E 069F6BC7
+//
+// Array index value
+// ----- ----- ----- ----
+// ints 0 199 0xC7
+// ints 7 13 0x0D
+// ints 10 222 0xDE
+// ints 17 26 0x1A
+// longs 0 85 0x55
+// longs 6 160 0xA0
+// longs 10 66 0x42
+// longs 17 255 0xFF
+// longs 21 182 0xB6
+//
\ No newline at end of file
diff --git a/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/setbyte.fs b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/setbyte.fs
new file mode 100644
index 00000000000..eb6e677c9de
--- /dev/null
+++ b/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/setbyte.fs
@@ -0,0 +1,60 @@
+module setbyte
+
+//
+open System
+
+// Display the array contents in hexadecimal.
+let inline displayArray (arr: ^a []) name =
+ // Get the array element width; format the formatting string.
+ let elemWidth = Buffer.ByteLength arr / arr.Length
+
+ // Display the array elements from right to left.
+ printf $"{name,5}:"
+ for i = arr.Length - 1 downto 0 do
+ printf " %0*X" (2 * elemWidth) arr[i]
+ printfn ""
+
+// These are the arrays to be modified with SetByte.
+let shorts = Array.zeroCreate 10
+let longs = Array.zeroCreate 3
+
+printfn "This example of the Buffer.SetByte(Array, int, byte) \nmethod generates the following output.\nNote: The arrays are displayed from right to left.\n"
+printfn " Initial values of arrays:\n"
+
+// Display the initial values of the arrays.
+displayArray shorts "shorts"
+displayArray longs "longs"
+
+// Copy two regions of source array to destination array,
+// and two overlapped copies from source to source.
+printfn "\n Array values after setting byte 3 = 25, \n byte 6 = 64, byte 12 = 121, and byte 17 = 196:\n"
+
+Buffer.SetByte(shorts, 3, 25uy)
+Buffer.SetByte(shorts, 6, 64uy)
+Buffer.SetByte(shorts, 12, 121uy)
+Buffer.SetByte(shorts, 17, 196uy)
+Buffer.SetByte(longs, 3, 25uy)
+Buffer.SetByte(longs, 6, 64uy)
+Buffer.SetByte(longs, 12, 121uy)
+Buffer.SetByte(longs, 17, 196uy)
+
+// Display the arrays again.
+displayArray shorts "shorts"
+displayArray longs "longs"
+
+
+// This example of the Buffer.SetByte( Array, int, byte )
+// method generates the following output.
+// Note: The arrays are displayed from right to left.
+//
+// Initial values of arrays:
+//
+// shorts: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+// longs: 0000000000000000 0000000000000000 0000000000000000
+//
+// Array values after setting byte 3 = 25,
+// byte 6 = 64, byte 12 = 121, and byte 17 = 196:
+//
+// shorts: 0000 C400 0000 0079 0000 0000 0040 0000 1900 0000
+// longs: 000000000000C400 0000007900000000 0040000019000000
+//
\ No newline at end of file
diff --git a/xml/System/Buffer.xml b/xml/System/Buffer.xml
index 9c32deef52a..bc7139df1ce 100644
--- a/xml/System/Buffer.xml
+++ b/xml/System/Buffer.xml
@@ -67,6 +67,7 @@
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CPP/buffer.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/buffer.cs" interactive="try-dotnet" id="Snippet1":::
+ :::code language="fsharp" source="~/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/buffer.fs" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Buffer.BlockCopy/VB/buffer.vb" id="Snippet1":::
]]>
@@ -140,12 +141,14 @@
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CPP/overlap1.cpp" id="Snippet3":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/overlap1.cs" interactive="try-dotnet-method" id="Snippet3":::
+ :::code language="fsharp" source="~/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/overlap1.fs" id="Snippet3":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Buffer.BlockCopy/VB/overlap1.vb" id="Snippet3":::
In the following example, the values of bytes 12-28 in an array named `arr` are copied to bytes 0-16. Again, despite the overlapping range, the values of the source bytes are successfully copied.
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CPP/overlap1.cpp" id="Snippet4":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/overlap1.cs" interactive="try-dotnet-method" id="Snippet4":::
+ :::code language="fsharp" source="~/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/overlap1.fs" id="Snippet4":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Buffer.BlockCopy/VB/overlap1.vb" id="Snippet4":::
@@ -155,6 +158,7 @@
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CPP/bcopy.cpp" id="Snippet2":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/bcopy.cs" id="Snippet2":::
+ :::code language="fsharp" source="~/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/bcopy.fs" id="Snippet2":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Buffer.BlockCopy/VB/bcopy.vb" id="Snippet2":::
]]>
@@ -231,6 +235,7 @@
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Buffer.Bytes/CPP/bytelength.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/bytelength.cs" interactive="try-dotnet" id="Snippet1":::
+ :::code language="fsharp" source="~/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/bytelength.fs" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Buffer.Bytes/VB/bytelength.vb" id="Snippet1":::
]]>
@@ -306,6 +311,7 @@
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Buffer.Bytes/CPP/getbyte.cpp" id="Snippet3":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/getbyte.cs" id="Snippet3":::
+ :::code language="fsharp" source="~/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/getbyte.fs" id="Snippet3":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Buffer.Bytes/VB/getbyte.vb" id="Snippet3":::
]]>
@@ -527,6 +533,7 @@
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Buffer.Bytes/CPP/setbyte.cpp" id="Snippet2":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/setbyte.cs" interactive="try-dotnet" id="Snippet2":::
+ :::code language="fsharp" source="~/samples/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.Bytes/FS/setbyte.fs" id="Snippet2":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Buffer.Bytes/VB/setbyte.vb" id="Snippet2":::
]]>