public ChatRoomCreateWindow(ChatClient client)
		{
			DataContext = ChatRoom = new ChatRoom();

			InitializeComponent();

			ParentRoom.ItemsSource = new[] { new ChatRoom {Name = "", Id = 0} }.Concat(client.GrantedRooms).ToList();
		}
Exemplo n.º 2
0
		public RoomItem(ChatRoom room)
		{
			Room = room;
			Messages = new ThreadSafeObservableCollection<ChatMessage>(new ObservableCollectionEx<ChatMessage>());
			Users = new ThreadSafeObservableCollection<User>(new ObservableCollectionEx<User>());
		}
Exemplo n.º 3
0
		private void OnAuthorAdded(User author, ChatRoom room, User by)
		{
			var chatRoom = _chatRooms.First(r => r.Room == room);

			chatRoom
				.Users
				.Add(author);

			chatRoom.Messages.Add(new ChatMessage
			{
				Body = LocalizedStrings.Str3209Params.Put(author.Name),
				CreationDate = TimeHelper.Now,
			});
		}
Exemplo n.º 4
0
		private void OnRoomCreated(ChatRoom room)
		{
			var item = new RoomItem(room);

			item.Users.AddRange(Client.GetAuthors(room));

			_chatRooms.Add(item);
		}
Exemplo n.º 5
0
		private void OnRoomDeleted(ChatRoom room)
		{
			_chatRooms.RemoveWhere(r => r.Room == room);
		}
Exemplo n.º 6
0
		private void OnRoomUpdated(ChatRoom room)
		{
		}
Exemplo n.º 7
0
 void IChatServiceCallback.RoomUpdated(ChatRoom room)
 {
     _eventDispatcher.Add(() => RoomUpdated.SafeInvoke(room));
 }
Exemplo n.º 8
0
 void IChatServiceCallback.RoomCreated(ChatRoom room)
 {
     _rooms.Add(room.Id, room);
     _eventDispatcher.Add(() => RoomCreated.SafeInvoke(room));
 }