Opc.Ua.Server.CustomNodeManager.FindPredefinedNode C# (CSharp) Method

FindPredefinedNode() public method

Finds the specified and checks if it is of the expected type.
public FindPredefinedNode ( NodeId nodeId, Type expectedType ) : NodeState
nodeId NodeId
expectedType System.Type
return NodeState
        public NodeState FindPredefinedNode(NodeId nodeId, Type expectedType)
        {
            if (nodeId == null)
            {
                return null;
            }

            NodeState node = null;

            if (!PredefinedNodes.TryGetValue(nodeId, out node))
            {
                return null;
            }

            if (expectedType != null)
            {
                if (!expectedType.IsInstanceOfType(node))
                {
                    return null;
                }
            }
                
            return node;
        }
        #endregion