Exemplo n.º 1
0
        public void Evaluate(int spreadMax)
        {
            if (!FKeyIn.IsChanged && !FCapsIn.IsChanged && !FTimeIn.IsChanged)
            {
                return;
            }

            spreadMax = SpreadUtils.SpreadMax(FKeyIn, FCapsIn, FTimeIn);
            FSubjects.ResizeAndDispose(spreadMax, slice => new Subject <KeyNotification>());
            FOutput.ResizeAndDismiss(spreadMax, slice => new Keyboard(FSubjects[slice], true));
            FKeyboardStates.ResizeAndDismiss(spreadMax, () => KeyboardState.Empty);

            for (int i = 0; i < spreadMax; i++)
            {
                var keyboard              = FOutput[i];
                var keyboardState         = new KeyboardState(FKeyIn[i].Cast <Keys>(), FCapsIn[0], FTimeIn[i]);
                var previousKeyboardState = FKeyboardStates[i];
                if (keyboardState != previousKeyboardState)
                {
                    var subject  = FSubjects[i];
                    var keyDowns = keyboardState.KeyCodes.Except(previousKeyboardState.KeyCodes);
                    foreach (var keyDown in keyDowns)
                    {
                        subject.OnNext(new KeyDownNotification(keyDown, this));
                    }
                    var keyUps = previousKeyboardState.KeyCodes.Except(keyboardState.KeyCodes);
                    foreach (var keyUp in keyUps)
                    {
                        subject.OnNext(new KeyUpNotification(keyUp, this));
                    }
                }
                FKeyboardStates[i] = keyboardState;
            }
        }
Exemplo n.º 2
0
        //called when data for any output pin is requested
        public void Evaluate(int SpreadMax)
        {
            if (!_pgready)
            {
                return;
            }
            if (_typeChanged || _firstFrame || _input.Spread.IsChanged)
            {
                Success.SliceCount = _input.Spread.SliceCount;
                Output.Resize(_input.Spread.SliceCount, i => new MemoryStream(), stream => stream?.Dispose());
                _output.ResizeAndDismiss(_input.Spread.SliceCount, i => null);

                for (int i = 0; i < _input.Spread.SliceCount; i++)
                {
                    Output[i] = Output[i] == null ? new MemoryStream() : Output[i];
                    var obj = _input[i];
                    var buf = _output[i];
                    if (obj == null)
                    {
                        Output[i].SetLength(0);
                        continue;
                    }
                    Output[i].Position = 0;
                    int length = 0;
                    try
                    {
                        length     = _ceras.Serialize(obj, ref buf);
                        Success[i] = true;
                    }
                    catch
                    {
                        Success[i] = false;
                        _ceras     = CerasSerializerHelper.Serializer();
                        Output[i].SetLength(0);
                        continue;
                    }
                    Output[i].SetLength(length);
                    Output[i].Write(buf, 0, length);
                    _output[i] = buf;
                }
                Output.Stream.IsChanged = true;
            }
            else
            {
                Output.Stream.IsChanged = false;
            }

            if (_firstFrame)
            {
                _firstFrame = false;
            }
            if (_typeChanged)
            {
                _typeChanged = false;
            }
        }
Exemplo n.º 3
0
 private void SetLength(int length)
 {
     if (length != Length)
     {
         FSubjects.ResizeAndDispose(length);
         FMouseStates.ResizeAndDismiss(length);
         FMouses.ResizeAndDismiss(
             length,
             slice =>
         {
             var subject = FSubjects[slice];
             return(new Mouse(subject));
         }
             );
         this.ResizeAndDismiss(length, () => MouseState.Create(0, 0, false, false, false, false, false, 0));
     }
 }
Exemplo n.º 4
0
 private void SetLength(int length)
 {
     if (length != Length)
     {
         FSubjects.ResizeAndDispose(length);
         FKeyboardStates.ResizeAndDismiss(length);
         FKeyboards.ResizeAndDismiss(
             length,
             slice =>
         {
             var subject = FSubjects[slice];
             return(new Keyboard(subject, true));
         }
             );
         this.ResizeAndDismiss(length, () => KeyboardState.Empty);
     }
 }
Exemplo n.º 5
0
        //called when data for any output pin is requested
        public void Evaluate(int SpreadMax)
        {
            //resize spread
            FFilters.ResizeAndDismiss(SpreadMax, i => new OneEuroFilter(FMinCutoff[i], FBeta[i]));

            FOutput.SliceCount = SpreadMax;

            var rate = 1 / (FHDEHost.FrameTime - FLastFrameTime);

            FLastFrameTime = FHDEHost.FrameTime;

            for (int i = 0; i < SpreadMax; i++)
            {
                FFilters[i].MinCutoff        = FMinCutoff[i];
                FFilters[i].Beta             = FBeta[i];
                FFilters[i].CutoffDerivative = FCutoffDerivative[i];

                FOutput[i] = FFilters[i].Filter(FInput[i], rate);
            }
        }
Exemplo n.º 6
0
        public override void Flush(bool force = false)
        {
            if (force || IsChanged)
            {
                FSubjects.ResizeAndDispose(Length);
                FKeyboardStates.ResizeAndDismiss(Length);
                FKeyboards.ResizeAndDismiss(
                    Length,
                    slice =>
                {
                    var subject = FSubjects[slice];
                    return(new Keyboard(subject, true));
                }
                    );
                for (int i = 0; i < Length; i++)
                {
                    var keyboardState         = this.Buffer[i];
                    var previousKeyboardState = FKeyboardStates[i];
                    if (keyboardState != previousKeyboardState)
                    {
                        var subject  = FSubjects[i];
                        var keyDowns = keyboardState.KeyCodes.Except(previousKeyboardState.KeyCodes);
                        foreach (var keyDown in keyDowns)
                        {
                            subject.OnNext(new KeyDownNotification(keyDown));
                        }
                        var keyUps = previousKeyboardState.KeyCodes.Except(keyboardState.KeyCodes);
                        foreach (var keyUp in keyUps)
                        {
                            subject.OnNext(new KeyUpNotification(keyUp));
                        }
                    }
                    FKeyboardStates[i] = keyboardState;
                }

                FNodeOut.SliceCount = Length;
                FNodeOut.MarkPinAsChanged();
            }
            base.Flush(force);
        }
Exemplo n.º 7
0
        public void Evaluate(int spreadMax)
        {
            FBuffer.ResizeAndDismiss(FInput.SliceCount, (slice) => { return(FInput[slice].DeepCopy()); });
            FOutput.ResizeAndDismiss(FInput.SliceCount, (slice) => { return(FInput[slice].DeepCopy()); });
            for (int i = 0; i < FInput.SliceCount; i++)
            {
                if (FBuffer[i] == null)
                {
                    FOutput[i] = null;
                }
                else if (FOutput[i] == null || FOutput[i].Key != FBuffer[i].Key)
                {
                    FOutput[i] = FBuffer[i].DeepCopy();
                }
                else
                {
                    foreach (var e in FBuffer[i].Data)
                    {
                        FOutput[i].Data[e.Key] = (e.Value as ISpread).Clone();
                    }
                }

                if (FInput[i] == null)
                {
                    FBuffer[i] = null;
                }
                else if (FBuffer[i] == null || FBuffer[i].Key != FInput[i].Key)
                {
                    FBuffer[i] = FInput[i].DeepCopy();
                }
                else
                {
                    foreach (var e in FInput[i].Data)
                    {
                        FBuffer[i].Data[e.Key] = (e.Value as ISpread).Clone();
                    }
                }
            }
        }
