Skip to main content

ICustomFunctionDescriptionsRegisterService.RegisterFunctionDescriptions(String, String, CustomFunctionArgumentsDescriptionsCollection) Method

Specifies text descriptions for use in the Function Argument dialog invoked for the specified custom function.

Namespace: DevExpress.Spreadsheet.Functions

Assembly: DevExpress.Spreadsheet.v23.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

void RegisterFunctionDescriptions(
    string functionName,
    string functionDescription,
    CustomFunctionArgumentsDescriptionsCollection argumentsDescriptions
)

Parameters

Name Type Description
functionName String

A string that is the name of a custom function for which descriptions are specified. The function name is defined by the IFunction.Name property.

functionDescription String

A string that describes the custom function itself.

argumentsDescriptions CustomFunctionArgumentsDescriptionsCollection

A collection of descriptions for the function arguments.

Example

This example shows how to use ICustomFunctionDescriptionsRegisterService for the SPHEREMASS custom function defined in the following example: Spreadsheet Document API Examples.

ICustomFunctionDescriptionsRegisterService

SphereMassFunction customFunction = new SphereMassFunction();
if (!workbook.CustomFunctions.Contains(customFunction.Name))
{
    workbook.CustomFunctions.Add(customFunction);
    // Get a service to specify the function description.
    ICustomFunctionDescriptionsRegisterService service = (ICustomFunctionDescriptionsRegisterService)workbook.GetService(typeof(ICustomFunctionDescriptionsRegisterService));
    if (service == null)
        return;
    CustomFunctionArgumentsDescriptionsCollection arguments = new CustomFunctionArgumentsDescriptionsCollection();
    arguments.Add(new CustomFunctionArgumentDescription("Radius", "Radius of a sphere, m", "number")); 
    arguments.Add(new CustomFunctionArgumentDescription("Density", "Material density, kg/m3", "number"));
    service.RegisterFunctionDescriptions("SPHEREMASS", "Calculates the mass of a sphere made of a certain material.", arguments);
}
See Also