public static string GetValueAsString <TEnum>(this IAIMPPropertyList propertyList, TEnum propId) where TEnum : Enum { var value = propertyList.GetValueAsObject <IAIMPString>(propId); var result = value.GetData(); Marshal.FinalReleaseComObject(value); return(result); }
public static T GetValueAsObject <T>(this IAIMPPropertyList propertyList, Enum propId) { propertyList.GetValueAsObject(Convert.ToInt32(propId), typeof(T).GUID, out var value).EnsureSuccess(); return((T)value); }