Opc.Ua.Server.CoreNodeManager.CheckSourceHandle C# (CSharp) Method

CheckSourceHandle() private static method

Checks if the operation needs to be handled by an external source.
private static CheckSourceHandle ( ILocalNode node, Type sourceType, int index, IDictionary sources ) : bool
node ILocalNode
sourceType System.Type
index int
sources IDictionary
return bool
        private static bool CheckSourceHandle(ILocalNode node, Type sourceType, int index, IDictionary sources)
        {            
            // check if a source is defined for the node.
            SourceHandle handle = node.Handle as SourceHandle;

            if (handle == null)
            {
                return false;
            }

            // check if the source type is valid.
            if (!sourceType.IsInstanceOfType(handle.Source))
            {
                return false;
            }

            // find list of handles for the source.
            List<RequestHandle> handles = null;

            if (!sources.Contains(handle.Source))
            {
                sources[handle.Source] = handles = new List<RequestHandle>();
            }
            else
            {
                handles = (List<RequestHandle>)sources[handle.Source];
            }

            // add node to list of values to process by the source.
            handles.Add(new RequestHandle(handle.Handle, index));

            return true;
        }