Exemplo n.º 1
0
 private void checkId(int id, Pointer.PointerType type)
 {
     if (id > pointerCount)
     {
         throw new InvalidOperationException("Pointer id desync!");
     }
     else if (id == pointerCount)
     {
         var list = new List <PointerLog>(MIN_POINTER_LIST_SIZE);
         events.Add(list);
         data.Add(new PointerData()
         {
             Id   = id,
             Type = type,
         });
         pointerCount++;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a pointer of certain type attached to the input source.
        /// </summary>
        /// <param name="type">Pointer type to create.</param>
        /// <param name="input">Input source to attach the pointer to.</param>
        /// <returns></returns>
        public static Pointer Create(Pointer.PointerType type, IInputSource input)
        {
            switch (type)
            {
            case Pointer.PointerType.Touch:
                return(new TouchPointer(input));

            case Pointer.PointerType.Mouse:
                return(new MousePointer(input));

            case Pointer.PointerType.Pen:
                return(new PenPointer(input));

            case Pointer.PointerType.Object:
                return(new ObjectPointer(input));
            }
            return(null);
        }