public static Guid GetAttr(XmlNode node, string name, Guid def) { Guid guid = def; string s = XFunc.GetAttr(node, name, ""); if (s != "") { guid = new Guid(s); } return(guid); }
public static bool GetAttr(XmlNode node, string name, bool def) { bool r = def; string s = XFunc.GetAttr(node, name, ""); if (s != "") { s = s.ToLower(); r = (s == "1") || (s == "true"); } return(r); }
public static DateTime GetAttr(XmlNode node, string name, DateTime def) { DateTime i = def; string s = XFunc.GetAttr(node, name, ""); if (s != "") { try { i = Convert.ToDateTime(s); } catch { } } return(i); }
public static long GetAttr(XmlNode node, string name, long def) { long i = def; string s = XFunc.GetAttr(node, name, ""); if (s != "") { try { i = Convert.ToInt64(s); } catch { } } return(i); }
public static int GetAttr(XmlNode node, string name, int def) { int i = def; string s = XFunc.GetAttr(node, name, ""); if (s != "") { try { i = Convert.ToInt32(s); } catch { } } return(i); }