3using System.Threading.Tasks;
4using System.Windows.Media;
18 [ScheduleDiagramColor(nameof(Colors.Coral))]
29 public string GreetingsText {
get;
set; } = DefaultGreetingsAttribute.DefGreeting;
41 internal const string DefGreeting =
"Some default greeting";
42 private readonly
string[]
mDefGreetings = { DefGreeting,
"Howdy!",
"Good day!" };
44 System.Collections.IEnumerator System.Collections.IEnumerable.
GetEnumerator()
47 greetingsList.Add($
"Current greeting of {DateTime.Now:HH:mm:ss}");
48 return greetingsList.GetEnumerator();
72 "Message shown by the mock task",
73 System.Windows.Forms.MessageBoxButtons.OK);
84 System.Windows.Forms.MessageBox.Show(
Helpers.
Gui.
MainWindow,
"If we were really executing, we would show something else.",
"Demo Execution of Plugin Task");
93 return $
"Just shows a message box with {GreetingsText}{(OkThisIsGoodbye ? ", then makes the schedule stop.
": "")}";
98 public event EventHandler<TraceWriteEventArgs>
TraceWrite;
106 Properties.LocalizeMockPlugin.Culture = newCulture;
109 public Func<StopRunArgs, Task>
StopRun {
get;
set; }
Classes and interfaces that are meant for plugins. The classes and interfaces below this namespace ar...
Example task implementations. Since there are lots of things that can be done from a task,...
IWin32Window MainWindow
If you need to set the owner window yourself or want to show message boxes.
Static instance for access to utility functions and resources.
static IGuiHelper Gui
Utility functions for window handling.
Implement this interface if you have messages for our run log.
Allows you to support runtime language switching just like Chronos does.
For future extension (categories, priorities...)
Writes some text to the trace log.
Implement this interface with your device or sample list worker to get fine-grained control about sto...
Options for stopping the schedule/queue.
StopMode
Details how to stop the run.
To be implemented by the "task" part of a Chronos plugin. Public properties of the implementing type ...
For tasks that try to do some special actions during schedule demo execution.
A task which does not need access to the custom device.
string GetTaskAction()
The result of this function will be shown in the timetable.
Func< StopRunArgs, Task > StopRun
Callback function returning a task that completes once the schedule queue was stopped.
void PreValidate()
Called before the schedule construction is completed.
bool OkThisIsGoodbye
See in .Execute - this is just a flag to tell us if we should stop the schedule.
EventHandler< TraceWriteEventArgs > TraceWrite
string GreetingsText
Parameter which can be edited in the method editor, with some predefined values.
void Execute()
Pretend we are doing some work by showing a message box.
void DemoExecute()
Will be called when the task is executed in demo mode.
void PostValidate()
Called after the schedule construction is completed.
Action< string > WriteToRunlog
void UICultureChanged(System.Globalization.CultureInfo newCulture)
Switch the resources with localized items to the newly selected culture.
Simple example how to provide a combobox with standard values for a property.
System.Collections.IEnumerator System.Collections.IEnumerable. GetEnumerator()
readonly string[] mDefGreetings