These files can be used to create a WindwardCustomFunctions.dll file containing your own custom functions, to be used with the Windward .NET engine and AutoTag, version 10.0.0.0 or newer.
- Do not change the version of the DLL created using this code.
- To use, replace the assembly of the same name where you installed the .NET engine or AutoTag.
- Windward Reports .NET Engine
- Available from the Windward downloads page.
Please note - we are currently in the process of updating all video content.
Creating Custom Functions
1. Open Catapult. (Found under Start -> All Programs -> Windward Studios -> Windward .NET Engine -> .Catapult - Windward .NET Engine demos)
2. In the Catapult menu, select C# from the list of programming languages.
Under C# demos, select Specialized.
Scroll to the right and click Custom Functions. (This will open the Project file in Visual Studio.)
3. In the file WindwardCustomFunctions.cs, you can write your own custom functions to be used with the .NET Engine or AutoTag. To view the functions in AutoTag, continue at step 4. Otherwise skip to step 8.
4.Open Microsoft Word.
In the AutoTag tab, open the tag builder.
Under the select tab, click equation.
In the drop-down menu click Custom to view the available custom functions.
Return to the Visual Studio Project File.
In the following steps, we will add a function LOG() that returns the log of the inputted parameter.
- Paste the following code at the end of the class:
[FunctionDescription("Returns the log of the inputted parameter")]
public static double LOG([ParameterDescription("Take the log (base 10) of this inputted number")] double num)
//Note the use of [ParameterDescription(string)] which allows for custom tip information in AutoTag.
return System.Math.Log10(num); //Returns the logarithm of the parameter.
- Verify that the indentation is correct; the resulting code should look like this:
- Click Build, Rebuild Solution. (The build will output a file called WindwardCustomFunctions.dll)
- Right click the project and click Open Folder in File Explorer.
- In the source folder, open to bin, Debug. If your configuration was set to Release, open the Release folder. Your new .dll file is in this folder.
Installing WindwardCustomFunctions.dll for use with the .NET Engine and AutoTag
Installing these functions depends on your .NET Engine installation options. If you chose to install your .dll files in the Global Assembly Cache (GAC) – an option in the installer – you must register the new file in the Global Assembly Cache. If you did not chose this option, you must copy the files over to the .NET Engine and AutoTag install directories. Choose the option that applies to you below, and follow those instructions.
In the .NET Engine Installation, .dll files were copied to the GAC.
- Open a Visual Studio Command Prompt. (Found under Start -> All Programs -> Visual Studio -> Visual Studio Tools -> Visual Studio Command Prompt)
- Type “cd\” to navigate to the C: Directory.
- To navigate to the folder where your WindwardCustomFunctions.dll file is located type:
- “cd C:\Users\%USERNAME%\Documents\Windward DotNet Engine Samples\CS\Specialized\CustomFunctions\WindwardCustomFunctions\bin\Debug\”
- To add your new WindwardCustomFunctions.dll file to the GAC type :
- “gacutil /i WindwardCustomFunctions.dll”
In the .NET Engine Installation, .dll files were NOT copied to the GAC.
- Navigate to the folder containing your new WindwardCustomFunctions.dll file.
- Copy the file WindwardCustomFunctions.dll.
- Navigate to the install directory of the .NET Engine.
- Open the folder dll.
- Delete the current WindwardCustomFunctions.dll file.
- Paste your new file in its place.
- If you also have AutoTag installed, navigate to the AutoTag Directory, delete the WindwardCustomFunctions.dll file, and paste your new file in its place.
Testing the Installation in AutoTag
- Close all open windows of Microsoft Office.
- Open Microsoft Word.
- Click the AutoTag tab.
- Open the Tag Builder.
- Under the select tab click Equation.
- Choose Custom from the drop-down menu. You should see the new function LOG() in place.