コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }