private void OnItemInteraction(EEInteractableItem item, SLabel label) { AssemblyContents cont = _assemblyMap[_assemblySelected]; NamespaceMap map = cont.Namespaces.FirstOrDefault(n => n.Namespace == _namespaceDropdown.Selected.ReadableName); Type type = map?.Types.FirstOrDefault(t => t.Name == item.Label.ReadableName); SelectedType = type; OnTypeSelected?.Invoke(type); }
/// <summary> /// Construct an InteractableItem. Foreach buttonLabel, a button will be created /// </summary> /// <param name="itemLabel"></param> /// <param name="buttonLabels"></param> public EEInteractableList(SLabel listLabel, params EEInteractableItem.Args[] interableItemArgs) { Label = listLabel; Items = interableItemArgs.Select( a => { EEInteractableItem item = new EEInteractableItem(a); item.OnInteraction += l => OnItemInteraction?.Invoke(item, l); return(item); } ).ToArray(); }
/// <summary> /// Construct an InteractableItem. Foreach buttonLabel, a button will be created /// </summary> /// <param name="itemLabel"></param> /// <param name="buttonLabels"></param> public EEInteractableItem(SLabel itemLabel, params SLabel[] buttonLabels) { Label = itemLabel; if (buttonLabels != null) { Buttons = buttonLabels.Select( l => { EEButton b = new EEButton(l); b.OnClick += () => OnInteraction?.Invoke(b.Label); return(b); } ).ToArray(); } else { Buttons = new EEButton[0]; } }
private void _list_OnItemInteraction(EEInteractableItem arg1, SLabel arg2) { _response = $"The item {arg1.Label.ReadableName} was clicked with the {arg2.ReadableName} action"; }
/// <summary> /// Construct a button /// </summary> /// <param name="label"></param> public EESaveFileButton(SLabel label) => Label = label;
/// <summary> /// Construct a button /// </summary> /// <param name="label"></param> public EEOpenFileButton(SLabel label) => Label = label;
/// <summary> /// Construct a button /// </summary> /// <param name="label"></param> public EEButton(SLabel label) => Label = label;
public EECustomString(SLabel label, Func <string> generationFunction) { Label = label; _generationFunction = generationFunction; _customInput = _generationFunction(); }