Opc.Ua.XmlDecoder.ReadDoubleArray C# (CSharp) Method

ReadDoubleArray() public method

Reads a double array from the stream.
public ReadDoubleArray ( string fieldName ) : DoubleCollection
fieldName string
return DoubleCollection
        public DoubleCollection ReadDoubleArray(string fieldName)
        {
            bool isNil = false;

            DoubleCollection values = new DoubleCollection();
                                    
            if (BeginField(fieldName, true, out isNil))
            {                                
                PushNamespace(Namespaces.OpcUaXsd);
                
                while (MoveToElement("Double"))
                {
                    values.Add(ReadDouble("Double"));
                }

                // check the length.
                if (m_context.MaxArrayLength > 0 && m_context.MaxArrayLength < values.Count)
                {
                    throw new ServiceResultException(StatusCodes.BadEncodingLimitsExceeded);
                }

                PopNamespace();

                EndField(fieldName);
                return values;
            }

            if (isNil)
            {
                return null;
            }

            return values;
        }