Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
compcode [2011/01/05 14:43] – minor spelling fixes hourdin | compcode [2011/01/05 15:33] – update again hourdin | ||
---|---|---|---|
Line 12: | Line 12: | ||
[Bean] | [Bean] | ||
- | public class Your_CSharpBean_Name { | + | public class Your_CSharpBean_Name |
+ | private Thread t; // Private attributes of the class | ||
+ | private volatile bool run; | ||
+ | private volatile int eventValue; | ||
public Your_CSharpBean_Name() { | public Your_CSharpBean_Name() { | ||
// Put here your init instructions | // Put here your init instructions | ||
- | | + | |
- | // every second. | + | run = false; |
- | | + | eventValue = 10; |
} | } | ||
+ | |||
+ | public void Start() { // method starting the thread | ||
+ | if (!run) { | ||
+ | run = true; | ||
+ | t.Start(); | ||
+ | } | ||
+ | } | ||
+ | public void Stop() { // since version 2.4.0.856, | ||
+ | run = false; | ||
+ | } | ||
// Loop sample | // Loop sample | ||
| | ||
- | | + | |
| | ||
- | | ||
// Check if the output is connected | // Check if the output is connected | ||
| | ||
// call the connected methods sequentially | // call the connected methods sequentially | ||
- | result = Output_Sample(123); | + | |
// and so on... | // and so on... | ||
} | } | ||
Line 35: | Line 47: | ||
// --- Start: Input port sample --- | // --- Start: Input port sample --- | ||
- | // an input port is a method (below) | + | // an input port is a public |
- | public | + | public |
- | | + | |
- | | + | |
+ | // results are given using events | ||
} | } | ||
// --- End: Input port sample --- | // --- End: Input port sample --- | ||
// --- Start: Output port sample --- | // --- Start: Output port sample --- | ||
- | public delegate | + | public delegate |
- | // This is the signature of the output method | + | // The delegate defines |
public event Output_Sample_Signature Output_Sample; | public event Output_Sample_Signature Output_Sample; | ||
// The output port is the event, named here Output_Sample | // The output port is the event, named here Output_Sample |