Added `PropertyDescriptionList.GetValuesForShellItem` method to retrieve list of properties from a shell item. Useful for tooltips and like items retrieved from `ShellAssociation`.

pull/187/head
dahall 2020-12-03 19:30:26 -07:00
parent af7996b401
commit b04ddce701
1 changed files with 5 additions and 0 deletions

View File

@ -243,6 +243,11 @@ namespace Vanara.Windows.Shell
/// <inheritdoc />
public IEnumerator<PropertyDescription> GetEnumerator() => Enum().GetEnumerator();
/// <summary>Gets the values for each property defined by this list for a specified shell item.</summary>
/// <param name="shellItem">The shell item used to retrieve property values.</param>
/// <returns>A list of property values.</returns>
public object[] GetValuesForShellItem(ShellItem shellItem) => Enum().Select(pd => shellItem.Properties[pd.PropertyKey]).ToArray();
/// <inheritdoc />
public override string ToString() => "prop:" + string.Join(";", this.Select(d => $"{GetPrefixForViewFlags(d.ViewFlags)}{d.CanonicalName}").ToArray());