Opc.Ua.ServerTest.TranslatePathTest.Translate C# (CSharp) Method

Translate() private method

Reads the attributes, verifies the results and updates the nodes.
private Translate ( BrowsePathCollection pathsToTranslate ) : bool
pathsToTranslate BrowsePathCollection
return bool
        private bool Translate(BrowsePathCollection pathsToTranslate)
        {
            bool success = true;

            BrowsePathResultCollection results;
            DiagnosticInfoCollection diagnosticInfos;
            
            RequestHeader requestHeader = new RequestHeader();
            requestHeader.ReturnDiagnostics = 0;

            Session.TranslateBrowsePathsToNodeIds(
                requestHeader,
                pathsToTranslate,
                out results,
                out diagnosticInfos);
            
            ClientBase.ValidateResponse(results, pathsToTranslate);
            ClientBase.ValidateDiagnosticInfos(diagnosticInfos, pathsToTranslate);
            
            // check diagnostics.
            if (diagnosticInfos != null && diagnosticInfos.Count > 0)
            {
                Log("Returned non-empty DiagnosticInfos array during Read.");
                return false;
            }
            
            // check results.
            for (int ii = 0; ii < pathsToTranslate.Count; ii++)
            {
                BrowsePath request = pathsToTranslate[ii];
                Node node = (Node)request.Handle;

                if (!VerifyPaths(node, request, results[ii]))
                {
                    success = false;
                    continue;
                }
            }

            return success;
        }