Opc.Ua.ServiceResult.ToLongString C# (CSharp) Method

ToLongString() public method

Returns a formatted string with the contents of exeception.
public ToLongString ( ) : string
return string
		public string ToLongString()
		{
			StringBuilder buffer = new StringBuilder();

			buffer.Append("Id: ");
            buffer.Append(StatusCodes.GetBrowseName(m_code));
            
            if (!String.IsNullOrEmpty(m_symbolicId))
            {
			    buffer.Append("\r\n");
			    buffer.Append("SymbolicId: ");
			    buffer.Append(m_symbolicId);
            }                

            if (!LocalizedText.IsNullOrEmpty(m_localizedText))
            {
			    buffer.Append("\r\n");
			    buffer.Append("Description: ");
			    buffer.Append(m_localizedText);
            }

			if (AdditionalInfo != null && AdditionalInfo.Length > 0)
			{
				buffer.Append("\r\n");
				buffer.Append(AdditionalInfo);
			}

            ServiceResult innerResult = m_innerResult;

            if (innerResult != null)
            {
			    buffer.Append("\r\n===\r\n");
			    buffer.Append(innerResult.ToLongString());
            }

			return buffer.ToString();
		}
		#endregion

Usage Example

コード例 #1
0
        /// <summary>
        /// Returns a formatted string with the contents of exception.
        /// </summary>
        public string ToLongString()
        {
            StringBuilder buffer = new StringBuilder();

            buffer.Append("Id: ");
            buffer.Append(StatusCodes.GetBrowseName(m_code));

            if (!String.IsNullOrEmpty(m_symbolicId))
            {
                buffer.AppendLine();
                buffer.Append("SymbolicId: ");
                buffer.Append(m_symbolicId);
            }

            if (!LocalizedText.IsNullOrEmpty(m_localizedText))
            {
                buffer.AppendLine();
                buffer.Append("Description: ");
                buffer.Append(m_localizedText);
            }

            if (AdditionalInfo != null && AdditionalInfo.Length > 0)
            {
                buffer.AppendLine();
                buffer.Append(AdditionalInfo);
            }

            ServiceResult innerResult = m_innerResult;

            if (innerResult != null)
            {
                buffer.AppendLine();
                buffer.Append("===");
                buffer.AppendLine();
                buffer.Append(innerResult.ToLongString());
            }

            return(buffer.ToString());
        }