コード例 #1
0
        private void AddBallBtn_Click(object sender, EventArgs e)
        {
            BallsLocation.Add(new Point(rand.Next(X_WINDOW_SIZE), rand.Next(Y_WINDOW_SIZE)));

            AllBalls.Add(new PictureBox
            {
                Name     = "Ball" + NameIndex.ToString(),
                Size     = new Size(100, 100),
                SizeMode = PictureBoxSizeMode.StretchImage,
                Location = BallsLocation[NameIndex],
                Image    = Image.FromFile(@"D:\Documents\HackerU\HW_Files\Ball_Pic.jpg")
            });
            this.Controls.Add(AllBalls[NameIndex]);

            DX.Add(1);
            DY.Add(1);
            NewLocationX.Add(FirstBallLocation.X);
            NewLocationY.Add(FirstBallLocation.Y);


            Task.Run(() =>
            {
                PlaceControl();
            });

            System.Timers.Timer timer = new System.Timers.Timer(1);
            timer.Elapsed += Timer_Elapsed;
            timer.Enabled  = true;

            NameIndex++;
        }
コード例 #2
0
        public void ProduceThresholdImage()
        {
            HueLow  = (int)(tBar_HLo.Value);
            HueHigh = (int)tBar_HHi.Value;
            SatLow  = (int)tBar_SLo.Value;
            SatHigh = (int)tBar_SHi.Value;
            ValLow  = (int)tBar_VLo.Value;
            ValHigh = (int)tBar_VHi.Value;

            PX = (int)tBar_PX.Value;
            IX = (int)tBar_IX.Value;
            DX = (int)tBar_DX.Value;
            PY = (int)tBar_PY.Value;
            IY = (int)tBar_IY.Value;
            DY = (int)tBar_DY.Value;

            SetPointX = (int)tBar_SetPointX.Value;
            SetPointY = (int)tBar_SetPointY.Value;

            tbl_HueLow.Text    = HueLow.ToString();
            tbl_HueHigh.Text   = HueHigh.ToString();
            tbl_SatLow.Text    = SatLow.ToString();
            tbl_SatHigh.Text   = SatHigh.ToString();
            tbl_ValLow.Text    = ValLow.ToString();
            tbl_ValHigh.Text   = ValHigh.ToString();
            tbl_PX.Text        = PX.ToString();
            tbl_IX.Text        = IX.ToString();
            tbl_DX.Text        = DX.ToString();
            tbl_PY.Text        = PY.ToString();
            tbl_IY.Text        = IY.ToString();
            tbl_DY.Text        = DY.ToString();
            tbl_SetPointX.Text = SetPointX.ToString();
            tbl_SetPointY.Text = SetPointY.ToString();
        }
コード例 #3
0
        public Form2(int a, int b)
        {
            f = a;
            q = b;
            string s = "Введите данные фигуры номер 1";

            InitializeComponent();
            outInfo.Text = s;
            if (a == 1)
            {
                textBox4.Dispose();
                DX.Dispose();
                DY.Dispose();
            }
            else if (a == 2)
            {
                textBox2.Dispose();
                BX.Dispose();
                BY.Dispose();
                textBox4.Dispose();
                DX.Dispose();
                DY.Dispose();
                textBox1.Text = "цент";
                textBox3.Text = "R";
                CY.Dispose();
            }
        }
