Updated ToString method to handle vectors

pull/10/head
David Hall 2018-01-15 09:42:07 -07:00
parent e6910dc9a9
commit 9421c1195b
1 changed files with 3 additions and 1 deletions

View File

@ -1055,7 +1055,9 @@ namespace Vanara.PInvoke
public override string ToString()
{
string s = null;
if (PropVariantToStringAlloc(this, out SafeCoTaskMemString str).Succeeded)
if (IsVector && Value is IEnumerable ie)
s = string.Join(",", ie.Cast<object>().Select(o => o.ToString()).ToArray());
else if (PropVariantToStringAlloc(this, out var str).Succeeded)
s = str;
return $"{vt}={s ?? "null"}";
}