Beispiel #1
0
        void Proc()
        {
            var reader = new StreamReader(client);
            var writer = new StreamWriter(client);

            while (IsStarted)
            {
                var read = reader.ReadLine();

                var spl = read.Split('|');
                switch (spl[0])
                {
                case "released":
                    Released?.Invoke(this, ApiSerializer.Released(spl[1]));
                    break;

                case "tracked":
                    GazeTracked?.Invoke(this, ApiSerializer.Tracked(spl[1]));
                    break;

                case "clicked":
                    Clicked?.Invoke(this, ApiSerializer.Clicked(spl[1]));
                    break;

                default:
                    throw new NotImplementedException("Unknown mode");
                }

                Thread.Sleep(1);
            }

            reader.Dispose();
            writer.Dispose();
        }
Beispiel #2
0
 void Cursor_Released(object sender, CursorReleasedArgs e)
 {
     AddMessage("released|" + ApiSerializer.Released(new ApiSerializer.CursorReleasedArgs(e.StartPosition, e.EndPosition, e.Duration)));
 }