Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Lire la valeur ‘Int’ d’un Attribut

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

/*
  Microsoft Public License (Ms-PL)
  http://dbmlmanager.codeplex.com/license
 */
 
#region using
using System;
using System.Xml;
#endregion
 
namespace DbmlManager.Lib.Utility
{
  #region Class Docs
  ///
<summary>
  /// Summary description for XmlUtil.
  /// </summary>
 
  #endregion
 
  public class XmlUtil
  {
 
    #region GetIntAttrib(XmlNode node, string name, out bool found, out bool valid, ref int result)
    public static void GetIntAttrib(XmlNode node, string name, out bool found, out bool valid, ref int result)
    {
      if (node.Attributes == null || node.Attributes[name] == null)
      {
        found = false;
        valid = false;
        return;
      }
 
      found = true;
      valid = Int32.TryParse(node.Attributes[name].InnerText, out result);
    }
    #endregion
 
  }
}

No comments yet.

Leave a Comment