/// <summary> /// Return a list of the values to display in the grid /// </summary> /// <param name="context"></param> /// <returns>A list of values the user can choose from</returns> public override StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { // Try to get a store from the current context // "context.Instance" returns the element(s) that are currently selected i.e. whose values are being // shown in the property grid. Note that the user could have selected multiple objects, in which case //context.Instance will be an array. Store store = GetStore(context.Instance); List <string> values = (store != null) ? DSLUtil.GetClasses(store).ToList() : new List <string>(); return(new StandardValuesCollection(values)); }
private void LoadTypes() { IEnumerable <string> types = DSLUtil.GetClasses(_Store); fromEntityComboBox.Items.Add("Select Entity"); fromEntityComboBox.Items.AddRange(types.OrderBy(t => t).ToArray()); fromEntityComboBox.SelectedItem = "Select Entity"; toEntityComboBox.Items.Add("Select Entity"); toEntityComboBox.Items.AddRange(types.OrderBy(t => t).ToArray()); toEntityComboBox.SelectedItem = "Select Entity"; fromEntityComboBox.Focus(); }