Opc.Ua.Core
Implicit Type Conversion(NodeId,Guid) Operator
Example 



Opc.Ua Namespace > NodeId Class > Implicit Type Conversion Operator : Implicit Type Conversion(NodeId,Guid) Operator
The System.Guid to compare this node to.
Converts a guid to a guid node identifier.
Syntax
'Declaration
 
Overloads Public Operator Widening CType( _
   ByVal value As Guid _
) As NodeId
'Usage
 
public NodeId operator implicit( 
   Guid value
)
public:
operator NodeId^ ( 
   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

//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.LogInfo("\n\nComparing NodeId to GUID");
Utils.LogInfo("\tComparing {0} to {0} = [equals] {2}", id1, id1, node1.Equals(id1));
Utils.LogInfo("\tComparing {0} to {0} = [ ==   ] {2}", id1, id1, node1 == id1);
Utils.LogInfo("\tComparing {0} to {1} = [equals] {2}", id1, id2, node1.Equals(id2));
Utils.LogInfo("\tComparing {0} to {1} = [ ==   ] {2}", id1, id2, node1 == id2);
'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.LogInfo("Comparing NodeId to GUID")
Utils.LogInfo("  Comparing {0} to {0} = [equals] {2}", id1, id1, node1.Equals(id1));
Utils.LogInfo("  Comparing {0} to {0} = [  =   ] {2}", id1, id1, node1 = id1);
Utils.LogInfo("  Comparing {0} to {0} = [equals] {2}", id1, id2, node1.Equals(id2));
Utils.LogInfo("  Comparing {0} to {0} = [  =   ] {2}", id1, id2, node1 = id2);
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

NodeId Class
NodeId Members
Overload List