Exemplo n.º 1
0
            /**
                 * Constructor for AuthListener class
                 */
            public AuthListener()
            {
                _requestCredentials = new InternalRequestCredentials(this._RequestCredentials);
                _verifyCredentials = new InternalVerifyCredentials(this._VerifyCredentials);
                _securityViolation = new InternalSecurityViolation(this._SecurityViolation);
                _authenticationComplete = new InternalAuthenticationComplete(this._AuthenticationComplete);

                AuthListenerCallbacks callbacks;
                callbacks.requestCredentials = Marshal.GetFunctionPointerForDelegate(_requestCredentials);
                callbacks.verifyCredentials = Marshal.GetFunctionPointerForDelegate(_verifyCredentials);
                callbacks.securityViolation = Marshal.GetFunctionPointerForDelegate(_securityViolation);
                callbacks.authenticationComplete = Marshal.GetFunctionPointerForDelegate(_authenticationComplete);

                main = GCHandle.Alloc(callbacks, GCHandleType.Pinned);
                _authListener = alljoyn_authlistener_create(main.AddrOfPinnedObject(), IntPtr.Zero);
            }
Exemplo n.º 2
0
            /**
             * Constructor for AuthListener class
             */
            public AuthListener()
            {
                _requestCredentials     = new InternalRequestCredentials(this._RequestCredentials);
                _verifyCredentials      = new InternalVerifyCredentials(this._VerifyCredentials);
                _securityViolation      = new InternalSecurityViolation(this._SecurityViolation);
                _authenticationComplete = new InternalAuthenticationComplete(this._AuthenticationComplete);

                AuthListenerCallbacks callbacks;

                callbacks.requestCredentials     = Marshal.GetFunctionPointerForDelegate(_requestCredentials);
                callbacks.verifyCredentials      = Marshal.GetFunctionPointerForDelegate(_verifyCredentials);
                callbacks.securityViolation      = Marshal.GetFunctionPointerForDelegate(_securityViolation);
                callbacks.authenticationComplete = Marshal.GetFunctionPointerForDelegate(_authenticationComplete);

                main          = GCHandle.Alloc(callbacks, GCHandleType.Pinned);
                _authListener = alljoyn_authlistener_create(main.AddrOfPinnedObject(), IntPtr.Zero);
            }