Example #1
0
        /// <summary>
        /// Sets is used directly by the drawing code, so this method asserts it is on the event thread to avoid threading issues.
        /// </summary>
        /// <param name="set"></param>
        private void AddSet(DataSet set)
        {
            Program.AssertOnEventThread();

            set.Points.Sort();

            var other = Sets.FirstOrDefault(s => s.Uuid == set.Uuid);

            if (other == null)
            {
                Sets.Add(set);
                set.TrimEnd(MaxPoints);
            }
            else
            {
                other.InsertPointCollection(set.Points);
                other.TrimEnd(MaxPoints);
            }
        }