Changed IPropertyStore.SetValue extension so value is coerced to correct type before setting.

master
David Hall 2024-06-06 11:09:33 -06:00
parent 33924ea0ff
commit c201274dba
1 changed files with 1 additions and 0 deletions

View File

@ -2181,6 +2181,7 @@ public static class PSExtensions
public static void SetValue(this PropSys.IPropertyStore ps, in PROPERTYKEY pkey, object? value, bool commit = true)
{
using var pv = new PROPVARIANT(value);
pkey.CoerceToCanonicalValue(pv);
ps.SetValue(pkey, pv);
if (commit) ps.Commit();
}