ChartObjectUpdatedEventArgs is obsolete
Created at 13 Jan 2022, 00:28
ChartObjectUpdatedEventArgs is obsolete
13 Jan 2022, 00:28
I gotta change "ChartObjectUpdatedEventArgs" to "ChartObjectsUpdatedEventArgs"
I dont want all objects in the chart to be updated, only the VerticalLine with a specific name, so in "ChartObjectUpdatedEventArgs" I write like this:
if (obj.ChartObject.ObjectType == ChartObjectType.VerticalLine)
{ var x_Name = "VerticalLine_name"
if (obj.ChartObject.Name == x_Name)
{
}
};
How can I write these two "IF" statements in the new "ChartObjectsUpdatedEventArgs" ?
amusleh
13 Jan 2022, 08:18
Hi,
The new event args gives you all the chart objects that were updated, not just one object, because multiple objects can be updated at the same time.
To find the object that you are looking for you can use Linq, ex:
Here I check if there is an updated object that's vertical line and its name is "VerticalLine_name", if there is such an object we will get it otherwise the result will be null.
@amusleh