ExpressionEditorSheet.GetExpression Method

Definition

When overridden in a derived class, returns the expression string that is formed by the expression editor sheet property values.

public:
 abstract System::String ^ GetExpression();
public abstract string GetExpression ();
abstract member GetExpression : unit -> string
Public MustOverride Function GetExpression () As String

Returns

The custom expression string for the current property values.

Remarks

A custom expression editor sheet contains design-time settings for multiple expression properties, which are combined to form an expression string. Control property values can be set using expression strings; the expression strings are evaluated at run time by an expression builder.

The GetExpression method returns an expression string that is built from the current expression properties. The visual designer allows you to set the expression sheet properties, and then calls the GetExpression method to get the expression string and set the control property value.

Notes to Implementers

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(String, IServiceProvider) method, initializes that instance with the current expression string set for the control property, and then 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.

Applies to

See also