diff --git a/xml/System.Windows/DataObject.xml b/xml/System.Windows/DataObject.xml index 475591ebaeb..1c97b8be28c 100644 --- a/xml/System.Windows/DataObject.xml +++ b/xml/System.Windows/DataObject.xml @@ -2319,7 +2319,7 @@ E_NOTIMPL - The direction specified by the parameter is not supported. + The direction specified by the parameter is not supported. OLE_S_USEREG @@ -2387,7 +2387,7 @@ DATA_S_SAMEFORMATETC - The structures are the same and is returned in the parameter. + The structures are the same and is returned in the parameter. DV_E_LINDEX @@ -2395,7 +2395,7 @@ DV_E_FORMATETC - There is an invalid value for the parameter. + There is an invalid value for the parameter. OLE_E_NOTRUNNING @@ -2563,7 +2563,7 @@ DV_E_FORMATETC - An invalid value for the parameter. + An invalid value for the parameter. DV_E_TYMED diff --git a/xml/System.Windows/DependencyObjectType.xml b/xml/System.Windows/DependencyObjectType.xml index b21347e2336..60001235c10 100644 --- a/xml/System.Windows/DependencyObjectType.xml +++ b/xml/System.Windows/DependencyObjectType.xml @@ -23,13 +23,13 @@ Implements an underlying type cache for all derived types. - represents a specific underlying system (CLR) of a . is essentially a wrapper for the (CLR) so that it can extend some of its capabilities. - - This class has no public constructor. Instances of this class can only be obtained through properties on other objects (such as ), or through the static method . - + represents a specific underlying system (CLR) of a . is essentially a wrapper for the (CLR) so that it can extend some of its capabilities. + + This class has no public constructor. Instances of this class can only be obtained through properties on other objects (such as ), or through the static method . + ]]> @@ -99,19 +99,19 @@ Returns a that represents a given system (CLR) type. A that represents the system (CLR) type. - maintains a property that returns a , but this requires having a particular instance. You can use this static utility method if you do not yet have a instance and require a . - - - -## Examples - The following example calls , creating a based on the type of the class. - + maintains a property that returns a , but this requires having a particular instance. You can use this static utility method if you do not yet have a instance and require a . + + + +## Examples + The following example calls , creating a based on the type of the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows/DependencyObjectType/FromSystemType/page3.xaml.cs" id="Snippetdotfromsystemtype"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PropertiesOvwSupport/visualbasic/page3.xaml.vb" id="Snippetdotfromsystemtype"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PropertiesOvwSupport/visualbasic/page3.xaml.vb" id="Snippetdotfromsystemtype"::: + ]]> @@ -143,11 +143,11 @@ Returns the hash code for this . A 32-bit signed integer hash code. - property. - + property. + ]]> @@ -184,11 +184,11 @@ Gets a zero-based unique identifier for constant-time array lookup operations. An internal identifier. - @@ -222,13 +222,13 @@ The object to compare with the current . Determines whether the specified object is an instance of the current . - if the class represented by the current is in the inheritance hierarchy of the passed as ; otherwise, . + if the class represented by the current is in the inheritance hierarchy of the passed as ; otherwise, . - @@ -292,11 +292,11 @@ Gets the name of the represented common language runtime (CLR) system type. The name of the represented CLR system type. - is the same string as the name of the type name of the . - + is the same string as the name of the type name of the . + ]]> diff --git a/xml/System.Windows/FrameworkElement.xml b/xml/System.Windows/FrameworkElement.xml index 37f1238a972..e771edbb800 100644 --- a/xml/System.Windows/FrameworkElement.xml +++ b/xml/System.Windows/FrameworkElement.xml @@ -441,7 +441,7 @@ The actual size used. To be added. - Control authors who want to customize the arrange pass of layout processing should override this method. The implementation pattern should call on each visible child element, and pass the final desired size for each child element as the parameter. Parent elements should call on each child, otherwise the child elements will not be rendered. + Control authors who want to customize the arrange pass of layout processing should override this method. The implementation pattern should call on each visible child element, and pass the final desired size for each child element as the parameter. Parent elements should call on each child, otherwise the child elements will not be rendered. Many derived classes offer implementations of this method. Prominent ones include: , and . @@ -5896,7 +5896,7 @@ The key identifier of the resource to be found. Searches for a resource with the specified key, and returns that resource if found. - The found resource, or if no resource with the provided is found. + The found resource, or if no resource with the provided is found. Represents the length of elements that explicitly support unit types. - and use this type to describe width and height in order to support variable distribution of available space. - - -## XAML Attribute Usage - + and use this type to describe width and height in order to support variable distribution of available space. + + +## XAML Attribute Usage + ```xaml - + ``` -or- ```xaml - -``` - - -## XAML Values - *doubleLength* - The element's length, described as either a value that specifies a device-independent units (1/96th inch per unit) measure, or as a *qualifiedDouble* (see below). - - *autoValue* - The element's length, described by either the value Auto or *. See for more information on the values Auto and *. - - *qualifiedDouble* - A *double* value as described above for any of the measures, followed by one of the following unit declaration strings: `px`, `in`, `cm`, `pt`. - - `px` (default) is device-independent units (1/96th inch per unit) - - `in` is inches; 1in==96px - - `cm` is centimeters; 1cm==(96/2.54) px - - `pt` is points; 1pt==(96/72) px - + +``` + + +## XAML Values + *doubleLength* + The element's length, described as either a value that specifies a device-independent units (1/96th inch per unit) measure, or as a *qualifiedDouble* (see below). + + *autoValue* + The element's length, described by either the value Auto or *. See for more information on the values Auto and *. + + *qualifiedDouble* + A *double* value as described above for any of the measures, followed by one of the following unit declaration strings: `px`, `in`, `cm`, `pt`. + + `px` (default) is device-independent units (1/96th inch per unit) + + `in` is inches; 1in==96px + + `cm` is centimeters; 1cm==(96/2.54) px + + `pt` is points; 1pt==(96/72) px + ]]> @@ -117,7 +117,7 @@ Initializes a new instance of the structure using the specified absolute value in pixels. To be added. - is equal to , , or . + is equal to , , or . @@ -389,11 +389,11 @@ if the property is ; otherwise, . - value is . Therefore, this property returns `true` if you do not specify a when creating the instance. - + value is . Therefore, this property returns `true` if you do not specify a when creating the instance. + ]]> diff --git a/xml/System.Windows/NameScope.xml b/xml/System.Windows/NameScope.xml index 2efb1d2dc3a..98cc6ca8f0e 100644 --- a/xml/System.Windows/NameScope.xml +++ b/xml/System.Windows/NameScope.xml @@ -300,7 +300,7 @@ ]]> - is . + is . diff --git a/xml/System.Windows/Point.xml b/xml/System.Windows/Point.xml index c98210adb86..6abeb4e775a 100644 --- a/xml/System.Windows/Point.xml +++ b/xml/System.Windows/Point.xml @@ -42,38 +42,38 @@ Represents an x- and y-coordinate pair in two-dimensional space. - and values of a can be either a comma or a space. - - Some cultures might use the comma character as the decimal delimiter instead of the period character. XAML processing for invariant culture defaults to en-US in most XAML processor implementations, and expects the period to be the decimal delimiter. You should avoid using the comma character as the decimal delimiter if specifying a in XAML, because that will clash with the string type conversion of a attribute value into the and components. - - -## XAML Attribute Usage - -``` - --or- - -``` - - -## XAML Values - *x* - The x-coordinate of this . - - *y* - The y-coordinate of this . - - - -## Examples - The following example shows how to check if two structures are not equal. It also illustrates how to assign values to a structure when the structure is being declared and after the structure has been declared. - + and values of a can be either a comma or a space. + + Some cultures might use the comma character as the decimal delimiter instead of the period character. XAML processing for invariant culture defaults to en-US in most XAML processor implementations, and expects the period to be the decimal delimiter. You should avoid using the comma character as the decimal delimiter if specifying a in XAML, because that will clash with the string type conversion of a attribute value into the and components. + + +## XAML Attribute Usage + +``` + +-or- + +``` + + +## XAML Values + *x* + The x-coordinate of this . + + *y* + The y-coordinate of this . + + + +## Examples + The following example shows how to check if two structures are not equal. It also illustrates how to assign values to a structure when the structure is being declared and after the structure has been declared. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetpointinequalityexample"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetpointinequalityexample"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetpointinequalityexample"::: + ]]> @@ -146,18 +146,18 @@ Adds a to a and returns the result as a structure. Returns the sum of and . - structure to a structure is prohibited. - - - -## Examples - This example adds a to a and returns the result as a structure. - - :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetaddpointandvectorexample_csharp"::: - + structure to a structure is prohibited. + + + +## Examples + This example adds a to a and returns the result as a structure. + + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetaddpointandvectorexample_csharp"::: + ]]> @@ -203,18 +203,18 @@ if is a and contains the same and values as this ; otherwise, . - coordinates are described using values. Because the value of a can lose precision when operated upon, a comparison between two values that are logically equal might fail. - - - -## Examples - The following example shows how to check if two structures are equal using the non-static method. - - :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetnonstaticequalsexample_csharp"::: - + coordinates are described using values. Because the value of a can lose precision when operated upon, a comparison between two values that are logically equal might fail. + + + +## Examples + The following example shows how to check if two structures are equal using the non-static method. + + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetnonstaticequalsexample_csharp"::: + ]]> @@ -251,11 +251,11 @@ if both structures contain the same and values; otherwise, . - coordinates are expressed using values. Because the value of a can lose precision when operated on, a comparison between two values that are logically equal might fail. - + coordinates are expressed using values. Because the value of a can lose precision when operated on, a comparison between two values that are logically equal might fail. + ]]> @@ -294,18 +294,18 @@ if and contain the same and values; otherwise, . - values. Because the value of a can lose precision when operated upon, a comparison between two values that are logically equal might fail. - - - -## Examples - The following example shows how to check if two structures are equal using the static method. - - :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetstaticequalsexample_csharp"::: - + values. Because the value of a can lose precision when operated upon, a comparison between two values that are logically equal might fail. + + + +## Examples + The following example shows how to check if two structures are equal using the static method. + + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetstaticequalsexample_csharp"::: + ]]> @@ -338,13 +338,13 @@ Returns the hash code for this . The hash code for this structure. - structure. - - :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetgethashcodeexample_csharp"::: - + structure. + + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetgethashcodeexample_csharp"::: + ]]> @@ -381,13 +381,13 @@ Transforms the specified structure by the specified structure. The transformed point. - structure by a structure using the method. - - :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetmultiplypointbymatrixexample_csharp"::: - + structure by a structure using the method. + + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetmultiplypointbymatrixexample_csharp"::: + ]]> @@ -424,20 +424,20 @@ The amount to offset the point's coordinate. Offsets a point's and coordinates by the specified amounts. - to a . - - Note that calling the method will only have an effect if you can change the and properties directly. Because is a value type, if you reference a object by using a property or indexer, you get a copy of the object, not a reference to the object. If you attempt to change or on a property or indexer reference, a compiler error occurs. Similarly, calling on the property or indexer will not change the underlying object. If you want to change the value of a that is referenced as a property or indexer, create a new , modify its fields, and then assign the back to the property or indexer. - - - -## Examples - The following example shows how to offset the and values of a structure. - - :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetoffsetexample_csharp"::: - + to a . + + Note that calling the method will only have an effect if you can change the and properties directly. Because is a value type, if you reference a object by using a property or indexer, you get a copy of the object, not a reference to the object. If you attempt to change or on a property or indexer reference, a compiler error occurs. Similarly, calling on the property or indexer will not change the underlying object. If you want to change the value of a that is referenced as a property or indexer, create a new , modify its fields, and then assign the back to the property or indexer. + + + +## Examples + The following example shows how to offset the and values of a structure. + + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetoffsetexample_csharp"::: + ]]> @@ -474,14 +474,14 @@ Translates the specified by the specified and returns the result. The result of translating the specified point by the specified vector. - to a using the overloaded (+) operator. - + to a using the overloaded (+) operator. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetoverloadedadditionoperatorexample"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedadditionoperatorexample"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedadditionoperatorexample"::: + ]]> @@ -520,19 +520,19 @@ if both the and coordinates of and are equal; otherwise, . - values. Because the value of can lose precision when arithmetic operations are performed on them, a comparison between two values that are logically equal might fail. - - - -## Examples - The following example shows how to check if two structures are equal using the overloaded (==) operator. - + values. Because the value of can lose precision when arithmetic operations are performed on them, a comparison between two values that are logically equal might fail. + + + +## Examples + The following example shows how to check if two structures are equal using the overloaded (==) operator. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetoverloadedequalityoperatorexample"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedequalityoperatorexample"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedequalityoperatorexample"::: + ]]> @@ -577,19 +577,19 @@ Creates a structure with a equal to this point's value and a equal to this point's value. A structure with a equal to this point's value and a equal to this point's value. - structure cannot be negative, the absolute values of the point's and properties are used. - - - -## Examples - The following example shows how to explicitly convert a into a . - + structure cannot be negative, the absolute values of the point's and properties are used. + + + +## Examples + The following example shows how to explicitly convert a into a . + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetoverloadedexplicitoperatorsizeexample"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedexplicitoperatorsizeexample"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedexplicitoperatorsizeexample"::: + ]]> @@ -624,14 +624,14 @@ Creates a structure with an value equal to the point's value and a value equal to the point's value. A vector with an value equal to the point's value and a value equal to the point's value. - into a . - + into a . + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetoverloadedexplicitoperatorvectorexample"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedexplicitoperatorvectorexample"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedexplicitoperatorvectorexample"::: + ]]> @@ -669,19 +669,19 @@ if and have different or coordinates; if and have the same and coordinates. - and coordinates are described using values. Because values can lose precision when operated on, a comparison between two values that are logically equal might fail. - - - -## Examples - The following example shows how to check whether two structures are not equal, using the overloaded (!=) operator. - + and coordinates are described using values. Because values can lose precision when operated on, a comparison between two values that are logically equal might fail. + + + +## Examples + The following example shows how to check whether two structures are not equal, using the overloaded (!=) operator. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetoverloadedinequalityoperatorexample"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedinequalityoperatorexample"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedinequalityoperatorexample"::: + ]]> @@ -718,14 +718,14 @@ Transforms the specified by the specified . The result of transforming the specified point using the specified matrix. - by a using the overloaded (*) operator. - + by a using the overloaded (*) operator. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetoverloadedmultiplypointbymatrixoperatorexample"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedmultiplypointbymatrixoperatorexample"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedmultiplypointbymatrixoperatorexample"::: + ]]> @@ -772,14 +772,14 @@ Subtracts the specified from another specified and returns the difference as a . The difference between and . - from another and return a using the overloaded (-) operator. - + from another and return a using the overloaded (-) operator. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetoverloadedsubtractionoperatorexample2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedsubtractionoperatorexample2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedsubtractionoperatorexample2"::: + ]]> @@ -813,18 +813,18 @@ The point from which is subtracted. - The vector to subtract from . + The vector to subtract from . Subtracts the specified from the specified and returns the resulting . The difference between and . - from a using the overloaded (-) operator. - + from a using the overloaded (-) operator. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetoverloadedsubtractionoperatorexample1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedsubtractionoperatorexample1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetoverloadedsubtractionoperatorexample1"::: + ]]> @@ -860,23 +860,23 @@ Constructs a from the specified . The equivalent structure. - method to convert a representation of a point into a structure. - + method to convert a representation of a point into a structure. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetparseexample"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetparseexample"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetparseexample"::: + ]]> is not composed of two comma- or space-delimited double values. - does not contain two numbers. - - -or- - + does not contain two numbers. + + -or- + contains too many delimiters. @@ -921,14 +921,14 @@ Subtracts the specified from another specified and returns the difference as a . The difference between and . - from another using the static method. - + from another using the static method. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetsubtractexample2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetsubtractexample2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetsubtractexample2"::: + ]]> @@ -966,14 +966,14 @@ Subtracts the specified from the specified and returns the resulting . The difference between and . - from a using the static method. - + from a using the static method. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetsubtractexample1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetsubtractexample1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetsubtractexample1"::: + ]]> @@ -1015,15 +1015,15 @@ - The string specifying the format to use. - - -or- - + The string specifying the format to use. + + -or- + to use the default format defined for the type of the implementation. - The to use to format the value. - - -or- - + The to use to format the value. + + -or- + to obtain the numeric format information from the current locale setting of the operating system. This member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. For a description of this member, see . A string containing the value of the current instance in the specified format. @@ -1072,14 +1072,14 @@ Creates a representation of this . A containing the and values of this structure. - method to get a representation of a structure. - + method to get a representation of a structure. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippettostringexample"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippettostringexample"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippettostringexample"::: + ]]> @@ -1158,14 +1158,14 @@ Gets or sets the -coordinate value of this structure. The -coordinate value of this structure. The default value is 0. - structures are not equal. It also illustrates how to assign values to a structure when the structure is being declared and after the structure has been declared. - + structures are not equal. It also illustrates how to assign values to a structure when the structure is being declared and after the structure has been declared. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetpointinequalityexample"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetpointinequalityexample"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetpointinequalityexample"::: + ]]> @@ -1207,14 +1207,14 @@ Gets or sets the -coordinate value of this . The -coordinate value of this structure. The default value is 0. - structures are not equal. It also illustrates how to assign values to a structure when the structure is being declared and after the structure has been declared. - + structures are not equal. It also illustrates how to assign values to a structure when the structure is being declared and after the structure has been declared. + :::code language="csharp" source="~/snippets/csharp/System.Windows/Point/Overview/PointExample.cs" id="Snippetpointinequalityexample"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetpointinequalityexample"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PointExamples_snip/visualbasic/pointexample.vb" id="Snippetpointinequalityexample"::: + ]]> diff --git a/xml/System.Windows/SizeConverter.xml b/xml/System.Windows/SizeConverter.xml index db4f84ef930..74dffc7543f 100644 --- a/xml/System.Windows/SizeConverter.xml +++ b/xml/System.Windows/SizeConverter.xml @@ -23,11 +23,11 @@ Converts instances of other types to and from instances of the class. - class supports conversion of values and base values that the class supports. - + class supports conversion of values and base values that the class supports. + ]]> @@ -171,13 +171,13 @@ Culture-specific information that should be respected during conversion. The source object that is being converted. Attempts to convert a specified object to an instance of . - The instance of that is created from the converted . + The instance of that is created from the converted . To be added. - is . - --or- + is . + +-or- cannot be converted to a . diff --git a/xml/System.Windows/StrokeCollectionConverter.xml b/xml/System.Windows/StrokeCollectionConverter.xml index c95d846cfcc..ff61d281f36 100644 --- a/xml/System.Windows/StrokeCollectionConverter.xml +++ b/xml/System.Windows/StrokeCollectionConverter.xml @@ -23,19 +23,19 @@ Converts a to a string. - converts a to a string that represents the in base-64, encoded Ink Serialized Format (ISF). It is useful to store ink data as base-64, encoded ISF when it is not possible to store raw byte data, such as in Web pages. - -## Examples - The following example demonstrates how to convert a base-64, encoded ISF string to a . This assumes that there is an called `presenter`. - + converts a to a string that represents the in base-64, encoded Ink Serialized Format (ISF). It is useful to store ink data as base-64, encoded ISF when it is not possible to store raw byte data, such as in Web pages. + +## Examples + The following example demonstrates how to convert a base-64, encoded ISF string to a . This assumes that there is an called `presenter`. + :::code language="csharp" source="~/snippets/csharp/System.Windows/StrokeCollectionConverter/Overview/InkEraser.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/InkEraser/VisualBasic/InkEraser.vb" id="Snippet8"::: + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/InkEraser/VisualBasic/InkEraser.vb" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Windows/StrokeCollectionConverter/Overview/InkEraser.cs" id="Snippet3"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/InkEraser/VisualBasic/InkEraser.vb" id="Snippet3"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/InkEraser/VisualBasic/InkEraser.vb" id="Snippet3"::: + ]]> @@ -138,7 +138,7 @@ The to convert to. Returns a value that indicates whether the can convert a to the specified type. - if the can convert a to the ; otherwise, . + if the can convert a to the ; otherwise, . To be added. @@ -177,21 +177,21 @@ Converts the specified object to a . A converted from . - method returns `null` if `value` is not a . - - - -## Examples - The following example demonstrates how to convert a base-64, encoded Ink Serialized Format (ISF) string to a . This assumes that there is an called `presenter`. - + method returns `null` if `value` is not a . + + + +## Examples + The following example demonstrates how to convert a base-64, encoded Ink Serialized Format (ISF) string to a . This assumes that there is an called `presenter`. + :::code language="csharp" source="~/snippets/csharp/System.Windows/StrokeCollectionConverter/Overview/InkEraser.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/InkEraser/VisualBasic/InkEraser.vb" id="Snippet8"::: + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/InkEraser/VisualBasic/InkEraser.vb" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Windows/StrokeCollectionConverter/Overview/InkEraser.cs" id="Snippet3"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/InkEraser/VisualBasic/InkEraser.vb" id="Snippet3"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/InkEraser/VisualBasic/InkEraser.vb" id="Snippet3"::: + ]]> @@ -239,13 +239,13 @@ Converts a to a string. An object that represents the specified . - method returns `null` if `value` is not a , or if `destinationType` is not or . - - The method returns a base-64, encoded Ink Serialized Format (ISF). It is useful to store ink data as base-64, encoded ISF when it is not possible to store raw byte data, such as in Web pages. - + method returns `null` if `value` is not a , or if `destinationType` is not or . + + The method returns a base-64, encoded Ink Serialized Format (ISF). It is useful to store ink data as base-64, encoded ISF when it is not possible to store raw byte data, such as in Web pages. + ]]> diff --git a/xml/System.Windows/UIElement.xml b/xml/System.Windows/UIElement.xml index 4a133e1a850..29cf3d46293 100644 --- a/xml/System.Windows/UIElement.xml +++ b/xml/System.Windows/UIElement.xml @@ -2138,9 +2138,8 @@ For this call to be successful, some other element in the application needed to is the Microsoft .NET property accessor for what is in reality a dependency property. This particular dependency property quite frequently has its apparent "default" value set differently in derived element classes, particularly in controls. This commonly occurs in one of two ways: -- The dependency property is inherited by a particular derived class, but that derived class overrides the metadata of the dependency property and changes the property default value. - -- A style or template is applied to an element, which sets that dependency property value differently. +- The dependency property is inherited by a particular derived class, but that derived class overrides the metadata of the dependency property and changes the property default value. +- A style or template is applied to an element, which sets that dependency property value differently. For example, the apparent "default" of for a control will be `true`, even though inherits as a common language runtime (CLR) property directly from . This is because the applied metadata value for the dependency property was overridden within the static constructor of the base class, which is situated between and in the class hierarchy. @@ -2156,8 +2155,6 @@ For this call to be successful, some other element in the application needed to |Identifier field|| |Metadata properties set to `true`|None| - - ## Examples The following example code illustrates a control template for a particular custom control, which sets `false` on one of the elements within the template. @@ -2171,7 +2168,7 @@ For this call to be successful, some other element in the application needed to :::code language="csharp" source="~/snippets/csharp/System.Windows/ComponentResourceKey/.ctor/corepseudocode.cs" id="Snippetuielementshortoverride"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/CorePseudocode/visualbasic/corepseudocode.vb" id="Snippetuielementshortoverride"::: - where should be the class name of the type that you are overriding the metadata value on. + should be the class name of the type that you are overriding the metadata value on. diff --git a/xml/System.Xaml.Schema/XamlTypeInvoker.xml b/xml/System.Xaml.Schema/XamlTypeInvoker.xml index 512104801e6..2493819f140 100644 --- a/xml/System.Xaml.Schema/XamlTypeInvoker.xml +++ b/xml/System.Xaml.Schema/XamlTypeInvoker.xml @@ -169,7 +169,7 @@ Internally, the base implementation calls , and throws if the result is . - The base implementation does not necessarily use its own implementation. First, a cast of to is attempted. If this succeeds, a call to is made and the method returns. Otherwise, the base implementation uses CLR to invoke the underlying method, as obtained from a call to for this . + The base implementation does not necessarily use its own implementation. First, a cast of to is attempted. If this succeeds, a call to is made and the method returns. Otherwise, the base implementation uses CLR to invoke the underlying method, as obtained from a call to for this . In the base implementation no exception is raised at this level if is . It is still possible that the underlying method will raise an exception when invoked. Other run time exceptions are possible if does not return a valid result. @@ -228,7 +228,7 @@ Internally, the base implementation calls , and throws if the result is . - The base implementation does not necessarily use its own implementation. First, a cast of to is attempted. If this succeeds, a call to is made and the method returns. Otherwise, the base implementation uses CLR to invoke the underlying method, as obtained from a call to for this . + The base implementation does not necessarily use its own implementation. First, a cast of to is attempted. If this succeeds, a call to is made and the method returns. Otherwise, the base implementation uses CLR to invoke the underlying method, as obtained from a call to for this . In the base implementation no exception is raised at this level if or is . It is still possible that the underlying method will raise an exception when invoked. Other run time exceptions are possible if does not return a valid result. @@ -399,7 +399,7 @@ The base implementation includes a call to the internal helper ThrowIfUnknown. This helper always throws for cases where a is based on an unknown , which includes cases where the of the is . - The base implementation does not necessarily use its own implementation. First, a cast of to is attempted. If this succeeds, a call to is made and the method returns that return value. Otherwise, the base implementation uses CLR to invoke the underlying method, as obtained from a call to for this . + The base implementation does not necessarily use its own implementation. First, a cast of to is attempted. If this succeeds, a call to is made and the method returns that return value. Otherwise, the base implementation uses CLR to invoke the underlying method, as obtained from a call to for this . diff --git a/xml/System.Xaml/AttachableMemberIdentifier.xml b/xml/System.Xaml/AttachableMemberIdentifier.xml index a69a1bfd2f6..e10fb703f19 100644 --- a/xml/System.Xaml/AttachableMemberIdentifier.xml +++ b/xml/System.Xaml/AttachableMemberIdentifier.xml @@ -24,7 +24,7 @@ - Provides a XAML type system identifier representation for attachable members. The identifier structure parallels the string form for attachable member usage. + Provides a XAML type system identifier representation for attachable members. The identifier structure parallels the string form for attachable member usage. To be added. @@ -96,11 +96,11 @@ Gets or sets the component value of the . The component value of the . - value should match the name of the of the attachable member's XAML type system information. - + value should match the name of the of the attachable member's XAML type system information. + ]]> @@ -179,11 +179,11 @@ if the objects have the same value; otherwise, . - and . - + and . + ]]> @@ -247,11 +247,11 @@ Gets or sets the component value of the . The component value of the . - value should match the of the attachable member's XAML type system information. - + value should match the of the attachable member's XAML type system information. + ]]> @@ -350,11 +350,11 @@ Returns a that represents the current . A that represents the current . - diff --git a/xml/System.Xaml/XamlNodeQueue.xml b/xml/System.Xaml/XamlNodeQueue.xml index 1f99250583a..36d0512c26a 100644 --- a/xml/System.Xaml/XamlNodeQueue.xml +++ b/xml/System.Xaml/XamlNodeQueue.xml @@ -22,13 +22,13 @@ Provides a buffer for writing nodes and reading them again. - when they are read by the XAML reader. If you require a list of XAML nodes that can be replayed, or a list model that supports random access, see . - - When you create a , you create a writer delegate that exists as the value. The writer delegate is based on an internal XAML writer class that is specifically for XAML nodes. - + when they are read by the XAML reader. If you require a list of XAML nodes that can be replayed, or a list model that supports random access, see . + + When you create a , you create a writer delegate that exists as the value. The writer delegate is based on an internal XAML writer class that is specifically for XAML nodes. + ]]> @@ -58,15 +58,15 @@ The schema context to use for node operations. Initializes a new instance of the class using a provided XAML schema context. - value. - + value. + ]]> - is . + is . diff --git a/xml/System.Xaml/XamlObjectWriter.xml b/xml/System.Xaml/XamlObjectWriter.xml index 7c0e9d2b771..7ad5c72b86f 100644 --- a/xml/System.Xaml/XamlObjectWriter.xml +++ b/xml/System.Xaml/XamlObjectWriter.xml @@ -26,35 +26,35 @@ Creates an object graph from a source XAML node stream. - implement a pattern so that the uses the that is defined by the method. logic switches between the `Write` methods, depending on which node type is at the current position in the reader. - -## Scope - A has a concept of scope; that is, the maintains a conceptual point of reference in its output object graph. For a particular scope, certain operations might be valid or invalid, or produce a no-operation result. For example, if you call to write directives for initialization on an object that already exists as an instance, the default implementation throws an exception. - - A possible technique for tracking scope in a custom is to align the node actions with a stack or frame class. The stack or frame can keep track of push and pop for each level of object-model depth that is entered or exited while the writes the object graph. - -## Callbacks - To support intermediate and advanced scenarios, the mechanism of writing an object graph provides callback entry points that occur when a commits or is about to commit certain actions. Some callbacks are enabled in the settings and are not specific to the object type or the member being written; however, callback information is often available in context or is in the event data that is sent through the callback. The following is a list of relevant callbacks: - -- The callback that is declared by is invoked when the scope goes to a new object and at the phase of object lifetime for each created object. - -- The callback that is declared by is invoked when the scope goes to a new object and at the phase of object lifetime for each created object. - -- The callback that is declared by is invoked when the scope starts in an object, and occurs when the first call to that object scope is made but not yet committed. - -- The callback that is declared by is invoked when the scope starts in an object, and happens when the call to that object scope is made but not yet committed. - -- The callback that is declared by is invoked when is called. - -## Writing Dictionary Keys - The default implementation of supports type conversion on the constraints of a before the dictionary contents are added to the object graph. In this manner, a generic dictionary can be keyed at run time by objects and can match the relevant generic `Add` and indexer behavior. However, as implemented for the base , this capability exists only for object graph creation from the base class and not for derived classes of . - -## Checks for Disposed - XAML writers are potentially used for deferred operations or where a call is made against a XAML writer instance that has been disposed in the interim. Various APIs of might throw in these cases. - + implement a pattern so that the uses the that is defined by the method. logic switches between the `Write` methods, depending on which node type is at the current position in the reader. + +## Scope + A has a concept of scope; that is, the maintains a conceptual point of reference in its output object graph. For a particular scope, certain operations might be valid or invalid, or produce a no-operation result. For example, if you call to write directives for initialization on an object that already exists as an instance, the default implementation throws an exception. + + A possible technique for tracking scope in a custom is to align the node actions with a stack or frame class. The stack or frame can keep track of push and pop for each level of object-model depth that is entered or exited while the writes the object graph. + +## Callbacks + To support intermediate and advanced scenarios, the mechanism of writing an object graph provides callback entry points that occur when a commits or is about to commit certain actions. Some callbacks are enabled in the settings and are not specific to the object type or the member being written; however, callback information is often available in context or is in the event data that is sent through the callback. The following is a list of relevant callbacks: + +- The callback that is declared by is invoked when the scope goes to a new object and at the phase of object lifetime for each created object. + +- The callback that is declared by is invoked when the scope goes to a new object and at the phase of object lifetime for each created object. + +- The callback that is declared by is invoked when the scope starts in an object, and occurs when the first call to that object scope is made but not yet committed. + +- The callback that is declared by is invoked when the scope starts in an object, and happens when the call to that object scope is made but not yet committed. + +- The callback that is declared by is invoked when is called. + +## Writing Dictionary Keys + The default implementation of supports type conversion on the constraints of a before the dictionary contents are added to the object graph. In this manner, a generic dictionary can be keyed at run time by objects and can match the relevant generic `Add` and indexer behavior. However, as implemented for the base , this capability exists only for object graph creation from the base class and not for derived classes of . + +## Checks for Disposed + XAML writers are potentially used for deferred operations or where a call is made against a XAML writer instance that has been disposed in the interim. Various APIs of might throw in these cases. + ]]> @@ -337,15 +337,15 @@ The object to report as the source to the handler. The name of the property to set, which is passed to the handler as part of . - The value to provide for the property that is named by . The value is passed to the handler as part of . + The value to provide for the property that's named by . The value is passed to the handler as part of . Invokes any referenced method that is associated with for this writer, as long as in event data is not . A Boolean value that is set by any associated handler; otherwise, . - is declared in ), this method creates new and passes them to the handler. The return value is set by reading the value that is passed through the event data. If no handler exists and this method is invoked, the call returns `false`. - + is declared in ), this method creates new and passes them to the handler. The return value is set by reading the value that is passed through the event data. If no handler exists and this method is invoked, the call returns `false`. + ]]> @@ -381,13 +381,13 @@ Gets the last object that was written. Typically only called when the node stream is at its end and the object graph is complete. The last object written, or . - is to call it only when the node stream is known to be at its end, and the object graph is complete. Otherwise, the object graph is likely to be incomplete, and is not useful for most platform scenarios. - - typically only contains a non-null value if it is called immediately after a call to , and if the current scope is in the member where the object provides a value. - + is to call it only when the node stream is known to be at its end, and the object graph is complete. Otherwise, the object graph is likely to be incomplete, and is not useful for most platform scenarios. + + typically only contains a non-null value if it is called immediately after a call to , and if the current scope is in the member where the object provides a value. + ]]> @@ -417,11 +417,11 @@ Gets the service that maintains the XAML namescope for the absolute node root of the XAML object writer. The service that maintains the XAML namescope for the current root of the object writer. - @@ -451,11 +451,11 @@ Gets the active XAML schema context. The XAML schema context. - @@ -493,11 +493,11 @@ The line position from the reader. Implements and provides line information for exceptions. - and expect to report a context where line numbers are unavailable or not useful, this method may be called. - + and expect to report a context where line numbers are unavailable or not useful, this method may be called. + ]]> @@ -531,11 +531,11 @@ if line information is used by the writer; otherwise, . - @@ -593,13 +593,13 @@ Closes the current object scope in the writer. The new object scope becomes the parent member scope. - might not yet have created the object because an object member might be a necessary initialization pathway, such as initialization text or initialization parameters. For these cases, the call to actually writes the object. - + might not yet have created the object because an object member might be a necessary initialization pathway, such as initialization text or initialization parameters. For these cases, the call to actually writes the object. + ]]> @@ -629,15 +629,15 @@ Writes the conceptual into the object graph when the specified object is a default or implicit value of the parent property. The implicit value comes from information that is obtained from the XAML schema context and backing type information, instead of being specified as an object value in the input XAML node set. - and writing with can be seen in the resulting object graph. does not construct an instance of a type because the API has no information to inform the object graph of what to construct. Instead, the object was created when the parent property was initialized; so a does not need to construct it. In contrast, specifies that an instance of that type should be constructed and inserted into the object graph. - - If you think of the XAML node stream as a series of frames, a is balanced to a call. Therefore, the number of plus calls should equal the number of calls as part of a complete object-writing evaluation of the XAML node stream. - - The conceptual `StartObject` position for an implicit object in the object graph is necessary because although the object value itself is an implicit default, that object might still have members that need to be written based on the XAML node stream. A typical scenario where this occurs is when writes member nodes for a collection property, and the collection initialization is implicit to creating the object that owns the collection property. - + and writing with can be seen in the resulting object graph. does not construct an instance of a type because the API has no information to inform the object graph of what to construct. Instead, the object was created when the parent property was initialized; so a does not need to construct it. In contrast, specifies that an instance of that type should be constructed and inserted into the object graph. + + If you think of the XAML node stream as a series of frames, a is balanced to a call. Therefore, the number of plus calls should equal the number of calls as part of a complete object-writing evaluation of the XAML node stream. + + The conceptual `StartObject` position for an implicit object in the object graph is necessary because although the object value itself is an implicit default, that object might still have members that need to be written based on the XAML node stream. A typical scenario where this occurs is when writes member nodes for a collection property, and the collection initialization is implicit to creating the object that owns the collection property. + ]]> @@ -670,15 +670,15 @@ The namespace declaration to write. Defines a namespace declaration that applies to the next object scope or member scope. - can only be called immediately before a call to one of the following: , , or . The consecutive case is for writing multiple namespace declarations to the same node. Eventually, either or must be called. - - does not use a `Start`/`End` metaphor. Although a XAML namespace has members in the CLR representation sense, the members are known and do not need to be represented as a special type of for extensibility. To access the values of a , you access its and properties. - - A namespace declaration may have a value for the prefix. A prefix represents a declaration of the default XAML namespace. Do not attempt to use null to represent the default prefix; it throws an exception in this API. For more information, see . - + can only be called immediately before a call to one of the following: , , or . The consecutive case is for writing multiple namespace declarations to the same node. Eventually, either or must be called. + + does not use a `Start`/`End` metaphor. Although a XAML namespace has members in the CLR representation sense, the members are known and do not need to be represented as a special type of for extensibility. To access the values of a , you access its and properties. + + A namespace declaration may have a value for the prefix. A prefix represents a declaration of the default XAML namespace. Do not attempt to use null to represent the default prefix; it throws an exception in this API. For more information, see . + ]]> The is . @@ -714,24 +714,24 @@ The XAML property to write. Typically you obtain this value from a XAML reader through the XAML node stream intermediate. Writes a new member node into the current object scope, and the scope becomes a new member scope. - [!TIP] -> Watch for a , which occurs when the same XAML property is set twice in the XAML input. In simple cases, such as when the same property is set in both attribute syntax and property element syntax, you can easily see this exception in the input markup. However, more subtle cases can occur that are more difficult to spot. For example, this exception might occur if you set a XAML content property, if you involve XAML ambient properties, and if a property enables both an attachable usage and an instance usage. In the debugging phases of development, you can often locate this exception by viewing the intermediate XAML node representation that connects the markup read and the object graph write. - +> Watch for a , which occurs when the same XAML property is set twice in the XAML input. In simple cases, such as when the same property is set in both attribute syntax and property element syntax, you can easily see this exception in the input markup. However, more subtle cases can occur that are more difficult to spot. For example, this exception might occur if you set a XAML content property, if you involve XAML ambient properties, and if a property enables both an attachable usage and an instance usage. In the debugging phases of development, you can often locate this exception by viewing the intermediate XAML node representation that connects the markup read and the object graph write. + ]]> - has set to . - - -or- - - passed, which indicates that the XAML node stream contained content for an object that does not support content. - - -or- - + has set to . + + -or- + + passed, which indicates that the XAML node stream contained content for an object that does not support content. + + -or- + Attempted to write a start member in an invalid scope. specifies a property that is already explicitly set in the parent object scope. @@ -767,10 +767,10 @@ The type to write. Typically you obtain this value from a XAML reader. Writes an object node into the current scope, and sets the scope to a new object scope. To be added. - Processing an type and cannot create an object. - - -or- - + Processing an type and cannot create an object. + + -or- + Attempted to write a start object in an invalid scope. Attempted to write a root object when the root object was already provided in the settings. diff --git a/xml/System.Xaml/XamlServices.xml b/xml/System.Xaml/XamlServices.xml index f2064f8fcc8..ee8122c236b 100644 --- a/xml/System.Xaml/XamlServices.xml +++ b/xml/System.Xaml/XamlServices.xml @@ -22,14 +22,14 @@ Provides higher-level services (static methods) for the common XAML tasks of reading XAML and writing an object graph; or reading an object graph and writing XAML file output for serialization purposes. - class that are used in the most common XAML reading and writing scenarios rely on creating instances of XAML readers and XAML writers. These readers and writers are specialized but internal implementations of public classes, such as , , and . To use for most scenarios, you can rely on the default internal implementations to obtain the results that you want. For more specialized scenarios, you might define readers and writers yourself, and then pass them as arguments for overloads of the methods. - + class that are used in the most common XAML reading and writing scenarios rely on creating instances of XAML readers and XAML writers. These readers and writers are specialized but internal implementations of public classes, such as , , and . To use for most scenarios, you can rely on the default internal implementations to obtain the results that you want. For more specialized scenarios, you might define readers and writers yourself, and then pass them as arguments for overloads of the methods. + > [!IMPORTANT] -> is not the recommended XAML reading or XAML writing API set if you are processing WPF-defined types, or types based on WPF. For WPF usage, use for reading or loading XAML (or BAML); and for writing back XAML. These classes use .NET Framework XAML Services APIs and the XAML readers and XAML writers internally in their implementation; however, they also provide support and specialized XAML schema context for WPF-specific concepts, such as optimizations for dependency properties and WPF known types. - +> is not the recommended XAML reading or XAML writing API set if you are processing WPF-defined types, or types based on WPF. For WPF usage, use for reading or loading XAML (or BAML); and for writing back XAML. These classes use .NET Framework XAML Services APIs and the XAML readers and XAML writers internally in their implementation; however, they also provide support and specialized XAML schema context for WPF-specific concepts, such as optimizations for dependency properties and WPF known types. + ]]> @@ -72,22 +72,22 @@ Loads a source for a XAML reader and writes its output as an object graph. The object graph that is written as output. - method specify different types of input for the source XAML. The internal implementation first creates an by calling and then creates a new instance of a specialized that processes the input. - - In order for the call to successfully create an object graph, the following must be true: - -- The source is well-formed and valid XML. - -- The source is valid XAML at the language level. - -- The XAML types that are specified in the source XAML must resolve to backing types in the relevant XAML namespaces. For example, XAML types for WPF namespaces can resolve to a WPF XAML namespace as specified in the XAML; the assemblies for WPF must be included in the project or available in the run time; and so on. - + method specify different types of input for the source XAML. The internal implementation first creates an by calling and then creates a new instance of a specialized that processes the input. + + In order for the call to successfully create an object graph, the following must be true: + +- The source is well-formed and valid XML. + +- The source is valid XAML at the language level. + +- The XAML types that are specified in the source XAML must resolve to backing types in the relevant XAML namespaces. For example, XAML types for WPF namespaces can resolve to a WPF XAML namespace as specified in the XAML; the assemblies for WPF must be included in the project or available in the run time; and so on. + > [!IMPORTANT] -> is not the recommended XAML reading or XAML writing API set if you are processing Windows Presentation Foundation (WPF) types, or types based on WPF. For WPF usage, use for reading or loading XAML; and for writing back XAML. These classes use APIs internally in their implementation; however, they also provide support for WPF-specific concepts that influence the nature of XAML reading and writing, such as optimizations for dependency properties. - +> is not the recommended XAML reading or XAML writing API set if you are processing Windows Presentation Foundation (WPF) types, or types based on WPF. For WPF usage, use for reading or loading XAML; and for writing back XAML. These classes use APIs internally in their implementation; however, they also provide support for WPF-specific concepts that influence the nature of XAML reading and writing, such as optimizations for dependency properties. + ]]> @@ -123,11 +123,11 @@ Creates a XAML reader from a , and returns an object graph. The object graph that is returned. - that is constructed by using a valid XAML-as-string input for the constructor. - + that is constructed by using a valid XAML-as-string input for the constructor. + ]]> @@ -163,19 +163,19 @@ Loads a source for a XAML reader and returns an object graph. The object graph that is returned. - method specify different types of input for the source XAML. The internal implementation first creates an by calling and then creates a new instance of a specialized that processes the input. - - In order for the call to successfully create an object graph, the following must be true: - -- The source is well-formed and valid XML. - -- The source is valid XAML at the language level. - -- The XAML types that are specified in the source XAML must resolve to backing types in the relevant XAML namespaces. For example, XAML types for WPF namespaces can resolve to a WPF XAML namespace as specified in the XAML; the assemblies for WPF must be included in the project or be available in the run time; and so on. - + method specify different types of input for the source XAML. The internal implementation first creates an by calling and then creates a new instance of a specialized that processes the input. + + In order for the call to successfully create an object graph, the following must be true: + +- The source is well-formed and valid XML. + +- The source is valid XAML at the language level. + +- The XAML types that are specified in the source XAML must resolve to backing types in the relevant XAML namespaces. For example, XAML types for WPF namespaces can resolve to a WPF XAML namespace as specified in the XAML; the assemblies for WPF must be included in the project or be available in the run time; and so on. + ]]> @@ -211,15 +211,15 @@ Loads a specific XAML reader implementation and returns an object graph. The object graph that is returned. - . - -- You specified settings for a that differ from the default settings. - + . + +- You specified settings for a that differ from the default settings. + ]]> @@ -255,15 +255,15 @@ Loads a specific XML reader implementation and returns an object graph. The output object graph. - . - + . + ]]> - input is . + input is . @@ -295,20 +295,20 @@ Reads XAML as string output and returns an object graph. The object graph that is returned. - call to successfully create an object tree, the following must be true: - -- The `xaml` input is well-formed and valid XML. - -- The `xaml` input is valid XAML at the language level. - -- The XAML types that are specified in the `xaml` input must resolve to backing types in the relevant XAML namespaces. For example, XAML types for a WPF namespace can resolve to a WPF XAML namespace as specified in the XAML; the assemblies for WPF must be included in the project or be available in the run time; and so on. - + call to successfully create an object tree, the following must be true: + +- The `xaml` input is well-formed and valid XML. + +- The `xaml` input is valid XAML at the language level. + +- The XAML types that are specified in the `xaml` input must resolve to backing types in the relevant XAML namespaces. For example, XAML types for a WPF namespace can resolve to a WPF XAML namespace as specified in the XAML; the assemblies for WPF must be included in the project or be available in the run time; and so on. + > [!IMPORTANT] -> is not the recommended XAML reading or XAML writing API set if you are processing Windows Presentation Foundation (WPF) types, or types based on WPF. For WPF usage, use for reading or loading XAML, and for writing back XAML. These classes use APIs internally in their implementation; however, they also provide support for WPF-specific concepts that influence the nature of XAML reading and writing, such as optimizations for dependency properties. - +> is not the recommended XAML reading or XAML writing API set if you are processing Windows Presentation Foundation (WPF) types, or types based on WPF. For WPF usage, use for reading or loading XAML, and for writing back XAML. These classes use APIs internally in their implementation; however, they also provide support for WPF-specific concepts that influence the nature of XAML reading and writing, such as optimizations for dependency properties. + ]]> @@ -353,13 +353,13 @@ Processes a provided object tree into a XAML node representation, and returns a string representation of the output XAML. The XAML markup output as a string. - that is created by the method call. That is created by using the following settings: is `true`; and is `true`. - - The returned string can be loaded as valid XML through the method if you processed the string into a stream, or into a reader more specifically dedicated for XAML. - + that is created by the method call. That is created by using the following settings: is `true`; and is `true`. + + The returned string can be loaded as valid XML through the method if you processed the string into a stream, or into a reader more specifically dedicated for XAML. + ]]> @@ -394,13 +394,13 @@ The root of the object graph to process. Processes a provided object graph into a XAML node representation and then into an output stream for serialization. - [!IMPORTANT] -> is not the recommended XAML reading or XAML writing API set if you are processing Windows Presentation Foundation (WPF) types, or types based on WPF. For WPF usage, use for reading or loading XAML; and for writing back XAML. These classes use APIs internally in their implementation; however, they also provide support for WPF-specific concepts that influence the nature of XAML reading and writing, such as optimizations for dependency properties. - +> is not the recommended XAML reading or XAML writing API set if you are processing Windows Presentation Foundation (WPF) types, or types based on WPF. For WPF usage, use for reading or loading XAML; and for writing back XAML. These classes use APIs internally in their implementation; however, they also provide support for WPF-specific concepts that influence the nature of XAML reading and writing, such as optimizations for dependency properties. + ]]> @@ -471,11 +471,11 @@ The root of the object graph to process. Processes a provided object graph into a XAML node representation and then writes it to an output file at a provided location. - , which creates a as part of the method call. - + , which creates a as part of the method call. + ]]> @@ -514,15 +514,15 @@ The root of the object graph to process. Processes a provided object graph into a XAML node representation and then writes it to the provided XAML writer. - . - -- You specified settings for the that differ from the default settings. - + . + +- You specified settings for the that differ from the default settings. + ]]> @@ -608,11 +608,11 @@ The to use. Connects a and a to use a common XAML node set intermediary. Potentially transforms the content, depending on the types of readers and writers that are provided. - , where `closeWriter` is specified as `true`. - + , where `closeWriter` is specified as `true`. + ]]> diff --git a/xml/System.Xaml/XamlXmlReader.xml b/xml/System.Xaml/XamlXmlReader.xml index 307d09371a6..884a614383b 100644 --- a/xml/System.Xaml/XamlXmlReader.xml +++ b/xml/System.Xaml/XamlXmlReader.xml @@ -26,13 +26,13 @@ Processes XAML markup from XML files by using an intermediary, and produces a XAML node stream. - , an is required. The purpose of this design is to use established .NET Framework APIs for XML processing in order to handle stream input, to obtain a stream from a file, and so on. - - is the first component of the standard load path for XAML operations and is incorporated by as well as by several existing framework XAML implementations for loading XAML. - + , an is required. The purpose of this design is to use established .NET Framework APIs for XML processing in order to handle stream input, to obtain a stream from a file, and so on. + + is the first component of the standard load path for XAML operations and is incorporated by as well as by several existing framework XAML implementations for loading XAML. + ]]> @@ -161,11 +161,11 @@ The to use as the intermediary XML processor. Initializes a new instance of the class using the provided . - @@ -230,11 +230,11 @@ The specific reader settings. Initializes a new instance of the class, based on a stream, with XAML-specific settings. - . - + . + ]]> @@ -269,10 +269,10 @@ Initializes a new instance of the class, based on a , with a supplied schema context and XAML-specific settings. To be added. - is . - - -or- - + is . + + -or- + is . @@ -303,11 +303,11 @@ The specific reader settings. Initializes a new instance of the class, based on a , and using XAML-specific settings. - . - + . + ]]> @@ -403,11 +403,11 @@ The XAML schema context for XAML processing. Initializes a new instance of the class using the provided and schema context. - @@ -441,15 +441,15 @@ The specific XAML reader settings. Initializes a new instance of the class, using the provided and reader settings. - . - + . + ]]> - or is . + or is . @@ -481,11 +481,11 @@ The specific reader settings. Initializes a new instance of the class, based on a stream, with a supplied XAML schema context and XAML-specific settings. - . - + . + ]]> @@ -521,18 +521,18 @@ The specific reader settings. Initializes a new instance of the class, based on a , and using a supplied schema context and XAML-specific settings. - . - + . + ]]> - is . - - -or- - + is . + + -or- + is . @@ -565,18 +565,18 @@ The specific reader settings. Initializes a new instance of the class, based on the file name of a file to load into a default XML reader, and using a supplied XAML schema context and XAML-specific reader settings. - . - + . + ]]> - is . - - -or- - + is . + + -or- + is . @@ -609,11 +609,11 @@ The specific XAML reader settings. Initializes a new instance of the class using the provided , schema context, and reader settings. - . - + . + ]]> @@ -649,11 +649,11 @@ if line information is available; otherwise, . - implementation. The result is partially based on the reader settings that were used to initialize this . - + implementation. The result is partially based on the reader settings that were used to initialize this . + ]]> @@ -684,11 +684,11 @@ if the position is at the conceptual end-of-file in the node stream; otherwise, . - after exiting the bounds of the subtree. For more information, see . - + after exiting the bounds of the subtree. For more information, see . + ]]> @@ -721,11 +721,11 @@ Gets the line number to report. The line number to report. - implementation. Node types of , , , or can return a line number. Other node types return a value of 0. All node types return 0 if is `false`. - + implementation. Node types of , , , or can return a line number. Other node types return a value of 0. All node types return 0 if is `false`. + ]]> @@ -758,11 +758,11 @@ Gets the line position to report. The line position to report. - implementation. Node types of , , , or can return a line position. Other node types return a value of 0. All node types return 0 if is `false`. - + implementation. Node types of , , , or can return a line position. Other node types return a value of 0. All node types return 0 if is `false`. + ]]> @@ -820,11 +820,11 @@ Gets the XAML namespace from the current node. The XAML namespace from the current node, if it is available; otherwise, . - of the current position is . This property does not report the XAML namespace that applies to objects or members in a general scoping sense. Your implementation should cache XAML namespace information if you need it for specific operations. For default operations that involve the loaded XAML schema context, the acting XAML namespace is internally cached by XAML writer implementations. - + of the current position is . This property does not report the XAML namespace that applies to objects or members in a general scoping sense. Your implementation should cache XAML namespace information if you need it for specific operations. For default operations that involve the loaded XAML schema context, the acting XAML namespace is internally cached by XAML writer implementations. + ]]> @@ -883,15 +883,15 @@ if a node is available; otherwise, . - returns `false` also returns `true` for . - - Calling generally has the side effect of advancing the or . - - The next operation after calling and getting a `true` result is typically to check . For more information about XAML node stream concepts, see [Understanding XAML Node Stream Structures and Concepts](/dotnet/framework/xaml-services/understanding-xaml-node-stream-structures-and-concepts). - + returns `false` also returns `true` for . + + Calling generally has the side effect of advancing the or . + + The next operation after calling and getting a `true` result is typically to check . For more information about XAML node stream concepts, see [Understanding XAML Node Stream Structures and Concepts](/dotnet/framework/xaml-services/understanding-xaml-node-stream-structures-and-concepts). + ]]> @@ -923,11 +923,11 @@ Gets an object that provides schema information for the information set. An object that provides schema information for the information set. - of the reader is generally used by any associated writer. - + of the reader is generally used by any associated writer. + ]]> @@ -957,11 +957,11 @@ Gets the of the current node. The of the current node; or , if the position is not on an object. - of the current position is . - + of the current position is . + ]]> Understanding XAML Node Streams diff --git a/xml/System.Xml.Linq/XAttribute.xml b/xml/System.Xml.Linq/XAttribute.xml index 2db4848d75c..c407262531e 100644 --- a/xml/System.Xml.Linq/XAttribute.xml +++ b/xml/System.Xml.Linq/XAttribute.xml @@ -64,21 +64,21 @@ Represents an XML attribute. - contains a list of the attributes for that element. Attributes must have a qualified name that is unique to the element. Attributes are not derived from ; they are not nodes in the XML tree. Instead, they are simply name/value pairs associated with an element. - - Attributes are maintained in the XML tree in the order that they were added to the element. When a collection of attributes is returned by , they are returned in the order that they were added to the element, and are not sorted. - - Technically, in XML, namespace declarations are not attributes proper. However, this distinction is not normally made by many XML programmers. Instead, because namespace declarations have exactly the same XML syntax as attributes, most XML programmers think of namespaces as attributes. To simplify the LINQ to XML programming interface, namespaces are represented in the XML tree as attributes. Such namespace attributes impact serialization of an XML tree. When serializing, LINQ to XML attempts to serialize with the namespace prefix specified in namespace attributes. You can use the to determine if an attribute is really a namespace declaration. - - The class derives from . You can add annotations to attributes, and observe events for them. - - Some methods can be used from XAML. For more information, see [LINQ to XML Dynamic Properties](/dotnet/desktop/wpf/data/linq-to-xml-dynamic-properties). - + contains a list of the attributes for that element. Attributes must have a qualified name that is unique to the element. Attributes are not derived from ; they are not nodes in the XML tree. Instead, they are simply name/value pairs associated with an element. + + Attributes are maintained in the XML tree in the order that they were added to the element. When a collection of attributes is returned by , they are returned in the order that they were added to the element, and are not sorted. + + Technically, in XML, namespace declarations are not attributes proper. However, this distinction is not normally made by many XML programmers. Instead, because namespace declarations have exactly the same XML syntax as attributes, most XML programmers think of namespaces as attributes. To simplify the LINQ to XML programming interface, namespaces are represented in the XML tree as attributes. Such namespace attributes impact serialization of an XML tree. When serializing, LINQ to XML attempts to serialize with the namespace prefix specified in namespace attributes. You can use the to determine if an attribute is really a namespace declaration. + + The class derives from . You can add annotations to attributes, and observe events for them. + + Some methods can be used from XAML. For more information, see [LINQ to XML Dynamic Properties](/dotnet/desktop/wpf/data/linq-to-xml-dynamic-properties). + ]]> @@ -144,44 +144,44 @@ An object to copy from. Initializes a new instance of the class from another object. - "); -// Make a deep copy. -XElement root2 = new XElement(root1); -if (root1.Attribute("Att1") == root2.Attribute("Att1")) - Console.WriteLine("This will not be printed"); -else - Console.WriteLine("Creating a deep copy created a new attribute from the original."); -``` - -```vb -Dim root1 As XElement = -' Make a deep copy. -Dim root2 As XElement = New XElement(root1) -If root1.Attribute("Att1") Is root2.Attribute("Att1") Then - Console.WriteLine("This will not be printed") -Else - Console.WriteLine("Creating a deep copy created a new attribute from the original.") -End If -``` - - This example produces the following output: - -``` - -Creating a deep copy created a new attribute from the original. -``` - + "); +// Make a deep copy. +XElement root2 = new XElement(root1); +if (root1.Attribute("Att1") == root2.Attribute("Att1")) + Console.WriteLine("This will not be printed"); +else + Console.WriteLine("Creating a deep copy created a new attribute from the original."); +``` + +```vb +Dim root1 As XElement = +' Make a deep copy. +Dim root2 As XElement = New XElement(root1) +If root1.Attribute("Att1") Is root2.Attribute("Att1") Then + Console.WriteLine("This will not be printed") +Else + Console.WriteLine("Creating a deep copy created a new attribute from the original.") +End If +``` + + This example produces the following output: + +``` + +Creating a deep copy created a new attribute from the original. +``` + ]]> The parameter is . @@ -234,88 +234,88 @@ Creating a deep copy created a new attribute from the original. An containing the value of the attribute. Initializes a new instance of the class from the specified name and value. - . Typical use of this constructor is to specify a string as the first parameter instead of creating a new , as follows: - -```csharp -XElement root = new XElement("Root", - new XAttribute("AnAttributeName", "Content") -); -``` - - You can also use the addition operator overload with an and a string to create an , as follows: - -```csharp -XNamespace aw = "http://www.adventure-works.com"; -XElement root = new XElement(aw + "Root", - new XAttribute(aw + "AnAttributeName", "Content") -); -``` - - For more information, see [Work with XML Namespaces](/dotnet/standard/linq/namespaces-overview). - - These same approaches will work for Visual Basic, however XML literals provide a better approach for creating XML trees. - - The `value` parameter can be a , `double`, `float`, `decimal`, `bool`, , or . If the value is a or , the value of the attribute is formatted correctly per the W3C specifications. - - - -## Examples - The following example uses this constructor to create attributes. It passes strings as the first argument to the constructor, which are then implicitly converted to objects. The attributes are added to an element. - -```csharp -XElement root; - -double dbl = 12.345; -XAttribute[] attArray = { - new XAttribute("Att4", 1), - new XAttribute("Att5", 2), - new XAttribute("Att6", 3) -}; -DateTime dt = new DateTime(2006, 10, 6, 12, 30, 00); - -// string content -root = new XElement("Root", - new XAttribute("Att1", "Some text"), - - // double content - new XAttribute("Att2", dbl), - - // DateTime content - new XAttribute("Att3", dt), - - // XAttribute array content - attArray -); - -Console.WriteLine(root); -``` - -```vb -Dim dbl As Double = 12.345 -Dim attArray As XAttribute() = { _ - New XAttribute("Att4", 1), _ - New XAttribute("Att5", 2), _ - New XAttribute("Att6", 3) _ -} -Dim dt As DateTime = New DateTime(2006, 10, 6, 12, 30, 0) -Dim root As XElement = - Att3=<%= dt %> - <%= attArray %> - /> -Console.WriteLine(root) -``` - - This example produces the following output: - -``` - - -``` - + . Typical use of this constructor is to specify a string as the first parameter instead of creating a new , as follows: + +```csharp +XElement root = new XElement("Root", + new XAttribute("AnAttributeName", "Content") +); +``` + + You can also use the addition operator overload with an and a string to create an , as follows: + +```csharp +XNamespace aw = "http://www.adventure-works.com"; +XElement root = new XElement(aw + "Root", + new XAttribute(aw + "AnAttributeName", "Content") +); +``` + + For more information, see [Work with XML Namespaces](/dotnet/standard/linq/namespaces-overview). + + These same approaches will work for Visual Basic, however XML literals provide a better approach for creating XML trees. + + The `value` parameter can be a , `double`, `float`, `decimal`, `bool`, , or . If the value is a or , the value of the attribute is formatted correctly per the W3C specifications. + + + +## Examples + The following example uses this constructor to create attributes. It passes strings as the first argument to the constructor, which are then implicitly converted to objects. The attributes are added to an element. + +```csharp +XElement root; + +double dbl = 12.345; +XAttribute[] attArray = { + new XAttribute("Att4", 1), + new XAttribute("Att5", 2), + new XAttribute("Att6", 3) +}; +DateTime dt = new DateTime(2006, 10, 6, 12, 30, 00); + +// string content +root = new XElement("Root", + new XAttribute("Att1", "Some text"), + + // double content + new XAttribute("Att2", dbl), + + // DateTime content + new XAttribute("Att3", dt), + + // XAttribute array content + attArray +); + +Console.WriteLine(root); +``` + +```vb +Dim dbl As Double = 12.345 +Dim attArray As XAttribute() = { _ + New XAttribute("Att4", 1), _ + New XAttribute("Att5", 2), _ + New XAttribute("Att6", 3) _ +} +Dim dt As DateTime = New DateTime(2006, 10, 6, 12, 30, 0) +Dim root As XElement = + Att3=<%= dt %> + <%= attArray %> + /> +Console.WriteLine(root) +``` + + This example produces the following output: + +``` + + +``` + ]]> The or parameter is . @@ -366,11 +366,11 @@ Console.WriteLine(root) Gets an empty collection of attributes. An of containing an empty collection. - objects. - + objects. + ]]> @@ -419,51 +419,51 @@ Console.WriteLine(root) if this attribute is a namespace declaration; otherwise . - - -For Each att As XAttribute In root.Attributes() - If (att.IsNamespaceDeclaration) Then - Console.WriteLine("{0} is a namespace declaration", att.Name) - Else - Console.WriteLine("{0} is not a namespace declaration", att.Name) - End If -Next -``` - - This example produces the following output: - -``` -{http://www.w3.org/2000/xmlns/}aw is a namespace declaration -{http://www.adventure-works.com}Att is not a namespace declaration -``` - + + +For Each att As XAttribute In root.Attributes() + If (att.IsNamespaceDeclaration) Then + Console.WriteLine("{0} is a namespace declaration", att.Name) + Else + Console.WriteLine("{0} is not a namespace declaration", att.Name) + End If +Next +``` + + This example produces the following output: + +``` +{http://www.w3.org/2000/xmlns/}aw is a namespace declaration +{http://www.adventure-works.com}Att is not a namespace declaration +``` + ]]> @@ -516,71 +516,71 @@ Next Gets the expanded name of this attribute. An containing the name of this attribute. - - -For Each att As XAttribute In root.Attributes() - Console.WriteLine("{0}={1}", att.Name, att.Value) -Next -Console.WriteLine("") - -Dim NewRoot As XElement = _ ->_ - - -For Each att As XAttribute In NewRoot.Attributes() - Console.WriteLine("{0}={1}", att.Name, att.Value) -Next - -``` - - This example produces the following output: - -``` -{http://www.w3.org/2000/xmlns/}aw=http://www.adventure-works.com -{http://www.adventure-works.com}Att=content -Att2=different content - -Att2=new content -``` - + + +For Each att As XAttribute In root.Attributes() + Console.WriteLine("{0}={1}", att.Name, att.Value) +Next +Console.WriteLine("") + +Dim NewRoot As XElement = _ +>_ + + +For Each att As XAttribute In NewRoot.Attributes() + Console.WriteLine("{0}={1}", att.Name, att.Value) +Next + +``` + + This example produces the following output: + +``` +{http://www.w3.org/2000/xmlns/}aw=http://www.adventure-works.com +{http://www.adventure-works.com}Att=content +Att2=different content + +Att2=new content +``` + ]]> @@ -636,52 +636,52 @@ Att2=new content Gets the next attribute of the parent element. An containing the next attribute of the parent element. - , they are returned in the order that they were added, and are not sorted. When you request the next attribute through this property, this property returns the attribute that was added after this attribute. - - If this attribute does not have a parent, or if there is no next attribute, then this property returns `null`. - - - -## Examples - The following example shows how to iterate through the attributes of an element using this property. - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att1", 1), - new XAttribute("Att2", 2), - new XAttribute("Att3", 3), - new XAttribute("Att4", 4) -); - -XAttribute att = root.FirstAttribute; -do { - Console.WriteLine(att); -} -while((att = att.NextAttribute) != null); -``` - -```vb -Dim root As XElement = -Dim att As XAttribute = root.FirstAttribute -Dim val As Boolean = True -Do - Console.WriteLine(att) - att = att.NextAttribute -Loop While (Not (att Is Nothing)) -``` - - This example produces the following output: - -``` -Att1="1" -Att2="2" -Att3="3" -Att4="4" -``` - + , they are returned in the order that they were added, and are not sorted. When you request the next attribute through this property, this property returns the attribute that was added after this attribute. + + If this attribute does not have a parent, or if there is no next attribute, then this property returns `null`. + + + +## Examples + The following example shows how to iterate through the attributes of an element using this property. + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att1", 1), + new XAttribute("Att2", 2), + new XAttribute("Att3", 3), + new XAttribute("Att4", 4) +); + +XAttribute att = root.FirstAttribute; +do { + Console.WriteLine(att); +} +while((att = att.NextAttribute) != null); +``` + +```vb +Dim root As XElement = +Dim att As XAttribute = root.FirstAttribute +Dim val As Boolean = True +Do + Console.WriteLine(att) + att = att.NextAttribute +Loop While (Not (att Is Nothing)) +``` + + This example produces the following output: + +``` +Att1="1" +Att2="2" +Att3="3" +Att4="4" +``` + ]]> @@ -728,38 +728,38 @@ Att4="4" Gets the node type for this node. The node type. For objects, this value is . - contain a property, you can write code that operates on collections of concrete subclass of . Your code can then test for the node type of each node in the collection. - - - -## Examples - The following example creates an attribute, and then displays the node type using this property. - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", "content") -); - -XAttribute att = root.FirstAttribute; -Console.WriteLine(att.NodeType); -``` - -```vb -Dim root As XElement = -Dim att As XAttribute = root.FirstAttribute -Console.WriteLine(att.NodeType.ToString) -``` - - This example produces the following output: - -``` - -Attribute -``` - + contain a property, you can write code that operates on collections of concrete subclass of . Your code can then test for the node type of each node in the collection. + + + +## Examples + The following example creates an attribute, and then displays the node type using this property. + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", "content") +); + +XAttribute att = root.FirstAttribute; +Console.WriteLine(att.NodeType); +``` + +```vb +Dim root As XElement = +Dim att As XAttribute = root.FirstAttribute +Console.WriteLine(att.NodeType.ToString) +``` + + This example produces the following output: + +``` + +Attribute +``` + ]]> @@ -817,34 +817,34 @@ Attribute Cast the value of this to a . A that contains the content of this . - from an attribute or element, allowed values are "0", "1", and any string that produces "true" or "false" after trimming and conversion to lower case. - -## Examples - The following example creates an attribute with a value, then casts it to . - -```csharp -XElement root = new XElement("Root", - new XAttribute("BoolValue", true) -); -bool bv = (bool)root.Attribute("BoolValue"); -Console.WriteLine("(bool)BoolValue={0}", bv); -``` - -```vb -Dim root As XElement = -Dim bv As Boolean = CBool(root.Attribute("BoolValue")) -Console.WriteLine("(bool)BoolValue={0}", bv) -``` - - This example produces the following output: - -``` -(bool)BoolValue=True -``` - + from an attribute or element, allowed values are "0", "1", and any string that produces "true" or "false" after trimming and conversion to lower case. + +## Examples + The following example creates an attribute with a value, then casts it to . + +```csharp +XElement root = new XElement("Root", + new XAttribute("BoolValue", true) +); +bool bv = (bool)root.Attribute("BoolValue"); +Console.WriteLine("(bool)BoolValue={0}", bv); +``` + +```vb +Dim root As XElement = +Dim bv As Boolean = CBool(root.Attribute("BoolValue")) +Console.WriteLine("(bool)BoolValue={0}", bv) +``` + + This example produces the following output: + +``` +(bool)BoolValue=True +``` + ]]> The attribute does not contain a valid value. @@ -903,71 +903,71 @@ Console.WriteLine("(bool)BoolValue={0}", bv) Cast the value of this to a . A that contains the content of this . - from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a . - - This conversion operator uses to convert from a . - -## Examples - The following example creates an attribute with date and time content. It then casts it to to retrieve the value. - -```csharp -// Behavior is strict when formatting an XML element or attribute from a DateTime, -// but behavior is lax when casting to a DateTime from an element or attribute. - -XElement root = new XElement("Root", - new XAttribute("Att", new DateTime(2006, 10, 6, 12, 30, 0)) -); -Console.WriteLine(root); - -// casting from a strictly formatted XML attribute -DateTime dt = (DateTime)root.Attribute("Att"); -Console.WriteLine("dt={0}", dt); -Console.WriteLine("-----"); - -// if root is formatted in some different way than the standard ISO 8601, if at all possible, -// the value is appropriately converted to DateTime - -XAttribute dtAtt = new XAttribute("OrderDate", "October 6, 2006"); -Console.WriteLine(dtAtt); -DateTime orderDate = (DateTime)dtAtt; -Console.WriteLine("OrderDate={0:d}", orderDate); -``` - -```vb -' Behavior is strict when formatting an XML element or attribute from a DateTime, -' but behavior is lax when casting to a DateTime from an element or attribute. -Dim root As XElement = /> - -Console.WriteLine(root) - -' casting from a strictly formatted XML attribute -Dim dt As DateTime = CType(root.Attribute("Att"), DateTime) -Console.WriteLine("dt={0}", dt) -Console.WriteLine("-----") - -' if root is formatted in some different way than the standard ISO 8601, if at all possible, -' the value is appropriately converted to DateTime -Dim dtAtt As XAttribute = New XAttribute("OrderDate", "October 6, 2006") -Console.WriteLine(dtAtt) -Dim orderDate As DateTime = CType(dtAtt, DateTime) -Console.WriteLine("OrderDate={0:d}", orderDate) -``` - - This example produces the following output: - -``` - -dt=10/6/2006 12:30:00 PM ------ -OrderDate="October 6, 2006" -OrderDate=10/6/2006 -``` - + from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a . + + This conversion operator uses to convert from a . + +## Examples + The following example creates an attribute with date and time content. It then casts it to to retrieve the value. + +```csharp +// Behavior is strict when formatting an XML element or attribute from a DateTime, +// but behavior is lax when casting to a DateTime from an element or attribute. + +XElement root = new XElement("Root", + new XAttribute("Att", new DateTime(2006, 10, 6, 12, 30, 0)) +); +Console.WriteLine(root); + +// casting from a strictly formatted XML attribute +DateTime dt = (DateTime)root.Attribute("Att"); +Console.WriteLine("dt={0}", dt); +Console.WriteLine("-----"); + +// if root is formatted in some different way than the standard ISO 8601, if at all possible, +// the value is appropriately converted to DateTime + +XAttribute dtAtt = new XAttribute("OrderDate", "October 6, 2006"); +Console.WriteLine(dtAtt); +DateTime orderDate = (DateTime)dtAtt; +Console.WriteLine("OrderDate={0:d}", orderDate); +``` + +```vb +' Behavior is strict when formatting an XML element or attribute from a DateTime, +' but behavior is lax when casting to a DateTime from an element or attribute. +Dim root As XElement = /> + +Console.WriteLine(root) + +' casting from a strictly formatted XML attribute +Dim dt As DateTime = CType(root.Attribute("Att"), DateTime) +Console.WriteLine("dt={0}", dt) +Console.WriteLine("-----") + +' if root is formatted in some different way than the standard ISO 8601, if at all possible, +' the value is appropriately converted to DateTime +Dim dtAtt As XAttribute = New XAttribute("OrderDate", "October 6, 2006") +Console.WriteLine(dtAtt) +Dim orderDate As DateTime = CType(dtAtt, DateTime) +Console.WriteLine("OrderDate={0:d}", orderDate) +``` + + This example produces the following output: + +``` + +dt=10/6/2006 12:30:00 PM +----- +OrderDate="October 6, 2006" +OrderDate=10/6/2006 +``` + ]]> The attribute does not contain a valid value. @@ -1026,43 +1026,43 @@ OrderDate=10/6/2006 Cast the value of this to a . A that contains the content of this . - class to do the conversion. - -## Examples - The following example creates an attribute with date and time content. It then casts it to to retrieve the value. - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", new DateTimeOffset(new DateTime(2006, 10, 6, 12, 30, 0))) -); -Console.WriteLine(root); - -// casting from a strictly formatted XML attribute -DateTimeOffset dt = (DateTimeOffset)root.Attribute("Att"); -Console.WriteLine("dt={0}", dt); -``` - -```vb -Dim root As XElement = _ - /> -Console.WriteLine(root) - -' casting from a strictly formatted XML attribute -Dim dt As DateTimeOffset = CType(root.Attribute("Att"), DateTimeOffset) -Console.WriteLine("dt={0}", dt) -``` - - This example produces the following output: - -``` - -dt=10/6/2006 12:30:00 PM -07:00 -``` - + class to do the conversion. + +## Examples + The following example creates an attribute with date and time content. It then casts it to to retrieve the value. + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", new DateTimeOffset(new DateTime(2006, 10, 6, 12, 30, 0))) +); +Console.WriteLine(root); + +// casting from a strictly formatted XML attribute +DateTimeOffset dt = (DateTimeOffset)root.Attribute("Att"); +Console.WriteLine("dt={0}", dt); +``` + +```vb +Dim root As XElement = _ + /> +Console.WriteLine(root) + +' casting from a strictly formatted XML attribute +Dim dt As DateTimeOffset = CType(root.Attribute("Att"), DateTimeOffset) +Console.WriteLine("dt={0}", dt) +``` + + This example produces the following output: + +``` + +dt=10/6/2006 12:30:00 PM -07:00 +``` + ]]> The attribute does not contain a valid value. @@ -1121,29 +1121,29 @@ dt=10/6/2006 12:30:00 PM -07:00 Cast the value of this to a . A that contains the content of this . - . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", "79228162514264337593543950335") -); -decimal value = (decimal)root.Attribute("Att"); -Console.WriteLine("value={0}", value); -``` - -```vb -Dim root As XElement = -Dim value As Decimal = CDec(root.Attribute("Att")) -Console.WriteLine("value={0}", value) -``` - - This example produces the following output: - -``` -value=79228162514264337593543950335 -``` - + . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", "79228162514264337593543950335") +); +decimal value = (decimal)root.Attribute("Att"); +Console.WriteLine("value={0}", value); +``` + +```vb +Dim root As XElement = +Dim value As Decimal = CDec(root.Attribute("Att")) +Console.WriteLine("value={0}", value) +``` + + This example produces the following output: + +``` +value=79228162514264337593543950335 +``` + ]]> The attribute does not contain a valid value. @@ -1202,29 +1202,29 @@ value=79228162514264337593543950335 Cast the value of this to a . A that contains the content of this . - content. It then retrieves the value by casting to . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 1.79769313486231e308) -); -double value = (double)root.Attribute("Att"); -Console.WriteLine("value={0}", value); -``` - -```vb -Dim root As XElement = -Dim value As Double = CDbl(root.Attribute("Att")) -Console.WriteLine("value={0}", value) -``` - - This example produces the following output: - -``` -value=1.79769313486231E+308 -``` - + content. It then retrieves the value by casting to . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 1.79769313486231e308) +); +double value = (double)root.Attribute("Att"); +Console.WriteLine("value={0}", value); +``` + +```vb +Dim root As XElement = +Dim value As Double = CDbl(root.Attribute("Att")) +Console.WriteLine("value={0}", value) +``` + + This example produces the following output: + +``` +value=1.79769313486231E+308 +``` + ]]> The attribute does not contain a valid value. @@ -1283,29 +1283,29 @@ value=1.79769313486231E+308 Cast the value of this to a . A that contains the content of this . - . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", new Guid("3c1cc55b-baff-4b7a-9d17-077af3aa5730")) -); -Guid value = (Guid)root.Attribute("Att"); -Console.WriteLine("value={0}", value); -``` - -```vb -Dim root As XElement = /> -Dim value As Guid = CType(root.Attribute("Att"), Guid) -Console.WriteLine("value={0}", value) -``` - - This example produces the following output: - -``` -value=3c1cc55b-baff-4b7a-9d17-077af3aa5730 -``` - + . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", new Guid("3c1cc55b-baff-4b7a-9d17-077af3aa5730")) +); +Guid value = (Guid)root.Attribute("Att"); +Console.WriteLine("value={0}", value); +``` + +```vb +Dim root As XElement = /> +Dim value As Guid = CType(root.Attribute("Att"), Guid) +Console.WriteLine("value={0}", value) +``` + + This example produces the following output: + +``` +value=3c1cc55b-baff-4b7a-9d17-077af3aa5730 +``` + ]]> The attribute does not contain a valid value. @@ -1364,29 +1364,29 @@ value=3c1cc55b-baff-4b7a-9d17-077af3aa5730 Cast the value of this to an . A that contains the content of this . - . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 2147483647) -); -int value = (int)root.Attribute("Att"); -Console.WriteLine("value={0}", value); -``` - -```vb -Dim root As XElement = -Dim value As Integer = CInt(root.Attribute("Att")) -Console.WriteLine("value={0}", value) -``` - - This example produces the following output: - -``` -value=2147483647 -``` - + . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 2147483647) +); +int value = (int)root.Attribute("Att"); +Console.WriteLine("value={0}", value); +``` + +```vb +Dim root As XElement = +Dim value As Integer = CInt(root.Attribute("Att")) +Console.WriteLine("value={0}", value) +``` + + This example produces the following output: + +``` +value=2147483647 +``` + ]]> The attribute does not contain a valid value. @@ -1445,29 +1445,29 @@ value=2147483647 Cast the value of this to an . A that contains the content of this . - . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 9223372036854775807) -); -long value = (long)root.Attribute("Att"); -Console.WriteLine("value={0}", value); -``` - -```vb -Dim root As XElement = -Dim value As Long = CLng(root.Attribute("Att")) -Console.WriteLine("value={0}", value) -``` - - This example produces the following output: - -``` -value=9223372036854775807 -``` - + . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 9223372036854775807) +); +long value = (long)root.Attribute("Att"); +Console.WriteLine("value={0}", value); +``` + +```vb +Dim root As XElement = +Dim value As Long = CLng(root.Attribute("Att")) +Console.WriteLine("value={0}", value) +``` + + This example produces the following output: + +``` +value=9223372036854775807 +``` + ]]> The attribute does not contain a valid value. @@ -1527,40 +1527,40 @@ value=9223372036854775807 Cast the value of this to a of . A of that contains the content of this . - from an attribute or element, allowed values are "0", "1", and any string that produces "true" or "false" after trimming and conversion to lower case. - -## Examples - The following example creates an attribute with Boolean content. It then retrieves the value by casting to of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("BoolValue1", true), - new XAttribute("BoolValue2", false) -); -bool? bool1 = (bool?)root.Attribute("BoolValue1"); -bool? bool2 = (bool?)root.Attribute("BoolValue2"); -Console.WriteLine("Nullable boolean: BoolValue1={0}", bool1); -Console.WriteLine("Nullable boolean: BoolValue2={0}", bool2); -``` - -```vb -Dim root As XElement = -Dim bool1 As Nullable(Of Boolean) = CType(root.Attribute("BoolValue1"), Nullable(Of Boolean)) -Dim bool2 As Nullable(Of Boolean) = CType(root.Attribute("BoolValue2"), Nullable(Of Boolean)) -Console.WriteLine("Nullable boolean: BoolValue1={0}", bool1) -Console.WriteLine("Nullable boolean: BoolValue2={0}", bool2) -``` - - This example produces the following output: - -``` -Nullable boolean: BoolValue1=True -Nullable boolean: BoolValue2=False -``` - + from an attribute or element, allowed values are "0", "1", and any string that produces "true" or "false" after trimming and conversion to lower case. + +## Examples + The following example creates an attribute with Boolean content. It then retrieves the value by casting to of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("BoolValue1", true), + new XAttribute("BoolValue2", false) +); +bool? bool1 = (bool?)root.Attribute("BoolValue1"); +bool? bool2 = (bool?)root.Attribute("BoolValue2"); +Console.WriteLine("Nullable boolean: BoolValue1={0}", bool1); +Console.WriteLine("Nullable boolean: BoolValue2={0}", bool2); +``` + +```vb +Dim root As XElement = +Dim bool1 As Nullable(Of Boolean) = CType(root.Attribute("BoolValue1"), Nullable(Of Boolean)) +Dim bool2 As Nullable(Of Boolean) = CType(root.Attribute("BoolValue2"), Nullable(Of Boolean)) +Console.WriteLine("Nullable boolean: BoolValue1={0}", bool1) +Console.WriteLine("Nullable boolean: BoolValue2={0}", bool2) +``` + + This example produces the following output: + +``` +Nullable boolean: BoolValue1=True +Nullable boolean: BoolValue2=False +``` + ]]> The attribute does not contain a valid value. @@ -1619,38 +1619,38 @@ Nullable boolean: BoolValue2=False Cast the value of this to a of . A of that contains the content of this . - of from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a of . - - This conversion operator uses to convert from a . - -## Examples - The following example creates an attribute with a date and time as content. It then retrieves the value by casting to of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", new DateTime(2006, 10, 6, 12, 30, 0)) -); -DateTime? value = (DateTime?)root.Attribute("Att"); -Console.WriteLine("Nullable DateTime: value={0}", value == null ? "null" : value.ToString()); -``` - -```vb -Dim root As XElement = /> -Dim value As Nullable(Of DateTime) = CType(root.Attribute("Att"), Nullable(Of DateTime)) -Console.WriteLine("Nullable DateTime: value={0}", IIf(value.HasValue, value.ToString(), "null")) -``` - - This example produces the following output: - -``` -Nullable DateTime: value=10/6/2006 12:30:00 PM -``` - + of from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a of . + + This conversion operator uses to convert from a . + +## Examples + The following example creates an attribute with a date and time as content. It then retrieves the value by casting to of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", new DateTime(2006, 10, 6, 12, 30, 0)) +); +DateTime? value = (DateTime?)root.Attribute("Att"); +Console.WriteLine("Nullable DateTime: value={0}", value == null ? "null" : value.ToString()); +``` + +```vb +Dim root As XElement = /> +Dim value As Nullable(Of DateTime) = CType(root.Attribute("Att"), Nullable(Of DateTime)) +Console.WriteLine("Nullable DateTime: value={0}", IIf(value.HasValue, value.ToString(), "null")) +``` + + This example produces the following output: + +``` +Nullable DateTime: value=10/6/2006 12:30:00 PM +``` + ]]> The attribute does not contain a valid value. @@ -1709,36 +1709,36 @@ Nullable DateTime: value=10/6/2006 12:30:00 PM Cast the value of this to a of . A of that contains the content of this . - class to do the conversion. - -## Examples - The following example creates an attribute with a date and time as content. It then retrieves the value by casting to of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", new DateTimeOffset(new DateTime(2006, 10, 6, 12, 30, 0))) -); -DateTimeOffset? value = (DateTimeOffset?)root.Attribute("Att"); -Console.WriteLine("Nullable DateTimeOffset: value={0}", value == null ? "null" : value.ToString()); -``` - -```vb -Dim root As XElement = _ - /> -Dim value As Nullable(Of DateTimeOffset) = CType(root.Attribute("Att"), Nullable(Of DateTimeOffset)) -Console.WriteLine("Nullable DateTimeOffset: value={0}", IIf(value.HasValue, value.ToString(), "null")) -``` - - This example produces the following output: - -``` -Nullable DateTimeOffset: value=10/6/2006 12:30:00 PM -07:00 -``` - + class to do the conversion. + +## Examples + The following example creates an attribute with a date and time as content. It then retrieves the value by casting to of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", new DateTimeOffset(new DateTime(2006, 10, 6, 12, 30, 0))) +); +DateTimeOffset? value = (DateTimeOffset?)root.Attribute("Att"); +Console.WriteLine("Nullable DateTimeOffset: value={0}", value == null ? "null" : value.ToString()); +``` + +```vb +Dim root As XElement = _ + /> +Dim value As Nullable(Of DateTimeOffset) = CType(root.Attribute("Att"), Nullable(Of DateTimeOffset)) +Console.WriteLine("Nullable DateTimeOffset: value={0}", IIf(value.HasValue, value.ToString(), "null")) +``` + + This example produces the following output: + +``` +Nullable DateTimeOffset: value=10/6/2006 12:30:00 PM -07:00 +``` + ]]> The attribute does not contain a valid value. @@ -1795,29 +1795,29 @@ Nullable DateTimeOffset: value=10/6/2006 12:30:00 PM -07:00 Cast the value of this to a of . A of that contains the content of this . - of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", "79228162514264337593543950335") -); -decimal? value = (decimal?)root.Attribute("Att"); -Console.WriteLine("Nullable decimal: value={0}", value == null ? "null" : value.ToString()); -``` - -```vb -Dim root As XElement = -Dim value As Nullable(Of Decimal) = CType(root.Attribute("Att"), Nullable(Of Decimal)) -Console.WriteLine("Nullable decimal: value={0}", IIf(value.HasValue, value.ToString(), "null")) -``` - - This example produces the following output: - -``` -Nullable decimal: value=79228162514264337593543950335 -``` - + of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", "79228162514264337593543950335") +); +decimal? value = (decimal?)root.Attribute("Att"); +Console.WriteLine("Nullable decimal: value={0}", value == null ? "null" : value.ToString()); +``` + +```vb +Dim root As XElement = +Dim value As Nullable(Of Decimal) = CType(root.Attribute("Att"), Nullable(Of Decimal)) +Console.WriteLine("Nullable decimal: value={0}", IIf(value.HasValue, value.ToString(), "null")) +``` + + This example produces the following output: + +``` +Nullable decimal: value=79228162514264337593543950335 +``` + ]]> The attribute does not contain a valid value. @@ -1876,29 +1876,29 @@ Nullable decimal: value=79228162514264337593543950335 Cast the value of this to a of . A of that contains the content of this . - of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 1.79769313486231e308) -); -double? value = (double?)root.Attribute("Att"); -Console.WriteLine("Nullable double: value={0}", value == null ? "null" : value.ToString()); -``` - -```vb -Dim root As XElement = -Dim value As Nullable(Of Double) = CType(root.Attribute("Att"), Nullable(Of Double)) -Console.WriteLine("Nullable double: value={0}", IIf(value.HasValue, value.ToString(), "null")) -``` - - This example produces the following output: - -``` -Nullable double: value=1.79769313486231E+308 -``` - + of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 1.79769313486231e308) +); +double? value = (double?)root.Attribute("Att"); +Console.WriteLine("Nullable double: value={0}", value == null ? "null" : value.ToString()); +``` + +```vb +Dim root As XElement = +Dim value As Nullable(Of Double) = CType(root.Attribute("Att"), Nullable(Of Double)) +Console.WriteLine("Nullable double: value={0}", IIf(value.HasValue, value.ToString(), "null")) +``` + + This example produces the following output: + +``` +Nullable double: value=1.79769313486231E+308 +``` + ]]> The attribute does not contain a valid value. @@ -1957,29 +1957,29 @@ Nullable double: value=1.79769313486231E+308 Cast the value of this to a of . A of that contains the content of this . - of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", new Guid("3c1cc55b-baff-4b7a-9d17-077af3aa5730")) -); -Guid? value = (Guid?)root.Attribute("Att"); -Console.WriteLine("Nullable Guid: value={0}", value == null ? "null" : value.ToString()); -``` - -```vb -Dim root As XElement = /> -Dim value As Nullable(Of Guid) = CType(root.Attribute("Att"), Nullable(Of Guid)) -Console.WriteLine("Nullable Guid: value={0}", IIf(value.HasValue, value.ToString(), "null")) -``` - - This example produces the following output: - -``` -Nullable Guid: value=3c1cc55b-baff-4b7a-9d17-077af3aa5730 -``` - + of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", new Guid("3c1cc55b-baff-4b7a-9d17-077af3aa5730")) +); +Guid? value = (Guid?)root.Attribute("Att"); +Console.WriteLine("Nullable Guid: value={0}", value == null ? "null" : value.ToString()); +``` + +```vb +Dim root As XElement = /> +Dim value As Nullable(Of Guid) = CType(root.Attribute("Att"), Nullable(Of Guid)) +Console.WriteLine("Nullable Guid: value={0}", IIf(value.HasValue, value.ToString(), "null")) +``` + + This example produces the following output: + +``` +Nullable Guid: value=3c1cc55b-baff-4b7a-9d17-077af3aa5730 +``` + ]]> The attribute does not contain a valid value. @@ -2038,29 +2038,29 @@ Nullable Guid: value=3c1cc55b-baff-4b7a-9d17-077af3aa5730 Cast the value of this to a of . A of that contains the content of this . - of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 2147483647) -); -int? value = (int?)root.Attribute("Att"); -Console.WriteLine("Nullable int: value={0}", value == null ? "null" : value.ToString()); -``` - -```vb -Dim root As XElement = -Dim value As Nullable(Of Integer) = CType(root.Attribute("Att"), Nullable(Of Integer)) -Console.WriteLine("Nullable int: value={0}", IIf(value.HasValue, value.ToString(), "null")) -``` - - This example produces the following output: - -``` -Nullable int: value=2147483647 -``` - + of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 2147483647) +); +int? value = (int?)root.Attribute("Att"); +Console.WriteLine("Nullable int: value={0}", value == null ? "null" : value.ToString()); +``` + +```vb +Dim root As XElement = +Dim value As Nullable(Of Integer) = CType(root.Attribute("Att"), Nullable(Of Integer)) +Console.WriteLine("Nullable int: value={0}", IIf(value.HasValue, value.ToString(), "null")) +``` + + This example produces the following output: + +``` +Nullable int: value=2147483647 +``` + ]]> @@ -2118,29 +2118,29 @@ Nullable int: value=2147483647 Cast the value of this to a of . A of that contains the content of this . - of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 9223372036854775807) -); -long? value = (long?)root.Attribute("Att"); -Console.WriteLine("Nullable long: value={0}", value == null ? "null" : value.ToString()); -``` - -```vb -Dim root As XElement = -Dim value As Nullable(Of Long) = CType(root.Attribute("Att"), Nullable(Of Long)) -Console.WriteLine("Nullable long: value={0}", IIf(value.HasValue, value.ToString(), "null")) -``` - - This example produces the following output: - -``` -Nullable long: value=9223372036854775807 -``` - + of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 9223372036854775807) +); +long? value = (long?)root.Attribute("Att"); +Console.WriteLine("Nullable long: value={0}", value == null ? "null" : value.ToString()); +``` + +```vb +Dim root As XElement = +Dim value As Nullable(Of Long) = CType(root.Attribute("Att"), Nullable(Of Long)) +Console.WriteLine("Nullable long: value={0}", IIf(value.HasValue, value.ToString(), "null")) +``` + + This example produces the following output: + +``` +Nullable long: value=9223372036854775807 +``` + ]]> The attribute does not contain a valid value. @@ -2199,29 +2199,29 @@ Nullable long: value=9223372036854775807 Cast the value of this to a of . A of that contains the content of this . - of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 3.402823e38) -); -float? value = (float?)root.Attribute("Att"); -Console.WriteLine("Nullable Single: value={0}", value == null ? "null" : value.ToString()); -``` - -```vb -Dim root As XElement = -Dim value As Nullable(Of Single) = CType(root.Attribute("Att"), Nullable(Of Single)) -Console.WriteLine("Nullable Single: value={0}", IIf(value.HasValue, value.ToString(), "null")) -``` - - This example produces the following output: - -``` -Nullable Single: value=3.402823E+38 -``` - + of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 3.402823e38) +); +float? value = (float?)root.Attribute("Att"); +Console.WriteLine("Nullable Single: value={0}", value == null ? "null" : value.ToString()); +``` + +```vb +Dim root As XElement = +Dim value As Nullable(Of Single) = CType(root.Attribute("Att"), Nullable(Of Single)) +Console.WriteLine("Nullable Single: value={0}", IIf(value.HasValue, value.ToString(), "null")) +``` + + This example produces the following output: + +``` +Nullable Single: value=3.402823E+38 +``` + ]]> The attribute does not contain a valid value. @@ -2280,36 +2280,36 @@ Nullable Single: value=3.402823E+38 Cast the value of this to a of . A of that contains the content of this . - of from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a of . - -## Examples - The following example creates an attribute with time span content. It then retrieves the value by casting to of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", new TimeSpan(1, 5, 30)) -); -TimeSpan? value = (TimeSpan?)root.Attribute("Att"); -Console.WriteLine("Nullable TimeSpan: value={0}", value == null ? "null" : value.ToString()); -``` - -```vb -Dim root As XElement = /> -Dim value As Nullable(Of TimeSpan) = CType(root.Attribute("Att"), Nullable(Of TimeSpan)) -Console.WriteLine("Nullable TimeSpan: value={0}", IIf(value.HasValue, value.ToString(), "null")) -``` - - This example produces the following output: - -``` -Nullable TimeSpan: value=01:05:30 -``` - + of from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a of . + +## Examples + The following example creates an attribute with time span content. It then retrieves the value by casting to of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", new TimeSpan(1, 5, 30)) +); +TimeSpan? value = (TimeSpan?)root.Attribute("Att"); +Console.WriteLine("Nullable TimeSpan: value={0}", value == null ? "null" : value.ToString()); +``` + +```vb +Dim root As XElement = /> +Dim value As Nullable(Of TimeSpan) = CType(root.Attribute("Att"), Nullable(Of TimeSpan)) +Console.WriteLine("Nullable TimeSpan: value={0}", IIf(value.HasValue, value.ToString(), "null")) +``` + + This example produces the following output: + +``` +Nullable TimeSpan: value=01:05:30 +``` + ]]> The attribute does not contain a valid value. @@ -2368,29 +2368,29 @@ Nullable TimeSpan: value=01:05:30 Cast the value of this to a of . A of that contains the content of this . - of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 4294967295) -); -uint? value = (uint?)root.Attribute("Att"); -Console.WriteLine("Nullable uint: value={0}", value == null ? "null" : value.ToString()); -``` - -```vb -Dim root As XElement = -Dim value As Nullable(Of UInteger) = CType(root.Attribute("Att"), Nullable(Of UInteger)) -Console.WriteLine("Nullable uint: value={0}", IIf(value.HasValue, value.ToString(), "null")) -``` - - This example produces the following output: - -``` -Nullable uint: value=4294967295 -``` - + of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 4294967295) +); +uint? value = (uint?)root.Attribute("Att"); +Console.WriteLine("Nullable uint: value={0}", value == null ? "null" : value.ToString()); +``` + +```vb +Dim root As XElement = +Dim value As Nullable(Of UInteger) = CType(root.Attribute("Att"), Nullable(Of UInteger)) +Console.WriteLine("Nullable uint: value={0}", IIf(value.HasValue, value.ToString(), "null")) +``` + + This example produces the following output: + +``` +Nullable uint: value=4294967295 +``` + ]]> The attribute does not contain a valid value. @@ -2449,29 +2449,29 @@ Nullable uint: value=4294967295 Cast the value of this to a of . A of that contains the content of this . - of . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 9223372036854775807) -); -ulong? value = (ulong?)root.Attribute("Att"); -Console.WriteLine("Nullable ulong: value={0}", value == null ? "null" : value.ToString()); -``` - -```vb -Dim root As XElement = -Dim value As Nullable(Of ULong) = CType(root.Attribute("Att"), Nullable(Of ULong)) -Console.WriteLine("Nullable ulong: value={0}", IIf(value.HasValue, value.ToString(), "null")) -``` - - This example produces the following output: - -``` -Nullable ulong: value=9223372036854775807 -``` - + of . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 9223372036854775807) +); +ulong? value = (ulong?)root.Attribute("Att"); +Console.WriteLine("Nullable ulong: value={0}", value == null ? "null" : value.ToString()); +``` + +```vb +Dim root As XElement = +Dim value As Nullable(Of ULong) = CType(root.Attribute("Att"), Nullable(Of ULong)) +Console.WriteLine("Nullable ulong: value={0}", IIf(value.HasValue, value.ToString(), "null")) +``` + + This example produces the following output: + +``` +Nullable ulong: value=9223372036854775807 +``` + ]]> The attribute does not contain a valid value. @@ -2529,29 +2529,29 @@ Nullable ulong: value=9223372036854775807 Cast the value of this to a . A that contains the content of this . - . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 3.402823e38) -); -float value = (float)root.Attribute("Att"); -Console.WriteLine("value={0}", value); -``` - -```vb -Dim root As XElement = -Dim value As Single = CSng(root.Attribute("Att")) -Console.WriteLine("value={0}", value) -``` - - This example produces the following output: - -``` -value=3.402823E+38 -``` - + . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 3.402823e38) +); +float value = (float)root.Attribute("Att"); +Console.WriteLine("value={0}", value); +``` + +```vb +Dim root As XElement = +Dim value As Single = CSng(root.Attribute("Att")) +Console.WriteLine("value={0}", value) +``` + + This example produces the following output: + +``` +value=3.402823E+38 +``` + ]]> The attribute does not contain a valid value. @@ -2611,31 +2611,31 @@ value=3.402823E+38 Cast the value of this to a . A that contains the content of this . - . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", "attribute content") -); -XAttribute att = root.Attribute("Att"); -string str = (string)att; -Console.WriteLine("(string)att={0}", str); -``` - -```vb -Dim root As XElement = -Dim att As XAttribute = root.Attribute("Att") -Dim str As String = CStr(att) -Console.WriteLine("(string)att={0}", str) -``` - - This example produces the following output: - -``` -(string)att=attribute content -``` - + . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", "attribute content") +); +XAttribute att = root.Attribute("Att"); +string str = (string)att; +Console.WriteLine("(string)att={0}", str); +``` + +```vb +Dim root As XElement = +Dim att As XAttribute = root.Attribute("Att") +Dim str As String = CStr(att) +Console.WriteLine("(string)att={0}", str) +``` + + This example produces the following output: + +``` +(string)att=attribute content +``` + ]]> @@ -2692,36 +2692,36 @@ Console.WriteLine("(string)att={0}", str) Cast the value of this to a . A that contains the content of this . - from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a . - -## Examples - The following example creates an attribute with time span content. It then retrieves the value by casting to . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", new TimeSpan(1, 5, 30)) -); -TimeSpan value = (TimeSpan)root.Attribute("Att"); -Console.WriteLine("value={0}", value); -``` - -```vb -Dim root As XElement = /> -Dim value As TimeSpan = CType(root.Attribute("Att"), TimeSpan) -Console.WriteLine("value={0}", value) -``` - - This example produces the following output: - -``` -value=01:05:30 -``` - + from an attribute or element. Even if the attribute or element value is not formatted exactly per the W3C specification, the value is appropriately converted to a . + +## Examples + The following example creates an attribute with time span content. It then retrieves the value by casting to . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", new TimeSpan(1, 5, 30)) +); +TimeSpan value = (TimeSpan)root.Attribute("Att"); +Console.WriteLine("value={0}", value); +``` + +```vb +Dim root As XElement = /> +Dim value As TimeSpan = CType(root.Attribute("Att"), TimeSpan) +Console.WriteLine("value={0}", value) +``` + + This example produces the following output: + +``` +value=01:05:30 +``` + ]]> The attribute does not contain a valid value. @@ -2780,29 +2780,29 @@ value=01:05:30 Cast the value of this to a . A that contains the content of this . - . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 4294967295) -); -uint value = (uint)root.Attribute("Att"); -Console.WriteLine("value={0}", value); -``` - -```vb -Dim root As XElement = -Dim value As UInteger = CUInt(root.Attribute("Att")) -Console.WriteLine("value={0}", value) -``` - - This example produces the following output: - -``` -value=4294967295 -``` - + . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 4294967295) +); +uint value = (uint)root.Attribute("Att"); +Console.WriteLine("value={0}", value); +``` + +```vb +Dim root As XElement = +Dim value As UInteger = CUInt(root.Attribute("Att")) +Console.WriteLine("value={0}", value) +``` + + This example produces the following output: + +``` +value=4294967295 +``` + ]]> The attribute does not contain a valid value. @@ -2861,29 +2861,29 @@ value=4294967295 Cast the value of this to a . A that contains the content of this . - . - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", 1844674407370955161) -); -ulong value = (ulong)root.Attribute("Att"); -Console.WriteLine("value={0}", value); -``` - -```vb -Dim root As XElement = -Dim value As ULong = CULng(root.Attribute("Att")) -Console.WriteLine("value={0}", value) -``` - - This example produces the following output: - -``` -value=1844674407370955161 -``` - + . + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", 1844674407370955161) +); +ulong value = (ulong)root.Attribute("Att"); +Console.WriteLine("value={0}", value); +``` + +```vb +Dim root As XElement = +Dim value As ULong = CULng(root.Attribute("Att")) +Console.WriteLine("value={0}", value) +``` + + This example produces the following output: + +``` +value=1844674407370955161 +``` + ]]> The attribute does not contain a valid value. @@ -2939,53 +2939,53 @@ value=1844674407370955161 Gets the previous attribute of the parent element. An containing the previous attribute of the parent element. - , they are returned in the order that they were added, and are not sorted. When you request the previous attribute through this property, this property returns the attribute that was added before this attribute. - - If this attribute does not have a parent, or if this attribute is the first attribute, then this property returns `null`. - - The class stores its attributes as a singly-linked list of objects. This means that the property must traverse the list of attributes that belong to the element. Therefore, using this property might affect your performance. - - - -## Examples - The following example shows how to iterate through the attributes of an element using this property. - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att1", 1), - new XAttribute("Att2", 2), - new XAttribute("Att3", 3), - new XAttribute("Att4", 4) -); -XAttribute att = root.LastAttribute; -do { - Console.WriteLine(att); -} -while((att = att.PreviousAttribute) != null); -``` - -```vb -Dim root As XElement = -Dim att As XAttribute = root.LastAttribute -Dim val As Boolean = True -Do - Console.WriteLine(att) - att = att.PreviousAttribute -Loop While (Not (att Is Nothing)) -``` - - This example produces the following output: - -``` -Att4="4" -Att3="3" -Att2="2" -Att1="1" -``` - + , they are returned in the order that they were added, and are not sorted. When you request the previous attribute through this property, this property returns the attribute that was added before this attribute. + + If this attribute does not have a parent, or if this attribute is the first attribute, then this property returns `null`. + + The class stores its attributes as a singly-linked list of objects. This means that the property must traverse the list of attributes that belong to the element. Therefore, using this property might affect your performance. + + + +## Examples + The following example shows how to iterate through the attributes of an element using this property. + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att1", 1), + new XAttribute("Att2", 2), + new XAttribute("Att3", 3), + new XAttribute("Att4", 4) +); +XAttribute att = root.LastAttribute; +do { + Console.WriteLine(att); +} +while((att = att.PreviousAttribute) != null); +``` + +```vb +Dim root As XElement = +Dim att As XAttribute = root.LastAttribute +Dim val As Boolean = True +Do + Console.WriteLine(att) + att = att.PreviousAttribute +Loop While (Not (att Is Nothing)) +``` + + This example produces the following output: + +``` +Att4="4" +Att3="3" +Att2="2" +Att1="1" +``` + ]]> @@ -3032,44 +3032,44 @@ Att1="1" Removes this attribute from its parent element. - using the extension method. Then you can iterate over the list, removing the attributes. For more information, see [Mixed Declarative Code/Imperative Code Bugs (LINQ to XML)](/dotnet/standard/linq/mixed-declarative-imperative-code-bugs). - - Alternatively, if you want to remove a set of attributes, it is recommended that you use the method. This method copies the attributes to a list, then iterates over the list, removing the attributes. - - - -## Examples - The following example creates an element with three attributes. It then removes one of the attributes. - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att1", "content1"), - new XAttribute("Att2", "content2"), - new XAttribute("Att3", "content3") -); -XAttribute att = root.Attribute("Att2"); -att.Remove(); -Console.WriteLine(root); -``` - -```vb -Dim root As XElement = -Dim att As XAttribute = root.Attribute("Att2") -att.Remove() -Console.WriteLine(root) -``` - - This example produces the following output: - -``` - -``` - + using the extension method. Then you can iterate over the list, removing the attributes. For more information, see [Mixed Declarative Code/Imperative Code Bugs (LINQ to XML)](/dotnet/standard/linq/mixed-declarative-imperative-code-bugs). + + Alternatively, if you want to remove a set of attributes, it is recommended that you use the method. This method copies the attributes to a list, then iterates over the list, removing the attributes. + + + +## Examples + The following example creates an element with three attributes. It then removes one of the attributes. + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att1", "content1"), + new XAttribute("Att2", "content2"), + new XAttribute("Att3", "content3") +); +XAttribute att = root.Attribute("Att2"); +att.Remove(); +Console.WriteLine(root); +``` + +```vb +Dim root As XElement = +Dim att As XAttribute = root.Attribute("Att2") +att.Remove() +Console.WriteLine(root) +``` + + This example produces the following output: + +``` + +``` + ]]> The parent element is . @@ -3119,44 +3119,44 @@ Console.WriteLine(root) The value to assign to this attribute. Sets the value of this attribute. - property. - - It is invalid to pass an instance of a class that derives from , such as or . - - This method will raise the and the events. - - - -## Examples - The following example creates an element with several attributes. It then changes the contents of one of the attributes. - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att1", "content1"), - new XAttribute("Att2", "content2"), - new XAttribute("Att3", "content3") -); -XAttribute att = root.Attribute("Att2"); -att.SetValue("new content"); -Console.WriteLine(root); -``` - -```vb -Dim root As XElement = -Dim att As XAttribute = root.Attribute("Att2") -att.SetValue("new content") -Console.WriteLine(root) -``` - - This example produces the following output: - -``` - -``` - + property. + + It is invalid to pass an instance of a class that derives from , such as or . + + This method will raise the and the events. + + + +## Examples + The following example creates an element with several attributes. It then changes the contents of one of the attributes. + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att1", "content1"), + new XAttribute("Att2", "content2"), + new XAttribute("Att3", "content3") +); +XAttribute att = root.Attribute("Att2"); +att.SetValue("new content"); +Console.WriteLine(root); +``` + +```vb +Dim root As XElement = +Dim att As XAttribute = root.Attribute("Att2") +att.SetValue("new content") +Console.WriteLine(root) +``` + + This example produces the following output: + +``` + +``` + ]]> The parameter is . @@ -3209,41 +3209,41 @@ Console.WriteLine(root) Converts the current object to a string representation. A containing the XML text representation of an attribute and its value. - [!WARNING] -> When this method is called and contains control character, an exception is thrown with a message like: hexadecimal value 0x0B, is an invalid character. - - - -## Examples - The following example creates an element with several attributes. It then gets an attribute and displays it and its content by calling this method. - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att1", "content1"), - new XAttribute("Att2", "content2"), - new XAttribute("Att3", "content3") -); -XAttribute att = root.Attribute("Att2"); -Console.WriteLine(att.ToString()); -``` - -```vb -Dim root As XElement = -Dim att As XAttribute = root.Attribute("Att2") -Console.WriteLine(att.ToString()) -``` - - This example produces the following output: - -``` -Att2="content2" -``` - +> When this method is called and contains control character, an exception is thrown with a message like: hexadecimal value 0x0B, is an invalid character. + + + +## Examples + The following example creates an element with several attributes. It then gets an attribute and displays it and its content by calling this method. + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att1", "content1"), + new XAttribute("Att2", "content2"), + new XAttribute("Att3", "content3") +); +XAttribute att = root.Attribute("Att2"); +Console.WriteLine(att.ToString()); +``` + +```vb +Dim root As XElement = +Dim att As XAttribute = root.Attribute("Att2") +Console.WriteLine(att.ToString()) +``` + + This example produces the following output: + +``` +Att2="content2" +``` + ]]> @@ -3298,185 +3298,183 @@ Att2="content2" Gets or sets the value of this attribute. A containing the value of this attribute. - and the events. - - If you are getting the value and the attribute might not exist, it is more convenient to use the explicit conversion operators, and assign the attribute to a nullable type such as `string` or of . If the attribute does not exist, then the nullable type is set to `null`. Before using this property, you must make sure that the method does not return `null`. - - - -## Examples - The following example creates an element with an attribute. It then retrieves the value of the attribute, and then sets it. - - Note that the Visual Basic example uses the XML attribute property. - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att", "content") -); -XAttribute att = root.FirstAttribute; -Console.WriteLine(att.Value); -att.Value = "new text"; -Console.WriteLine(att.Value); -``` - -```vb -Dim root As XElement = -Console.WriteLine(root.@Att) -root.@Att = "new text" -Console.WriteLine(root.@Att) -``` - - This example produces the following output: - -``` -content -new text -``` - - The following example shows the benefit of using the explicit conversion operators to get the value of an attribute that might not exist: - -```csharp -XElement root = new XElement("Root", - new XAttribute("Att1", "attribute 1 content"), - new XAttribute("Att2", "2") -); - -// The following assignments demonstrate why it is easier to use -// casting when the attribute might or might not exist. - -string c1 = (string)root.Attribute("Att1"); -Console.WriteLine("c1:{0}", c1 == null ? "attribute does not exist" : c1); - -int? c2 = (int?)root.Attribute("Att2"); -Console.WriteLine("c2:{0}", c2 == null ? "attribute does not exist" : c2.ToString()); - -string c3 = (string)root.Attribute("Att3"); -Console.WriteLine("c3:{0}", c3 == null ? "attribute does not exist" : c3); - -int? c4 = (int?)root.Attribute("Att4"); -Console.WriteLine("c4:{0}", c4 == null ? "attribute does not exist" : c4.ToString()); - -Console.WriteLine(); - -// The following assignments show the necessary code when using -// the value property when the attribute might or might not exist. - -XAttribute att1 = root.Attribute("Att1"); -string v1; -if (att1 == null) - v1 = null; -else - v1 = att1.Value; -Console.WriteLine("v1:{0}", v1 == null ? "attribute does not exist" : v1); - -XAttribute att2 = root.Attribute("Att2"); -int? v2; -if (att2 == null) - v2 = null; -else - v2 = Int32.Parse(att2.Value); -Console.WriteLine("v2:{0}", v2 == null ? "attribute does not exist" : v2.ToString()); - -XAttribute att3 = root.Attribute("Att3"); -string v3; -if (att3 == null) - v3 = null; -else - v3 = att3.Value; -Console.WriteLine("v3:{0}", v3 == null ? "attribute does not exist" : v3); - -XAttribute att4 = root.Attribute("Att4"); -int? v4; -if (att4 == null) - v4 = null; -else - v4 = Int32.Parse(att4.Value); -Console.WriteLine("v4:{0}", v4 == null ? "attribute does not exist" : v4.ToString()); -``` - -```vb -Dim root As XElement = - -' The following assignments demonstrate why it is easier to use -' casting when the attribute might or might not exist. - -Dim c1 As String = CStr(root.Attribute("Att1")) -Console.WriteLine("c1:{0}", IIf(c1 Is Nothing, "attribute does not exist", c1)) - -Dim c2 As Nullable(Of Integer) = CType(root.Attribute("Att2"), Nullable(Of Integer)) -Console.WriteLine("c2:{0}", IIf(c2.HasValue, c2, "attribute does not exist")) - -Dim c3 As String = CStr(root.Attribute("Att3")) -Console.WriteLine("c3:{0}", IIf(c3 Is Nothing, "attribute does not exist", c3)) - -Dim c4 As Nullable(Of Integer) = CType(root.Attribute("Att4"), Nullable(Of Integer)) -Console.WriteLine("c4:{0}", IIf(c4.HasValue, c4, "attribute does not exist")) - -Console.WriteLine() - -' The following assignments show the necessary code when using -' the value property when the attribute might or might not exist. - -Dim att1 As XAttribute = root.Attribute("Att1") -Dim v1 As String -If att1 Is Nothing Then - v1 = Nothing -Else - v1 = att1.Value -End If - -Console.WriteLine("v1:{0}", IIf(v1 Is Nothing, "attribute does not exist", v1)) - -Dim att2 As XAttribute = root.Attribute("Att2") -Dim v2 As Nullable(Of Integer) -If att2 Is Nothing Then - v2 = Nothing -Else - v2 = Int32.Parse(att2.Value) -End If - -Console.WriteLine("v2:{0}", IIf(v2.HasValue, v2, "attribute does not exist")) - -Dim att3 As XAttribute = root.Attribute("Att3") -Dim v3 As String -If att3 Is Nothing Then - v3 = Nothing -Else - v3 = att3.Value -End If - -Console.WriteLine("v3:{0}", IIf(v3 Is Nothing, "attribute does not exist", v3)) - -Dim att4 As XAttribute = root.Attribute("Att4") -Dim v4 As Nullable(Of Integer) -If att4 Is Nothing Then - v4 = Nothing -Else - v4 = Int32.Parse(att4.Value) -End If - -Console.WriteLine("v4:{0}", IIf(v4.HasValue, v4, "attribute does not exist")) -``` - - This example produces the following output: - -``` -c1:attribute 1 content -c2:2 -c3:attribute does not exist -c4:attribute does not exist - -v1:attribute 1 content -v2:2 -v3:attribute does not exist -v4:attribute does not exist -``` - + and the events. + + If you're getting the value and the attribute might not exist, it is more convenient to use the explicit conversion operators, and assign the attribute to a nullable type such as `string` or of . If the attribute does not exist, then the nullable type is set to `null`. Before using this property, you must make sure that the method does not return `null`. + +## Examples + The following example creates an element with an attribute. It then retrieves the value of the attribute, and then sets it. + + Note that the Visual Basic example uses the XML attribute property. + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att", "content") +); +XAttribute att = root.FirstAttribute; +Console.WriteLine(att.Value); +att.Value = "new text"; +Console.WriteLine(att.Value); +``` + +```vb +Dim root As XElement = +Console.WriteLine(root.@Att) +root.@Att = "new text" +Console.WriteLine(root.@Att) +``` + + This example produces the following output: + +``` +content +new text +``` + + The following example shows the benefit of using the explicit conversion operators to get the value of an attribute that might not exist: + +```csharp +XElement root = new XElement("Root", + new XAttribute("Att1", "attribute 1 content"), + new XAttribute("Att2", "2") +); + +// The following assignments demonstrate why it is easier to use +// casting when the attribute might or might not exist. + +string c1 = (string)root.Attribute("Att1"); +Console.WriteLine("c1:{0}", c1 == null ? "attribute does not exist" : c1); + +int? c2 = (int?)root.Attribute("Att2"); +Console.WriteLine("c2:{0}", c2 == null ? "attribute does not exist" : c2.ToString()); + +string c3 = (string)root.Attribute("Att3"); +Console.WriteLine("c3:{0}", c3 == null ? "attribute does not exist" : c3); + +int? c4 = (int?)root.Attribute("Att4"); +Console.WriteLine("c4:{0}", c4 == null ? "attribute does not exist" : c4.ToString()); + +Console.WriteLine(); + +// The following assignments show the necessary code when using +// the value property when the attribute might or might not exist. + +XAttribute att1 = root.Attribute("Att1"); +string v1; +if (att1 == null) + v1 = null; +else + v1 = att1.Value; +Console.WriteLine("v1:{0}", v1 == null ? "attribute does not exist" : v1); + +XAttribute att2 = root.Attribute("Att2"); +int? v2; +if (att2 == null) + v2 = null; +else + v2 = Int32.Parse(att2.Value); +Console.WriteLine("v2:{0}", v2 == null ? "attribute does not exist" : v2.ToString()); + +XAttribute att3 = root.Attribute("Att3"); +string v3; +if (att3 == null) + v3 = null; +else + v3 = att3.Value; +Console.WriteLine("v3:{0}", v3 == null ? "attribute does not exist" : v3); + +XAttribute att4 = root.Attribute("Att4"); +int? v4; +if (att4 == null) + v4 = null; +else + v4 = Int32.Parse(att4.Value); +Console.WriteLine("v4:{0}", v4 == null ? "attribute does not exist" : v4.ToString()); +``` + +```vb +Dim root As XElement = + +' The following assignments demonstrate why it is easier to use +' casting when the attribute might or might not exist. + +Dim c1 As String = CStr(root.Attribute("Att1")) +Console.WriteLine("c1:{0}", IIf(c1 Is Nothing, "attribute does not exist", c1)) + +Dim c2 As Nullable(Of Integer) = CType(root.Attribute("Att2"), Nullable(Of Integer)) +Console.WriteLine("c2:{0}", IIf(c2.HasValue, c2, "attribute does not exist")) + +Dim c3 As String = CStr(root.Attribute("Att3")) +Console.WriteLine("c3:{0}", IIf(c3 Is Nothing, "attribute does not exist", c3)) + +Dim c4 As Nullable(Of Integer) = CType(root.Attribute("Att4"), Nullable(Of Integer)) +Console.WriteLine("c4:{0}", IIf(c4.HasValue, c4, "attribute does not exist")) + +Console.WriteLine() + +' The following assignments show the necessary code when using +' the value property when the attribute might or might not exist. + +Dim att1 As XAttribute = root.Attribute("Att1") +Dim v1 As String +If att1 Is Nothing Then + v1 = Nothing +Else + v1 = att1.Value +End If + +Console.WriteLine("v1:{0}", IIf(v1 Is Nothing, "attribute does not exist", v1)) + +Dim att2 As XAttribute = root.Attribute("Att2") +Dim v2 As Nullable(Of Integer) +If att2 Is Nothing Then + v2 = Nothing +Else + v2 = Int32.Parse(att2.Value) +End If + +Console.WriteLine("v2:{0}", IIf(v2.HasValue, v2, "attribute does not exist")) + +Dim att3 As XAttribute = root.Attribute("Att3") +Dim v3 As String +If att3 Is Nothing Then + v3 = Nothing +Else + v3 = att3.Value +End If + +Console.WriteLine("v3:{0}", IIf(v3 Is Nothing, "attribute does not exist", v3)) + +Dim att4 As XAttribute = root.Attribute("Att4") +Dim v4 As Nullable(Of Integer) +If att4 Is Nothing Then + v4 = Nothing +Else + v4 = Int32.Parse(att4.Value) +End If + +Console.WriteLine("v4:{0}", IIf(v4.HasValue, v4, "attribute does not exist")) +``` + + This example produces the following output: + +``` +c1:attribute 1 content +c2:2 +c3:attribute does not exist +c4:attribute does not exist + +v1:attribute 1 content +v2:2 +v3:attribute does not exist +v4:attribute does not exist +``` + ]]> When setting, the is . diff --git a/xml/System.Xml.Linq/XProcessingInstruction.xml b/xml/System.Xml.Linq/XProcessingInstruction.xml index 3664bc780f0..285353713a6 100644 --- a/xml/System.Xml.Linq/XProcessingInstruction.xml +++ b/xml/System.Xml.Linq/XProcessingInstruction.xml @@ -52,13 +52,13 @@ Represents an XML processing instruction. - node. - + node. + ]]> LINQ to XML overview @@ -116,11 +116,11 @@ The node to copy from. Initializes a new instance of the class. - LINQ to XML overview @@ -168,27 +168,27 @@ The string data for this . Initializes a new instance of the class. - , and specifies a target and the string data for the processing instruction. - -```csharp -XProcessingInstruction pi = new XProcessingInstruction("xml-stylesheet", "type='text/xsl' href='hello.xsl'"); -Console.WriteLine(pi); -``` - -```vb -Dim pi As XProcessingInstruction = -Console.WriteLine(pi) -``` - - This example produces the following output: - -``` - -``` - + , and specifies a target and the string data for the processing instruction. + +```csharp +XProcessingInstruction pi = new XProcessingInstruction("xml-stylesheet", "type='text/xsl' href='hello.xsl'"); +Console.WriteLine(pi); +``` + +```vb +Dim pi As XProcessingInstruction = +Console.WriteLine(pi) +``` + + This example produces the following output: + +``` + +``` + ]]> The or parameter is . @@ -240,40 +240,38 @@ Console.WriteLine(pi) Gets or sets the string value of this processing instruction. - A that contains the string value of this processing instruction. + The string value of this processing instruction. - property to retrieve the string value of a processing instruction. - -```csharp -XProcessingInstruction pi = - new XProcessingInstruction("xml-stylesheet", "type='text/xsl' href='hello.xsl'"); -Console.WriteLine(pi.Data); -pi.Data = "type='text/xsl' href='xform.xsl'"; -Console.WriteLine(pi.Data); -``` - -```vb -Dim pi As XProcessingInstruction = -Console.WriteLine(pi.Data) -pi.Data = "type='text/xsl' href='xform.xsl'" -Console.WriteLine(pi.Data) -``` - - This example produces the following output: - -``` -type='text/xsl' href='hello.xsl' -type='text/xsl' href='xform.xsl' -``` - + property to retrieve the string value of a processing instruction. + +```csharp +XProcessingInstruction pi = + new XProcessingInstruction("xml-stylesheet", "type='text/xsl' href='hello.xsl'"); +Console.WriteLine(pi.Data); +pi.Data = "type='text/xsl' href='xform.xsl'"; +Console.WriteLine(pi.Data); +``` + +```vb +Dim pi As XProcessingInstruction = +Console.WriteLine(pi.Data) +pi.Data = "type='text/xsl' href='xform.xsl'" +Console.WriteLine(pi.Data) +``` + + This example produces the following output: + +``` +type='text/xsl' href='hello.xsl' +type='text/xsl' href='xform.xsl' +``` + ]]> The string is . @@ -320,34 +318,34 @@ type='text/xsl' href='xform.xsl' Gets the node type for this node. The node type. For objects, this value is . - contain a property, you can write code that operates on collections of concrete subclass of . Your code can then test for the node type of each node in the collection. - - - -## Examples - The following example creates a processing instruction, and then prints its node type. - -```csharp -XProcessingInstruction pi = - new XProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"hello.xsl\""); -Console.WriteLine(pi.NodeType); -``` - -```vb -Dim pi As XProcessingInstruction = _ - -Console.WriteLine(pi.NodeType.ToString) -``` - - This example produces the following output: - -``` -ProcessingInstruction -``` - + contain a property, you can write code that operates on collections of concrete subclass of . Your code can then test for the node type of each node in the collection. + + + +## Examples + The following example creates a processing instruction, and then prints its node type. + +```csharp +XProcessingInstruction pi = + new XProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"hello.xsl\""); +Console.WriteLine(pi.NodeType); +``` + +```vb +Dim pi As XProcessingInstruction = _ + +Console.WriteLine(pi.NodeType.ToString) +``` + + This example produces the following output: + +``` +ProcessingInstruction +``` + ]]> LINQ to XML overview @@ -396,36 +394,36 @@ ProcessingInstruction System.String - Gets or sets a string containing the target application for this processing instruction. - A containing the target application for this processing instruction. + Gets or sets the target application for this processing instruction. + The target application for this processing instruction. - property to retrieve the target application for a processing instruction. - -```csharp -XProcessingInstruction pi = - new XProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"hello.xsl\""); -Console.WriteLine(pi.Target); -``` - -```vb -Dim pi As XProcessingInstruction = _ - -Console.WriteLine(pi.Target) -``` - - This example produces the following output: - -``` -xml-stylesheet -``` - + property to retrieve the target application for a processing instruction. + +```csharp +XProcessingInstruction pi = + new XProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"hello.xsl\""); +Console.WriteLine(pi.Target); +``` + +```vb +Dim pi As XProcessingInstruction = _ + +Console.WriteLine(pi.Target) +``` + + This example produces the following output: + +``` +xml-stylesheet +``` + ]]> The string is . - The does not follow the constraints of an XML name. + The target does not follow the constraints of an XML name. LINQ to XML overview @@ -472,11 +470,11 @@ xml-stylesheet The to write this processing instruction to. Writes this processing instruction to an . - . - + . + ]]> LINQ to XML overview diff --git a/xml/System.Xml.Resolvers/XmlPreloadedResolver.xml b/xml/System.Xml.Resolvers/XmlPreloadedResolver.xml index 0f7ea6e6333..9a5d21bcf52 100644 --- a/xml/System.Xml.Resolvers/XmlPreloadedResolver.xml +++ b/xml/System.Xml.Resolvers/XmlPreloadedResolver.xml @@ -48,11 +48,11 @@ Represents a class that is used to prepopulate the cache with DTDs or XML streams. - type is used as a resolver when automatic calls to the network are not desired or are not possible. For example, this type can be used for loading cached external DTDs. Or, you might use to preload well-known DTDs that are defined in XHTML 1.0. Preloading well-known DTDs does not start any network connections because these DTDs are already embedded in the System.Xml.Utils assembly. Currently, includes the DTDs that are defined in XHTML 1.0 and RSS 0.91. - + type is used as a resolver when automatic calls to the network are not desired or are not possible. For example, this type can be used for loading cached external DTDs. Or, you might use to preload well-known DTDs that are defined in XHTML 1.0. Preloading well-known DTDs does not start any network connections because these DTDs are already embedded in the System.Xml.Utils assembly. Currently, includes the DTDs that are defined in XHTML 1.0 and RSS 0.91. + ]]> @@ -296,11 +296,11 @@ The implementation of the generic interface to use when you compare URIs. Initializes a new instance of the class with the specified fallback resolver, preloaded well-known DTDs, and URI equality comparer. - @@ -502,10 +502,10 @@ or is . - or is less than 0. - - -or- - + or is less than 0. + + -or- + The length of the minus is less than . @@ -601,19 +601,19 @@ Maps a URI to an object that contains the actual resource. A or object that corresponds to the actual source. - will first try to look up the resource in its store of preloaded data. If it cannot find it, it will call the fallback resolver's `GetEntity` method. If no fallback resolver was provided in the constructor, an exception is thrown. - + will first try to look up the resource in its store of preloaded data. If it cannot find it, it will call the fallback resolver's `GetEntity` method. If no fallback resolver was provided in the constructor, an exception is thrown. + ]]> is . - Cannot resolve URI passed in . - - -or- - + Cannot resolve URI passed in . + + -or- + is not of a supported type. @@ -758,11 +758,11 @@ The URI of the data that should be removed from the store. Removes the data that corresponds to the URI from the . - @@ -820,7 +820,7 @@ The representing the absolute URI or if the relative URI cannot be resolved. To be added. - is . + is . @@ -876,7 +876,7 @@ if the is supported; otherwise, . To be added. - is . + is . diff --git a/xml/System.Xml.Schema/XmlSchemaObjectCollection.xml b/xml/System.Xml.Schema/XmlSchemaObjectCollection.xml index 0e7a8d5210c..8ab6167a680 100644 --- a/xml/System.Xml.Schema/XmlSchemaObjectCollection.xml +++ b/xml/System.Xml.Schema/XmlSchemaObjectCollection.xml @@ -50,11 +50,11 @@ A collection of s. - for an example using this class. - + for an example using this class. + ]]> @@ -199,49 +199,43 @@ - The . + The to add to the collection. Adds an to the . The index at which the item has been added. - method expects only and its derived types (, , and ) as parameters. The following example illustrates adding an included schema to the collection of an existing object. - -```vb -Dim schema As XmlSchema = New XmlSchema() - -Dim textReader As XmlTextReader = New XmlTextReader("include.xsd") -Dim includeSchema As XmlSchema = XmlSchema.Read(textReader, null) - -Dim include As XmlSchemaInclude = New XmlSchemaInclude() -include.Schema = includeSchema; -schema.Includes.Add(include); -``` - -```csharp -XmlSchema schema = new XmlSchema(); - -XmlTextReader textReader = new XmlTextReader("include.xsd"); -XmlSchema includeSchema = XmlSchema.Read(textReader, null); - -XmlSchemaInclude include = new XmlSchemaInclude(); -include.Schema = includeSchema; -schema.Includes.Add(include); -``` - + method expects only and its derived types (, , and ) as parameters. The following example illustrates adding an included schema to the collection of an existing object. + +```vb +Dim schema As XmlSchema = New XmlSchema() + +Dim textReader As XmlTextReader = New XmlTextReader("include.xsd") +Dim includeSchema As XmlSchema = XmlSchema.Read(textReader, null) + +Dim include As XmlSchemaInclude = New XmlSchemaInclude() +include.Schema = includeSchema; +schema.Includes.Add(include); +``` + +```csharp +XmlSchema schema = new XmlSchema(); + +XmlTextReader textReader = new XmlTextReader("include.xsd"); +XmlSchema includeSchema = XmlSchema.Read(textReader, null); + +XmlSchemaInclude include = new XmlSchemaInclude(); +include.Schema = includeSchema; +schema.Includes.Add(include); +``` + ]]> - - is less than zero. - - -or- - - is greater than . The parameter specified is not of type or its derived types , , and . @@ -335,13 +329,13 @@ schema.Includes.Add(include); The zero-based index in the array at which copying begins. Copies all the s from the collection into the given array, starting at the given index. - to copy the elements. - + to copy the elements. + ]]> @@ -349,14 +343,14 @@ schema.Includes.Add(include); is less than zero. - is multi-dimensional. - + is multi-dimensional. + -or- - - is equal to or greater than the length of . - + + is equal to or greater than the length of . + -or- - + The number of elements in the source is greater than the available space from index to the end of the destination array. The type of the source cannot be cast automatically to the type of the destination array. @@ -492,22 +486,22 @@ schema.Includes.Add(include); The to insert. Inserts an to the . - - is less than zero. - - -or- - + is less than zero. + + -or- + is greater than . @@ -786,15 +780,15 @@ schema.Includes.Add(include); The to remove. Removes an from the . - . That is, this method is an O(`n`) operation, where `n` is . - - This method determines equality by calling . - - The elements that follow the removed element move up to occupy the vacated spot. - + . That is, this method is an O(`n`) operation, where `n` is . + + This method determines equality by calling . + + The elements that follow the removed element move up to occupy the vacated spot. + ]]> diff --git a/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml b/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml index f2b2666612d..b31ff71a068 100644 --- a/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml +++ b/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml @@ -50,29 +50,29 @@ Provides data for the event. - event occurs only when you call the method. - - - -## Examples - The following example deserializes a class named `Group` from a file named UnknownAttributes.xml. Whenever an element is found in the file that has no corresponding member in the class, the event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. - -``` - - - MyGroup - -``` - + event occurs only when you call the method. + + + +## Examples + The following example deserializes a class named `Group` from a file named UnknownAttributes.xml. Whenever an element is found in the file that has no corresponding member in the class, the event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. + +``` + + + MyGroup + +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/XmlAttributeEventArgs/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -123,22 +123,22 @@ Gets an object that represents the unknown XML attribute. An that represents the unknown XML attribute. - event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. - -``` - - - MyGroup - -``` - + event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. + +``` + + + MyGroup + +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/XmlAttributeEventArgs/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -181,7 +181,7 @@ Gets a comma-delimited list of XML attribute names expected to be in an XML document instance. - A comma-delimited list of XML attribute names. Each name is in the following format: :. + A comma-delimited list of XML attribute names. Each name is in the following format: :. To be added. @@ -230,22 +230,22 @@ Gets the line number of the unknown XML attribute. The line number of the unknown XML attribute. - event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. - -``` - - - MyGroup - -``` - + event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. + +``` + + + MyGroup + +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/XmlAttributeEventArgs/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -295,22 +295,22 @@ Gets the position in the line of the unknown XML attribute. The position number of the unknown XML attribute. - event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. - -``` - - - MyGroup - -``` - + event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. + +``` + + + MyGroup + +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/XmlAttributeEventArgs/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -365,15 +365,15 @@ Gets the object being deserialized. The object being deserialized. - method when the method encounters an unknown attribute. - + method when the method encounters an unknown attribute. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Classic XmlAttributeEventArgs.ObjectBeingDeserialized Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/XmlAttributeEventArgs/ObjectBeingDeserialized/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/Classic XmlAttributeEventArgs.ObjectBeingDeserialized Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/Classic XmlAttributeEventArgs.ObjectBeingDeserialized Example/VB/source.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Xml.Serialization/XmlSerializationReader+CollectionFixup.xml b/xml/System.Xml.Serialization/XmlSerializationReader+CollectionFixup.xml index 68d9772b821..443df2a50e3 100644 --- a/xml/System.Xml.Serialization/XmlSerializationReader+CollectionFixup.xml +++ b/xml/System.Xml.Serialization/XmlSerializationReader+CollectionFixup.xml @@ -49,15 +49,15 @@ Holds an delegate instance, plus the method's inputs; also supplies the method's parameters. - class. During this process, the infrastructure generates methods that implement the delegate. Additionally, it instantiates class objects to store the fix-up methods along with their inputs. The infrastructure does so for SOAP-encoded arrays or SOAP-encoded, multireferenced elements whose data types, in either case, map to .NET Framework collections or enumerations. Then, as necessary, the methods are invoked during deserialization to fill in array items or multireferenced objects. - - Do not directly instantiate or . - - SOAP encoding is described in Section 5 of the SOAP 1.1 specification. - + class. During this process, the infrastructure generates methods that implement the delegate. Additionally, it instantiates class objects to store the fix-up methods along with their inputs. The infrastructure does so for SOAP-encoded arrays or SOAP-encoded, multireferenced elements whose data types, in either case, map to .NET Framework collections or enumerations. Then, as necessary, the methods are invoked during deserialization to fill in array items or multireferenced objects. + + Do not directly instantiate or . + + SOAP encoding is described in Section 5 of the SOAP 1.1 specification. + ]]> @@ -121,11 +121,11 @@ An array into which the callback method copies a collection. Initializes a new instance of the class with parameters for a callback method. - class or the delegate. - + class or the delegate. + ]]> @@ -224,14 +224,14 @@ System.Object - Gets the for the callback method. + Gets the object collection for the callback method. The collection that is used for the fixup. - property gets the collection into which the method that implements the delegate copies the array that is obtained through the property. - + property gets the collection into which the method that implements the delegate copies the array that is obtained through the property. + ]]> @@ -281,11 +281,11 @@ Gets the array into which the callback method copies a collection. The array into which the callback method copies a collection. - property gets the array that the method that implements the delegate copies into the collection object that is obtained through the property. - + property gets the array that the method that implements the delegate copies into the collection object that is obtained through the property. + ]]> diff --git a/xml/System.Xml.Xsl/XslCompiledTransform.xml b/xml/System.Xml.Xsl/XslCompiledTransform.xml index aa88980fb6e..3cfc2f6aedb 100644 --- a/xml/System.Xml.Xsl/XslCompiledTransform.xml +++ b/xml/System.Xml.Xsl/XslCompiledTransform.xml @@ -1566,8 +1566,6 @@ xslt.Load(typeof(bookOrders)); An with default settings is used to load the input document. DTD processing is disabled on the . If you require DTD processing, create an with this feature enabled, and pass it to the method. - - ## Examples The following example uses an object to create a parameter representing the current date and time. @@ -1588,7 +1586,7 @@ xslt.Load(typeof(bookOrders)); The or value is . There was an error executing the XSLT transform. - The value includes a filename or directory cannot be found. + The value includes a filename or directory cannot be found. The value cannot be resolved. -or- diff --git a/xml/System.Xml/UniqueId.xml b/xml/System.Xml/UniqueId.xml index dc546e8db02..fecf145a7d4 100644 --- a/xml/System.Xml/UniqueId.xml +++ b/xml/System.Xml/UniqueId.xml @@ -52,11 +52,11 @@ A unique identifier optimized for Guids. - s. - + s. + ]]> @@ -149,11 +149,11 @@ A byte array that represents a . Creates a new instance of this class using a byte array that represents a . - @@ -260,11 +260,11 @@ A string used to generate the . Creates a new instance of this class using a string. - @@ -328,11 +328,11 @@ Offset position within the array that represents a . Creates a new instance of this class starting from an offset within a array that represents a . - @@ -770,23 +770,21 @@ The array. - Position in the array to start inserting the value. + The position in the array to start inserting the value. Puts the value into a array. - Number of entries in the array filled by the value. + The number of entries in the array filled by the value. - is . less than zero or greater than the length of the array. - - and provide less than 16 valid bytes. @@ -896,15 +894,11 @@ - The if successful; otherwise . + When this method returns, contains the if successful; otherwise . Tries to get the value of the as a . if the UniqueId represents a ; otherwise . To be added. - - is . - - and provide less than 16 valid bytes. @@ -969,11 +963,11 @@ if the value stored in this instance of is a ; otherwise . - diff --git a/xml/System.Xml/XmlConvert.xml b/xml/System.Xml/XmlConvert.xml index 041bb47ba17..dc76605aed8 100644 --- a/xml/System.Xml/XmlConvert.xml +++ b/xml/System.Xml/XmlConvert.xml @@ -2936,7 +2936,7 @@ The to be converted. - The format to which is converted. The format parameter can be any subset of the W3C Recommendation for the XML dateTime type. (For more information, see the dateTime section of the XML Schema specification..) + The format to which is converted. The format parameter can be any subset of the W3C Recommendation for the XML dateTime type. (For more information, see the dateTime section of the XML Schema specification..) Converts the supplied to a in the specified format. A representation in the specified format of the supplied . diff --git a/xml/System.Xml/XmlDictionaryReader.xml b/xml/System.Xml/XmlDictionaryReader.xml index 9a2be1d9524..a7f42c3156d 100644 --- a/xml/System.Xml/XmlDictionaryReader.xml +++ b/xml/System.Xml/XmlDictionaryReader.xml @@ -1023,7 +1023,7 @@ ]]> - is . + is . diff --git a/xml/System.Xml/XmlNodeReader.xml b/xml/System.Xml/XmlNodeReader.xml index 1bb11b42eb1..58283892266 100644 --- a/xml/System.Xml/XmlNodeReader.xml +++ b/xml/System.Xml/XmlNodeReader.xml @@ -598,14 +598,14 @@ Output: ## Remarks -> [!NOTE] -> In the .NET Framework 2.0, the recommended practice is to create instances using the class and the method. This allows you to take full advantage of all the new features introduced in the .NET Framework. For more information, see the Remarks section in the reference page. +The recommended practice is to create instances using the class and the method. - This method does not move the reader. +This method does not move the reader. ]]> - The parameter is less than 0 or greater than or equal to . + + is less than 0 or greater than or equal to . @@ -1056,14 +1056,14 @@ String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/); ## Remarks -> [!NOTE] -> In the .NET Framework 2.0, the recommended practice is to create instances using the class and the method. This allows you to take full advantage of all the new features introduced in the .NET Framework. For more information, see the Remarks section in the reference page. +The recommended practice is to create instances using the class and the method. This property does not move the reader. ]]> - The parameter is less than 0 or greater than or equal to . + + is less than 0 or greater than or equal to . diff --git a/xml/System.Xml/XmlWriter.xml b/xml/System.Xml/XmlWriter.xml index 82a353e41b1..f2c88699b43 100644 --- a/xml/System.Xml/XmlWriter.xml +++ b/xml/System.Xml/XmlWriter.xml @@ -336,8 +336,6 @@ An method was called before a previous asy Also, XmlWriter always writes a Byte Order Mark (BOM) to the underlying data stream; however, some streams must not have a BOM. To omit the BOM, create a new object and set the Encoding property to be a new object with the Boolean value in the constructor set to false. - - ## Examples The following example writes an XML fragment to a memory stream. (It uses the overload, which also configures the settings on the new XML writer instance.) @@ -346,7 +344,8 @@ An method was called before a previous asy ]]> - The value is . + + is . @@ -423,8 +422,6 @@ An method was called before a previous asy If you want to specify the features to support on the created writer, use an overload that takes an object as one of its arguments, and pass in an object with your custom settings. - - ## Examples The following example creates a writer that outputs to the console. @@ -433,7 +430,8 @@ An method was called before a previous asy ]]> - The value is . + + is . @@ -507,8 +505,6 @@ An method was called before a previous asy If you want to specify the features to support on the created XML writer, use an overload that takes an object as one of its arguments, and pass in a object with your custom settings. - - ## Examples The following example creates an object and writes a book node. @@ -517,7 +513,7 @@ An method was called before a previous asy ]]> - The value is . + is . @@ -596,7 +592,8 @@ An method was called before a previous asy ]]> - The value is . + + is . @@ -677,7 +674,8 @@ An method was called before a previous asy ]]> - The value is . + + is . @@ -742,8 +740,6 @@ An method was called before a previous asy ## Remarks XmlWriter always writes a Byte Order Mark (BOM) to the underlying data stream; however, some streams must not have a BOM. To omit the BOM, create a new object and set the Encoding property to be a new object with the Boolean value in the constructor set to false. - - ## Examples The following example writes an XML fragment to a memory stream. @@ -752,7 +748,8 @@ An method was called before a previous asy ]]> - The value is . + + is . @@ -822,7 +819,8 @@ An method was called before a previous asy ]]> - The value is . + + is . @@ -889,7 +887,8 @@ An method was called before a previous asy ]]> - The value is . + + is . @@ -949,7 +948,8 @@ An method was called before a previous asy Creates a new instance using the and objects. An object. To be added. - The value is . + + is . @@ -1016,7 +1016,8 @@ An method was called before a previous asy ]]> - The value is . + + is .