Opc.Ua.BinaryDecoder.ReadLocalizedText C# (CSharp) Method

ReadLocalizedText() public method

Reads an LocalizedText from the stream.
public ReadLocalizedText ( string fieldName ) : Opc.Ua.LocalizedText
fieldName string
return Opc.Ua.LocalizedText
        public LocalizedText ReadLocalizedText(string fieldName)
        {
            // read the encoding byte.
            byte encodingByte = m_reader.ReadByte();
                                    
            string text = null;
            string locale = null;

            // read the fields of the diagnostic info structure.
            if ((encodingByte & (byte)LocalizedTextEncodingBits.Locale) != 0)
            {
                locale = ReadString(null);
            }

            if ((encodingByte & (byte)LocalizedTextEncodingBits.Text) != 0)
            {
                text = ReadString(null);
            }

            return new LocalizedText(locale, text);
        }

Usage Example

コード例 #1
0
        /// <summary>
        /// Updates the specified context.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="decoder">The decoder.</param>
        /// <param name="attibutesToLoad">The attributes to load.</param>
        public override void Update(ISystemContext context, BinaryDecoder decoder, AttributesToSave attibutesToLoad)
        {
            base.Update(context, decoder, attibutesToLoad);

            if ((attibutesToLoad & AttributesToSave.InverseName) != 0)
            {
                m_inverseName = decoder.ReadLocalizedText(null);
            }

            if ((attibutesToLoad & AttributesToSave.Symmetric) != 0)
            {
                m_symmetric = decoder.ReadBoolean(null);
            }
        }