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

			InitializeComponent();

			ParentRoom.ItemsSource = new[] { new ChatRoom {Name = "", Id = 0} }.Concat(client.GrantedRooms).ToList();
		}
Пример #2
0
		public RoomItem(ChatRoom room)
		{
			Room = room;
			Messages = new ThreadSafeObservableCollection<ChatMessage>(new ObservableCollectionEx<ChatMessage>());
			Users = new ThreadSafeObservableCollection<User>(new ObservableCollectionEx<User>());
		}
Пример #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,
			});
		}
Пример #4
0
		private void OnRoomCreated(ChatRoom room)
		{
			var item = new RoomItem(room);

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

			_chatRooms.Add(item);
		}
Пример #5
0
		private void OnRoomDeleted(ChatRoom room)
		{
			_chatRooms.RemoveWhere(r => r.Room == room);
		}
Пример #6
0
		private void OnRoomUpdated(ChatRoom room)
		{
		}
Пример #7
0
 void IChatServiceCallback.RoomUpdated(ChatRoom room)
 {
     _eventDispatcher.Add(() => RoomUpdated.SafeInvoke(room));
 }
Пример #8
0
 void IChatServiceCallback.RoomCreated(ChatRoom room)
 {
     _rooms.Add(room.Id, room);
     _eventDispatcher.Add(() => RoomCreated.SafeInvoke(room));
 }