本文整理匯總了C#中Opc.Ua.NodeId.SetNamespaceIndex方法的典型用法代碼示例。如果您正苦於以下問題:C# NodeId.SetNamespaceIndex方法的具體用法?C# NodeId.SetNamespaceIndex怎麽用?C# NodeId.SetNamespaceIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Opc.Ua.NodeId
的用法示例。
在下文中一共展示了NodeId.SetNamespaceIndex方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ReadNodeId
/// <summary>
/// Reads an NodeId from the stream.
/// </summary>
public NodeId ReadNodeId(string fieldName)
{
byte encodingByte = m_reader.ReadByte();
NodeId value = new NodeId();
ReadNodeIdBody(encodingByte, value);
if (m_namespaceMappings != null && m_namespaceMappings.Length > value.NamespaceIndex)
{
value.SetNamespaceIndex(m_namespaceMappings[value.NamespaceIndex]);
}
return value;
}
示例2: ReadNodeId
/// <summary>
/// Reads an NodeId from the stream.
/// </summary>
public NodeId ReadNodeId(string fieldName)
{
NodeId value = new NodeId();
if (BeginField(fieldName, true))
{
PushNamespace(Namespaces.OpcUaXsd);
value.IdentifierText = ReadString("Identifier");
PopNamespace();
EndField(fieldName);
}
if (m_namespaceMappings != null && m_namespaceMappings.Length > value.NamespaceIndex)
{
value.SetNamespaceIndex(m_namespaceMappings[value.NamespaceIndex]);
}
return value;
}
示例3: ReadNodeIdBody
/// <summary>
/// Reads the body of a node id.
/// </summary>
private void ReadNodeIdBody(byte encodingByte, NodeId value)
{
switch ((NodeIdEncodingBits)(encodingByte & 0x3F))
{
case NodeIdEncodingBits.TwoByte:
{
value.SetNamespaceIndex(0);
value.SetIdentifier(IdType.Numeric, (uint)m_reader.ReadByte());
break;
}
case NodeIdEncodingBits.FourByte:
{
value.SetNamespaceIndex(m_reader.ReadByte());
value.SetIdentifier(IdType.Numeric, (uint)m_reader.ReadUInt16());
break;
}
case NodeIdEncodingBits.Numeric:
{
value.SetNamespaceIndex(m_reader.ReadUInt16());
value.SetIdentifier(IdType.Numeric, (uint)m_reader.ReadUInt32());
break;
}
case NodeIdEncodingBits.String:
{
value.SetNamespaceIndex(m_reader.ReadUInt16());
value.SetIdentifier(IdType.String, ReadString(null));
break;
}
case NodeIdEncodingBits.Guid:
{
value.SetNamespaceIndex(m_reader.ReadUInt16());
value.SetIdentifier(IdType.Guid, (Guid)ReadGuid(null));
break;
}
case NodeIdEncodingBits.ByteString:
{
value.SetNamespaceIndex(m_reader.ReadUInt16());
value.SetIdentifier(IdType.Opaque, ReadByteString(null));
break;
}
default:
{
throw new ServiceResultException(
StatusCodes.BadDecodingError,
Utils.Format("Invald encoding byte (0x{0:X2}) for NodeId.", encodingByte));
}
}
}