public override void OnDataChanged() { base.OnDataChanged(); NodePresenter presenter = base.GetPresenter <NodePresenter>(); this.m_Expanded = presenter.expanded; this.RefreshExpandedState(); this.m_TitleLabel.text = presenter.title; this.SetLayoutClassLists(presenter); }
private void ToggleCollapsePresenter() { NodePresenter presenter = base.GetPresenter <NodePresenter>(); presenter.expanded = !presenter.expanded; }
public bool RefreshPorts() { NodePresenter presenter = base.GetPresenter <NodePresenter>(); bool expanded = this.expanded; if (presenter != null) { List <Port> currentPorts = this.inputContainer.Query(null, null).ToList(); List <Port> currentPorts2 = this.outputContainer.Query(null, null).ToList(); this.ProcessRemovedPorts(currentPorts, this.inputContainer, presenter.inputPorts); this.ProcessRemovedPorts(currentPorts2, this.outputContainer, presenter.outputPorts); this.ProcessAddedPorts(currentPorts, this.inputContainer, presenter.inputPorts); this.ProcessAddedPorts(currentPorts2, this.outputContainer, presenter.outputPorts); expanded = presenter.expanded; } List <Port> list = this.inputContainer.Query(null, null).ToList(); List <Port> list2 = this.outputContainer.Query(null, null).ToList(); foreach (Port current in list) { Port expr_EB = current; expr_EB.OnConnect = (Action <Port>)Delegate.Combine(expr_EB.OnConnect, new Action <Port>(this.OnPortConnectAction)); Port expr_10E = current; expr_10E.OnDisconnect = (Action <Port>)Delegate.Combine(expr_10E.OnDisconnect, new Action <Port>(this.OnPortConnectAction)); } foreach (Port current2 in list2) { Port expr_16A = current2; expr_16A.OnConnect = (Action <Port>)Delegate.Combine(expr_16A.OnConnect, new Action <Port>(this.OnPortConnectAction)); Port expr_18D = current2; expr_18D.OnDisconnect = (Action <Port>)Delegate.Combine(expr_18D.OnDisconnect, new Action <Port>(this.OnPortConnectAction)); } int num = this.ShowPorts(expanded, list); int num2 = this.ShowPorts(expanded, list2); VisualElement element = this.topContainer.Q("divider", null); bool flag = num2 > 0 || !this.AllElementsHidden(this.outputContainer); bool flag2 = num > 0 || !this.AllElementsHidden(this.inputContainer); if (flag) { if (this.outputContainer.shadow.parent != this.topContainer) { this.topContainer.Add(this.outputContainer); this.outputContainer.BringToFront(); } } else if (this.outputContainer.shadow.parent == this.topContainer) { this.outputContainer.RemoveFromHierarchy(); } if (flag2) { if (this.inputContainer.shadow.parent != this.topContainer) { this.topContainer.Add(this.inputContainer); this.inputContainer.SendToBack(); } } else if (this.inputContainer.shadow.parent == this.topContainer) { this.inputContainer.RemoveFromHierarchy(); } this.SetElementVisible(element, flag2 && flag); return(flag2 || flag); }
protected virtual void SetLayoutClassLists(NodePresenter nodePresenter) { }