Exemplo n.º 8
0
                #pragma warning restore 649, 169
        #endregion fields & pins

        //called when data for any output pin is requested
        public void Evaluate(int spreadMax)
        {
            FContent.SliceCount = spreadMax;
            FEOS.SliceCount     = spreadMax;

            path.ResizeAndDismiss(spreadMax, () => string.Empty);
            lineWise.ResizeAndDismiss(spreadMax, (i) => FLineWise[i]);
            streamReader.Resize(spreadMax, (i) => new StreamReader(FInput[i]), (t) => t.Dispose());

            for (int i = 0; i < spreadMax; i++)
            {
                //check if encoding has changed
                bool encodingChanged     = false;
                System.Text.Encoding enc = System.Text.Encoding.Default;
                if (FEncoding.IsChanged)
                {
                    if (FEncoding[i].Index > 0)
                    {
                        enc = Encoding.GetEncoding(FEncoding[i].Name);
                    }
                    encodingChanged = !(streamReader[i].CurrentEncoding != enc);
                }

                //initialize stream reader
                bool update  = false;
                bool isValid = true;
                if (path[i] != FInput[i] || encodingChanged || FRead[i])
                {
                    try
                    {
                        streamReader[i].Dispose();
                        streamReader[i] = new StreamReader(FInput[i], enc);
                        path[i]         = FInput[i];
                        update          = true;
                    }
                    catch
                    {
                        FContent[i] = string.Empty;
                        FEOS[i]     = true;
                        isValid     = false;
                    }
                }

                //do the reading part
                if ((lineWise[i] != FLineWise[i] || FIndex.IsChanged || FCount.IsChanged || update) && isValid)
                {
                    streamReader[i].DiscardBufferedData();
                    if (FLineWise[i])
                    {
                        streamReader[i].BaseStream.Seek(0, SeekOrigin.Begin);
                        int incr = 0;
                        FContent[i] = string.Empty;
                        while (incr < FIndex[i] + FCount[i] && !streamReader[i].EndOfStream)
                        {
                            string line = streamReader[i].ReadLine();
                            if (incr >= FIndex[i])
                            {
                                FContent[i] += line + Environment.NewLine;
                            }

                            incr++;
                        }
                        if (incr > 0)                        //remove last \r\n
                        {
                            FContent[i] = FContent[i].Substring(0, FContent[i].Length - Environment.NewLine.Length);
                        }
                    }
                    else
                    {
                        streamReader[i].BaseStream.Seek(FIndex[i], SeekOrigin.Begin);

                        char[] buffer = new char[Math.Max(FCount[i], 0)];
                        int    read   = streamReader[i].ReadBlock(buffer, 0, buffer.Length);
                        FContent[i] = new string(buffer);
                    }
                    FEOS[i] = streamReader[i].EndOfStream;
                }
            }
        }
