CodeDomSerializerBase.SerializeToResourceExpression Method (IDesignerSerializationManager, Object)
Serializes the given object into an expression.
Assembly: System.Design (in System.Design.dll)
protected CodeExpression SerializeToResourceExpression( IDesignerSerializationManager manager, Object value )
- Type: System.ComponentModel.Design.Serialization.IDesignerSerializationManager
The IDesignerSerializationManager to use for serialization.
- Type: System.Object
The object to serialize.
The SerializeToResourceExpression method is a helper method that serializes a value to a resource expression. This is in contrast to the SerializeResource method, which writes a value to a resource binary object. SerializeToResourceExpression goes one step further and returns an expression that can be used to recover the resource. For example, the return value might be "rm.GetValue("SomeBitmap");". The name of the resource is calculated from the ExpressionContext, if one can be found on the context stack.
CodeStatementCollection—a collection of statements to add a resource manager to, if one needs to be declared.
RootContext—the root expression, which is needed to create a resource manager.
ExpressionContext—used to fabricate a name for the resource and to decide what type of resource manager call to make.
- 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 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.