Opc.Ua.ClientBase.GetResult C# (CSharp) Method

GetResult() public static method

Converts a service response to a ServiceResult object.
public static GetResult ( Opc.Ua.StatusCode statusCode, int index, DiagnosticInfoCollection diagnosticInfos, ResponseHeader responseHeader ) : ServiceResult
statusCode Opc.Ua.StatusCode The status code.
index int The index.
diagnosticInfos DiagnosticInfoCollection The diagnostic information.
responseHeader ResponseHeader The response header.
return ServiceResult
        public static ServiceResult GetResult(
            StatusCode statusCode,
            int index,
            DiagnosticInfoCollection diagnosticInfos,
            ResponseHeader responseHeader)
        {
            if (diagnosticInfos != null && diagnosticInfos.Count > index)
            {
                return new ServiceResult(statusCode.Code, diagnosticInfos[index], responseHeader.StringTable);
            }

            return new ServiceResult(statusCode.Code);
        }