コード例 #4
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (DX != 0)
            {
                hash ^= DX.GetHashCode();
            }
            if (DY != 0)
            {
                hash ^= DY.GetHashCode();
            }
            if (ActionFlags != 0)
            {
                hash ^= ActionFlags.GetHashCode();
            }
            if (ActionData != 0)
            {
                hash ^= ActionData.GetHashCode();
            }
            if (ExtraInfo != 0)
            {
                hash ^= ExtraInfo.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #5
0
ファイル: Primitives.cs プロジェクト: tevfikoguz/BoxCulvert
        public override string ToString()
        {
            string str = "|" + M11.ToString() + ", " + M12.ToString() + ", " + DX.ToString() + "|" + Environment.NewLine +
                         "|" + M21.ToString() + ", " + M22.ToString() + ", " + DY.ToString() + "|" + Environment.NewLine +
                         "|0, 0, 1|";

            return(str);
        }
コード例 #6
0
        //登录党员信息
        public DY DYDeng(DY d)
        {
            string sql = $"select DYid,DYname from DangYuan where DYhao='{d.DYhao}' and DYpwd='{d.DYpwd}'";
            var    dt  = DBHelper.ExecuteQuery(sql, System.Data.CommandType.Text);
            string str = JsonConvert.SerializeObject(dt);
            DY     dd  = JsonConvert.DeserializeObject <List <DY> >(str).FirstOrDefault();

            return(dd);
        }
コード例 #7
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = 236514578;
         hashCode = hashCode * -1521134295 + X.GetHashCode();
         hashCode = hashCode * -1521134295 + Y.GetHashCode();
         hashCode = hashCode * -1521134295 + Z.GetHashCode();
         hashCode = hashCode * -1521134295 + DX.GetHashCode();
         hashCode = hashCode * -1521134295 + DY.GetHashCode();
         hashCode = hashCode * -1521134295 + DZ.GetHashCode();
         return(hashCode);
     }
 }
コード例 #8
0
        public void set(string ParamDetal,string ParamStol)
        {
            Article = Article.Replace("$lpx", DX.ToString()).Replace("$lpy", DY.ToString()).Replace("$lpz", DZ.ToString());
            Article = Article.Replace("_art", "_" + Guid.NewGuid().ToString() + DateTime.Now.ToString().Replace(";", "").Replace(" ", "").Replace(".", "").Replace("/", "").Replace(":", "").Replace("\\", ""));

            //if (ScmData != null)
            //    for (int i = 0; i < ScmData.Length; i++)
            //    {
            //        ScmData[i] = ScmData[i].Replace("$lpx", DX.ToString()).Replace("$lpy", DY.ToString()).Replace("$lpz", DZ.ToString());
                    
            //        for (int j = 0; j < massParam.Length; j++)
            //       {
            //        string[] value = massParam[j].Split('=');
            //        ScmData[i] = ScmData[i].Replace(value[0].Replace(" ", ""), value[1].Replace(" ", ""));
            //       }
            //    }
        }
コード例 #9
0
 //return item data as a string
 public override string ToString()
 {
     return("Name = " + Name + "\r\n" +
            "EUMType = " + EUMType.ToString() + " (" + ((int)EUMType).ToString() + ")\r\n" +
            "EUMUnit = " + EUMUnit.ToString() + " (" + ((int)EUMUnit).ToString() + ")\r\n" +
            "EUMUnitString = " + EUMUnitString + "\r\n" +
            "EUMTypeString = " + EUMTypeString + "\r\n" +
            "sAxisType = " + sAxisType.ToString() + "\r\n" +
            "axisEUMUnit = " + axisEUMUnit.ToString() + "\r\n" +
            "axisEUMUnitString = " + axisEUMUnitString + "\r\n" +
            "dim = " + dim.ToString() + "\r\n" +
            "nPointsX = " + nPointsX.ToString() + "\r\n" +
            "nPointsY = " + nPointsY.ToString() + "\r\n" +
            "nPointsZ = " + nPointsZ.ToString() + "\r\n" +
            "XMinLimit = " + XMinLimit.ToString() + "\r\n" +
            "YMinLimit = " + YMinLimit.ToString() + "\r\n" +
            "ZMinLimit = " + ZMinLimit.ToString() + "\r\n" +
            "DX = " + DX.ToString() + "\r\n" +
            "DY = " + DY.ToString() + "\r\n" +
            "DZ = " + DZ.ToString() + "\r\n" +
            "dataType = " + dataType.ToString() + "\r\n" +
            "dataValType = " + dataValType.ToString() + "\r\n");
 }
