5. Compilation. Modules and assembly handling
PL.NET supports studies written on 2 programming languages, C# and VB.NET. It is well known that the .NET Framework contains the compilers for both of these languages. But it is also known that it is impossible to compile source codes written on two different languages into a single assembly. That’s why all C# studies should be compiled into a single .netmodule, and all VB.NET studies should be compiled into a separate .netmodule, only then can these two netmodules be linked into a single assembly.
Below are some advantages that can be gained with the implementation described above:
- It is possible to organize data transfer between several separate studies within a single MultiCharts .NET process by using static fields.
- It is possible to create source code storage with common types. To do that:
- Create a new function with any name.
- Delete the WHOLE code (this function will always be colored in red (not compiled), but it will be required for code storage only)
- Fill this function with any info that can be necessary common classes including basic classes of indicators, signals, methods, etc.
- This common code can be used further in any other signals and indicators
When the compilation of a study is initialized, either after pressing the “Compile” button or because of changes to a study, it will check to see if this study is already applied to a chart or a scanner window. If it is already being used, after compilation has been completed successfully, MultiCharts .NET will be informed that these exemplars should be re-created from a new assembly, re-initialize their inputs with the values set by user, and recalculate.