Exemplo n.º 1
0
 public bool UnsubscribeFromEventData(MTAEVENTDATA eventData)
 {
     return(NativeMethods.mta_eventdata_unsubscribe(_nativeHandle, eventData));
 }
Exemplo n.º 2
0
        public bool SubscribeToEventData(MTAEVENTDATA eventData, uint requestLimit, bool cache)
        {
            switch (eventData)
            {
            case MTAEVENTDATA.mtaManualEvent:
                _manualEventContainer.Cache = cache;
                break;

            case MTAEVENTDATA.mtaPassing:
                _passingContainer.Cache = cache;
                break;

            case MTAEVENTDATA.mtaPassingTrigger:
                _passingTriggerContainer.Cache = cache;
                break;

            case MTAEVENTDATA.mtaTwoWayMessage:
                _twoWayMessageContainer.Cache = cache;
                break;

            case MTAEVENTDATA.mtaBeaconDownloadStatus:
                _beaconDownloadStatusContainer.Cache = cache;
                break;

            case MTAEVENTDATA.mtaBeaconDownloadTrigger:
                _beaconDownloadTriggerContainer.Cache = cache;
                break;

            case MTAEVENTDATA.mtaDriverInfo:
                _driverInfoContainer.Cache = cache;
                break;

            case MTAEVENTDATA.mtaBeaconLog:
                /* stored in the same container and are always cached */
                break;

            case MTAEVENTDATA.mtaAuxEvent:
                /* allways cache */
                _auxEventContainer.Cache = true;
                break;

            case MTAEVENTDATA.mtaAuxStatus:
                /* never stored. */
                break;

            case MTAEVENTDATA.mtaDecoderStatus:
                /* never stored. */
                break;

            case MTAEVENTDATA.mtaPassingFirstContact:
                /* never stored. */
                break;

            case MTAEVENTDATA.mtaTransponderStatus:
                /* never stored. */
                break;

            default:
                /* other events never cached */
                break;
            }
            return(NativeMethods.mta_eventdata_subscribe(_nativeHandle, eventData, requestLimit, false /* don't cache data in lib, let wrapper handle it */));
        }