internal ApplianceContainer(MTA mta, IntPtr mtaHandle)
        {
            _mta       = mta;
            _mtaHandle = mtaHandle;

            _connectionNotifier      = NotifyConnect;
            _connectionStateNotifier = NotifyConnectionState;

            NativeMethods.mta_notify_connect(mtaHandle, _connectionNotifier);
            NativeMethods.mta_notify_connectionstate(mtaHandle, _connectionStateNotifier);
        }
示例#2
0
        internal MTA(SDK sdkHandleWrapper)
        {
            _disposed         = false;
            _sdkHandleWrapper = sdkHandleWrapper;
            _nativeHandle     = NativeMethods.mta_handle_alloc(sdkHandleWrapper.NativeHandle, IntPtr.Zero);

            if (_nativeHandle == IntPtr.Zero)
            {
                throw new MylapsException("failed to create a MTA instance");
            }

            _connectionNotifier      = NotifyConnect;
            _connectionStateNotifier = NotifyConnectionState;

            NativeMethods.mta_notify_connect(_nativeHandle, _connectionNotifier);
            NativeMethods.mta_notify_connectionstate(_nativeHandle, _connectionStateNotifier);

            SetupContainers();
        }