SubscribeResults









How do I use Subscribe Results
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: ChatClient.cs Copy
735         private void HandleSubscribeEvent(EventData eventData)
736         {
737             var channelsInResponse = (string[])eventData.Parameters[ChatParameterCode.Channels];
738             var results = (bool[])eventData.Parameters[ChatParameterCode.SubscribeResults];
739
740             for (int i = 0; i < channelsInResponse.Length; i++)
741             {
742                 if (results[i])
743                 {
744                     string channelName = channelsInResponse[i];
745                     if (!this.PublicChannels.ContainsKey(channelName))
746                     {
747                         ChatChannel channel = new ChatChannel(channelName);
748                         this.PublicChannels.Add(channel.Name, channel);
749                     }
750                 }
751             }
752
753             this.listener.OnSubscribed(channelsInResponse, results);
754         }

SubscribeResults 127 lượt xem

Gõ tìm kiếm nhanh...