Opc.Ua.XmlEncoder.WriteInt32Array C# (CSharp) Method

WriteInt32Array() public method

Writes a int array to the stream.
public WriteInt32Array ( string fieldName, IList values ) : void
fieldName string
values IList
return void
        public void WriteInt32Array(string fieldName, IList<int> values)
        {            
            if (BeginField(fieldName, values == null, true))
            {
                // check the length.
                if (m_context.MaxArrayLength > 0 && m_context.MaxArrayLength < values.Count)
                {
                    throw new ServiceResultException(StatusCodes.BadEncodingLimitsExceeded);
                }

                PushNamespace(Namespaces.OpcUaXsd);

                if (values != null)
                {
                    for (int ii = 0; ii < values.Count; ii++)
                    {
                        WriteInt32("Int32", values[ii]);
                    }
                }

                PopNamespace();

                EndField(fieldName);
            }
        }