public ResourcePayload GetResource(ulong index) { var ptr = OCPayloadInterop.OCDiscoveryPayloadGetResource(Handle, (UIntPtr)index); var resource = Marshal.PtrToStructure(ptr, typeof(OCResourcePayload)) as OCResourcePayload; return(new ResourcePayload(resource)); }
private static ResourcePayload GetResource(IntPtr handle, ulong index) { var ptr = OCPayloadInterop.OCDiscoveryPayloadGetResource(handle, (UIntPtr)index); if (ptr == IntPtr.Zero) { return(null); } return(new ResourcePayload(ptr)); }