Paint.CanvasPlayback.GetNextTouchPoints C# (CSharp) Method

GetNextTouchPoints() public method

Gets the next set of touch points.
public GetNextTouchPoints ( int maxTouchPoints ) : ITouchPointSizeColor[]
maxTouchPoints int Maximum number of touchpoints that should be retrieved
return ITouchPointSizeColor[]
        public ITouchPointSizeColor[] GetNextTouchPoints(int maxTouchPoints)
        {
            List<ITouchPointSizeColor> touchPoints = new List<ITouchPointSizeColor>();

            while (this.commandsReadSoFar < this.playbackCommandTotal && touchPoints.Count < maxTouchPoints)
            {
                fileStream.Read(this.commandByteArray, 0, BytesPerCommand);

                this.commandsReadSoFar++;

                switch (this.commandByteArray[0])
                {
                    case CanvasRecorderCommand.SetColor:
                        this.SetColor();
                        break;

                    case CanvasRecorderCommand.SetBrushSize:
                        this.SetBrushSize();
                        break;

                    case CanvasRecorderCommand.Tap:
                    case CanvasRecorderCommand.StartDrag:
                    case CanvasRecorderCommand.FreeDrag:
                    case CanvasRecorderCommand.DragComplete:
                    default:
                        touchPoints.Add(this.CreateTouchPoint(this.commandByteArray[0]));
                        break;
                }
            }

            return touchPoints.ToArray();
        }