private void ProcessTransferEvent(StreamTransferItem item) { var key = new TransferKey(item.Client, item.EventArgs.StreamId); ListViewItem listViewItem; if (!_transferItems.TryGetValue(key, out listViewItem)) { Debug.Fail("Expected a transfer"); return; } UpdateListViewItem(listViewItem, item.EventArgs); }
private void ProcessStartEvent(StreamTransferItem item) { var key = new TransferKey(item.Client, item.EventArgs.StreamId); if (_transferItems.ContainsKey(key)) { Debug.Fail("Did not expect the item to already exist"); return; } var listViewItem = new ListViewItem { Text = item.EventArgs.StreamId.ToString(), SubItems = { item.EventArgs.StreamName, "", "" } }; UpdateListViewItem(listViewItem, item.EventArgs); _transferItems.Add(key, listViewItem); _listView.Items.Add(listViewItem); }