-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathExtensions.cs
More file actions
21 lines (18 loc) · 765 Bytes
/
Extensions.cs
File metadata and controls
21 lines (18 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.Xml;
using System.IO;
namespace MultiplyChannels {
public static class ExtensionMethods {
public static string GetNamedItemValueOrEmpty(this XmlAttributeCollection iAttibutes, string iName) {
string lResult = "";
XmlNode lAttribute = iAttibutes.GetNamedItem(iName);
if (lAttribute != null) lResult = lAttribute.Value;
return lResult;
}
public static string NodeAttr(this XmlNode iNode, string iAttributeName, string iDefault = "") {
string lResult = iDefault;
XmlNode lAttribute = iNode.Attributes.GetNamedItem(iAttributeName);
if (lAttribute != null) lResult = lAttribute.Value.ToString();
return lResult;
}
}
}