Sometimes there’s a need to inject some C++ code into your translated C# code. If translating your code just once, you can do this after translation completes. However, if you are setting up a pipeline for translating some code continuously (e. g. to translate each version of your product), it is easier to let translator do this job.
There are several features providing this behavior.
Placing ‘CppSkipDefinition’ attribute at some method will remove this method’s definition (but not declaration) from translated code. After doing this, you can either provide an alternative definition using ‘implementation’ codification file node, or simply include a *.cpp file containing one directly into your project - when translating is done, this file will be copied into output project unchanged.
Code line injection
Alternatively, you may use a specially formatted comments in your C# code to add small portions of C++ code into your translated code. The example is below.