コード例 #1
0
ファイル: MarvelAPIClient.cs プロジェクト: alejacma/MarvelAPI
 /// <summary>
 /// Initializes a new instance of the MarvelAPIClient class
 /// </summary>
 /// <param name="configuration">The configuration of the Marvel API</param>
 public MarvelAPIClient(IMarvelAPIConfiguration configuration)
 {
     Characters = new CharactersAPI(configuration);
     Comics     = new ComicsAPI(configuration);
     Creators   = new CreatorsAPI(configuration);
     Events     = new EventsAPI(configuration);
     Series     = new SeriesAPI(configuration);
     Stories    = new StoriesAPI(configuration);
 }
コード例 #2
0
        /// <summary>
        /// Sets the callback that is called when a new tango
        /// event has been issued by the Tango Service.
        /// </summary>
        /// <param name="callback">Callback.</param>
        public static void SetCallback(TangoService_onEventAvailable callback)
        {
            int returnValue = EventsAPI.TangoService_connectOnTangoEvent(callback);

            if (returnValue != Common.ErrorType.TANGO_SUCCESS)
            {
                Debug.Log("TangoEvents.SetCallback() Callback was not set!");
            }
            else
            {
                Debug.Log("TangoEvents.SetCallback() Callback was set!");
            }
        }
コード例 #3
0
ファイル: TangoEvents.cs プロジェクト: mountsin/Coasterfy
        /// <summary>
        /// Sets the callback that is called when a new tango
        /// event has been issued by the Tango Service.
        /// </summary>
        /// <param name="callback">Callback.</param>
        public static void SetCallback(TangoService_onEventAvailable callback)
        {
            int returnValue = EventsAPI.TangoService_connectOnTangoEvent(callback);

            if (returnValue != Common.ErrorType.TANGO_SUCCESS)
            {
                DebugLogger.GetInstance.WriteToLog(DebugLogger.EDebugLevel.DEBUG_ERROR,
                                                   "TangoEvents.SetCallback() Callback was not set!");
            }
            else
            {
                DebugLogger.GetInstance.WriteToLog(DebugLogger.EDebugLevel.DEBUG_INFO,
                                                   "TangoEvents.SetCallback() Callback was set!");
            }
        }
コード例 #4
0
        /// <summary>
        /// Sends events to server.
        /// </summary>
        public void Send()
        {
            if ((ClientAPI.IsClientLoggedIn()) && (isSending == false))
            {
                isSending = true;

                EventsModels.WriteEventsRequest request = new EventsModels.WriteEventsRequest();
                request.Events = new List <EventsModels.EventContents>();

                while ((eventsRequests.Count > 0) && (request.Events.Count < maxBatchSizeInEvents))
                {
                    EventsModels.EventContents eventInfo = eventsRequests.Dequeue();
                    request.Events.Add(eventInfo);
                }

                if (request.Events.Count > 0)
                {
                    EventsAPI.WriteEvents(request.Events).FireForgetLog("Failed to send session data.");
                }

                isSending = false;
            }
        }