Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ExpressionEditorSheet Class

Note: This class is new in the .NET Framework version 2.0.

Represents a design-time editor sheet for a custom expression. This class must be inherited.

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

public abstract class ExpressionEditorSheet
public abstract class ExpressionEditorSheet
public abstract class ExpressionEditorSheet

A custom expression editor sheet lets a developer set properties on a custom expression at design-time. Control property values can be set using expression strings; the expression strings are evaluated at run time by an expression builder and at design time by an expression editor.

When you browse the Expressions property for a control in the design-time properties grid, the visual designer displays a dialog box to set expressions that provide the value for a control property. You can select the expression type based on a list of expression prefixes. When you select an expression prefix from the list, the visual designer uses the associated ExpressionEditor and ExpressionEditorSheet objects to evaluate and convert the expression string based on the syntax for that type of expression. The visual designer uses expression editor sheet properties to prompt for one or more strings that combine into the custom expression string.

Typically, to supply a new expression type at design time, you define a unique expression prefix and provide custom ExpressionBuilder and ExpressionEditor implementations. Optionally, you can provide a custom ExpressionEditorSheet implementation that defines properties that are used to form the expression. To associate an expression prefix with an expression builder and an expression editor, apply the ExpressionEditorAttribute attribute and an ExpressionPrefixAttribute attribute to the custom ExpressionBuilder class, and then configure the expression prefix for an expression builder in the expressionBuilders element in the Web configuration file.

The default implementation of the GetExpressionEditorSheet method returns a basic editor sheet, which uses a single input string to form the expression. Custom expression editors that are derived from the ExpressionEditor can override the GetExpressionEditorSheet method to return a custom editor sheet implementation. Typically, a custom editor sheet contains multiple properties that are used to build the expression string. The GetExpression method returns the resulting expression string based on the current expression properties.

For example, the ResourceExpressionEditor class derives from the ExpressionEditor class and provides an implementation for evaluating and associating a resource string reference with a control property at design time. The ResourceExpressionBuilder class is associated with the expression prefix Resources and the ResourceExpressionEditor implementation. The GetExpressionEditorSheet method returns a ResourceExpressionEditorSheet, which defines the individual properties that form a resource reference expression.

When you inherit from the ExpressionEditorSheet class, you must override the following members:

  • The GetExpressionEditorSheet method to return a custom editor sheet implementation.

  • The ExpressionEditorSheet constructor to implement custom initialization actions for your expression editor sheet implementation.

Notes to Inheritors Derive a custom expression editor sheet from the ExpressionEditorSheet class, if you are defining a new expression type for control property values and you want to build the expression string based on multiple expression property values. A derived class implementation should contain the following:

  • A public property for each distinct value in the expression string that can be set at design time.

  • An implementation of the GetExpression method that forms the custom expression string from the editor sheet property values.

  • Optionally, a constructor implementation that sets the initial values of the editor sheet properties.

The associated custom expression editor class creates an instance of the derived editor sheet in the GetExpressionEditorSheet method, initializes that instance with the current expression string set for the control property, and returns the instance to the visual designer. The visual designer allows you to set the expression sheet properties, and then calls the GetExpression method to form the expression string from the input expression sheet property values.
System.Object
  System.Web.UI.Design.ExpressionEditorSheet
     System.Web.UI.Design.ResourceExpressionEditorSheet
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.