private void button2_Click(object sender, EventArgs e) { if (bw.IsBusy) { MessageBox.Show("Please wait for enumeration to complete.", "Please wait", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } else { if (treeView1.GetNodeCount(false) > 0) { if ((treeView1.SelectedNode != null) && (treeView1.SelectedNode.Level > 0)) { Target tmp = (Target)treeView1.SelectedNode.Tag; if ((tmp.actionDesc.Name == "Browse") || (tmp.actionDesc.Name == "SetVolume")) { WindowsMedia windowsMedia = new WindowsMedia(tmp, tmp.controlURL, tmp.actionDesc.Name); windowsMedia.Show(); } else { MessageBox.Show("Select either a 'Browse' or 'SetVolume' action for a media player target.", "Selected action was not 'Browse' or 'SetVolume'", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } else { MessageBox.Show("Select either a 'Browse' or 'SetVolume' action for a media player target.", "No target selected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } else { MessageBox.Show("Please enumerate a device before using this tool.", "No devices enumerated yet", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } }
private void button2_Click(object sender, EventArgs e) { if (bw.IsBusy) { MessageBox.Show("Please wait for enumeration to complete.", "Please wait", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } else { if (treeView1.GetNodeCount(false) > 0) { if ((treeView1.SelectedNode != null)&&(treeView1.SelectedNode.Level > 0)) { Target tmp = (Target)treeView1.SelectedNode.Tag; if ((tmp.actionDesc.Name == "Browse") || (tmp.actionDesc.Name == "SetVolume")) { WindowsMedia windowsMedia = new WindowsMedia(tmp, tmp.controlURL,tmp.actionDesc.Name); windowsMedia.Show(); } else { MessageBox.Show("Select either a 'Browse' or 'SetVolume' action for a media player target.", "Selected action was not 'Browse' or 'SetVolume'", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } else { MessageBox.Show("Select either a 'Browse' or 'SetVolume' action for a media player target.", "No target selected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } else { MessageBox.Show("Please enumerate a device before using this tool.", "No devices enumerated yet", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } }