/// <summary> /// Suspends the data updates while a given action occurs. /// </summary> /// <param name="action">The action.</param> private void SuspendDataUpdatesWhile(Action action) { chartData1.BeginUpdate(); chartData2.BeginUpdate(); try { action(); } finally { chartData1.EndUpdate(); chartData2.EndUpdate(); } }
/// <summary> /// Regenerates all data sets. /// </summary> public void RegenerateDataSets() { dataSets.BeginUpdate(); try { dataSets.Clear(); for (int index = 0; index < dataSetCount; index++) { dataSets.Add(this.Generate()); } } finally { dataSets.EndUpdate(); } }