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

ReadExtensionObjectArray() public method

Reads an array of extension objects from the stream.
public ReadExtensionObjectArray ( string fieldName ) : ExtensionObjectCollection
fieldName string
return ExtensionObjectCollection
        public ExtensionObjectCollection ReadExtensionObjectArray(string fieldName)
        {
            bool isNil = false;

            ExtensionObjectCollection values = new ExtensionObjectCollection();
                                    
            if (BeginField(fieldName, true, out isNil))
            {                                
                PushNamespace(Namespaces.OpcUaXsd);
                
                while (MoveToElement("ExtensionObject"))
                {
                    values.Add(ReadExtensionObject("ExtensionObject"));
                }

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