Exemple #1
0
        /// <summary>
        /// Sends a ChannelStatusChange message to a consumer.
        /// </summary>
        /// <param name="channelId">The channel identifier.</param>
        /// <param name="status">The channel status.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <ChannelStatusChange> ChannelStatusChange(long channelId, ChannelStatuses status)
        {
            var body = new ChannelStatusChange()
            {
                ChannelId = channelId,
                Status    = status
            };

            return(SendNotification(body));
        }
        /// <summary>
        /// Sends a ChannelStatusChange message to a consumer.
        /// </summary>
        /// <param name="channelId">The channel identifier.</param>
        /// <param name="status">The channel status.</param>
        /// <returns>The message identifier.</returns>
        public virtual long ChannelStatusChange(long channelId, ChannelStatuses status)
        {
            var header = CreateMessageHeader(Protocols.ChannelStreaming, MessageTypes.ChannelStreaming.ChannelStatusChange);

            var channelStatusChange = new ChannelStatusChange()
            {
                ChannelId = channelId,
                Status    = status
            };

            return(Session.SendMessage(header, channelStatusChange));
        }
 /// <summary>
 /// Handles the ChannelStatusChange message from a producer.
 /// </summary>
 /// <param name="header">The message header.</param>
 /// <param name="channelStatusChange">The ChannelStatusChange message.</param>
 protected virtual void HandleChannelStatusChange(IMessageHeader header, ChannelStatusChange channelStatusChange)
 {
     Notify(OnChannelStatusChange, header, channelStatusChange);
 }