XmlIncludeAttribute Constructor (Type^)
.NET Framework (current version)
Initializes a new instance of the XmlIncludeAttribute class.
Assembly: System.Xml (in System.Xml.dll)
The following example shows three classes, two of which inherit from the third. The example applies the XmlIncludeAttribute to a method that returns an instance of one of the two derived classes. The example sets the Type property to the type of the returned object.
public ref class Vehicle{}; public ref class Car: public Vehicle{}; public ref class Truck: public Vehicle{}; public ref class Sample { public: [WebMethodAttribute] [XmlInclude(Car::typeid)] [XmlInclude(Truck::typeid)] Vehicle^ ReturnVehicle( int i ) { if ( i == 0 ) return gcnew Car; else return gcnew Truck; } };
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: