Beispiel #1
0
        private ScalarInput Read_ScalarInput(BinaryReader reader)
        {
            var result = new ScalarInput();

            result.Data  = ReadString(reader);
            result.Value = reader.ReadSingle();

            return(result);
        }
Beispiel #2
0
 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);
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public void OnFlushed <T>(ScalarInput <T> scalarInput, bool makeProgress, bool valueChanged) where T : UIElement, new()
 {
     BaseScalarValidation.OnFlushed(this, makeProgress, valueChanged);
 }
Beispiel #5
0
        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);
        }
Beispiel #6
0
 public CombineScalars(ScalarInput x, ScalarInput y) : base(x, y, Calculate)
 {
 }
Beispiel #7
0
 public static Vector2Input ScalarsToVector(ScalarInput x, ScalarInput y)
 {
     return(new Vector2Input($"Vector({x}, {y})", new CombineScalars(x, y)));
 }