コード例 #10
0
ファイル: Line.cs プロジェクト: tilemapjp/MapsforgeSharp
        private void ExtractValues(IGraphicFactory graphicFactory, DisplayModel displayModel, string elementName, XmlReader reader, string relativePathPrefix)
        {
            for (int i = 0; i < reader.AttributeCount; ++i)
            {
                reader.MoveToAttribute(i);

                string name  = reader.Name;
                string value = reader.Value;

                if (SRC.Equals(name))
                {
                    this.src = value;
                }
                else if (CAT.Equals(name))
                {
                    this.category = value;
                }
                else if (DY.Equals(name))
                {
                    this.dy = float.Parse(value) * displayModel.ScaleFactor;
                }
                else if (STROKE.Equals(name))
                {
                    this.stroke.Color = (Color)XmlUtils.GetColor(graphicFactory, value);
                }
                else if (STROKE_WIDTH.Equals(name))
                {
                    this.strokeWidth = XmlUtils.ParseNonNegativeFloat(name, value) * displayModel.ScaleFactor;
                }
                else if (STROKE_DASHARRAY.Equals(name))
                {
                    float[] floatArray = ParseFloatArray(name, value);
                    for (int f = 0; f < floatArray.Length; ++f)
                    {
                        floatArray[f] = floatArray[f] * displayModel.ScaleFactor;
                    }
                    this.stroke.DashPathEffect = floatArray;
                }
                else if (STROKE_LINECAP.Equals(name))
                {
                    this.stroke.StrokeCap = Cap.FromString(value);
                }
                else if (STROKE_LINEJOIN.Equals(name))
                {
                    this.stroke.StrokeJoin = Join.FromString(value);
                }
                else if (SYMBOL_HEIGHT.Equals(name))
                {
                    this.height = XmlUtils.ParseNonNegativeInteger(name, value) * displayModel.ScaleFactor;
                }
                else if (SYMBOL_PERCENT.Equals(name))
                {
                    this.percent = XmlUtils.ParseNonNegativeInteger(name, value);
                }
                else if (SYMBOL_SCALING.Equals(name))
                {
                    this.scaling = FromValue(value);
                }
                else if (SYMBOL_WIDTH.Equals(name))
                {
                    this.width = XmlUtils.ParseNonNegativeInteger(name, value) * displayModel.ScaleFactor;
                }
                else
                {
                    throw XmlUtils.CreateXmlReaderException(elementName, name, value, i);
                }
            }
        }
コード例 #11
0
        private void button1_Click(object sender, EventArgs e)
        {
            StreamWriter sw = new StreamWriter(Application.StartupPath + "\\GPS.txt");
            object       DX, DH, DY, mSpeed;
            int          ItemID = IInfoTree.FindItem("car");

            if (ItemID == 0)
            {
                //tempDynamicObject = IObjectManager.CreateDynamicObject(DynamicMotionStyle.MOTION_GROUND_VEHICLE, DynamicObjectType.DYNAMIC_3D_MODEL, Application.StartupPath + "\\car.xpc", 3, HeightStyleCode.HS_ON_TERRAIN, 0, this.textBox4.Text);
                tempDynamicObject = IObjectManager.CreateDynamicObject(DynamicMotionStyle.MOTION_GROUND_VEHICLE, DynamicObjectType.DYNAMIC_3D_MODEL, Application.StartupPath + "\\car.xpc", 1, HeightStyleCode.HS_ON_TERRAIN, 0, this.textBox4.Text);
                tempDynamicObject.SetPosition(Convert.ToDouble(this.textBox1.Text), Convert.ToDouble(this.textBox2.Text), -30, -30, 0, 0);
            }
            for (int i = 0; i < tempDynamicObject.NumberOfWaypoints; i++)
            {
                tempDynamicObject.GetWaypoint(i, out DX, out DH, out DY, out mSpeed);
                if (tempDynamicObject.CurrentWaypoint != 1)
                {
                    tempDynamicObject.ModifyWaypoint(i, Convert.ToDouble(this.textBox1.Text), 0, Convert.ToDouble(this.textBox2.Text), Convert.ToDouble(this.textBox3.Text));
                    sw.WriteLine(i.ToString() + "\t" + DX.ToString() + "\t" + DH.ToString() + "\t" + DY.ToString() + "\t" + mSpeed.ToString());
                }
                sw.Close();
            }
        }
