Skip to content

Commit e272112

Browse files
Guid.xml updates for Try .NET (#3393)
* updating for Try .NET * addressing review comments * adding interactivity notes * Update xml/System/Guid.xml Co-Authored-By: Maira Wenzel <[email protected]> * Update xml/System/Guid.xml Co-Authored-By: Maira Wenzel <[email protected]> * Update xml/System/Guid.xml Co-Authored-By: Maira Wenzel <[email protected]> * Update xml/System/Guid.xml Co-Authored-By: Maira Wenzel <[email protected]> * Update xml/System/Guid.xml Co-Authored-By: Maira Wenzel <[email protected]> * Update xml/System/Guid.xml Co-Authored-By: Maira Wenzel <[email protected]> * addressing last 3 review comments * remove try.net notes * fix members * remove empty remarks Co-authored-by: Maira Wenzel <[email protected]>
1 parent dbfdabc commit e272112

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

xml/System/Guid.xml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
## Examples
247247
The following example passes each string listed in the Remarks section to the <xref:System.Guid.%23ctor%28System.String%29> constructor.
248248
249-
[!code-csharp[System.Guid.ctor#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.ctor/cs/ctor1.cs#1)]
249+
[!code-csharp-interactive[System.Guid.ctor#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.ctor/cs/ctor1.cs#1)]
250250
[!code-vb[System.Guid.ctor#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.ctor/vb/ctor1.vb#1)]
251251
252252
]]></format>
@@ -380,7 +380,7 @@
380380
## Examples
381381
The following example creates a GUID whose string representation is "0000000a-000b-000c-0001-020304050607".
382382
383-
[!code-csharp[System.Guid.Ctor#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.ctor/cs/ctor2.cs#2)]
383+
[!code-csharp-interactive[System.Guid.Ctor#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.ctor/cs/ctor2.cs#2)]
384384
[!code-vb[System.Guid.Ctor#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.ctor/vb/ctor2.vb#2)]
385385
386386
]]></format>
@@ -698,7 +698,7 @@
698698
## Remarks
699699
You can compare a GUID with the value of the <xref:System.Guid.Empty?displayProperty=nameWithType> field to determine whether a GUID is non-zero. The following example uses the <xref:System.Guid.op_Equality%2A> operator to compare two GUID values with <xref:System.Guid.Empty?displayProperty=nameWithType> to determine whether they consist exclusively of zeros.
700700
701-
[!code-csharp[System.Guid.Empty#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.empty/cs/empty.cs#1)]
701+
[!code-csharp-interactive[System.Guid.Empty#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.empty/cs/empty.cs#1)]
702702
[!code-vb[System.Guid.Empty#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.empty/vb/empty.vb#1)]
703703
704704
]]></format>
@@ -918,8 +918,8 @@
918918
919919
## Examples
920920
The following code example creates and displays the values of two <xref:System.Guid> objects.
921-
922-
[!code-csharp[system.guid.newguid#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.newguid/cs/ng.cs#1)]
921+
922+
[!code-csharp-interactive[system.guid.newguid#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.newguid/cs/ng.cs#1)]
923923
[!code-vb[system.guid.newguid#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.newguid/vb/ng.vb#1)]
924924
925925
]]></format>
@@ -975,7 +975,7 @@
975975
## Examples
976976
The following example uses the <xref:System.Guid.op_Equality%2A> operator to compare two GUID values with <xref:System.Guid.Empty?displayProperty=nameWithType> to determine whether they consist exclusively of zeros.
977977
978-
[!code-csharp[System.Guid.Empty#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.empty/cs/empty.cs#1)]
978+
[!code-csharp-interactive[System.Guid.Empty#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.empty/cs/empty.cs#1)]
979979
[!code-vb[System.Guid.Empty#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.empty/vb/empty.vb#1)]
980980
981981
]]></format>
@@ -1161,12 +1161,10 @@ After trimming, the length of the read-only character span is 0.</exception>
11611161
11621162
Use the <xref:System.Guid.TryParse%2A> method to catch any unsuccessful parse operations without having to handle an exception.
11631163
1164-
1165-
11661164
## Examples
11671165
The following example creates a new GUID, converts it to three separate string representations by calling the <xref:System.Guid.ToString%28System.String%29> method with the "B", "D", and "X" format specifiers, and then calls the <xref:System.Guid.Parse%2A> method to convert the strings back to <xref:System.Guid> values.
11681166
1169-
[!code-csharp[System.Guid.Parse#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.parse/cs/parseex1.cs#3)]
1167+
[!code-csharp-interactive[System.Guid.Parse#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.parse/cs/parseex1.cs#3)]
11701168
[!code-vb[System.Guid.Parse#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.parse/vb/parseex1.vb#3)]
11711169
11721170
]]></format>
@@ -1284,12 +1282,10 @@ The <xref:System.Guid.ParseExact%2A> method requires the read-only character spa
12841282
|P|32 digits separated by hyphens, enclosed in parentheses:<br /><br /> (00000000-0000-0000-0000-000000000000)|
12851283
|X|Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces:<br /><br /> {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}|
12861284
1287-
1288-
12891285
## Examples
12901286
The following example calls the <xref:System.Guid.ToString%28System.String%29> method with each of the supported format specifiers to generate an array of strings that represent a single GUID. These are then passed to the <xref:System.Guid.ParseExact%2A> method, which successfully parses only the string that conforms to the "B" format specifier.
12911287
1292-
[!code-csharp[System.Guid.Parse#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.parse/cs/parseexactex1.cs#4)]
1288+
[!code-csharp-interactive[System.Guid.Parse#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.parse/cs/parseexactex1.cs#4)]
12931289
[!code-vb[System.Guid.Parse#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.parse/vb/parseexactex1.vb#4)]
12941290
12951291
]]></format>
@@ -1470,7 +1466,7 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust
14701466
## Examples
14711467
The following example calls the <xref:System.Guid.NewGuid%2A> method to create a <xref:System.Guid> value, and then calls the <xref:System.Guid.ToByteArray%2A> method to represent the <xref:System.Guid> value as a byte array. It then displays both values to the console. Finally, it instantiates a new <xref:System.Guid> value from the byte array and calls its <xref:System.Guid.Equals%28System.Guid%29> method to show that the two <xref:System.Guid> values are identical.
14721468
1473-
[!code-csharp[System.Guid.ToByteArray#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.tobytearray/cs/tobytearray3.cs#1)]
1469+
[!code-csharp-interactive[System.Guid.ToByteArray#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.tobytearray/cs/tobytearray3.cs#1)]
14741470
[!code-vb[System.Guid.ToByteArray#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.tobytearray/vb/tobytearray3.vb#1)]
14751471
14761472
]]></format>
@@ -1806,7 +1802,7 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust
18061802
## Examples
18071803
The following example creates a new GUID, converts it to three separate string representations by calling the <xref:System.Guid.ToString%28System.String%29> method with the "B", "D", and "X" format specifiers, and then calls the <xref:System.Guid.TryParse%2A> method to convert the strings back to <xref:System.Guid> values.
18081804
1809-
[!code-csharp[System.Guid.Parse#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.parse/cs/tryparseex1.cs#2)]
1805+
[!code-csharp-interactive[System.Guid.Parse#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.parse/cs/tryparseex1.cs#2)]
18101806
[!code-vb[System.Guid.Parse#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.parse/vb/tryparseex1.vb#2)]
18111807
18121808
]]></format>
@@ -1915,8 +1911,8 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust
19151911
19161912
## Examples
19171913
The following example calls the <xref:System.Guid.ToString%28System.String%29> method with each of the supported format specifiers to generate an array of strings that represent a single GUID. These are then passed to the <xref:System.Guid.TryParseExact%2A> method, which successfully parses the string that conforms to the "B" format specifier.
1918-
1919-
[!code-csharp[System.Guid.Parse#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.parse/cs/tryparseexactex1.cs#5)]
1914+
1915+
[!code-csharp-interactive[System.Guid.Parse#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.guid.parse/cs/tryparseexactex1.cs#5)]
19201916
[!code-vb[System.Guid.Parse#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.parse/vb/tryparseexactex1.vb#5)]
19211917
19221918
]]></format>

0 commit comments

Comments
 (0)