Bewerken

Delen via


ExpressionEditor.GetExpressionEditor Method

Definition

Returns an ExpressionEditor implementation that is associated with an expression prefix or expression builder.

Overloads

GetExpressionEditor(String, IServiceProvider)

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

GetExpressionEditor(Type, IServiceProvider)

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

GetExpressionEditor(String, IServiceProvider)

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

public:
 static System::Web::UI::Design::ExpressionEditor ^ GetExpressionEditor(System::String ^ expressionPrefix, IServiceProvider ^ serviceProvider);
public static System.Web.UI.Design.ExpressionEditor GetExpressionEditor (string expressionPrefix, IServiceProvider serviceProvider);
static member GetExpressionEditor : string * IServiceProvider -> System.Web.UI.Design.ExpressionEditor
Public Shared Function GetExpressionEditor (expressionPrefix As String, serviceProvider As IServiceProvider) As ExpressionEditor

Parameters

expressionPrefix
String

The expression prefix used to find the associated expression editor.

serviceProvider
IServiceProvider

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

Returns

An ExpressionEditor implementation associated with expressionPrefix; otherwise, null, if expressionPrefix is not defined or is not associated with an ExpressionEditor.

Exceptions

serviceProvider is null.

Remarks

Use the static GetExpressionEditor method 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.

To find the associated expression editor for an expression prefix, the GetExpressionEditor method enumerates the available ExpressionBuilder implementations for a matching prefix. The ExpressionBuilder implementations can be configured in the expressionBuilders section of the Web configuration file. If an available ExpressionBuilder implementation defines the expression prefix, the GetExpressionEditor method returns the type that is specified in the ExpressionEditorAttribute attribute of the ExpressionBuilder metadata.

See also

Applies to

GetExpressionEditor(Type, IServiceProvider)

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

public:
 static System::Web::UI::Design::ExpressionEditor ^ GetExpressionEditor(Type ^ expressionBuilderType, IServiceProvider ^ serviceProvider);
public static System.Web.UI.Design.ExpressionEditor GetExpressionEditor (Type expressionBuilderType, IServiceProvider serviceProvider);
static member GetExpressionEditor : Type * IServiceProvider -> System.Web.UI.Design.ExpressionEditor
Public Shared Function GetExpressionEditor (expressionBuilderType As Type, serviceProvider As IServiceProvider) As ExpressionEditor

Parameters

expressionBuilderType
Type

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

serviceProvider
IServiceProvider

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

Returns

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

Exceptions

expressionBuilderType is null.

-or-

serviceProvider is null.

Remarks

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.

See also

Applies to