Ejemplo n.º 1
0
        public static Int64 XmlGetAttributeInt64(XmlNode node, string name, Int64 def)
        {
            XmlNode nodeAttr = node.Attributes[name];

            if (nodeAttr == null)
            {
                return(def);
            }
            else
            {
                return(Conversions.ToInt64(nodeAttr.Value));
            }
        }
Ejemplo n.º 2
0
 public static void FormatBytesEx(Int64 val, string[] suf, int logBase, ref Int64 number, ref string unit)
 {
     if (val <= 0)
     {
         number = 0;
         unit   = suf[0];
     }
     else
     {
         //string[] suf = { "B", "KB", "MB", "GB", "TB", "PB" };
         int    place = Conversions.ToInt32(Math.Floor(Math.Log(val, logBase)));
         double num   = Math.Round(val / Math.Pow(logBase, place), 1);
         number = Conversions.ToInt64(num);
         unit   = suf[place];
     }
 }
Ejemplo n.º 3
0
 public Int64 GetInt64(string name)
 {
     return(Conversions.ToInt64(Get(name)));
 }