private void WorkerThread(object sender, DoWorkEventArgs e) { lock (status) status.IsWorking = true; ClearGraphs(); Graph[] graphs = panel.FindAllChildren <Graph>().Cast <Graph>().ToArray(); IGraphPanelScript script = panel.Script; if (script != null) { IStorageReader reader = GetStorage(); string[] simNames = script.GetSimulationNames(reader, panel); if (simNames != null) { foreach (string sim in simNames) { CreatePageOfGraphs(sim, graphs); if (processingThread.CancellationPending) { e.Cancel = true; return; } } } } }
private void WorkerThread() { ClearGraphs(); Graph[] graphs = panel.FindAllChildren <Graph>().ToArray(); IGraphPanelScript script = panel.Script; if (script != null) { IStorageReader reader = GetStorage(); string[] simNames = script.GetSimulationNames(reader, panel); if (simNames != null) { foreach (string sim in simNames) { CreatePageOfGraphs(sim, graphs); if (cts.Token.IsCancellationRequested) { return; } } } } }