Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        /// <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();
        }
Esempio n. 3
0
        /// <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];
            }
        }
Esempio n. 4
0
 private void _list_OnItemInteraction(EEInteractableItem arg1, SLabel arg2)
 {
     _response = $"The item {arg1.Label.ReadableName} was clicked with the {arg2.ReadableName} action";
 }
Esempio n. 5
0
 /// <summary>
 /// Construct a button
 /// </summary>
 /// <param name="label"></param>
 public EESaveFileButton(SLabel label) => Label = label;
Esempio n. 6
0
 /// <summary>
 /// Construct a button
 /// </summary>
 /// <param name="label"></param>
 public EEOpenFileButton(SLabel label) => Label = label;
Esempio n. 7
0
 /// <summary>
 /// Construct a button
 /// </summary>
 /// <param name="label"></param>
 public EEButton(SLabel label) => Label = label;
Esempio n. 8
0
 public EECustomString(SLabel label, Func <string> generationFunction)
 {
     Label = label;
     _generationFunction = generationFunction;
     _customInput        = _generationFunction();
 }