Esempio n. 1
0
        public static Nullable <T> AttributeNullableValue <T>(this XElement @this, XName name) where T : struct
        {
            var attribute = @this.Attribute(name);

            return(XConvert.ToNullable <T>(attribute.Value));
        }
Esempio n. 2
0
        public static T AttributeValueOrDefault <T>(this XElement @this, XName name, T defaultValue = default) where T : struct
        {
            var attribute = @this.Attribute(name);

            return(XConvert.ToOrDefault <T>(attribute.Value));
        }