コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ServiceResult"/> class.
        /// </summary>
        /// <param name="code">A code.</param>
        /// <param name="index">An index.</param>
        /// <param name="diagnosticInfos">A diagnostic info array.</param>
        /// <param name="stringTable">A string table.</param>
        public ServiceResult(StatusCode code, int index, DiagnosticInfo[] diagnosticInfos, IList<string> stringTable)
        {
            this.StatusCode = code;

            if (index >= 0 && diagnosticInfos != null && index < diagnosticInfos.Length)
            {
                DiagnosticInfo diagnosticInfo = diagnosticInfos[index];

                if (diagnosticInfo != null)
                {
                    this.SymbolicId = LookupString(stringTable, diagnosticInfo.SymbolicId);
                    this.NamespaceUri = LookupString(stringTable, diagnosticInfo.NamespaceUri);

                    string locale = LookupString(stringTable, diagnosticInfo.Locale);
                    string localizedText = LookupString(stringTable, diagnosticInfo.LocalizedText);
                    this.LocalizedText = new LocalizedText(locale, localizedText);

                    this.AdditionalInfo = diagnosticInfo.AdditionalInfo;

                    if (!StatusCode.IsGood(diagnosticInfo.InnerStatusCode))
                    {
                        this.InnerResult = new ServiceResult(diagnosticInfo.InnerStatusCode, diagnosticInfo.InnerDiagnosticInfo, stringTable);
                    }
                }
            }
        }
コード例 #2
0
        public virtual void Decode(IDecoder decoder) {
            decoder.PushNamespace("http://opcfoundation.org/UA/2008/02/Types.xsd");
			StatusCode = decoder.ReadStatusCode("StatusCode");
			DiagnosticInfo = decoder.ReadDiagnosticInfo("DiagnosticInfo");
            decoder.PopNamespace();
        }
コード例 #3
0
        public override void Decode(IDecoder decoder) {
			base.Decode(decoder);
            decoder.PushNamespace("http://opcfoundation.org/UA/2008/02/Types.xsd");
			Status = decoder.ReadStatusCode("Status");
			DiagnosticInfo = decoder.ReadDiagnosticInfo("DiagnosticInfo");
            decoder.PopNamespace();
        }