Navigation: CodeStencil > Code Nanites > Creating Code nanites > Code Stucture > Main Class |
This class is the entry point for your Code Nanite.
GetPrimaryKey.Functions.cs:
using System.Collections.Generic;
using System.ComponentModel.Composition;
using ZeraSystems.CodeStencil.Contracts;
namespace ZeraSystems.CodeNanite.Schema
{
[Export(typeof(ICodeStencilCodeNanite))]
[CodeStencilCodeNanite(new[]
{
"Zera Systems Inc.", // 0
"Returns the Primaty Key of passed table", // 1
"..", // 2
"1.0", // 3
"GetPrimaryKey", // 4
"ZeraSystems.CodeNanite.Schema", // 5
"10/10/2018", // 6
"CS_PRIMARY_KEY", // 7
"1", // 8
"", // 9
"https://www.regularlabs.com/extensions/modals/features" // 10
})]
public partial class GetPrimaryKey : ExpansionBase, ICodeStencilCodeNanite
{
public string Input { get; set; }
public string Output { get; set; }
public int Counter { get; set; }
public List<string> OutputList { get; set; }
public List<ISchemaItem> SchemaItem { get; set; }
public List<IExpander> Expander { get; set; }
public List<string> InputList { get ; set; }
public void ExecutePlugin()
{
Initializer(SchemaItem, Expander);
MainFunction();
}
}
}
You have the option of specifying the meta data of the class via attributes. The are 11 positions defined.
Position |
Name |
Description |
0 |
Publisher |
This is the name of the publisher |
1 |
Title |
This contains more detailed information on the Code Nanite |
2 |
Description |
This is the description of the Code Nanite |
3 |
Version Number |
This is the version Number |
4 |
Label |
Label of the Code Nanite. That is also the Class name |
5 |
Namespace |
This is the namespace of the code nanite |
6 |
Release Date |
This is the release date (MM/DD/YYY) |
7 |
Expander Label |
Name to use for Expander Label |
8 |
|
Indicates that the Nanite is Schema Dependent |
9 |
RESERVED |
|
10 |
Help File URL |
This is the link to the Online help |
These properties pass and receive data between CodeStencil and your Code Nanite:
Input - This is a string passed from CodeStencil.
Output - This is the string you send back to CodeStencil.
SchemaItem - Provides access to Tables and Columns defined in Global Schema.
Counter - You can use this to increment a counter as the Code Nanite revolves back and forth between Code Stencil.
OutputList - You can send a list of strings back to CodeStencil with this property.
Expander - You can receive and update the Expanders from CodeStencil with this property.