Chronos Plugins  5.2.0
This documentation covers the plugin interfaces definitions and an example implementation.
MockPlugin.Tasks.JobInspectionDemo Class Reference

Shows how to get information about other tasks in the schedule. More...

+ Inheritance diagram for MockPlugin.Tasks.JobInspectionDemo:
+ Collaboration diagram for MockPlugin.Tasks.JobInspectionDemo:

Properties

IInspectJob INeedToInspectOtherTasks. JobInspector [set]
 
JITCheckerDelegate JITChecker [set]
 
- Properties inherited from AxelSemrau.Chronos.Plugin.INeedToInspectOtherTasks
IInspectJob JobInspector [set]
 The JobInspector lets you see information about other tasks and their properties. More...
 
- Properties inherited from AxelSemrau.Chronos.Plugin.INeedToCheckForJITLinks
JITCheckerDelegate JITChecker [set]
 Chronos will provide a function that you can use to check for JIT expressions in properties. More...
 

Private Member Functions

void ITask. PreValidate ()
 Called before the schedule construction is completed. More...
 
void ITask. PostValidate ()
 Called after the schedule construction is completed. More...
 
string GetJitInfo (ITaskInfo someTaskInfo, IAccessProperty somePropInfo)
 
void ITask. Execute ()
 Do whatever you have to do with your parameters. More...
 
string ITask. GetTaskAction ()
 Description of the tasks's action (for hints/time table) More...
 

Private Attributes

IInspectJob mJobInspector
 
JITCheckerDelegate mJitChecker
 

Additional Inherited Members

Detailed Description

Shows how to get information about other tasks in the schedule.

Definition at line 12 of file MockJobInspectingTask.cs.

Member Function Documentation

◆ Execute()

void ITask. MockPlugin.Tasks.JobInspectionDemo.Execute ( )
private

Do whatever you have to do with your parameters.

Implements AxelSemrau.Chronos.Plugin.ITask.

Definition at line 38 of file MockJobInspectingTask.cs.

39  {
40  var sb = new StringBuilder();
41  var i = 1;
42  foreach (var someTaskInfo in mJobInspector.JobsTasks)
43  {
44  sb.AppendLine($"Task {i++}");
45  sb.AppendFormat("Class {0}, {1} properties\r\n",
46  someTaskInfo.Task.GetType().Name,
47  someTaskInfo.PropertyAccessInfos.Count());
48  foreach (var somePropInfo in someTaskInfo.PropertyAccessInfos)
49  {
50  sb.AppendFormat("Property {0}: {1}, jit? {2}\r\n",
51  somePropInfo.PropInfo.Name,
52  somePropInfo.PropInfo.GetValue(somePropInfo.BaseObject, null),
53  GetJitInfo(someTaskInfo,somePropInfo));
54  }
55  sb.AppendLine();
56  }
57  System.Windows.Forms.MessageBox.Show(Helpers.Gui.MainWindow, sb.ToString(), "Checked other tasks");
58  }
IWin32Window MainWindow
If you need to set the owner window yourself or want to show message boxes.
Definition: Helpers.cs:39
Static instance for access to utility functions and resources.
Definition: Helpers.cs:80
static IGuiHelper Gui
Utility functions for window handling
Definition: Helpers.cs:94
IEnumerable< ITaskInfo > JobsTasks
Enumerate the tasks in your task's job.
string GetJitInfo(ITaskInfo someTaskInfo, IAccessProperty somePropInfo)

References MockPlugin.Tasks.JobInspectionDemo.GetJitInfo(), AxelSemrau.Chronos.Plugin.Helpers.Gui, AxelSemrau.Chronos.Plugin.IInspectJob.JobsTasks, AxelSemrau.Chronos.Plugin.IGuiHelper.MainWindow, and MockPlugin.Tasks.JobInspectionDemo.mJobInspector.

◆ GetJitInfo()

string MockPlugin.Tasks.JobInspectionDemo.GetJitInfo ( ITaskInfo  someTaskInfo,
IAccessProperty  somePropInfo 
)
private

Definition at line 30 of file MockJobInspectingTask.cs.

31  {
32  if(mJitChecker == null)
33  {
34  return "N/A";
35  }
36  return mJitChecker(someTaskInfo.Task,somePropInfo.FullPath) ? "yes" : "no";
37  }
string FullPath
Full path, as must be given in property reference expressions.
object Task
Task object, Chronos internal type.

References AxelSemrau.Chronos.Plugin.IAccessProperty.FullPath, MockPlugin.Tasks.JobInspectionDemo.mJitChecker, and AxelSemrau.Chronos.Plugin.ITaskInfo.Task.

Referenced by MockPlugin.Tasks.JobInspectionDemo.Execute().

◆ GetTaskAction()

string ITask. MockPlugin.Tasks.JobInspectionDemo.GetTaskAction ( )
private

Description of the tasks's action (for hints/time table)

Implements AxelSemrau.Chronos.Plugin.ITask.

Definition at line 60 of file MockJobInspectingTask.cs.

61  {
62  return "Snooping around";
63  }

◆ PostValidate()

void ITask. MockPlugin.Tasks.JobInspectionDemo.PostValidate ( )
private

Called after the schedule construction is completed.

Implements AxelSemrau.Chronos.Plugin.ITask.

Definition at line 25 of file MockJobInspectingTask.cs.

26  {
27 
28  }

◆ PreValidate()

void ITask. MockPlugin.Tasks.JobInspectionDemo.PreValidate ( )
private

Called before the schedule construction is completed.

Implements AxelSemrau.Chronos.Plugin.ITask.

Definition at line 16 of file MockJobInspectingTask.cs.

17  {
18  if (mJitChecker != null)
19  {
20  System.Windows.Forms.MessageBox.Show(Helpers.Gui.MainWindow,
21  $"My enabled property {(mJitChecker(this, "Enabled") ? "will be set by a JIT expression" : "has an ordinary value")}", "JobInspectionDemo");
22  }
23  }

References AxelSemrau.Chronos.Plugin.Helpers.Gui, AxelSemrau.Chronos.Plugin.IGuiHelper.MainWindow, and MockPlugin.Tasks.JobInspectionDemo.mJitChecker.

Member Data Documentation

◆ mJitChecker

JITCheckerDelegate MockPlugin.Tasks.JobInspectionDemo.mJitChecker
private

◆ mJobInspector

IInspectJob MockPlugin.Tasks.JobInspectionDemo.mJobInspector
private

Definition at line 69 of file MockJobInspectingTask.cs.

Referenced by MockPlugin.Tasks.JobInspectionDemo.Execute().

Property Documentation

◆ JITChecker

JITCheckerDelegate MockPlugin.Tasks.JobInspectionDemo.JITChecker
set

Definition at line 80 of file MockJobInspectingTask.cs.

80 { set => mJitChecker = value; }

◆ JobInspector

IInspectJob INeedToInspectOtherTasks. MockPlugin.Tasks.JobInspectionDemo.JobInspector
setprivate

Definition at line 71 of file MockJobInspectingTask.cs.

72  {
73  set => mJobInspector = value;
74  }

The documentation for this class was generated from the following file: