public void OnSelectionMade(StatementCompletionItem statementCompletionItem) { if (SelectionMade != null) { SelectionMade.Invoke(statementCompletionItem); } }
public void AwaitSelection(Dictionary<int, string> selections, SelectionMade callback) { this.Writer.ClearText(); bool first = true; foreach (int key in selections.Keys) { GameObject clickable = Instantiate(this.ClickablePrefab); clickable.name = "Decision_" + selections[key]; clickable.transform.SetParent(this.ClickableContainer.transform, false); clickable.GetComponentInChildren<Text>().text = selections[key]; int thisKey = key; clickable.GetComponentInChildren<Button>().onClick.AddListener(() => { MakeSelection(thisKey); }); clickables.Add(clickable); if (first) { EventSystem.current.SetSelectedGameObject(clickable); first = false; } } this.Selecting = true; this.selectionCallback = callback; }
private void EndSelection() { if (!_startPoint.HasValue || !_endPoint.HasValue) { _startPoint = null; return; } SelectionMade?.Invoke(this, new Rect(_startPointOriginal, _endPointOriginal)); CleanSelection(); }
public void MakeSelection(int key) { this.selectionCallback(key); this.selectionCallback = null; for (int i = 0; i < this.clickables.Count; ++i) { Destroy(this.clickables[i]); } this.clickables.Clear(); this.selectionOrder.Clear(); this.Selecting = false; }
private void SearchItemClicked(object sender, ItemClickEventArgs e) { // raise event SelectionMade?.Invoke(this, e.ClickedItem as string); }
private void GetActionFrameMeta_PreFramePopped() { SelectedInspectable = SingularFocus; SelectionMade?.Invoke(); }
protected virtual void OnSelectionMade(HomeScreenSelectionMadeEventArgs e) { SelectionMade?.Invoke(this, e); }
/// <summary>Call back for OnAction events from the drop-down ribbon elements.</summary> public void OnSelectionMade(IRibbonControl control, string selectedId, int selectedIndex) { SelectionMade?.Invoke(control, selectedId, selectedIndex); Invalidate(); }