private void GenerateMenu() { changeStateMenu = ContextMenuItem.CreateAndRegister(this, StateMenuEventId, Messages.Menu_SetState); Enum.GetValues(typeof(AlternativeState)).Cast <AlternativeState>().ToList().ForEach(state => { ContextMenuItem menuItem = ContextMenuItem.CreateAndRegister(this, state.GetName().ToUpper(), state.GetName(), true); menuItem.Action = () => State = state; menu[state] = menuItem; }); }
public FlowLayoutAlternativeState(AlternativeState state, int index) { OldState = state.GetName(); Color = state.GetColor(); Index = index; Init(); }