public override bool Equals(object o)
        {
            EsfArrayNode <T> otherNode = o as EsfArrayNode <T>;
            bool             result    = otherNode != null;

            result &= ArraysEqual(Value, otherNode.Value);
            return(result);
        }
Example #2
0
        protected virtual EsfNode CreateArrayNode(EsfType typeCode)
        {
            EsfNode result = null;

            switch (typeCode)
            {
            case EsfType.BOOL_ARRAY:
                result = new EsfArrayNode <bool>(this, typeCode);
                // CreateArrayNode<bool>(reader), ItemReader = ReadBool);
                break;

            case EsfType.INT8_ARRAY:
                result = new EsfArrayNode <sbyte>(this, typeCode);
                break;

            case EsfType.INT16_ARRAY:
                result = new EsfArrayNode <short>(this, typeCode);
                break;

            case EsfType.INT32_ARRAY:
                result = new EsfArrayNode <int>(this, typeCode);
                break;

            case EsfType.INT64_ARRAY:
                result = new EsfArrayNode <long>(this, typeCode);
                break;

            case EsfType.UINT8_ARRAY:
                result = new EsfArrayNode <byte>(this, typeCode);
                break;

            case EsfType.UINT16_ARRAY:
                result = new EsfArrayNode <ushort>(this, typeCode);
                break;

            case EsfType.UINT32_ARRAY:
                result = new EsfArrayNode <uint>(this, typeCode);
                break;

            case EsfType.UINT64_ARRAY:
                result = new EsfArrayNode <ulong>(this, typeCode);
                break;

            case EsfType.SINGLE_ARRAY:
                result = new EsfArrayNode <float>(this, typeCode);
                break;

            case EsfType.DOUBLE_ARRAY:
                result = new EsfArrayNode <double>(this, typeCode);
                break;

            case EsfType.COORD2D_ARRAY:
                result = new EsfArrayNode <Coordinates2D>(this, typeCode)
                {
                    Separator = "-"
                };
                break;

            case EsfType.COORD3D_ARRAY:
                result = new EsfArrayNode <Coordinates2D>(this, typeCode)
                {
                    Separator = "-"
                };
                break;

            case EsfType.UTF16_ARRAY:
                result = new EsfArrayNode <string>(this, EsfType.UTF16_ARRAY);
                break;

            case EsfType.ASCII_ARRAY:
                result = new EsfArrayNode <string>(this, EsfType.ASCII_ARRAY);
                break;

            case EsfType.ANGLE_ARRAY:
                result = new EsfArrayNode <ushort>(this, typeCode);
                break;

            default:
                throw new InvalidDataException(string.Format("Unknown array type code {0}", typeCode));
            }
            result.TypeCode = typeCode;
            return(result);
        }