Exemplo n.º 9
0
 public void Evaluate(int spreadMax)
 {
     FLastSet.ResizeAndDismiss(FSet.SliceCount, (int i) => !FSet[i]);
     if (FSet.SliceCount == 1)
     {
         if (FSet[0])
         {
             FInput.Sync();
             FOutput.ResizeAndDismiss(spreadMax, (int i) => FInput[i]);
             FBuffer.ResizeAndDismiss(spreadMax, (int i) => FInput[i] == null ? null : new StructType(FInput[i]));
             for (int i = 0; i < FInput.SliceCount; i++)
             {
                 if (FOutput[i] != FInput[i])
                 {
                     FOutput[i] = FInput[i];
                     if (FInput[i] != null)
                     {
                         FBuffer[i] = new StructType(FInput[i]);
                     }
                 }
             }
         }
         else if ((FSet[0] != FLastSet[0]) && (!FSet[0]))
         {
             FOutput.SliceCount = FBuffer.SliceCount;
             for (int i = 0; i < FInput.SliceCount; i++)
             {
                 if (FBuffer[i] != null)
                 {
                     FOutput[i] = new StructType(FBuffer[i]);
                     foreach (var f in FBuffer[i].Fields)
                     {
                         FOutput[i][f] = FBuffer[i].GetClonedData(f);
                     }
                 }
                 else
                 {
                     FOutput[i] = null;
                 }
             }
         }
     }
     else
     {
         FInput.Sync();
         FOutput.ResizeAndDismiss(spreadMax, (int i) => null);
         FBuffer.ResizeAndDismiss(spreadMax, (int i) => null);
         for (int i = 0; i < spreadMax; i++)
         {
             if (FSet[i])
             {
                 if (FOutput[i] != FInput[i])
                 {
                     FOutput[i] = FInput[i];
                     if (FInput[i] != null)
                     {
                         FBuffer[i] = new StructType(FInput[i]);
                     }
                 }
             }
             else if ((FSet[i] != FLastSet[i]) && (!FSet[i]))
             {
                 if (FBuffer[i] == null)
                 {
                     FOutput[i] = null;
                 }
                 else
                 {
                     FOutput[i] = new StructType(FBuffer[i]);
                     foreach (var f in FBuffer[i].Fields)
                     {
                         FOutput[i][f] = FBuffer[i].GetClonedData(f);
                     }
                 }
             }
         }
     }
     FLastSet.AssignFrom(FSet);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Set bincount of Operations
 /// </summary>
 /// <param name="i"></param>
 public void SetBinCount(int i)
 {
     Operations.ResizeAndDismiss(i, () => new Spread <TOp>());
 }
Exemplo n.º 11
0
        public override void Flush(bool force = false)
        {
            if (force || IsChanged)
            {
                FSubjects.ResizeAndDispose(Length);
                FMouseStates.ResizeAndDismiss(Length);
                FMouses.ResizeAndDismiss(
                    Length,
                    slice =>
                {
                    var subject = FSubjects[slice];
                    return(new Mouse(subject));
                }
                    );
                for (int i = 0; i < Length; i++)
                {
                    var mouseState         = this.Buffer[i];
                    var previousMouseState = FMouseStates[i];
                    if (mouseState != previousMouseState)
                    {
                        var subject  = FSubjects[i];
                        var v        = new Vector2D(mouseState.X, mouseState.Y);
                        var position = ToMousePoint(v);
                        if (mouseState.X != previousMouseState.X || mouseState.Y != previousMouseState.Y)
                        {
                            subject.OnNext(new MouseMoveNotification(position, FClientArea));
                        }
                        if (mouseState.Buttons != previousMouseState.Buttons)
                        {
                            if (mouseState.IsLeft && !previousMouseState.IsLeft)
                            {
                                subject.OnNext(new MouseDownNotification(position, FClientArea, MouseButtons.Left));
                            }
                            else if (!mouseState.IsLeft && previousMouseState.IsLeft)
                            {
                                subject.OnNext(new MouseUpNotification(position, FClientArea, MouseButtons.Left));
                            }
                            if (mouseState.IsMiddle && !previousMouseState.IsMiddle)
                            {
                                subject.OnNext(new MouseDownNotification(position, FClientArea, MouseButtons.Middle));
                            }
                            else if (!mouseState.IsMiddle && previousMouseState.IsMiddle)
                            {
                                subject.OnNext(new MouseUpNotification(position, FClientArea, MouseButtons.Middle));
                            }
                            if (mouseState.IsRight && !previousMouseState.IsRight)
                            {
                                subject.OnNext(new MouseDownNotification(position, FClientArea, MouseButtons.Right));
                            }
                            else if (!mouseState.IsRight && previousMouseState.IsRight)
                            {
                                subject.OnNext(new MouseUpNotification(position, FClientArea, MouseButtons.Right));
                            }
                            if (mouseState.IsXButton1 && !previousMouseState.IsXButton1)
                            {
                                subject.OnNext(new MouseDownNotification(position, FClientArea, MouseButtons.XButton1));
                            }
                            else if (!mouseState.IsXButton1 && previousMouseState.IsXButton1)
                            {
                                subject.OnNext(new MouseUpNotification(position, FClientArea, MouseButtons.XButton1));
                            }
                            if (mouseState.IsXButton2 && !previousMouseState.IsXButton2)
                            {
                                subject.OnNext(new MouseDownNotification(position, FClientArea, MouseButtons.XButton2));
                            }
                            else if (!mouseState.IsXButton2 && previousMouseState.IsXButton2)
                            {
                                subject.OnNext(new MouseUpNotification(position, FClientArea, MouseButtons.XButton2));
                            }
                        }
                        if (mouseState.MouseWheel != previousMouseState.MouseWheel)
                        {
                            var wheelDelta = previousMouseState.MouseWheel - mouseState.MouseWheel;
                            subject.OnNext(new MouseWheelNotification(position, FClientArea, wheelDelta * Const.WHEEL_DELTA));
                        }
                    }
                    FMouseStates[i] = mouseState;
                }

                FNodeOut.SliceCount = Length;
                FNodeOut.MarkPinAsChanged();
            }
            base.Flush(force);
        }
Exemplo n.º 12
0
        public void Evaluate(int spreadMax)
        {
            FBuffer.ResizeAndDismiss(spreadMax, () => new Spread <double>());
            FDelta.SliceCount = spreadMax;

            //return null if one of the control inputs is null
            if (FDoInsert.IsAnyEmpty(FFrameCount, FReset))
            {
                FOutput.SliceCount = 0;
                return;
            }

            //Reset the BufferSlice
            if (FReset.IsChanged)
            {
                for (int i = 0; i < spreadMax; i++)
                {
                    if (FReset[i])
                    {
                        FBuffer[i] = new Spread <double>();
                        FDelta[i]  = 0;
                    }
                }
            }

            //
            for (int i = 0; i < spreadMax; i++)
            {
                if (FDoInsert[i])
                {
                    //insert new values to the buffer
                    FBuffer[i].Insert(0, FInput[i]);

                    //calculate the delta between the first an last slice
                    if (FBuffer[i].SliceCount > 0)
                    {
                        FDelta[i] = (FBuffer[i][0] - FBuffer[i][FBuffer[i].SliceCount - 1]);
                    }
                }
                else
                {
                    if (FBuffer.SliceCount > 0)
                    {
                        if (FBuffer[i].SliceCount > 0)
                        {
                            //add a new caluclate slice via delta to the spread
                            Spread <double>  MovedBuffer = new Spread <double>();
                            ISpread <double> MovedSpread = FBuffer[i].GetRange(0, FBuffer[i].SliceCount - 1);
                            double           NewSlice    = FBuffer[i][FBuffer[i].SliceCount - 1] + FDelta[i];
                            MovedBuffer.Add(NewSlice);
                            MovedBuffer.AddRange(MovedSpread);
                            FBuffer[i] = MovedBuffer;
                        }
                    }
                }

                //remove slices from the Buffer if the framecount gets smaller
                if (FFrameCount.IsChanged)
                {
                    if (FFrameCount[i] >= 0 && FBuffer[i].SliceCount > FFrameCount[i])
                    {
                        FBuffer[i].RemoveRange(FFrameCount[i], FBuffer[i].SliceCount - FFrameCount[i]);
                    }
                }
            }

            //set the output pins
            FDeltaOut.AssignFrom(FDelta as ISpread <double>);
            FOutput.AssignFrom(FBuffer);
        }
Exemplo n.º 13
0
        public void Evaluate(int spreadMax)
        {
            PositionOut.SliceCount     = spreadMax;
            MouseWheelOut.SliceCount   = spreadMax;
            FRawMouseWheel.SliceCount  = spreadMax;
            LeftButtonOut.SliceCount   = spreadMax;
            MiddleButtonOut.SliceCount = spreadMax;
            RightButtonOut.SliceCount  = spreadMax;
            X1ButtonOut.SliceCount     = spreadMax;
            X2ButtonOut.SliceCount     = spreadMax;

            FSchedulers.ResizeAndDismiss(spreadMax, () => new FrameBasedScheduler());
            FSubscriptions.ResizeAndDispose(
                spreadMax,
                slice =>
            {
                return(new Subscription <Mouse, MouseNotification>(
                           mouse => mouse.MouseNotifications,
                           (mouse, n) =>
                {
                    switch (n.Kind)
                    {
                    case MouseNotificationKind.MouseDown:
                    case MouseNotificationKind.MouseUp:
                        var mouseButton = n as MouseButtonNotification;
                        var isDown = n.Kind == MouseNotificationKind.MouseDown;
                        if ((mouseButton.Buttons & MouseButtons.Left) > 0)
                        {
                            LeftButtonOut[slice] = isDown;
                        }
                        if ((mouseButton.Buttons & MouseButtons.Middle) > 0)
                        {
                            MiddleButtonOut[slice] = isDown;
                        }
                        if ((mouseButton.Buttons & MouseButtons.Right) > 0)
                        {
                            RightButtonOut[slice] = isDown;
                        }
                        if ((mouseButton.Buttons & MouseButtons.XButton1) > 0)
                        {
                            X1ButtonOut[slice] = isDown;
                        }
                        if ((mouseButton.Buttons & MouseButtons.XButton2) > 0)
                        {
                            X2ButtonOut[slice] = isDown;
                        }
                        break;

                    case MouseNotificationKind.MouseMove:
                        var position = new Vector2D(n.Position.X, n.Position.Y);
                        var clientArea = new Vector2D(n.ClientArea.Width - 1, n.ClientArea.Height - 1);
                        PositionOut[slice] = VMath.Map(position, Vector2D.Zero, clientArea, new Vector2D(-1, 1), new Vector2D(1, -1), TMapMode.Float);
                        break;

                    case MouseNotificationKind.MouseWheel:
                        var mouseWheel = n as MouseWheelNotification;
                        FRawMouseWheel[slice] += mouseWheel.WheelDelta;
                        MouseWheelOut[slice] = (int)Math.Round((float)FRawMouseWheel[slice] / Const.WHEEL_DELTA);
                        break;

                    default:
                        break;
                    }
                },
                           FSchedulers[slice]
                           ));
            }
                );

            for (int i = 0; i < spreadMax; i++)
            {
                //resubsribe if necessary
                FSubscriptions[i].Update(MouseIn[i]);
                //process events
                FSchedulers[i].Run(QueueModeIn[i]);
            }
        }
Exemplo n.º 14
0
        public void Evaluate(int spreadMax)
        {
            KeyNameOut.SliceCount = spreadMax;
            KeyCodeOut.SliceCount = spreadMax;
            KeyCharOut.SliceCount = spreadMax;

            FSchedulers.ResizeAndDismiss(spreadMax, () => new FrameBasedScheduler());
            FSubscriptions.ResizeAndDispose(
                spreadMax,
                slice =>
            {
                return(new Subscription <Keyboard, KeyNotification>(
                           keyboard =>
                {
                    return keyboard.KeyNotifications
                    .DistinctUntilChanged(new KeyNotificationComparer());
                },
                           (keyboard, n) =>
                {
                    var keyCodeOut = KeyCodeOut[slice];
                    var keyNameOut = KeyNameOut[slice];
                    switch (n.Kind)
                    {
                    case KeyNotificationKind.KeyDown:
                        var keyDown = n as KeyDownNotification;
                        if (!keyCodeOut.Contains((int)keyDown.KeyCode))
                        {
                            keyCodeOut.Add((int)keyDown.KeyCode);
                            keyNameOut.Add(keyDown.KeyCode.ToString());
                        }
                        break;

                    case KeyNotificationKind.KeyPress:
                        var keyPress = n as KeyPressNotification;
                        KeyCharOut[slice] = new string(keyPress.KeyChar, 1);
                        break;

                    case KeyNotificationKind.KeyUp:
                        var keyUp = n as KeyUpNotification;
                        keyCodeOut.RemoveAll(k => k == (int)keyUp.KeyCode);
                        keyNameOut.RemoveAll(k => k == keyUp.KeyCode.ToString());
                        KeyCharOut[slice] = string.Empty;
                        break;

                    default:
                        throw new NotImplementedException();
                    }
                },
                           FSchedulers[slice]
                           ));
            }
                );

            for (int i = 0; i < spreadMax; i++)
            {
                //resubsribe if necessary
                FSubscriptions[i].Update(KeyboardIn[i]);
                //process events
                FSchedulers[i].Run(QueueModeIn[i]);
            }
        }
Exemplo n.º 15
0
        //called when data for any output pin is requested
        public void Evaluate(int SpreadMax)
        {
            if (!_pgready)
            {
                return;
            }
            if (_typeChanged || _firstFrame || Input.IsChanged)
            {
                Success.SliceCount        = Input.SliceCount;
                _output.Spread.SliceCount = Input.SliceCount;
                _input.ResizeAndDismiss(Input.SliceCount, i => new byte[0]);

                for (int i = 0; i < Input.SliceCount; i++)
                {
                    if (Input[i] != null && _input[i].Length < Input[i].Length)
                    {
                        _input[i] = new byte[Input[i].Length];
                    }

                    if (Input[i] == null || Input[i].Read(_input[i], 0, (int)Input[i].Length) <= 0)
                    {
                        _output[i] = null;
                        continue;
                    }

                    try
                    {
                        if (_output[i] == null)
                        {
                            _output[i] = _ceras.Deserialize <object>(_input[i]);
                        }
                        else
                        {
                            var obj = _output[i];
                            _ceras.Deserialize(ref obj, _input[i]);
                            _output[i] = obj;
                        }
                        Success[i] = true;
                    }
                    catch
                    {
                        Success[i] = false;
                        _ceras     = CerasSerializerHelper.Serializer();
                        _output[i] = null;
                        continue;
                    }
                }
                _output.SetReflectedChanged(true);
            }
            else
            {
                _output.SetReflectedChanged(false);
            }

            if (_firstFrame)
            {
                _firstFrame = false;
            }
            if (_typeChanged)
            {
                _typeChanged = false;
            }
        }