Example #1
0
 /// <summary>
 /// 添加字段(新创建的IFields与FeatureClass中的IFields处理方式不同)
 /// </summary>
 /// <param name="fieldHelper"></param>
 public void AddField(ZField fieldHelper)
 {
     if (featureClass == null)
     {
         fieldsEdit.AddField(fieldHelper.field);
     }
     else
     {
         featureClass.AddField(fieldHelper.field);
     }
     ZFieldList.Add(fieldHelper);
 }
Example #2
0
        /// <summary>
        /// 添加字段
        /// </summary>
        /// <param name="name">字段名</param>
        /// <param name="alias">字段别名</param>
        /// <param name="type">字段类型</param>
        /// <param name="length">长度</param>
        /// <param name="precision">精度</param>
        /// <param name="nullable">是否可为空</param>
        /// <param name="editable">是否可编辑</param>
        /// <param name="defaultvalue">默认值</param>
        public void AddField(string name, string alias, Enum.FieldType type, int length = 0, int precision = 0, bool nullable = true, bool editable = true, object dValue = null)
        {
            ZField zfield = new ZField(name, alias, type, length, precision, nullable, editable, dValue);

            AddField(zfield);
        }
Example #3
0
        /// <summary>
        /// 添加图形字段
        /// </summary>
        /// <param name="geoType"></param>
        /// <param name="srHelper"></param>
        /// <param name="name"></param>
        public void AddShapeField(GeometryType geoType, ZSpatialReference sr, string name = "SHAPE")
        {
            ZField zfield = new ZField(geoType, sr, name);

            AddField(zfield);
        }