private void UpdateShowControls() { var newDisplayMode = DisplayAs.Nothing; if (!Operator.Outputs.Any() || Operator.Outputs.Count < _shownOutputIndex) { DisplayMode = DisplayAs.Nothing; return; } var output = Operator.Outputs[_shownOutputIndex]; if (Operator.InternalParts.Count > 0 && Operator.InternalParts[0].Func is ICurve) { var curve = Operator.InternalParts[0].Func as ICurve; XShowCurveControl.Curve = curve; newDisplayMode = DisplayAs.Curve; } else if (output.Type == FunctionType.Image || output.Type == FunctionType.Scene || output.Type == FunctionType.Mesh) { newDisplayMode = DisplayAs.Scene; XShowSceneControl.SetOperatorAndOutputIndex(Operator, _shownOutputIndex); } else if (output.Type == FunctionType.Float || output.Type == FunctionType.Generic || output.Type == FunctionType.Text) { newDisplayMode = DisplayAs.Text; XShowAsTextControl.SetOperatorAndOutput(Operator, _shownOutputIndex); } DisplayMode = newDisplayMode; }
private void DiscardShownOperator() { DisplayMode = DisplayAs.Nothing; if (_shownOperatorWidget != null) { _shownOperatorWidget.Operator.Parent.OperatorRemovedEvent -= Parent_OperatorRemovedEventHandler; } _shownOperatorWidget = null; XSelectedOperatorName.Text = "?"; XStickyCheckbox.IsChecked = false; XShowCurveControl.Curve = null; XShowAsTextControl.SetOperatorAndOutput(null); XShowSceneControl.SetOperatorAndOutputIndex(null); }