예제 #1
0
        /// <summary>
        /// Thread worker for sending the point list.
        /// Awaits as input the list of points and the list of timestamps.
        /// </summary>
        /// <param name="ActivePoints">The active points.</param>
        /// <param name="ActiveTimes">The active times.</param>
        bool SendPointListThreadWorker(List <System.Windows.Forms.MouseEventArgs> ActivePoints, List <DateTime> ActiveTimes)
        {
            try
            {
                List <int> xs = new List <int>();
                List <int> ys = new List <int>();
                foreach (System.Windows.Forms.MouseEventArgs mea in ActivePoints)
                {
                    xs.Add(mea.X);
                    ys.Add(mea.Y);
                }

                return(_client.ReceivePoints(xs.ToArray(), ys.ToArray(), ActiveTimes.ToArray()));
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
                return(false);
            }
        }
예제 #2
0
        /// <summary>
        /// Thread worker for sending the point list.
        /// Awaits as input the list of points and the list of timestamps.
        /// </summary>
        /// <param name="ActivePoints">The active points.</param>
        /// <param name="ActiveTimes">The active times.</param>
        bool SendPointListThreadWorker(List <System.Windows.Forms.MouseEventArgs> ActivePoints, List <DateTime> ActiveTimes)
        {
            try
            {
                List <int> xs = new List <int>();
                List <int> ys = new List <int>();
                foreach (System.Windows.Forms.MouseEventArgs mea in ActivePoints)
                {
                    xs.Add(mea.X);
                    ys.Add(mea.Y);
                }

                //xxx here, active times are converted into an array.
                //possibly this is where the Ticks get lost and everything is rounded
                //to full seconds

                return(_client.ReceivePoints(xs.ToArray(), ys.ToArray(), ActiveTimes.ToArray()));
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
                return(false);
            }
        }