コード例 #1
0
        public IChannelSession GetChannelSession(ChannelId channelId)
        {
            if (ChannelId.IsNullOrEmpty(channelId))
            {
                throw new ArgumentNullException(nameof(channelId));
            }
            AssertLoggedIn();
            if (_channelSessions.ContainsKey(channelId))
            {
                return(_channelSessions[channelId]);
            }
            var c = new ChannelSession(this, channelId, _groupHandle);

            _channelSessions[channelId] = c;
            return(c);
        }
コード例 #2
0
ファイル: ChannelSession.cs プロジェクト: pyr53540/vivox
 public ChannelSession(LoginSession loginSession, ChannelId channelId, string groupId)
 {
     if (loginSession == null)
     {
         throw new ArgumentNullException(nameof(loginSession));
     }
     if (ChannelId.IsNullOrEmpty(channelId))
     {
         throw new ArgumentNullException(nameof(channelId));
     }
     _loginSession  = loginSession;
     Key            = channelId;
     GroupId        = groupId;
     _sessionHandle = $"{loginSession.AccountHandle}_{channelId}";
     VxClient.Instance.EventMessageReceived += InstanceOnEventMessageReceived;
     _loginSession.PropertyChanged          += (sender, args) =>
     {
         if (args.PropertyName == nameof(_loginSession.TransmittingChannel))
         {
             PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsTransmitting)));
         }
     };
 }