コード例 #1
0
        public static int GetAttributeAsInt32(this XElement element, string name)
        {
            var text = element.GetAttribute(name);

            if (string.IsNullOrEmpty(text) == true)
            {
                return(0);
            }
            return(CremaXmlConvert.ToInt32(text));
        }
コード例 #2
0
        public static int GetAttributeAsInt32(this XmlReader reader, string name)
        {
            var text = reader.GetAttribute(name);

            if (string.IsNullOrEmpty(text) == true)
            {
                return(0);
            }
            return(CremaXmlConvert.ToInt32(text));
        }