Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static char GetDbaseType(Type type)
        {
            DbaseFieldDescriptor dbaseColumn = new DbaseFieldDescriptor();

            if (type == typeof(Char))
            {
                return('C');
            }
            if (type == typeof(string))
            {
                return('C');
            }
            else if (type == typeof(Double))
            {
                return('N');
            }
            else if (type == typeof(Single))
            {
                return('N');
            }
            else if (type == typeof(Int16))
            {
                return('N');
            }
            else if (type == typeof(Int32))
            {
                return('N');
            }
            else if (type == typeof(Int64))
            {
                return('N');
            }
            else if (type == typeof(UInt16))
            {
                return('N');
            }
            else if (type == typeof(UInt32))
            {
                return('N');
            }
            else if (type == typeof(UInt64))
            {
                return('N');
            }
            else if (type == typeof(Decimal))
            {
                return('N');
            }
            else if (type == typeof(Boolean))
            {
                return('L');
            }
            else if (type == typeof(DateTime))
            {
                return('D');
            }

            throw new NotSupportedException(String.Format("{0} does not have a corresponding dbase type.", type.Name));
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static DbaseFieldDescriptor ShapeField()
        {
            DbaseFieldDescriptor shpfield = new DbaseFieldDescriptor();

            shpfield.Name  = "Geometry";
            shpfield._type = 'B';
            return(shpfield);
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static DbaseFieldDescriptor IdField()
        {
            DbaseFieldDescriptor shpfield = new DbaseFieldDescriptor();

            shpfield.Name  = "Row";
            shpfield._type = 'I';
            return(shpfield);
        }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the ColumnStructure class.
 /// </summary>
 /// <param name="dbaseField"></param>
 /// <param name="index"></param>
 public ColumnStructure(DbaseFieldDescriptor dbaseField, int index) : base(dbaseField.Name, null)
 {
     _dbaseField = dbaseField;
     _index      = index;
 }