Пример #1
0
        public void Subscribe(EventCallback callback)
        {
            NativeImports.TIO_DATA start = new NativeImports.TIO_DATA();// = NativeImports.TioDataConverter.FromObject(null);

            NativeImports.tio_container_subscribe(
                _nativeContainerHandle,
                ref start,
                delegate(int result,
                         IntPtr cookie,
                         IntPtr handle,
                         uint eventCode,
                         ref NativeImports.TIO_DATA key,
                         ref NativeImports.TIO_DATA value,
                         ref NativeImports.TIO_DATA metadata)
            {
                EventCode convertedEventCode = (EventCode)eventCode;

                callback(
                    convertedEventCode,
                    NativeImports.TioDataConverter.ToObject(key),
                    NativeImports.TioDataConverter.ToObject(value),
                    NativeImports.TioDataConverter.ToObject(metadata));
            },
                IntPtr.Zero);
        }
Пример #2
0
        public void Subscribe(EventCallback callback)
        {
            NativeImports.TIO_DATA start = new NativeImports.TIO_DATA();// = NativeImports.TioDataConverter.FromObject(null);

            NativeImports.tio_container_subscribe(
                _nativeContainerHandle,
               ref start,
                delegate(int result,
                    IntPtr cookie,
                    IntPtr handle,
                    uint eventCode,
                    ref NativeImports.TIO_DATA key,
                    ref NativeImports.TIO_DATA value,
                    ref NativeImports.TIO_DATA metadata)
                    {
                        EventCode convertedEventCode = (EventCode)eventCode;

                        callback(
                            convertedEventCode,
                            NativeImports.TioDataConverter.ToObject(key),
                            NativeImports.TioDataConverter.ToObject(value),
                            NativeImports.TioDataConverter.ToObject(metadata));
                    },
                IntPtr.Zero);
        }