4. Test Connectivity To CodeStencil

Now that we have our Boilerplate Solution, we need to test and confirm that CodeStencil is able to load our nanite before we start any coding.


Step 1: Update Output Property

We need to update the property - Output with a string, e.g. "*** This string confirms we can connect***" and uncomment the code.



using System.Collections.Generic;
using System.ComponentModel.Composition;
using ZeraSystems.CodeStencil.Contracts;

namespace DolaSoft.CodeNanites
    public partial class FolderListing
        private void MainFunction()
            //Uncomment to test that the Code nanite works
            //MessageBox.Show("It works!");
            Output = "*** This string confirms we can connect***";


See the article on Properties to understand more about the properties we can use to communicate with CodeStencil.


Step 2: Build the application

Press F6 to build the application.

Navigate to the ..\build folder. You should find the DLL - DolaSoft.CodeNanites.dll already created.


Step 3: Copy the DLL

Copy the DLL to the CodeStencil's Code Nanite folder. This is usually in: c:\documents\codestencil\codenanites depending on where your Documents' folder is located. See "Code Nanites" for more information on this.


Step 4: Load CodeStencil

Once we load CodeStencil, we can verify that the DLL has been loaded, from the "About" form.  To load this form, go To  Windows | About.


Step 5: Test on a new project

We will now add our newly created Code Nanite to a new project that creates a text file.


Step 6: Drag/Drop or Copy to Code Editor

Drag (or copy) the new Code Nanite - LIST_OF_FILES from the Code Nanites panel to the Code Editor (use the node - test.txt):

Lets do a Copy. Note we are copyng the "LIST_OF_FILES" Code Nanite, grouped under this namespace -  "DolaSoft.CodeNanites.FileUtilities":

And paste (CTRL+V) into the Code Editor:


Step 7: Generate code

Generate the code and at the same time open a copy of the generated file.

After the code is generated, another tab is opened for the generated file showing the test string we added to the Code Nanite.


Step 8: Open generated file

Use the "Locate File/Folder" context menu to locate the generated file:


Use Notepad to view the contents

Having established a working connection between our Code Nanite and Code Stencil, we can now proceed to code our File Listing functions.



About CodeStencil

CodeStencil is Published and Marketed by Zera Systems Inc.

© 2018-2019 CodeStencil - Zera Systems Inc. All Rights Reserved.

No