コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="eventType"></param>
        /// <param name="eventHandler"></param>
        /// <returns></returns>
        public Task AddEventListenerAsync(FDC3EventType eventType, Action <FDC3Event> eventHandler)
        {
            var hasAny = FDC3Handlers.HasEventListener(this.ChannelId);

            FDC3Handlers.FDC3ChannelEventHandlers[this.ChannelId].Add(eventType, eventHandler);

            if (!hasAny)
            {
                return(connection.AddChannelEventListenerAsync(this.ChannelId, eventType));
            }
            else
            {
                return(new TaskCompletionSource <object>(null).Task);
            }
        }