소스 검색

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 13 년 전
부모
커밋
60ba82cc13
1개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 9
    4
      DocX/_Extensions.cs

+ 9
- 4
DocX/_Extensions.cs 파일 보기

@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.IO;
using System.Xml.Linq;
namespace Novacode
@@ -61,5 +58,13 @@ 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;
}
}
}

Loading…
취소
저장