31{
32 var prevTask = mJobInspector.CompleteSchedule
33 .TakeWhile(someTaskInfo => someTaskInfo.PluginTask != mJobInspector.CurrentTask.PluginTask).LastOrDefault();
34 if (prevTask?.PluginTask is JobInspectionDemo)
35 {
36 prevTask.Enabled = false;
37 }
38 }
39
41 {
42 DisablePreviousTwin();
43 }
44
46 {
47 if(mJitChecker == null)
48 {
49 return "N/A";
50 }
51 return mJitChecker(someTaskInfo.
Task,somePropInfo.
FullPath) ?
"yes" :
"no";
52 }
54 {
55 var sb = new StringBuilder();
56 var i = 1;
57 foreach (var someTaskInfo in mJobInspector.JobsTasks)
58 {
59 sb.AppendLine($"Task {i++}");
60 sb.AppendFormat("Class {0}, {1} properties\r\n",
61 someTaskInfo.Task.GetType().Name,
62 someTaskInfo.PropertyAccessInfos.Count());
63 foreach (var somePropInfo in someTaskInfo.PropertyAccessInfos)
64 {
65 sb.AppendFormat("Property {0}: {1}, jit? {2}\r\n",
66 somePropInfo.PropInfo.Name,
67 somePropInfo.PropInfo.GetValue(somePropInfo.BaseObject, null),
68 GetJitInfo(someTaskInfo,somePropInfo));
69 }
70 sb.AppendLine();
71 }
72 System.Windows.Forms.MessageBox.Show(
Helpers.
Gui.
MainWindow, sb.ToString(),
"Checked other tasks");
73 }
74
76 {
77 return "Snooping around";
78 }
79
80 #endregion Normal task methods
81
82 #region Job inspection
83
85
87 {
88 set => mJobInspector = value;
89 }
90
91 #endregion Job inspection
92 #region JIT Check
93
96 #endregion
97
98
99 }
100}
delegate bool JITCheckerDelegate(object task, string propertyPath)
The delegate that does the check for you.
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.
To be implemented by the "task" part of a Chronos plugin. Public properties of the implementing type ...
void Execute()
Do whatever you have to do with your parameters.
void PostValidate()
Called after the schedule construction is completed.
string GetTaskAction()
Description of the tasks's action (for hints/time table)
Gives full access to other tasks's properties.
string FullPath
Full path, as must be given in property reference expressions.
Gives access to a task's implementation and to all user visible properties.
object Task
Task object, Chronos internal type.
Allows to get information about other tasks within our task's job and about other jobs.