Creating custom functions
Custom functions are used to extend the Built-in functions.
Both VB.NET and C# are supported as .NET languages for defining custom functions.
Build CustomFunctions.dll and save this dll in Extensions\Release\Custom functions\ of the Bin\Core or Bin\Framework folder
Hello World example
VB.NET
//Hello world custom function Imports System.Xml Partial Public NotInheritable Class VSDllExtendedFunctions Public Property Info As XElement = <CustomFunctions> <CustomFunction> <Category>Misc</Category> <Name>HelloWorld</Name> <Library>Custom</Library> <Parameters>None</Parameters> <Returns>String</Returns> <Description>Test string</Description> <Example>HelloWorld()</Example> <Url></Url> </CustomFunction> </CustomFunctions> Public Shared Function HelloWorld() As String Return "Hello world" End Function End Class |
C#
//Hello world custom function using System.Xml.Linq; namespace CustomFunctionsCSharp { public sealed partial class VSDllExtendedFunctions { public XElement Info { get; set; } = XElement.Parse($@"<CustomFunctions> <CustomFunction> <Category>{"Misc"}</Category> <Name>{"HelloWorld"}</Name> <Library>{"Custom"}</Library> <Parameters>{"None"}</Parameters> <Returns>{"String"}</Returns> <Description>{"Test string"}</Description> <Example>{"HelloWorld()"}</Example> <Url></Url> </CustomFunction> </CustomFunctions>"); public static string HelloWorld() { return "Hello world"; } } } |