Here is a sample for calling external .net functions from DataMapper 2008.
using System;
using System.Collections.Generic;
using System.Text;
using Astera.Core; // Add Astera.Core.Dll to your project references. This dll is in the DataMapper installation folder.
namespace CustomRuleFunctionSample
{
/// <summary>
/// This class represents a sample for defining custom rules expression functions.
/// All classes containing rule functions must have attribute RuleFunctionClass.
/// All functions must be declared public static and must have Function attribute.
/// Other attributes are optional. However, it is recommended that you provide
/// description of parameters and the category attribute. This information is
/// displayed as tooltips in the rule expression editor and expression builder.
/// A class may contain multiple custom functions.
///
/// Once compiled, the dlls must be dropped in PlugIn folder under the program
/// files\Astera Software\Product Name folder. Create the folder if it is not there already. The folder must be named "PlugIn".
//These DLLs are automatically picked up at the application startup and the functions will show in rule function lists
/// and intellisense dropdowns.
/// </summary>
RuleFunctionClass
public class CustomFunctionSample
{
public static string Concatenate(string str1, string str2)
{
return string.Format("{0}{1}", str1, str2);
}
}
}