Ejemplo n.º 1
0
 public static void ClearFast(this DataPointCollection collection)
 {
     collection.SuspendUpdates();
     while (collection.Count > 0)
     {
         collection.RemoveAt(collection.Count - 1);
     }
     collection.ResumeUpdates();
     collection.Clear();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Speed up MSChart data points clear operations.
        /// </summary>
        /// <param name="sender"></param>
        public static void ClearPoints(this Series sender)
        {
            DataPointCollection points = sender.Points;

            points.SuspendUpdates();
            while (points.Count > 0)
            {
                points.RemoveAt(points.Count - 1);
            }
            points.ResumeUpdates();
            points.Clear(); //Force refresh.
        }