ExpressionContext Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a means of passing context state among serializers. This class cannot be inherited.
public ref class ExpressionContext sealed
public sealed class ExpressionContext
type ExpressionContext = class
Public NotInheritable Class ExpressionContext
- Inheritance
-
ExpressionContext
An ExpressionContext is placed on the context stack and contains the most relevant expression during serialization. The following C# code demonstrates an assignment.
button1.Text = "Hello";
During serialization, several serializers are responsible for creating this single statement. One of those serializers is responsible for creating "Hello". There are times when that serializer may need to know the context in which it is creating its expression. In the previous example, this context is not needed. The following C# code shows a situation in which knowledge of the context is necessary.
button1.Text = rm.GetString("button1_Text");
In this case, the serializer responsible for creating the resource expression needs to be informed of the names of the target objects. The ExpressionContext class can be used for this. As each serializer creates an expression and invokes a serializer to handle a smaller part of the statement as a whole, the serializer pushes an expression context on the context stack. Each expression context has a parent property that locates the next expression context on the stack. This provides a convenient traversal capability.
Expression |
Initializes a new instance of the ExpressionContext class with a current value. |
Expression |
Initializes a new instance of the ExpressionContext class with the given expression and owner. |
Expression |
Gets the expression this context represents. |
Expression |
Gets the Type of the expression. |
Owner |
Gets the object owning this expression. |
Preset |
Gets the preset value of an expression. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
To |
Returns a string that represents the current object. (Inherited from Object) |
Product | Versies |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET-feedback
.NET is een open source project. Selecteer een koppeling om feedback te geven: