public static void AddClass(this XElement @this, string @class)
        {
            if (@this == null) throw new ArgumentNullException();

            var c = @this.ClassAttribute();
            if (c == null)
            {
                @this.Add(c = new XClassAttribute());
            }
            c.Add(@class);
        }
示例#2
0
        public static void AddClass(this XElement @this, string @class)
        {
            if (@this == null)
            {
                throw new ArgumentNullException();
            }

            var c = @this.ClassAttribute();

            if (c == null)
            {
                @this.Add(c = new XClassAttribute());
            }
            c.Add(@class);
        }