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

ReadUInt32() public method

Reads a uint from the stream.
public ReadUInt32 ( string fieldName ) : uint
fieldName string
return uint
        public uint ReadUInt32(string fieldName)
        {
            if (BeginField(fieldName, true))
            {
                string xml = ReadString();
                
                if (!String.IsNullOrEmpty(xml))
                {
                    uint value = XmlConvert.ToUInt32(xml);
                    EndField(fieldName);
                    return value;
                }
            }

            return 0;
        }
        

Usage Example

コード例 #1
0
        /// <summary>
        /// Updates the attributes from the stream.
        /// </summary>
        /// <param name="context">The context for the system being accessed.</param>
        /// <param name="decoder">The decoder wrapping the stream to read.</param>
        public override void Update(ISystemContext context, XmlDecoder decoder)
        {
            base.Update(context, decoder);

            decoder.PushNamespace(Namespaces.OpcUaXsd);

            if (decoder.Peek("ReferenceTypeId"))
            {
                ReferenceTypeId = decoder.ReadNodeId("ReferenceTypeId");
            }

            if (decoder.Peek("TypeDefinitionId"))
            {
               TypeDefinitionId = decoder.ReadNodeId("TypeDefinitionId");
            }

            if (decoder.Peek("ModellingRuleId"))
            {
                ModellingRuleId = decoder.ReadNodeId("ModellingRuleId");
            }

            if (decoder.Peek("NumericId"))
            {
                NumericId = decoder.ReadUInt32("NumericId");
            }

            decoder.PopNamespace();
        }