EasyUA Reference
Implicit Type Conversion(NodeId,Guid) Operator
See Also  Example Send Feedback
Opc.Ua.Core.Net4 Assembly > Opc.Ua Namespace > NodeId Class > Implicit Type Conversion Operator : Implicit Type Conversion(NodeId,Guid) Operator
value
The System.Guid to compare this node to.

Glossary Item Box

Converts a guid to a guid node identifier.

Syntax

Visual Basic (Usage)Copy Code
C# 
public NodeId operator implicit( 
   Guid value
)

Parameters

value
The System.Guid to compare this node to.

Remarks

Converts a NodeId into a Guid allowing you to compare a Node against a Guid.

Example

This produces the following output (taken from C# example):

Comparing NodeId to GUID
Comparing bbe8b5f2-0f50-4302-877f-346afb07704c to bbe8b5f2-0f50-4302-877f-346afb07704c = [equals] True
Comparing bbe8b5f2-0f50-4302-877f-346afb07704c to bbe8b5f2-0f50-4302-877f-346afb07704c = [ = ] True
Comparing bbe8b5f2-0f50-4302-877f-346afb07704c to e707de86-4c11-4fe6-94b2-83638a9427e6 = [equals] False
Comparing bbe8b5f2-0f50-4302-877f-346afb07704c to e707de86-4c11-4fe6-94b2-83638a9427e6 = [ = ] False

C#Copy Code
//define our 2 GUID ids, and then define our node to use the first id.
Guid id1 = Guid.NewGuid(), id2 = Guid.NewGuid();
NodeId node1 = new NodeId(id1);
            
//now to compare the node to the guids
Utils.Trace("\n\nComparing NodeId to GUID");
Utils.Trace("\tComparing {0} to {0} = [equals] {2}", id1, id1, node1.Equals(id1));
Utils.Trace("\tComparing {0} to {0} = [ ==   ] {2}", id1, id1, node1 == id1);
Utils.Trace("\tComparing {0} to {1} = [equals] {2}", id1, id2, node1.Equals(id2));
Utils.Trace("\tComparing {0} to {1} = [ ==   ] {2}", id1, id2, node1 == id2);
Visual BasicCopy Code
'define our 2 GUID ids, and then define our node to use the first id.
Dim id1 As Guid = Guid.NewGuid()
Dim id2 As Guid = Guid.NewGuid()
Dim node1 As NodeId = new NodeId(id1)
            
'now to compare the node to the guids
Utils.Trace("Comparing NodeId to GUID")
Utils.Trace( String.Format( "  Comparing {0} to {0} = [equals] {2}", id1, id1, node1.Equals(id1)) );
Utils.Trace( String.Format( "  Comparing {0} to {0} = [  =   ] {2}", id1, id1, node1 = id1) );
Utils.Trace( String.Format( "  Comparing {0} to {0} = [equals] {2}", id1, id2, node1.Equals(id2)) );
Utils.Trace( String.Format( "  Comparing {0} to {0} = [  =   ] {2}", id1, id2, node1 = id2) );

Requirements

Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2015, .NET4.x

See Also

Copyright © 2018 Advosol Inc. All Rights Reserved.