/// <summary> /// Returns a string representation of the HierarchyReference. /// </summary> /// <param name="format">The <see cref="T:System.String"/> specifying the format to use. /// -or- /// null to use the default format defined for the type of the <see cref="T:System.IFormattable"/> implementation.</param> /// <param name="formatProvider">The <see cref="T:System.IFormatProvider"/> to use to format the value. /// -or- /// null to obtain the numeric format information from the current locale setting of the operating system.</param> /// <returns> /// A <see cref="T:System.String"/> containing the value of the current instance in the specified format. /// </returns> public string ToString(string format, IFormatProvider formatProvider) { if (format != null) { throw new FormatException(Utils.Format("Invalid format string: '{0}'.", format)); } string referenceType = Utils.Format("{0}", m_referenceTypeId); if (m_referenceTypeId != null && m_referenceTypeId.IdType == IdType.Numeric && m_referenceTypeId.NamespaceIndex == 0) { referenceType = ReferenceTypes.GetBrowseName((uint)m_referenceTypeId.Identifier); } string targetBrowsePath = m_targetBrowsePath; if (targetBrowsePath == null) { targetBrowsePath = Utils.Format("{0}", m_targetDeclarationId); } return(Utils.Format("{0}<{1}>{2})", m_sourceBrowsePath, referenceType, targetBrowsePath)); }