public void AddChoice(ContextualMenuChoice choice) { choice.Scene = Simulator.Scene; choice.VisualPriority = VisualPriority; choice.DataChanged += new NoneHandler(DoChoiceDataChanged); choice.AvailabilityChanged += new NoneHandler(DoChoiceAvailabilityChanged); Choices.Add(choice); if (Choices.Count == 1) SelectedIndex = 0; ComputeSize(); }
private EditorCommand GetCommand(ContextualMenuChoice choice) { var attempt1 = choice as EditorTextContextualMenuChoice; var attempt2 = choice as EditorToggleContextualMenuChoice; if (attempt1 != null) return attempt1.Command; else return attempt2.Command; }
public void RemoveChoice(ContextualMenuChoice choice) { Choices.Remove(choice); if (Choices.Count == 0) SelectedIndex = -1; ComputeSize(); }