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

ReadGuidArray() public method

Reads a GUID array from the stream.
public ReadGuidArray ( string fieldName ) : UuidCollection
fieldName string
return UuidCollection
        public UuidCollection ReadGuidArray(string fieldName)
        {
            bool isNil = false;

            UuidCollection values = new UuidCollection();
                                    
            if (BeginField(fieldName, true, out isNil))
            {                                
                PushNamespace(Namespaces.OpcUaXsd);
                
                while (MoveToElement("Guid"))
                {
                    values.Add(ReadGuid("Guid"));
                }

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