Esempio n. 1
0
        /// <summary>
        /// 字段计算器新增字段,更新回来
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AttributeCalNewFieldAdded(object sender, EventArgs e)
        {
            AttributeCalculator attributeCal = sender as AttributeCalculator;

            if (attributeCal != null)
            {
                _activeLayer.DataSet = attributeCal.FeatureSet;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 字段计算器
        /// </summary>
        public void FieldCalculationExecute()
        {
            AttributeCalculator attributeCal = new AttributeCalculator();

            attributeCal.Show();
            attributeCal.FeatureSet = _activeLayer.DataSet;
            List <string> fieldList = new List <string>();

            foreach (DataColumn dataCol in _activeLayer.DataSet.DataTable.Columns)
            {
                fieldList.Add(dataCol.ToString());
            }
            attributeCal.LoadTableField(fieldList);                  //Load all fields
            attributeCal.NewFieldAdded += AttributeCalNewFieldAdded; //when user click new field to put the calulated values.
        }