Example #1
0
        /// <summary>
        /// 添加图形字段
        /// </summary>
        /// <param name="fields"></param>
        /// <param name="geoType"></param>
        /// <param name="sr"></param>
        /// <param name="name"></param>
        public static void AddShapeField(this IFields fields, esriGeometryType geoType, ISpatialReference sr, string name = "SHAPE")
        {
            IField field = IFieldEx.CreateShapeField(geoType, sr, name);

            fields.AddField(field);
        }
Example #2
0
        /// <summary>
        /// 添加字段
        /// </summary>
        /// <param name="fields"></param>
        /// <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 static void AddField(this IFields fields, string name, string alias, esriFieldType type, int length = 0, int precision = 0, bool nullable = true, bool editable = true, object dValue = null)
        {
            IField field = IFieldEx.CreateField(name, alias, type, length, precision, nullable, editable, dValue);

            fields.AddField(field);
        }