Chronos Plugins 5.9.0
This documentation covers the plugin interfaces definitions and an example implementation.
Loading...
Searching...
No Matches
MockDeviceToolbox.cs
Go to the documentation of this file.
1using System;
2using System.Drawing;
3using System.Windows.Forms;
5
6namespace MockPlugin.Device
7{
15 public partial class MockDeviceToolbox : UserControl, IToolbox<MockDevice>, IUsableDuringRun<MockDevice>
16 {
18 {
19 InitializeComponent();
20 }
21
23
25 {
26 get => mDev;
27 set
28 {
29 mDev = value;
30 if (mDev != null)
31 {
32 // Handle connect/disconnect using data binding
33 checkBox1.DataBindings.Add(new Binding("Checked",
34 mDev,
35 "IsConnected",
36 false,
37 DataSourceUpdateMode.OnPropertyChanged));
38 }
39 }
40 }
41
42 private void btnShowMessage_Click(object sender, EventArgs e)
43 {
44 mDev.ShowTheMessage(textBox1.Text);
45 }
46
47 public Icon NavBarIcon => Properties.Resources.MockNormal;
48
49 public bool SequenceRunning
50 {
51 set => lblRunning.Text = $@"{(value ? "Sequence" : "No sequence")} running";
52 }
53 }
54}
Classes and interfaces that are meant for plugins. The classes and interfaces below this namespace ar...
A fake device. This namespace contains the fake device driver and auxiliary classes for settings,...
To be implemented by the Toolbox part of a Chronos plugin.
Implement this if you want your toolbox to be visible during a sequence run.
A chronos plugin implementation for a fake device. We pretend we are controlling a mixture of coffee ...
Definition MockDevice.cs:53
void ShowTheMessage(string messageText)
Let our device set a status message and display some message box instead of doing real work.
Example implementation for a WinForms toolbox for our Mock Device.
void btnShowMessage_Click(object sender, EventArgs e)