Esempio n. 1
0
        public ChannelViewModel(ChannelSession channelSession)
        {
            this.channelSession = channelSession;
            Users = new ObservableCollection<UserInfoViewModel>();

            foreach (var userSession in channelSession.UserSessions)
            {
                var userVM = new UserInfoViewModel(userSession);
                Users.Add(userVM);
            }
        }
Esempio n. 2
0
 private void AddChannel(ChannelSession channel)
 {
     channelSessions.Add(channel);
 }
Esempio n. 3
0
 private void CreateChannelRequestHandler(NetworkClient client, Message message)
 {
     var channelToCreate = message.GetData<Channel>();
     var createdChannel = channelService.CreateChannel(channelToCreate.Name);
     var createdChannelSession = new ChannelSession(createdChannel);
     AddChannel(createdChannelSession);
     BroadcastAll(client, Message.Create(MessageType.CreateChannelResponse, createdChannelSession), true);
 }