Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

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.v19.1.Core.dll

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 illustrates the use of the ICustomFunctionDescriptionsRegisterService service for the SPHEREMASS custom function defined in the WinForms SpreadsheetControl API - Part 2 example available in the DevExpress Code Examples database at http://www.devexpress.com/example=E4832.

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