public void deleteSeries(string graphName, string name)
{
Type GraphicsWindowType = typeof(GraphicsWindow);
Dictionary<string, UIElement> _objectsMap;
UIElement obj;
try
{
_objectsMap = (Dictionary<string, UIElement>)GraphicsWindowType.GetField("_objectsMap", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreCase).GetValue(null);
if (!_objectsMap.TryGetValue(graphName, out obj))
{
Utilities.OnShapeError(Utilities.GetCurrentMethod(), graphName);
return;
}
try
{
Canvas _graph = (Canvas)obj;
foreach (plotData _plotData in plotInfo)
{
if (_plotData.name == graphName)
{
foreach (seriesData _series in _plotData.series)
{
if (_series.name == name)
{
_plotData.series.Remove(_series);
delegate_Data = new object[] { _graph, _plotData, eZoom.FALSE, eRescale.TRUE };
FastThread.Invoke(plotSeries_Delegate);
break;
}
}
}
}
}
catch (Exception ex)
{
Utilities.OnError(Utilities.GetCurrentMethod(), ex);
}
}
catch (Exception ex)
{
Utilities.OnError(Utilities.GetCurrentMethod(), ex);
}
}