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

Author:

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 description.
  /// 

  #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

  }
}

Leave a Reply

Your email address will not be published. Required fields are marked *