Thursday

xdocument elements getting by SafeElement function


public string SafeElem(XDocument x, string tag, string _default_)
{
string r = _default_;
IEnumerable<XElement> a = x.Elements(tag);
if (a!=null && a.Count() >0)
{
string g= a.First().Value;
if (!string.IsNullOrEmpty(g))
{
r = g;
}
}
return r;
}


No comments:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...