ExpressionEditor::GetExpressionEditorSheet Method
Returns an expression editor sheet that is associated with the current expression editor.
Assembly: System.Design (in System.Design.dll)
public: virtual ExpressionEditorSheet^ GetExpressionEditorSheet( String^ expression, IServiceProvider^ serviceProvider )
Parameters
- expression
- Type: System::String
The expression string set for a control property, used to initialize the expression editor sheet.
- 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::ExpressionEditorSheetAn ExpressionEditorSheet that defines the custom expression properties.
The GetExpressionEditorSheet method returns an ExpressionEditorSheet implementation that defines the strings that are combined to form a custom expression. The visual designer uses an expression editor sheet to prompt for one or more strings that combine into a custom expression. The base class method returns a default expression editor sheet, which uses a single input string to form the expression. The expression editor sheet defines the property grid for the expression. Therefore, the properties that the expression editor exposes become properties that can be defined for the expression in the dialog box.
Classes deriving from the ExpressionEditor class optionally can override the GetExpressionEditorSheet method to provide a custom expression editor sheet. A custom expression editor sheet can allow design-time input for multiple properties, which are combined together to form the expression string.
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 ResourceExpressionEditor::GetExpressionEditorSheet method returns a ResourceExpressionEditorSheet, which defines the individual properties that form a resource reference expression.
Notes to InheritorsTypically, 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. Even though the configuration file defines the prefix, you should also apply an ExpressionPrefixAttribute object and an ExpressionEditorAttribute object.
Override the GetExpressionEditorSheet method to return an expression editor sheet that defines design-time input for multiple properties in a custom expression. When you select a control property and the expression editor type, the visual designer calls the GetExpressionEditorSheet method, and then supplies the current expression string that is set for the control property. Use expression to set the initial values for the expression properties. Use serviceProvider to initialize a custom expression sheet constructor and to access services that are provided by the designer host. For example, call the GetService method with the IWebApplication type to access project items, documents, or configuration file details that are provided through the visual designer.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.