private void addSharedMenuItem_Click(object sender, System.EventArgs e) { DeviceSelector deviceselector = new DeviceSelector(); if (deviceselector.ShowDialog() == DialogResult.OK) { if (devicelist.Contains(deviceselector.SelectedDevice) == true) { MessageBox.Show(deviceselector.SelectedDevice.FriendlyName + " Already Shared", "Relay for UPnP Technologies"); return; } ListViewItem lv = new ListViewItem(new string[] { deviceselector.SelectedDevice.FriendlyName, "0", "0" }, 1); lv.Tag = deviceselector.SelectedDevice; OutboundListViewTable[deviceselector.SelectedDevice] = lv; //deviceselector.SelectedDevice.OnRemoved += new UPnPDevice.OnRemovedHandler(RemovedSink); lock (outboundListView) { outboundListView.Items.Add(lv); } devicelist.Add(deviceselector.SelectedDevice); gk.AddDevice(deviceselector.SelectedDevice); } deviceselector.Dispose(); }
private void addSharedMenuItem_Click(object sender, System.EventArgs e) { DeviceSelector deviceselector = new DeviceSelector(); if (deviceselector.ShowDialog() == DialogResult.OK) { if (devicelist.Contains(deviceselector.SelectedDevice) == true) { MessageBox.Show(deviceselector.SelectedDevice.FriendlyName + " Already Shared","Relay for UPnP Technologies"); return; } ListViewItem lv = new ListViewItem(new string[] {deviceselector.SelectedDevice.FriendlyName,"0","0"},1); lv.Tag = deviceselector.SelectedDevice; OutboundListViewTable[deviceselector.SelectedDevice] = lv; //deviceselector.SelectedDevice.OnRemoved += new UPnPDevice.OnRemovedHandler(RemovedSink); lock(outboundListView) { outboundListView.Items.Add(lv); } devicelist.Add(deviceselector.SelectedDevice); gk.AddDevice(deviceselector.SelectedDevice); } deviceselector.Dispose(); }