예제 #1
0
            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);
            }
예제 #2
0
            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);
            }