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

ReadDiagnosticInfoArray() public method

Reads an DiagnosticInfo array from the stream.
public ReadDiagnosticInfoArray ( string fieldName ) : DiagnosticInfoCollection
fieldName string
return DiagnosticInfoCollection
        public DiagnosticInfoCollection ReadDiagnosticInfoArray(string fieldName)
        {
            bool isNil = false;

            DiagnosticInfoCollection values = new DiagnosticInfoCollection();
                                    
            if (BeginField(fieldName, true, out isNil))
            {                                
                PushNamespace(Namespaces.OpcUaXsd);
                
                while (MoveToElement("DiagnosticInfo"))
                {
                    values.Add(ReadDiagnosticInfo("DiagnosticInfo"));
                }

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