示例#1
0
        public static IntBox Truncate(IntBox trunc1)
        {
            IntBox res = new IntBox();

            res.text = (int)Math.Truncate(trunc1.text);
            return(res);
        }
示例#2
0
        public static IntBox Mod(IntBox mod1, IntBox mod2)
        {
            IntBox res = new IntBox();

            res.text = (int)mod1.text % mod2.text;
            return(res);
        }
示例#3
0
        public static IntBox Abs(IntBox abs1)
        {
            IntBox res = new IntBox();

            res.text = Math.Abs(abs1.text);
            return(res);
        }
示例#4
0
        public static IntBox Mul(IntBox mul1, IntBox mul2)
        {
            IntBox res = new IntBox();

            res.text = mul1.text * mul2.text;
            return(res);
        }
示例#5
0
        public static IntBox Div(IntBox div1, IntBox div2)
        {
            IntBox res = new IntBox();

            res.text = div1.text / div2.text;
            return(res);
        }
示例#6
0
        public static IntBox Sub(IntBox sub1, IntBox sub2)
        {
            IntBox res = new IntBox();

            res.text = sub1.text - sub2.text;
            return(res);
        }
示例#7
0
        public static IntBox Sum(IntBox add1, IntBox add2)
        {
            IntBox res = new IntBox();

            res.text = add1.text + add2.text;
            return(res);
        }
示例#8
0
            public IntBoxControl(IntBox ib)
                : base()
            {
                father  = ib;
                this.ID = String.IsNullOrEmpty(father.Name) ? "_intBox" : father.Name;

                // for rollback..
                if (!double.IsNaN(father.text))
                {
                    this.Text = father.text.ToString();
                }
            }
示例#9
0
        public static IntBox Length(StringBox source)
        {
            IntBox      result = new IntBox();
            XmlDocument doc    = new XmlDocument();

            XmlNode nodeValue = doc.CreateElement("null");

            nodeValue.AppendChild(doc.CreateElement("Value"));
            nodeValue.FirstChild.InnerText = source.text.Length.ToString();

            result.Value = nodeValue;

            return(result);
        }
示例#10
0
        public static IntBox Length(StringBox source)
        {
            IntBox      result = new IntBox();
            XmlDocument doc    = new XmlDocument();

            XmlNode nodeValue = doc.CreateElement("null");

            nodeValue.AppendChild(doc.CreateElement("Value"));
            nodeValue.FirstChild.InnerText = source.text.Length.ToString();
            List <XmlNode> listres = new List <XmlNode>();

            listres.Add(nodeValue);
            result.SetValue(listres);

            return(result);
        }
示例#11
0
        public static IntBox Distance(VEMap map1, VEMap map2)
        {
            double lat1 = 0, lon1 = 0, lat2 = 0, lon2 = 0, dist = 0;

            if (!double.TryParse(map1.latitude, out lat1))
            {
                dist = double.PositiveInfinity;
            }
            else if (!double.TryParse(map1.longitude, out lat1))
            {
                dist = double.PositiveInfinity;
            }
            else if (!double.TryParse(map2.latitude, out lat1))
            {
                dist = double.PositiveInfinity;
            }
            else if (!double.TryParse(map2.longitude, out lat1))
            {
                dist = double.PositiveInfinity;
            }
            else
            {
                dist = distance(lat1, lon1, lat2, lon2);
            }

            XmlDocument doc       = new XmlDocument();
            XmlNode     nodeValue = doc.CreateElement("null");

            nodeValue.AppendChild(doc.CreateElement("Value"));
            nodeValue.FirstChild.InnerText = dist.ToString();

            IntBox         result  = new IntBox();
            List <XmlNode> listres = new List <XmlNode>();

            listres.Add(nodeValue);
            result.SetValue(listres);


            return(result);
        }
示例#12
0
 public static bool IsEmpty(IntBox s)
 {
     return(double.IsNaN(s.text));
 }
示例#13
0
 public static bool Lesser(IntBox lt1, IntBox lt2)
 {
     return((lt1.text < lt2.text) ? true : false);
 }
示例#14
0
 public static bool Greater(IntBox gt1, IntBox gt2)
 {
     return((gt1.text > gt2.text) ? true : false);
 }
示例#15
0
 public static bool Equals(IntBox eq1, IntBox eq2)
 {
     return((eq1.text - eq2.text) == 0 ? true : false);
 }