示例#1
0
        public pointCoord(pointCoord pre, string tabStr)
        {
            preCoord = pre;
            var tmp = tabStr.Split(';');

            int count = tmp.Count() / 2;

            Type type = this.GetType(); //获取类型

            for (int i = 0; i < count; i++)
            {
                System.Reflection.PropertyInfo propertyInfo = type.GetProperty(tmp[2 * i]);

                propertyInfo.SetValue(this, tmp[2 * i + 1], null); //给对应属性赋值
            }

            if (tabStr.Contains("C"))
            {
                Cstate = true;
            }
            else
            {
                Cstate = false;
            }
        }
示例#2
0
        public pointCoord Offset(string offsetStr)
        {
            pointCoord offsetCooord = new pointCoord(this);
            var        tmp          = offsetStr.Split(';');
            int        count        = tmp.Count() / 2;

            Type type = this.GetType(); //获取类型

            for (int i = 0; i < count; i++)
            {
                System.Reflection.PropertyInfo propertyInfo = type.GetProperty(tmp[2 * i]);
                string basecoordStr = (string)propertyInfo.GetValue(this, null);
                //Convert it to double
                double offset    = System.Convert.ToDouble(tmp[2 * i + 1]);
                double basecoord = System.Convert.ToDouble(basecoordStr);
                propertyInfo.SetValue(offsetCooord, (basecoord + offset).ToString(), null); //给对应属性赋值
            }
            //  offsetCooord.preCoord = this;
            return(offsetCooord);
        }
示例#3
0
 public pointCoord(pointCoord pre)
 {
     this.preCoord = pre;
 }
示例#4
0
        public pointCoord Offset(string offsetStr)
        {
            pointCoord offsetCooord = new pointCoord(this);
            var tmp = offsetStr.Split(';');
            int count = tmp.Count() / 2;

            Type type = this.GetType(); //获取类型
            for (int i = 0; i < count; i++)
            {
                System.Reflection.PropertyInfo propertyInfo = type.GetProperty(tmp[2 * i]);
                string basecoordStr = (string)propertyInfo.GetValue(this, null);
                //Convert it to double
                double offset = System.Convert.ToDouble(tmp[2 * i + 1]);
                double basecoord = System.Convert.ToDouble(basecoordStr);
                propertyInfo.SetValue(offsetCooord, (basecoord + offset).ToString(), null); //给对应属性赋值

            }
            //  offsetCooord.preCoord = this;
            return offsetCooord;

        }
示例#5
0
        public pointCoord(pointCoord pre, string tabStr)
        {
            preCoord = pre;
            var tmp = tabStr.Split(';');

            int count = tmp.Count() / 2;

            Type type = this.GetType(); //获取类型
            for (int i = 0; i < count; i++)
            {
                System.Reflection.PropertyInfo propertyInfo = type.GetProperty(tmp[2 * i]);

                propertyInfo.SetValue(this, tmp[2 * i + 1], null); //给对应属性赋值

            }

            if (tabStr.Contains("C"))
            {
                Cstate = true;

            }
            else
            {
                Cstate = false;
            }




        }
示例#6
0
        public pointCoord(pointCoord pre)
        {
            this.preCoord = pre;



        }