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

ReadBooleanArray() public method

Reads a boolean array from the stream.
public ReadBooleanArray ( string fieldName ) : BooleanCollection
fieldName string
return BooleanCollection
        public BooleanCollection ReadBooleanArray(string fieldName)
        {           
            bool isNil = false;

            BooleanCollection values = new BooleanCollection();
                                    
            if (BeginField(fieldName, true, out isNil))
            {
                PushNamespace(Namespaces.OpcUaXsd);      

                while (MoveToElement("Boolean"))
                {
                    values.Add(ReadBoolean("Boolean"));
                }

                // 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;
        }