Explorar el Código

Added an extension method GetAttribute that returns a specified default value when getting XElement Attribute values - provided by Carko

Removed unused variables from _Extensions.cs
master
MadBoy_cp hace 14 años
padre
commit
60ba82cc13
Se han modificado 1 ficheros con 9 adiciones y 4 borrados
  1. 9
    4
      DocX/_Extensions.cs

+ 9
- 4
DocX/_Extensions.cs Ver fichero

using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Drawing; using System.Drawing;
using System.IO;
using System.Xml.Linq; using System.Xml.Linq;
namespace Novacode namespace Novacode
) )
); );
} }
public static string GetAttribute(this XElement el, XName name, string defaultValue = "")
{
var attr = el.Attribute(name);
if (attr != null)
return attr.Value;
return defaultValue;
}
} }
} }

Cargando…
Cancelar
Guardar