diff --git a/xml/System.Linq/Queryable.xml b/xml/System.Linq/Queryable.xml index 6e4409b9e3b..81b3f58c759 100644 --- a/xml/System.Linq/Queryable.xml +++ b/xml/System.Linq/Queryable.xml @@ -633,9 +633,9 @@ ## Examples The following code example demonstrates how to use to convert an to an . - [!code-csharp[System.Linq.Queryable#125](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#125)] - [!code-vb[System.Linq.Queryable#125](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#125)] - + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs" interactive="try-dotnet-method" id="Snippet125"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb" id="Snippet125"::: + ]]> diff --git a/xml/System/Array.xml b/xml/System/Array.xml index aea170e8195..aa11e48afd2 100644 --- a/xml/System/Array.xml +++ b/xml/System/Array.xml @@ -1411,9 +1411,9 @@ ## Examples The following code example defines a method named `PointFToPoint` that converts a structure to a structure. The example then creates an array 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-cpp[Array_ConvertAll#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_ConvertAll/cpp/source.cpp#1)] - [!code-csharp[Array_ConvertAll#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_ConvertAll/cs/source.cs#1)] - [!code-vb[Array_ConvertAll#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Array_ConvertAll/vb/source.vb#1)] + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/Array_ConvertAll/cpp/source.cpp" id="Snippet1"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Array_ConvertAll/cs/source.cs" interactive="try-dotnet" id="Snippet1"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/Array_ConvertAll/vb/source.vb" id="Snippet1"::: ]]> @@ -6642,6 +6642,17 @@ int[,,] TDArray = new int[1,1,1]; Sets the specified element in the current to the specified value. + + + @@ -6705,13 +6716,6 @@ int[,,] TDArray = new int[1,1,1]; -## Examples - The following code example demonstrates how to set and get a specific value in a one-dimensional or multidimensional array. - - [!code-cpp[System.Array_GetSetValue#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Array_GetSetValue/CPP/array_getsetvalue.cpp#1)] - [!code-csharp[System.Array_GetSetValue#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs#1)] - [!code-vb[System.Array_GetSetValue#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Array_GetSetValue/VB/array_getsetvalue.vb#1)] - ]]> The current does not have exactly one dimension. @@ -6797,13 +6801,6 @@ int[,,] TDArray = new int[1,1,1]; -## Examples - The following code example demonstrates how to set and get a specific value in a one-dimensional or multidimensional array. - - [!code-cpp[System.Array_GetSetValue#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Array_GetSetValue/CPP/array_getsetvalue.cpp#1)] - [!code-csharp[System.Array_GetSetValue#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs#1)] - [!code-vb[System.Array_GetSetValue#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Array_GetSetValue/VB/array_getsetvalue.vb#1)] - ]]> @@ -6876,13 +6873,6 @@ int[,,] TDArray = new int[1,1,1]; -## Examples - The following code example demonstrates how to set and get a specific value in a one-dimensional or multidimensional array. - - [!code-cpp[System.Array_GetSetValue#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Array_GetSetValue/CPP/array_getsetvalue.cpp#1)] - [!code-csharp[System.Array_GetSetValue#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs#1)] - [!code-vb[System.Array_GetSetValue#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Array_GetSetValue/VB/array_getsetvalue.vb#1)] - ]]> The current does not have exactly one dimension. @@ -6963,13 +6953,6 @@ int[,,] TDArray = new int[1,1,1]; -## Examples - The following code example demonstrates how to set and get a specific value in a one-dimensional or multidimensional array. - - [!code-cpp[System.Array_GetSetValue#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Array_GetSetValue/CPP/array_getsetvalue.cpp#1)] - [!code-csharp[System.Array_GetSetValue#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs#1)] - [!code-vb[System.Array_GetSetValue#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Array_GetSetValue/VB/array_getsetvalue.vb#1)] - ]]> @@ -7044,13 +7027,6 @@ int[,,] TDArray = new int[1,1,1]; -## Examples - The following code example demonstrates how to set and get a specific value in a one-dimensional or multidimensional array. - - [!code-cpp[System.Array_GetSetValue#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Array_GetSetValue/CPP/array_getsetvalue.cpp#1)] - [!code-csharp[System.Array_GetSetValue#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs#1)] - [!code-vb[System.Array_GetSetValue#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Array_GetSetValue/VB/array_getsetvalue.vb#1)] - ]]> The current does not have exactly two dimensions. @@ -7123,13 +7099,6 @@ int[,,] TDArray = new int[1,1,1]; -## Examples - The following code example demonstrates how to set and get a specific value in a one-dimensional or multidimensional array. - - [!code-cpp[System.Array_GetSetValue#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Array_GetSetValue/CPP/array_getsetvalue.cpp#1)] - [!code-csharp[System.Array_GetSetValue#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs#1)] - [!code-vb[System.Array_GetSetValue#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Array_GetSetValue/VB/array_getsetvalue.vb#1)] - ]]> The current does not have exactly two dimensions. @@ -7203,14 +7172,6 @@ int[,,] TDArray = new int[1,1,1]; > If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. - -## Examples - The following code example demonstrates how to set and get a specific value in a one-dimensional or multidimensional array. - - [!code-cpp[System.Array_GetSetValue#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Array_GetSetValue/CPP/array_getsetvalue.cpp#1)] - [!code-csharp[System.Array_GetSetValue#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs#1)] - [!code-vb[System.Array_GetSetValue#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Array_GetSetValue/VB/array_getsetvalue.vb#1)] - ]]> The current does not have exactly three dimensions. @@ -7286,13 +7247,6 @@ int[,,] TDArray = new int[1,1,1]; -## Examples - The following code example demonstrates how to set and get a specific value in a one-dimensional or multidimensional array. - - [!code-cpp[System.Array_GetSetValue#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Array_GetSetValue/CPP/array_getsetvalue.cpp#1)] - [!code-csharp[System.Array_GetSetValue#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs#1)] - [!code-vb[System.Array_GetSetValue#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Array_GetSetValue/VB/array_getsetvalue.vb#1)] - ]]> The current does not have exactly three dimensions. diff --git a/xml/System/Attribute.xml b/xml/System/Attribute.xml index c3b4278b56d..efc0ab93f2a 100644 --- a/xml/System/Attribute.xml +++ b/xml/System/Attribute.xml @@ -279,10 +279,10 @@ When implementing your own class derived from , you can o ## Examples The following code example illustrates the use of the method taking an as a parameter. - - [!code-cpp[IsDefined#1](~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp#1)] - [!code-csharp[IsDefined#1](~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id1.cs#1)] - [!code-vb[IsDefined#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id1.vb#1)] +  + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp" id="Snippet1"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id1.cs" id="Snippet1"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id1.vb" id="Snippet1"::: ]]> @@ -346,10 +346,10 @@ When implementing your own class derived from , you can o ## Examples The following code example illustrates the use of the method taking a as a parameter. - - [!code-cpp[IsDefined#4](~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp#4)] - [!code-csharp[IsDefined#4](~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id4.cs#4)] - [!code-vb[IsDefined#4](~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id4.vb#4)] +  + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp" id="Snippet4"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id4.cs" interactive="try-dotnet" id="Snippet4"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id4.vb" id="Snippet4"::: ]]> @@ -408,10 +408,10 @@ When implementing your own class derived from , you can o ## Examples The following code example illustrates the use of the method taking a as a parameter. - - [!code-cpp[IsDefined#2](~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp#2)] - [!code-csharp[IsDefined#2](~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id2.cs#2)] - [!code-vb[IsDefined#2](~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id2.vb#2)] +  + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp" id="Snippet2"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id2.cs" id="Snippet2"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id2.vb" id="Snippet2"::: ]]> @@ -473,9 +473,9 @@ When implementing your own class derived from , you can o ## Examples The following code example defines a custom parameter class and applies the custom attribute to a method in a derived class and the base of the derived class. The example shows the use of the method to return the attributes. - [!code-cpp[System.Attribute.GetCustomAttribute#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CPP/getcustattrparam.cpp#1)] - [!code-csharp[System.Attribute.GetCustomAttribute#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrparam.cs#1)] - [!code-vb[System.Attribute.GetCustomAttribute#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/VB/getcustattrparam.vb#1)] + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CPP/getcustattrparam.cpp" id="Snippet1"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrparam.cs" interactive="try-dotnet" id="Snippet1"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/VB/getcustattrparam.vb" id="Snippet1"::: ]]> @@ -541,10 +541,10 @@ When implementing your own class derived from , you can o ## Examples The following code example illustrates the use of the method taking an as a parameter. - - [!code-cpp[IsDefined#1](~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp#1)] - [!code-csharp[IsDefined#1](~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id1.cs#1)] - [!code-vb[IsDefined#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id1.vb#1)] +  + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp" id="Snippet1"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id1.cs" id="Snippet1"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id1.vb" id="Snippet1"::: ]]> @@ -609,10 +609,10 @@ When implementing your own class derived from , you can o ## Examples The following code example illustrates the use of the method taking a as a parameter. - - [!code-cpp[IsDefined#4](~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp#4)] - [!code-csharp[IsDefined#4](~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id4.cs#4)] - [!code-vb[IsDefined#4](~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id4.vb#4)] +  + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp" id="Snippet4"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id4.cs" interactive="try-dotnet" id="Snippet4"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id4.vb" id="Snippet4"::: ]]> @@ -673,10 +673,10 @@ When implementing your own class derived from , you can o ## Examples The following code example illustrates the use of the method taking a as a parameter. - - [!code-cpp[IsDefined#2](~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp#2)] - [!code-csharp[IsDefined#2](~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id2.cs#2)] - [!code-vb[IsDefined#2](~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id2.vb#2)] +  + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/IsDefined/CPP/isdefined.cpp" id="Snippet2"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id2.cs" id="Snippet2"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/IsDefined/VB/id2.vb" id="Snippet2"::: ]]> @@ -740,9 +740,9 @@ When implementing your own class derived from , you can o ## Examples The following code example defines a custom parameter class and applies the custom attribute to a method in a derived class and the base of the derived class. The example shows the use of the method to return the attributes. - [!code-cpp[System.Attribute.GetCustomAttribute#3](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CPP/getcustattrprminh.cpp#3)] - [!code-csharp[System.Attribute.GetCustomAttribute#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrprminh.cs#3)] - [!code-vb[System.Attribute.GetCustomAttribute#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/VB/getcustattrprminh.vb#3)] + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CPP/getcustattrprminh.cpp" id="Snippet3"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrprminh.cs" interactive="try-dotnet" id="Snippet3"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/VB/getcustattrprminh.vb" id="Snippet3"::: ]]> diff --git a/xml/System/Convert.xml b/xml/System/Convert.xml index 1e92992dc96..2e411827cc4 100644 --- a/xml/System/Convert.xml +++ b/xml/System/Convert.xml @@ -9516,9 +9516,9 @@ ## Examples The following example converts the values `true` and `false` to integers. - [!code-csharp[System.Convert.ToInt32#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#1)] - [!code-vb[System.Convert.ToInt32#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#1)] - + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet1"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet1"::: +  ]]> @@ -9572,9 +9572,9 @@ ## Examples The following example converts each element in an array of bytes to an integer. - [!code-csharp[System.Convert.ToInt32#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#2)] - [!code-vb[System.Convert.ToInt32#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#2)] - + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet2"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet2"::: +  ]]> @@ -9633,8 +9633,8 @@ ## Examples The following example converts each element in an array of values to an integer. - [!code-csharp[System.Convert.ToInt32#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#3)] - [!code-vb[System.Convert.ToInt32#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#3)] + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet3"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet3"::: ]]> @@ -9740,9 +9740,9 @@ ## Examples The following example attempts to convert each element in an array of values to an integer. - [!code-csharp[System.Convert.ToInt32#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#4)] - [!code-vb[System.Convert.ToInt32#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#4)] - + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet4"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet4"::: +  ]]> @@ -9800,9 +9800,9 @@ ## Examples The following example attempts to convert each element in an array of values to an integer. - [!code-csharp[System.Convert.ToInt32#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#5)] - [!code-vb[System.Convert.ToInt32#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#5)] - + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet5"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet5"::: +  ]]> @@ -9860,9 +9860,9 @@ ## Examples The following example converts each element in an array of 16-bit signed integers to an integer. - [!code-csharp[System.Convert.ToInt32#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#6)] - [!code-vb[System.Convert.ToInt32#6](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#6)] - + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet6"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet6"::: +  ]]> @@ -9963,8 +9963,8 @@ ## Examples The following example attempts to convert each element in an array of long integers to an integer. - [!code-csharp[System.Convert.ToInt32#7](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#7)] - [!code-vb[System.Convert.ToInt32#7](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#7)] + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet7"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet7"::: ]]> @@ -10098,8 +10098,8 @@ ## Examples The following example converts each element in an array of signed bytes to an integer. - [!code-csharp[System.Convert.ToInt32#9](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#9)] - [!code-vb[System.Convert.ToInt32#9](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#9)] + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet9"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet9"::: ]]> @@ -10155,8 +10155,8 @@ ## Examples The following example attempts to convert each element in an array of values to an integer. - [!code-csharp[System.Convert.ToInt32#10](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#10)] - [!code-vb[System.Convert.ToInt32#10](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#10)] + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet10"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet10"::: ]]> @@ -10222,8 +10222,8 @@ ## Examples The following example attempts to convert each element in a numeric string array to an integer. - [!code-csharp[System.Convert.ToInt32#11](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#11)] - [!code-vb[System.Convert.ToInt32#11](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#11)] + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet11"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet11"::: ]]> @@ -10288,8 +10288,8 @@ ## Examples The following example converts each element in an array of 16-bit unsigned integers to an integer. - [!code-csharp[System.Convert.ToInt32#12](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#12)] - [!code-vb[System.Convert.ToInt32#12](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#12)] + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet12"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet12"::: ]]> @@ -10350,8 +10350,8 @@ ## Examples The following example attempts to convert each element in an array of unsigned integers to a signed integer. - [!code-csharp[System.Convert.ToInt32#13](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#13)] - [!code-vb[System.Convert.ToInt32#13](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#13)] + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet13"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet13"::: ]]> @@ -10414,8 +10414,8 @@ ## Examples The following example attempts to convert each element in an array of unsigned long integers to a signed integer. - [!code-csharp[System.Convert.ToInt32#14](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs#14)] - [!code-vb[System.Convert.ToInt32#14](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb#14)] + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs" interactive="try-dotnet-method" id="Snippet14"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_1.vb" id="Snippet14"::: ]]> @@ -10557,8 +10557,8 @@ ## Examples The following example defines a custom object that recognizes the string "pos" as the positive sign and the string "neg" as the negative sign. It then attempts to convert each element of a numeric string array to an integer using both this provider and the provider for the invariant culture. - [!code-csharp[System.Convert.ToInt32#15](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_2.cs#15)] - [!code-vb[System.Convert.ToInt32#15](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_2.vb#15)] + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_2.cs" interactive="try-dotnet" id="Snippet15"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.convert.toint32/vb/toint32_2.vb" id="Snippet15"::: ]]> @@ -10621,15 +10621,15 @@ Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two's complement representation. In other words, the method always interprets the highest-order binary bit of an integer (bit 31) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example increments by one, converts the resulting number to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x80000000 converts to -2147483648." - [!code-cpp[System.Convert.BaseConversion#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cpp/toint_str_int32.cpp#1)] - [!code-csharp[System.Convert.BaseConversion#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cs/Conversion.cs#1)] - [!code-vb[System.Convert.BaseConversion#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Convert.BaseConversion/vb/Conversion.vb#1)] + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cpp/toint_str_int32.cpp" id="Snippet1"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cs/Conversion.cs" interactive="try-dotnet-method" id="Snippet1"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Convert.BaseConversion/vb/Conversion.vb" id="Snippet1"::: When performing binary operations or numeric conversions, it is always the responsibility of the developer to verify that a method is using the appropriate numeric representation to interpret a particular value. As the following example illustrates, you can ensure that the method handles overflows appropriately by first retrieving the sign of the numeric value before converting it to its hexadecimal string representation. Throw an exception if the original value was positive but the conversion back to an integer yields a negative value. - [!code-cpp[System.Convert.BaseConversion#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cpp/toint_str_int32.cpp#2)] - [!code-csharp[System.Convert.BaseConversion#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cs/Conversion.cs#2)] - [!code-vb[System.Convert.BaseConversion#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Convert.BaseConversion/vb/Conversion.vb#2)] + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cpp/toint_str_int32.cpp" id="Snippet2"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cs/Conversion.cs" interactive="try-dotnet-method" id="Snippet2"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Convert.BaseConversion/vb/Conversion.vb" id="Snippet2"::: ]]> diff --git a/xml/System/DateTime.xml b/xml/System/DateTime.xml index 9db71bf2157..b0393aa7dcc 100644 --- a/xml/System/DateTime.xml +++ b/xml/System/DateTime.xml @@ -1931,10 +1931,10 @@ The behavior of the .NET Framework and COM means that if your application round- ## Examples The following example uses the method to add 30 seconds and the number of seconds in one day to a value. It then displays each new value and displays the difference between it and the original value. The difference is displayed both as a time span and as a number of ticks. - - [!code-csharp[System.DateTime.AddSeconds#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addseconds/cs/addseconds1.cs#1)] - [!code-vb[System.DateTime.AddSeconds#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.datetime.addseconds/vb/addseconds1.vb#1)] - + + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addseconds/cs/addseconds1.cs" interactive="try-dotnet" id="Snippet1"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.datetime.addseconds/vb/addseconds1.vb" id="Snippet1"::: + ]]> The resulting is less than or greater than . diff --git a/xml/System/Enum.xml b/xml/System/Enum.xml index 98d8221f9ad..c9add5e6fed 100644 --- a/xml/System/Enum.xml +++ b/xml/System/Enum.xml @@ -761,20 +761,20 @@ ## Remarks The elements of the return value array are sorted by the binary values of the enumerated constants (that is, by their unsigned magnitude). The following example provides displays information about the array returned by the method for an enumeration that includes a negative, zero, and a positive value. - [!code-csharp[System.Enum.GetNames#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getnames/cs/getnames1.cs#1)] - [!code-vb[System.Enum.GetNames#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.enum.getnames/vb/getnames1.vb#1)] - + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getnames/cs/getnames1.cs" interactive="try-dotnet" id="Snippet1"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.enum.getnames/vb/getnames1.vb" id="Snippet1"::: + If there are enumerated constants with same value, the order of their corresponding names is unspecified. ## Examples The following example illustrates the use of the method. - - [!code-cpp[enumgetnames#1](~/samples/snippets/cpp/VS_Snippets_CLR/enumgetnames/CPP/EnumGetNames.cpp#1)] - [!code-csharp[enumgetnames#1](~/samples/snippets/csharp/VS_Snippets_CLR/enumgetnames/CS/EnumGetNames.cs#1)] - [!code-vb[enumgetnames#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/enumgetnames/VB/EnumGetNames.vb#1)] - + + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/enumgetnames/CPP/EnumGetNames.cpp" id="Snippet1"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/enumgetnames/CS/EnumGetNames.cs" interactive="try-dotnet" id="Snippet1"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/enumgetnames/VB/EnumGetNames.vb" id="Snippet1"::: + ]]> diff --git a/xml/System/ObjectDisposedException.xml b/xml/System/ObjectDisposedException.xml index 60d6f11fa49..a08e7c8d146 100644 --- a/xml/System/ObjectDisposedException.xml +++ b/xml/System/ObjectDisposedException.xml @@ -71,10 +71,10 @@ ## Examples The following example demonstrates an error that causes the `ObjectDisposedException` exception to be thrown. - [!code-cpp[ObjDispEx#1](~/samples/snippets/cpp/VS_Snippets_CLR/ObjDispEx/CPP/objdispexc.cpp#1)] - [!code-csharp[ObjDispEx#1](~/samples/snippets/csharp/VS_Snippets_CLR/ObjDispEx/CS/objdispexc.cs#1)] - [!code-vb[ObjDispEx#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/ObjDispEx/VB/objdispexc.vb#1)] - + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/ObjDispEx/CPP/objdispexc.cpp" id="Snippet1"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/ObjDispEx/CS/objdispexc.cs" interactive="try-dotnet" id="Snippet1"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR/ObjDispEx/VB/objdispexc.vb" id="Snippet1"::: + This code produces the following output: ``` diff --git a/xml/System/TimeSpan.xml b/xml/System/TimeSpan.xml index 32f92fead82..cab545afa79 100644 --- a/xml/System/TimeSpan.xml +++ b/xml/System/TimeSpan.xml @@ -1526,10 +1526,10 @@ ## Examples The following example creates several objects using the method. - [!code-cpp[System.TimeSpan.From#3](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.From/CPP/fromseconds.cpp#3)] - [!code-csharp[System.TimeSpan.From#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.From/CS/fromseconds.cs#3)] - [!code-vb[System.TimeSpan.From#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.From/VB/fromseconds.vb#3)] - + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.TimeSpan.From/CPP/fromseconds.cpp" id="Snippet3"::: + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.TimeSpan.From/CS/fromseconds.cs" interactive="try-dotnet" id="Snippet3"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.TimeSpan.From/VB/fromseconds.vb" id="Snippet3"::: + ]]> diff --git a/xml/System/UInt32.xml b/xml/System/UInt32.xml index 843ac05f0b4..b73f2d6ad26 100644 --- a/xml/System/UInt32.xml +++ b/xml/System/UInt32.xml @@ -567,9 +567,9 @@ ## Examples The following example uses the and fields to verify that an value is within the range of the type before it performs a type conversion. This verification prevents an at run time. - [!code-csharp[System.UInt32.MaxValue#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.UInt32.MaxValue/cs/MaxValue1.cs#1)] - [!code-vb[System.UInt32.MaxValue#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.UInt32.MaxValue/vb/MaxValue1.vb#1)] - + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.UInt32.MaxValue/cs/MaxValue1.cs" interactive="try-dotnet-method" id="Snippet1"::: + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.UInt32.MaxValue/vb/MaxValue1.vb" id="Snippet1"::: + ]]>