Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }