At the beginning
This document explains how to implement CookerGX's dynamic embedded class by adding the definition to the sample code.
First, let's see the Rtemplate.cs in the sample archive.
As shown in the image above, Rtemplate.cs will be divided into five parts and explained on an individual page.
In addition, we will use one page for the RtemplateEmbedder.cs and a total of six pages will explain the dynamic embedded class implementation.
The C # source code used in this document has been organized into an archive file. The download link is on the index page.
The downloaded archive file is a 7z self-extracting format. That is, this archive file is an executable file with an .exe extension.
Please execute the downloaded file in a suitable directory. Necessary files are extracted in that directory.
This document assumes that you use C# language on Microsoft Visual Studio Community 2019.
How to make a project
We need to create a project in order to build C# source files distributed as an archive file on Visual Studio.
It starts Visual Studio and select "Create a new project" to create a project. The type of project to create is as follows
Next, enter a name for the project, etc. Please enter the following.
|Framework||.NET Framework 4.6|
A new project is created.
We need to set a reference to Rice to the project. Please install the latest Rice for x86 from NuGet.
The target platform of the project needs to be x86.
Here, the target platform is set by the above method, but there are other setting methods. Please set in the appropriate way.
The .dll file for dynamic embedded class must have a name according to the following rules.
The name of the .dll file can specify by setting the assembly name. Here, please specify "Rtype.template". The name will be "Rtype.template.dll".
Add source file
Please load source files - Rtemplate.cs and RtemplateEmbedder.cs - into the project.
Here, the source files is loaded by the above method, but there are other loading methods. Please load in the appropriate way.
If there is a Class1.cs file in the project, please delete it.
In this page, we created a project and loaded source files. A dynamic embedded class will create by building this project.
The next page details the first part of Rtemplate.cs that divided into five parts.