Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Charger une valeur Booléan à partir d’un élément XML

Utilisation,de,la,classe,'XmlTextReader',pour,lire,un,document,XML
{filelink=16413}

/*
 Microsoft Public License (Ms-PL)
 http://dbmlmanager.codeplex.com/license
 */
 
#region using
using System;
using System.Xml;
#endregion
 
namespace Mesexemples.com
{
  #region Class Docs
  ///
<summary>
  /// Summary description.
  /// </summary>
 
  #endregion
 
  public class XmlUtil
  {
 
    #region ChargerBoolean(ref bool documentXMLeur, XmlNode parent, string nom)
    public static void ChargerBoolean(ref bool documentXMLeur, XmlNode parent, string nom)
    {
      try
      {
        XmlElement elem = parent[nom];
        if (elem != null)
          documentXMLeur = (elem.InnerText.Trim() == "1");
      }
      catch
      {
        documentXMLeur = false;
      }
    }
    #endregion
 
  }
}

No comments yet.

Leave a Comment