ChartRobotEventArgs
class cAlgo.API
DesktopCLICloud
The base class representing event args for a ChartRobot.
Environment behaviour
Cloud — not supported. Never raised in the cloud: the ChartRobots events never fire there.
Definition
public abstract class ChartRobotEventArgs
Namespace: cAlgo.API · Group: EventArgs
Examples
protected override void OnStart()
{
Chart.Robots.RobotAdded += OnChartRobotEvent;
Chart.Robots.RobotRemoved += OnChartRobotEvent;
Chart.Robots.RobotModified += OnChartRobotEvent;
Chart.Robots.RobotStarted += OnChartRobotEvent;
Chart.Robots.RobotStopped += OnChartRobotEvent;
}
private void OnChartRobotEvent(ChartRobotEventArgs args)
{
Print("{0}: {1} is {2}", args.GetType().Name, args.Robot.Name, args.Robot.State);
}
def on_start(self):
api.Chart.Robots.RobotAdded += self.on_chart_robot_event
api.Chart.Robots.RobotRemoved += self.on_chart_robot_event
api.Chart.Robots.RobotModified += self.on_chart_robot_event
api.Chart.Robots.RobotStarted += self.on_chart_robot_event
api.Chart.Robots.RobotStopped += self.on_chart_robot_event
def on_chart_robot_event(self, args):
api.Print(f"{type(args).__name__}: {args.Robot.Name} is {args.Robot.State}")
Properties
| Name | Description |
|---|---|
RobotDesktopCLICloudChartRobot | Gets the ChartRobot that raised an event. |