Example #1
0
        private object transformValue(GroupCodeValueType code, string strVal)
        {
            switch (code)
            {
            case GroupCodeValueType.String:
            case GroupCodeValueType.Comment:
            case GroupCodeValueType.ExtendedDataString:
                return(strVal);

            case GroupCodeValueType.Point3D:
            case GroupCodeValueType.Double:
            case GroupCodeValueType.ExtendedDataDouble:
                return(this.lineAsDouble(strVal));

            case GroupCodeValueType.Int16:
            case GroupCodeValueType.ExtendedDataInt16:
                return(this.lineAsShort(strVal));

            case GroupCodeValueType.Int32:
            case GroupCodeValueType.ExtendedDataInt32:
                return(this.lineAsInt(strVal));

            case GroupCodeValueType.Int64:
                return(this.lineAsLong(strVal));

            case GroupCodeValueType.Handle:
            case GroupCodeValueType.ObjectId:
            case GroupCodeValueType.ExtendedDataHandle:
                return(this.lineAsHandle(strVal));

            case GroupCodeValueType.Bool:
                return(this.lineAsBool(strVal));

            case GroupCodeValueType.Chunk:
            case GroupCodeValueType.ExtendedDataChunk:
                return(this.lineAsBinaryChunk(strVal));

            case GroupCodeValueType.None:
            default:
                throw new DxfException((int)code, this.Line);
            }
        }
Example #2
0
        private object transformValue(GroupCodeValueType code)
        {
            switch (code)
            {
            case GroupCodeValueType.String:
            case GroupCodeValueType.Comment:
            case GroupCodeValueType.ExtendedDataString:
                return(this.readStringLine());

            case GroupCodeValueType.Point3D:
            case GroupCodeValueType.Double:
            case GroupCodeValueType.ExtendedDataDouble:
                return(this.ReadDouble());

            case GroupCodeValueType.Int16:
            case GroupCodeValueType.ExtendedDataInt16:
                return(this.ReadInt16());

            case GroupCodeValueType.Int32:
            case GroupCodeValueType.ExtendedDataInt32:
                return(this.ReadInt32());

            case GroupCodeValueType.Int64:
                return(this.ReadInt64());

            case GroupCodeValueType.Handle:
            case GroupCodeValueType.ObjectId:
            case GroupCodeValueType.ExtendedDataHandle:
                return(this.lineAsHandle(this.readStringLine()));

            case GroupCodeValueType.Bool:
                return(this.ReadByte() > 0);

            case GroupCodeValueType.Chunk:
            case GroupCodeValueType.ExtendedDataChunk:
                return(this.lineAsBinaryChunk());

            case GroupCodeValueType.None:
            default:
                throw new DxfException((int)code, this.Line);
            }
        }