コード例 #12
0
ファイル: Caption.cs プロジェクト: tilemapjp/MapsforgeSharp
        private void ExtractValues(IGraphicFactory graphicFactory, DisplayModel displayModel, string elementName, XmlReader reader)
        {
            FontFamily fontFamily = FontFamily.Default;
            FontStyle  fontStyle  = FontStyle.Normal;

            for (int i = 0; i < reader.AttributeCount; ++i)
            {
                reader.MoveToAttribute(i);

                string name  = reader.Name;
                string value = reader.Value;

                if (K.Equals(name))
                {
                    this.textKey = TextKey.getInstance(value);
                }
                else if (POSITION.Equals(name))
                {
                    this.position = value.ToPosition();
                }
                else if (CAT.Equals(name))
                {
                    this.category = value;
                }
                else if (DISPLAY.Equals(name))
                {
                    this.display = value.ToDisplay();
                }
                else if (DY.Equals(name))
                {
                    this.dy = float.Parse(value) * displayModel.ScaleFactor;
                }
                else if (FONT_FAMILY.Equals(name))
                {
                    fontFamily = value.ToFontFamily();
                }
                else if (FONT_STYLE.Equals(name))
                {
                    fontStyle = value.ToFontStyle();
                }
                else if (FONT_SIZE.Equals(name))
                {
                    this.fontSize = XmlUtils.ParseNonNegativeFloat(name, value) * displayModel.ScaleFactor;
                }
                else if (FILL.Equals(name))
                {
                    this.fill.Color = XmlUtils.GetColor(value);
                }
                else if (PRIORITY.Equals(name))
                {
                    this.priority = int.Parse(value);
                }
                else if (STROKE.Equals(name))
                {
                    this.stroke.Color = XmlUtils.GetColor(value);
                }
                else if (STROKE_WIDTH.Equals(name))
                {
                    this.stroke.StrokeWidth = XmlUtils.ParseNonNegativeFloat(name, value) * displayModel.ScaleFactor;
                }
                else if (SYMBOL_ID.Equals(name))
                {
                    this.symbolId = value;
                }
                else
                {
                    throw XmlUtils.CreateXmlReaderException(elementName, name, value, i);
                }
            }

            this.fill.SetTypeface(fontFamily, fontStyle);
            this.stroke.SetTypeface(fontFamily, fontStyle);

            XmlUtils.CheckMandatoryAttribute(elementName, K, this.textKey);
        }
コード例 #13
0
        public IHttpActionResult DYAdd(DY d)
        {
            var list = dal.DYAdd(d);

            return(Json(list));
        }
コード例 #14
0
        public string generate()
            {
               

                string temp = File.ReadAllText(Application.StartupPath +  "\\BiessePrograms\\Macros\\Шапка.bmac") + "\n"; ;

                if (BiesseListData != null)
                    for (int i = 0; i < BiesseListData.Length; i++)
                    {
                        if (BiesseListData[i] != "")
                        {
                            string param = "";
                            string nameProg = "";
                            if (BiesseListData[i].Contains("$"))
                            {
                                param = "$" + BiesseListData[i].Split('$')[1];
                                nameProg = BiesseListData[i].Split('$')[0];
                            }
                            else
                                nameProg = BiesseListData[i];

                            string macrosPatch = Application.StartupPath + "\\BiessePrograms\\Macros\\" + nameProg + ".bmac";
                            if (!File.Exists(macrosPatch)) { MessageBox.Show("Файл: " + macrosPatch + "\n не найден."); return null; }



                            string programm = setMINRoutg(macrosPatch);



                            if (param != "")
                            {
                                string[] values = param.Split('=')[1].Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries);
                                for (int j = 0; j < values.Length; j++)
                                {
                                    string tekMakro = programm;
                                    temp += tekMakro.Replace(param.Split('=')[0], values[j]) + "\n";
                                }

                            }
                            else {
                                temp += programm + "\n"; }
                        }
                    }

            string[] sep = new string[] { ";" };
            string[] paramMass = new string[1];

            if (StolParam != null)
            {
                paramMass = StolParam.Split(sep, StringSplitOptions.RemoveEmptyEntries);

                if (paramMass != null)
                    for (int i = 0; i < paramMass.Length; i++)
                        temp = temp.Replace(paramMass[i].Split('=')[0].Trim(), paramMass[i].Split('=')[1].Trim());
            }

            if (DetalParam != null)
            {
                paramMass = DetalParam.Split(sep, StringSplitOptions.RemoveEmptyEntries);
                if (paramMass != null)
                    for (int i = 0; i < paramMass.Length; i++)
                        temp = temp.Replace(paramMass[i].Split('=')[0].Trim(), paramMass[i].Split('=')[1].Trim());
            }
                temp = temp.Replace("$lpx", DX.ToString()).Replace("$lpy", DY.ToString()).Replace("$lpz", DZ.ToString());

                return temp;
            }
コード例 #15
0
ファイル: DangYuanDAL.cs プロジェクト: HouJunZhe/WisdomParty
        //注册党员信息
        public int DYAdd(DY d)
        {
            string sql = $"insert into DangYuan(DYweixin,DYname,DYhao,DYpwd,DYgonghao,DYsex,DYchusheng,DYxueli,DYrudang,DYzhibu) values('{d.DYweixin}','{d.DYname}','{d.DYhao}','{d.DYpwd}','{d.DYgonghao}','{d.DYsex}','{d.DYchusheng}','{d.DYxueli}','{d.DYrudang}','{d.DYzhibu}')";

            return(DBHelper.ExecuteNonQuery(sql, System.Data.CommandType.Text));
        }
コード例 #16
0
        private void ExtractValues(string elementName, XmlReader reader)
        {
            this.repeatGap   = REPEAT_GAP_DEFAULT * displayModel.ScaleFactor;
            this.repeatStart = REPEAT_START_DEFAULT * displayModel.ScaleFactor;

            for (int i = 0; i < reader.AttributeCount; ++i)
            {
                reader.MoveToAttribute(i);

                string name  = reader.Name;
                string value = reader.Value;

                if (SRC.Equals(name))
                {
                    this.src = value;
                }
                else if (DISPLAY.Equals(name))
                {
                    this.display = Display.FromString(value);
                }
                else if (DY.Equals(name))
                {
                    this.dy = float.Parse(value) * displayModel.ScaleFactor;
                }
                else if (ALIGN_CENTER.Equals(name))
                {
                    this.alignCenter = bool.Parse(value);
                }
                else if (CAT.Equals(name))
                {
                    this.category = value;
                }
                else if (PRIORITY.Equals(name))
                {
                    this.priority = int.Parse(value);
                }
                else if (REPEAT.Equals(name))
                {
                    this.repeat = bool.Parse(value);
                }
                else if (REPEAT_GAP.Equals(name))
                {
                    this.repeatGap = float.Parse(value) * displayModel.ScaleFactor;
                }
                else if (REPEAT_START.Equals(name))
                {
                    this.repeatStart = float.Parse(value) * displayModel.ScaleFactor;
                }
                else if (ROTATE.Equals(name))
                {
                    this.rotate = bool.Parse(value);
                }
                else if (SYMBOL_HEIGHT.Equals(name))
                {
                    this.height = XmlUtils.ParseNonNegativeInteger(name, value) * displayModel.ScaleFactor;
                }
                else if (SYMBOL_PERCENT.Equals(name))
                {
                    this.percent = XmlUtils.ParseNonNegativeInteger(name, value);
                }
                else if (SYMBOL_SCALING.Equals(name))
                {
                    this.scaling = FromValue(value);
                }
                else if (SYMBOL_WIDTH.Equals(name))
                {
                    this.width = XmlUtils.ParseNonNegativeInteger(name, value) * displayModel.ScaleFactor;
                }
                else
                {
                    throw XmlUtils.CreateXmlReaderException(elementName, name, value, i);
                }
            }
        }