/// <summary> /// Get the display name of the specified display name type. /// </summary> /// <param name="displayNameType">Display name type.</param> /// <returns>Display name.</returns> /// <exception cref="ShellException">Failed to acquire display name.</exception> public string GetDisplayName(DisplayNameTypes displayNameType) { Contract.Ensures(Contract.Result <string>() != null); string result; var hr = this.ShellItemInterface.GetDisplayName((SIGDN)displayNameType, out result); if (HRESULT.Failed(hr)) { throw new ShellException(ErrorMessages.ShellItemCannotGetDisplayName, hr); } return(result); }
/// <summary> /// Get the display name of the specified <paramref name="displayNameType" />. /// </summary> /// <param name="displayNameType">Display name type.</param> /// <returns>Display name.</returns> public virtual string GetDisplayName(DisplayNameTypes displayNameType) { Contract.Ensures(Contract.Result <string>() != null); return(this.ShellItem.GetDisplayName(displayNameType)); }