private void removeToolStripMenuItem_Click(object sender, EventArgs e) { if (((ListBox)ctxStrip.SourceControl).SelectedItem != null) { tc.testSteps.Remove("" + FormatName.GetListBoxItem(ctxStrip.SourceControl)); ((ListBox)ctxStrip.SourceControl).Items.Remove(((ListBox)ctxStrip.SourceControl).SelectedItem); isDirty = true; } }
private void lstTestSteps_Click(object sender, EventArgs e) { if (((ListBox)sender).SelectedItem != null) { LblDesc.Text = td.steps["" + FormatName.GetListBoxItem(sender)].Desc; txtSample.Text = XmlFormatter.MakeReadable(td.steps["" + FormatName.GetListBoxItem(sender)].Sample); toolTip1.SetToolTip((Control)sender, LblDesc.Text); toolTip1.SetToolTip(LblDesc, LblDesc.Text); } }
private void moveUpToolStripMenuItem_Click(object sender, EventArgs e) { FormatName strItemName = (FormatName)((ListBox)ctxStrip.SourceControl).SelectedItem; if (strItemName != null) { int index = ((ListBox)ctxStrip.SourceControl).Items.IndexOf(strItemName); if (index > 0) { ((ListBox)ctxStrip.SourceControl).Items.Remove(strItemName); ((ListBox)ctxStrip.SourceControl).Items.Insert(index - 1, strItemName); ((ListBox)ctxStrip.SourceControl).SelectedItem = strItemName; isDirty = true; } } }
private void lstTestCase_Click(object sender, EventArgs e) { stepAttributeBindingSource.CurrentItemChanged -= new EventHandler(stepAttributeBindingSource_CurrentChanged); stepAttributeBindingSource.Clear(); if (((ListBox)sender).SelectedItem != null) { Dictionary <string, StepAttribute> .Enumerator enumerator = tc.testSteps[FormatName.GetListBoxItem(sender)].StepAttributes.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current.Key == "ValidationStep" || enumerator.Current.Key == "ContextLoaderStep") { continue; } stepAttributeBindingSource.Add(enumerator.Current.Value); } LblDesc.Text = tc.testSteps["" + FormatName.GetListBoxItem(sender)].Desc; txtSample.Text = XmlFormatter.MakeReadable(tc.testSteps["" + FormatName.GetListBoxItem(sender)].Sample); toolTip1.SetToolTip((Control)sender, LblDesc.Text); toolTip1.SetToolTip(LblDesc, LblDesc.Text); } stepAttributeBindingSource.CurrentItemChanged += new EventHandler(stepAttributeBindingSource_CurrentChanged); }
private void lstTestSteps_MouseDown(object sender, MouseEventArgs e) { DoDragDrop(FormatName.GetListBoxItem(sender), DragDropEffects.Copy); lstTestSteps_Click(sender, null); }