示例#1
0
文件: MotionForm.cs 项目: dytell/ntv
        /// <summary>
        /// Функция которая открывает форму и вписывает
        /// изменёные значения в datgrid
        /// </summary>
        /// <param name="motion"></param>
        /// <param name="rowIndex"></param>
        private void EditMotion(IMotion motion, int rowIndex)
        {
            _motions[rowIndex] = motion;
            var row = new DataGridViewRow();

            row.CreateCells(_dataGridView);
            var motionType = motion.Name;
            var motionCalc = motion.CalculateCoordination().ToString("F");

            _dataGridView.Rows[rowIndex].Cells[0].Value = motionType;
            _dataGridView.Rows[rowIndex].Cells[1].Value = motionCalc;
        }
示例#2
0
文件: MotionForm.cs 项目: dytell/ntv
        /// <summary>
        /// Функция добавляющия в datagrid значения
        /// </summary>
        /// <param name="motion"></param>
        private void AddMotion(IMotion motion)
        {
            _motions.Add(motion);
            var row = new DataGridViewRow();

            row.CreateCells(_dataGridView);
            var motionType = motion.Name;
            var motionCalc = motion.CalculateCoordination().ToString("F");

            row.Cells[0].Value = motionType;
            row.Cells[1].Value = motionCalc;
            _dataGridView.Rows.Add(row);
        }