From b04ddce70143a1ced2c3ca6ed1d570bda3042a5b Mon Sep 17 00:00:00 2001 From: dahall Date: Thu, 3 Dec 2020 19:30:26 -0700 Subject: [PATCH] Added `PropertyDescriptionList.GetValuesForShellItem` method to retrieve list of properties from a shell item. Useful for tooltips and like items retrieved from `ShellAssociation`. --- Windows.Shell/ShellProperties/PropertyDescription.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Windows.Shell/ShellProperties/PropertyDescription.cs b/Windows.Shell/ShellProperties/PropertyDescription.cs index 0d827387..91678adb 100644 --- a/Windows.Shell/ShellProperties/PropertyDescription.cs +++ b/Windows.Shell/ShellProperties/PropertyDescription.cs @@ -243,6 +243,11 @@ namespace Vanara.Windows.Shell /// public IEnumerator GetEnumerator() => Enum().GetEnumerator(); + /// Gets the values for each property defined by this list for a specified shell item. + /// The shell item used to retrieve property values. + /// A list of property values. + public object[] GetValuesForShellItem(ShellItem shellItem) => Enum().Select(pd => shellItem.Properties[pd.PropertyKey]).ToArray(); + /// public override string ToString() => "prop:" + string.Join(";", this.Select(d => $"{GetPrefixForViewFlags(d.ViewFlags)}{d.CanonicalName}").ToArray());