private static Type GetRecordElementType(IRecordInfo record) { Guid guid; HRESULT hr = record.GetGuid(&guid); hr.ThrowIfFailed(); Type?t = System.Type.GetTypeFromCLSID(guid); if (t is null || !t.IsValueType) { throw new ArgumentException("The specified record cannot be mapped to a managed value class."); } return(t); }
private static Type GetRecordElementType(IRecordInfo record) { Guid guid; HRESULT hr = record.GetGuid(&guid); if (!hr.Succeeded()) { throw Marshal.GetExceptionForHR((int)hr) !; } Type?t = System.Type.GetTypeFromCLSID(guid); if (t is null || !t.IsValueType) { throw new ArgumentException("The specified record cannot be mapped to a managed value class."); } return(t); }