Opc.Ua.JsonEncoder.WriteLocalizedTextArray C# (CSharp) Method

WriteLocalizedTextArray() public method

Writes an LocalizedText array to the stream.
public WriteLocalizedTextArray ( string fieldName, IList values ) : void
fieldName string
values IList
return void
        public void WriteLocalizedTextArray(string fieldName, IList<LocalizedText> values)
        {
            PushArray(fieldName);

            // check the length.
            if (m_context.MaxArrayLength > 0 && m_context.MaxArrayLength < values.Count)
            {
                throw new ServiceResultException(StatusCodes.BadEncodingLimitsExceeded);
            }

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

            PopArray();
        }