|
246 | 246 | ## Examples
|
247 | 247 | The following example passes each string listed in the Remarks section to the <xref:System.Guid.%23ctor%28System.String%29> constructor.
|
248 | 248 |
|
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)] |
250 | 250 | [!code-vb[System.Guid.ctor#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.ctor/vb/ctor1.vb#1)]
|
251 | 251 |
|
252 | 252 | ]]></format>
|
|
380 | 380 | ## Examples
|
381 | 381 | The following example creates a GUID whose string representation is "0000000a-000b-000c-0001-020304050607".
|
382 | 382 |
|
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)] |
384 | 384 | [!code-vb[System.Guid.Ctor#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.ctor/vb/ctor2.vb#2)]
|
385 | 385 |
|
386 | 386 | ]]></format>
|
|
698 | 698 | ## Remarks
|
699 | 699 | 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.
|
700 | 700 |
|
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)] |
702 | 702 | [!code-vb[System.Guid.Empty#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.empty/vb/empty.vb#1)]
|
703 | 703 |
|
704 | 704 | ]]></format>
|
|
918 | 918 |
|
919 | 919 | ## Examples
|
920 | 920 | 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)] |
923 | 923 | [!code-vb[system.guid.newguid#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.newguid/vb/ng.vb#1)]
|
924 | 924 |
|
925 | 925 | ]]></format>
|
|
975 | 975 | ## Examples
|
976 | 976 | 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.
|
977 | 977 |
|
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)] |
979 | 979 | [!code-vb[System.Guid.Empty#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.empty/vb/empty.vb#1)]
|
980 | 980 |
|
981 | 981 | ]]></format>
|
@@ -1161,12 +1161,10 @@ After trimming, the length of the read-only character span is 0.</exception>
|
1161 | 1161 |
|
1162 | 1162 | Use the <xref:System.Guid.TryParse%2A> method to catch any unsuccessful parse operations without having to handle an exception.
|
1163 | 1163 |
|
1164 |
| - |
1165 |
| - |
1166 | 1164 | ## Examples
|
1167 | 1165 | 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.
|
1168 | 1166 |
|
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)] |
1170 | 1168 | [!code-vb[System.Guid.Parse#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.parse/vb/parseex1.vb#3)]
|
1171 | 1169 |
|
1172 | 1170 | ]]></format>
|
@@ -1284,12 +1282,10 @@ The <xref:System.Guid.ParseExact%2A> method requires the read-only character spa
|
1284 | 1282 | |P|32 digits separated by hyphens, enclosed in parentheses:<br /><br /> (00000000-0000-0000-0000-000000000000)|
|
1285 | 1283 | |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}}|
|
1286 | 1284 |
|
1287 |
| - |
1288 |
| - |
1289 | 1285 | ## Examples
|
1290 | 1286 | 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.
|
1291 | 1287 |
|
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)] |
1293 | 1289 | [!code-vb[System.Guid.Parse#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.parse/vb/parseexactex1.vb#4)]
|
1294 | 1290 |
|
1295 | 1291 | ]]></format>
|
@@ -1470,7 +1466,7 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust
|
1470 | 1466 | ## Examples
|
1471 | 1467 | 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.
|
1472 | 1468 |
|
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)] |
1474 | 1470 | [!code-vb[System.Guid.ToByteArray#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.tobytearray/vb/tobytearray3.vb#1)]
|
1475 | 1471 |
|
1476 | 1472 | ]]></format>
|
@@ -1806,7 +1802,7 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust
|
1806 | 1802 | ## Examples
|
1807 | 1803 | 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.
|
1808 | 1804 |
|
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)] |
1810 | 1806 | [!code-vb[System.Guid.Parse#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.parse/vb/tryparseex1.vb#2)]
|
1811 | 1807 |
|
1812 | 1808 | ]]></format>
|
@@ -1915,8 +1911,8 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust
|
1915 | 1911 |
|
1916 | 1912 | ## Examples
|
1917 | 1913 | 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)] |
1920 | 1916 | [!code-vb[System.Guid.Parse#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.guid.parse/vb/tryparseexactex1.vb#5)]
|
1921 | 1917 |
|
1922 | 1918 | ]]></format>
|
|
0 commit comments