Пример #1
0
            /**
             * Constructor for a KeyStoreListener object.
             */
            public KeyStoreListener()
            {
                _loadRequest = new InternalLoadRequest(this._LoadRequest);
                _storeRequest = new InternalStoreRequest(this._StoreRequest);

                KeyStoreListenerCallbacks callbacks;
                callbacks.loadRequest = Marshal.GetFunctionPointerForDelegate(_loadRequest);
                callbacks.storeRequest = Marshal.GetFunctionPointerForDelegate(_storeRequest);

                GCHandle gch = GCHandle.Alloc(callbacks, GCHandleType.Pinned);
                _keyStoreListener = alljoyn_keystorelistener_create(gch.AddrOfPinnedObject(), IntPtr.Zero);
                gch.Free();
            }
Пример #2
0
            public KeyStoreListener()
            {
                _loadRequest  = new InternalLoadRequest(this._LoadRequest);
                _storeRequest = new InternalStoreRequest(this._StoreRequest);

                KeyStoreListenerCallbacks callbacks;

                callbacks.loadRequest  = Marshal.GetFunctionPointerForDelegate(_loadRequest);
                callbacks.storeRequest = Marshal.GetFunctionPointerForDelegate(_storeRequest);

                GCHandle gch = GCHandle.Alloc(callbacks, GCHandleType.Pinned);

                _keyStoreListener = alljoyn_keystorelistener_create(gch.AddrOfPinnedObject(), IntPtr.Zero);
                gch.Free();
            }