private void finishSelection()
 {
     if (SelectedIndex >= 0)
     {
         MadeSelection = true;
         Selection     = Items[SelectedIndex] as ValueWithDesc;
     }
     _service.CloseDropDown();
 }
 public ValueList(IWindowsFormsEditorService service, ValueWithDesc[] values, object curValue)
 {
     _service = service;
     if (values != null && values.Length > 0)
     {
         Items.AddRange(values);
         for (int i = 0; i < Items.Count; i++)
         {
             ValueWithDesc v = Items[i] as ValueWithDesc;
             if (v != null)
             {
                 if (v.Value == curValue)
                 {
                     this.SelectedIndex = i;
                     break;
                 }
             }
         }
     }
 }