示例#1
0
        private static Dictionary <NodeID, EnumDescription> ParseEnumDescriptions(Stream inputStream)
        {
            if (inputStream == null || !inputStream.CanRead)
            {
                return(null);
            }
            int?length = BaseType.ReadInt32(inputStream);

            if (!length.HasValue)
            {
                return(null);
            }
            if (length < 0)
            {
                return(null);
            }
            Dictionary <NodeID, EnumDescription> dictionary = new Dictionary <NodeID, EnumDescription>(length.Value);

            for (int i = 0; i < length; i++)
            {
                EnumDescription desc = EnumDescription.Decode(inputStream);
                dictionary[desc.DataTypeID] = desc;
            }
            return(dictionary);
        }