ExpressionEditor.GetExpressionEditor Method (Type, IServiceProvider)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns an ExpressionEditor implementation that is associated with the specified expression builder type.

Namespace:   System.Web.UI.Design
Assembly:  System.Design (in System.Design.dll)

public static ExpressionEditor GetExpressionEditor(
	Type expressionBuilderType,
	IServiceProvider serviceProvider
)

Parameters

expressionBuilderType
Type: System.Type

The type of the derived expression builder class, used to locate the associated expression editor.

serviceProvider
Type: System.IServiceProvider

A service provider implementation supplied by the designer host, used to obtain additional design-time services.

Return Value

Type: System.Web.UI.Design.ExpressionEditor

An ExpressionEditor implementation associated with expressionBuilderType; otherwise, null, if expressionBuilderType cannot be located or has no associated ExpressionEditor.

Exception Condition
ArgumentNullException

expressionBuilderType is null.

- or -

serviceProvider is null.

Use the static GetExpressionEditor overloads to find the ExpressionEditor object that is associated with a particular expression prefix or expression builder type.

For each custom expression type, an expression prefix identifies the associated expression builder and expression editor. When custom expressions are parsed in a page, the expression prefix is used to create instances of the associated ExpressionBuilder and ExpressionEditor classes.

To associate an expression prefix with an expression builder and expression editor, apply the ExpressionEditorAttribute and ExpressionPrefixAttribute attributes to the custom ExpressionBuilder class and configure the expression prefix for an expression builder in the expressionBuilders element in the Web configuration file.

The GetExpressionEditor method enumerates the available ExpressionBuilder implementations to locate expressionBuilderType. The ExpressionBuilder implementations can be configured in the expressionBuilders section of the Web configuration file. If expressionBuilderType is found in the set of available ExpressionBuilder implementations, the GetExpressionEditor method returns the type that is specified in the ExpressionEditorAttribute attribute of the ExpressionBuilder metadata.

.NET Framework
Available since 2.0
Return to top
Show: