XmlConvert

XmlConvert CF 1.0, ECMA 1.0

System.Xml (system.xml.dll) class

This type is used to convert XML elements into other, non-XML types, such as CLR objects. In particular, it is used to convert XSD types into CLR types, for easy transformation of schema-valid XML documents into .NET objects and back again. It is also used within a variety of other areas, including ADO.NET (for automatic conversion of XML documents into relational tables and rows).

For the most part, .NET programmers use this type indirectly as part of the .NET Web Services stack or else directly in order to convert between XML documents and CLR objects (as part of a home-grown XML-to-RDBMS system, for example).

Note that although a constructor is provided, all methods of any interest are declared static and therefore require no instance to use. In essence, this type is a collection of C-style functions.

 public class  XmlConvert  {  // Public Constructors  public  XmlConvert  ( );  // Public Static Methods  public static string  DecodeName  (string   name   );    public static string  EncodeLocalName  (string   name   );    public static string  EncodeName  (string   name   );    public static string  EncodeNmToken  (string   name   );    public static bool  ToBoolean  (string   s   );    public static byte  ToByte  (string   s   );    public static char  ToChar  (string   s   );    public static DateTime  ToDateTime  (string   s   );    public static DateTime  ToDateTime  (string   s   , string   format   );    public static DateTime  ToDateTime  (string   s   , string[ ]   formats   );    public static decimal  ToDecimal  (string   s   );    public static double  ToDouble  (string   s   );    public static Guid  ToGuid  (string   s   );    public static short  ToInt16  (string   s   );    public static int  ToInt32  (string   s   );    public static long  ToInt64  (string   s   );    public static sbyte  ToSByte  (string   s   );    public static float  ToSingle  (string   s   );    public static string  ToString  (bool   value   );    public static string  ToString  (byte   value   );    public static string  ToString  (char   value   );    public static string  ToString  (DateTime   value   );    public static string  ToString  (DateTime   value   , string   format   );    public static string  ToString  (decimal   value   );    public static string  ToString  (double   value   );    public static string  ToString  (Guid   value   );    public static string  ToString  (short   value   );    public static string  ToString  (int   value   );    public static string  ToString  (long   value   );    public static string  ToString  (sbyte   value   );    public static string  ToString  (float   value   );    public static string  ToString  (TimeSpan   value   );    public static string  ToString  (ushort   value   );    public static string  ToString  (uint   value   );    public static string  ToString  (ulong   value   );    public static TimeSpan  ToTimeSpan  (string   s   );    public static ushort  ToUInt16  (string   s   );    public static uint  ToUInt32  (string   s   );    public static ulong  ToUInt64  (string   s   );    public static string  VerifyName  (string   name   );    public static string  VerifyNCName  (string   name   ); } 


C# in a Nutshell
C # in a Nutshell, Second Edition
ISBN: 0596005261
EAN: 2147483647
Year: 2005
Pages: 963

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net