private ScalarInput Read_ScalarInput(BinaryReader reader) { var result = new ScalarInput(); result.Data = ReadString(reader); result.Value = reader.ReadSingle(); return(result); }
public ProxyScalarInput(ScalarBinding <InPlaceEditor> binding, ScalarInput <TEditor> editorInput, ScalarBinding <TInert> inertBinding) : base(binding, new ExplicitTrigger <InPlaceEditor>(), null) { Debug.Assert(editorInput != null); Debug.Assert(inertBinding != null); _editorInput = editorInput; _inertBinding = inertBinding; _editorInput.InjectScalarValidation(this); InertBinding.Seal(binding, 0); EditorBinding.Seal(binding, 1); }
public void BoundEventListTest() { InputEvent.ResetBindings(); TriggerInput t = new TriggerInput("t"); ScalarInput v = new ScalarInput("v"); Action <bool> boolAction = _ => { }; Action <bool> boolAction2 = _ => { }; Action <float> floatAction = _ => { }; t.Updated += boolAction; t.Updated += boolAction2; v.Updated += floatAction; Assert.That(InputEvent.BoundEvents, ContainsExactly(t, v)); t.Updated -= boolAction; Assert.That(InputEvent.BoundEvents, ContainsExactly(t, v)); t.Updated -= boolAction2; Assert.That(InputEvent.BoundEvents, ContainsExactly(v)); InputEvent.ResetBindings(); Assert.That(InputEvent.BoundEvents, Is.Empty); }
public void OnFlushed <T>(ScalarInput <T> scalarInput, bool makeProgress, bool valueChanged) where T : UIElement, new() { BaseScalarValidation.OnFlushed(this, makeProgress, valueChanged); }
internal static ScalarBinding <InPlaceEditor> AddToInPlaceEditor <TEditing, TInert>(ScalarInput <TEditing> scalarInput, ScalarBinding <TInert> inertScalarBinding) where TEditing : UIElement, new() where TInert : UIElement, new() { var result = new ScalarBinding <InPlaceEditor>((Action <InPlaceEditor>)null); result.Input = new ProxyScalarInput <TEditing, TInert>(result, scalarInput, inertScalarBinding); return(result); }
public CombineScalars(ScalarInput x, ScalarInput y) : base(x, y, Calculate) { }
public static Vector2Input ScalarsToVector(ScalarInput x, ScalarInput y) { return(new Vector2Input($"Vector({x}, {y})", new CombineScalars(x, y))); }