public EditCustomActions(Area area, List <CustomAction> actions) { _area = area; InitializeComponent(); Type types = typeof(CustomAction.ActionTriggerType); CustomAction.ActionTriggerType[] vals = (CustomAction.ActionTriggerType[])Enum.GetValues(types); foreach (CustomAction.ActionTriggerType i in vals) { this.cbTriggers.Items.Add(CustomAction.WhenString(i)); } cbTriggers.SelectedIndex = 0; types = typeof(CustomAction.ActionType); CustomAction.ActionType[] vals2 = (CustomAction.ActionType[])Enum.GetValues(types); foreach (CustomAction.ActionType i in vals2) { this.cbActions.Items.Add(CustomAction.ActionString(i)); } cbActions.SelectedIndex = 0; if (actions != null) { foreach (CustomAction action in actions) { lstCustomActions.Items.Add(action); } } }