System.Design
2.0.0.0
System.Object
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
The class is used as a shared base between the and classes. Public classes derive from the class. Each public class defines its own public API. The class defines no public API, but does offer a multitude of utility methods that can be used to aid the serialization process.
Provides a base class for classes.
Method
2.0.0.0
System.Object
This is a helper method that derived classes can call to deserialize an expression. It deserializes the statement by interpreting and executing the CodeDOM expression specified by the parameter, and then returns the results. If an object needs to be created as a result of this expression, it will be given the name specified by the parameter. The name can be null if there is no need to name the object. The following table describes how specific expressions are handled.
-
Expression
Behavior
-
This expression represents this or Me. To locate the object that is associated with this expression, the method will look in the context stack for a . This object contains the root object of the graph and the expression that represents it. If the object is present and the expression matches, the root object will be returned. An error is reported if an instance cannot be located.
-
If the target of the field reference evaluates to the root object, the method of the manager parameter will be used to retrieve the object instance based on name. Otherwise, standard reflection is used against the target object to locate the requested field. An error is reported if the field cannot be located.
-
The method of the parameter is used to locate the instance representing the given variable name. An error is reported if an instance cannot be located.
continues to interpret expressions until they are completely resolved to an object, or until it can no longer simplify the expression. In this case, will return a that contains the most simplified expression. The following expressions are not supported:
-
-
-
Deserializes the given expression into an in-memory object.
An object resulting from interpretation of .
The to use for serialization.
The name of the object that results from the expression. Can be null if there is no need to name the object.
The to interpret.
Method
2.0.0.0
System.Object
The method is invoked during deserialization to obtain an instance of an object. When this is called, an instance of the requested type should be returned. The default implementation invokes the method of the parameter.
Returns an instance of the given type.
An instance of .
The to use for serialization.
The of the instance to return.
The parameters to pass to the constructor for .
The name of the deserialized object.
true to add this object to the design container; otherwise, false. The object must implement for this to have any effect.
Method
2.0.0.0
System.Void
The method is a helper method that derived classes can call. It looks for properties on the given object and attempts to load their values out of the invariant culture’s resource bundle. This is generally used to handle design-time properties that are not emitted into source code. It should not be used for localized properties because it only operates on the invariant culture.
This method inspects all of the properties of the parameter that match the attributes specified by the parameter, and then checks for those properties in a resource binary object. This is useful for deserializing properties that cannot be represented in code, such as design-time properties.
This method requires that a designer loader offers an to read resources. If the provides a for the invariant culture, then will read resources from the XML resource (.resx) file’s metadata section, which is not included in final compiled code. If this service is not available, no resources will be read.
Deserializes properties on the given object from the invariant culture’s resource bundle.
The to use for serialization.
The object from which the properties are to be deserialized.
An array that filters which properties will be deserialized.
Method
2.0.0.0
System.Void
The method is a helper method that derived classes can call. It interprets the parameter.
The being deserialized will be pushed on the context stack.
Deserializes a statement by interpreting and executing a CodeDOM statement.
The to use for serialization.
The to deserialize.
Method
2.0.0.0
System.CodeDom.CodeExpression
To be added.
The method returns an expression representing the given object. It can return null, indicating that no expression has been set that describes the object. Expressions are acquired in one of three ways:
-
The expression could be the result of a prior call to the method.
-
The expression could have been found in the .
-
The expression could be derived through .
To derive expressions through , the method queries the reference service for a name for the given object. If the expression service returns a valid name, , the method checks to see if there is a "." in the name. This indicates that the expression service found this object as the return value of a read-only property on another object. If there is a ".", will split the reference into parts. The leftmost part is a name that will be evaluated with the method. For each subsequent part, a property reference expression will be built. The final expression will then be returned.
If the object did not have an expression set, or if the object was not found in the reference service, will return null, indicating there is no existing expression for the object.
Returns an expression for the given object.
A representing v, or null if there is no existing expression for v.
The to use for serialization.
Method
2.0.0.0
System.ComponentModel.Design.Serialization.CodeDomSerializer
To be added.
The method is an extension to the method. The method takes an object type, rather than an object value. If an external party had overridden metadata for a specific object through , that metadata override would not be seen by the method, which only takes a type. The method checks the metadata of the value and the value’s type. If the two differ, will look to see if there is a custom designer serializer attribute on the value. If so, will attempt to use it. Otherwise, it will defer to .
Locates a serializer for the given object value.
A that is appropriate for .
The to use for serialization.
Method
2.0.0.0
System.ComponentModel.Design.Serialization.CodeDomSerializer
To be added.
The method is an extension to the method. The method takes an object type, rather than an object value.
Locates a serializer for the given type.
A that is appropriate for .
The to use for serialization.
Method
2.0.0.0
System.String
To be added.
The method calls the method. If this method does not return a name, then uses to fabricate a valid name for the object. If the service is not available, will fabricate a name based on the short type name combined with an index number to make it unique. The resulting name is associated with the serialization manager by calling the method before the new name is returned.
Returns a unique name for the given object.
A unique name for .
The to use for serialization.
Method
2.0.0.0
System.Boolean
For the parameter to be considered serialized, the parameter or another serializer must have called the method to create a relationship between and a referring expression.
Returns a value indicating whether the given object has been serialized.
true if has been serialized; otherwise, false.
The to use for serialization.
The object to test for previous serialization.
Method
2.0.0.0
System.Boolean
To be added.
For the parameter to be considered serialized, the parameter or another serializer must have called the method to create a relationship between and a referring expression.
Returns a value indicating whether the given object has been serialized, optionally considering preset expressions.
true if has been serialized; otherwise, false.
The to use for serialization.
true to include preset expressions; otherwise, false.
Method
2.0.0.0
System.CodeDom.CodeExpression
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
Method
2.0.0.0
System.Void
The method is a helper method that derived classes can call to serialize a single event into the given . queries the serialization manager for a for the given event, and then asks the to serialize it.
places the and parameters on the .
requires an to discover event bindings to methods that are not compiled. If this service is not present, event bindings to non-compiled methods will not be written. Event bindings to compiled methods will still be serialized if the objects to which the events are bound can be converted into expressions.
Serializes the given event into the given statement collection.
The to use for serialization.
The into which the event will be serialized.
The object to which is bound.
An specifying the event to serialize.
Method
2.0.0.0
System.Void
System.ParamArray
The method is a helper method that derived classes can call. It looks at events on the parameter that match the parameter, and then it calls the method for each event.
The method places the for on the .
Serializes the specified events into the given statement collection.
The to use for serialization.
The into which the event will be serialized.
The object on which events will be serialized.
An array that filters which events will be serialized.
Method
2.0.0.0
System.Void
The method is a helper method that derived classes can call. It looks at properties on the parameter that match the parameter, and then it calls the method for each property.
The method places the for on the .
Serializes the properties on the given object into the given statement collection.
The to use for serialization.
The into which the properties will be serialized.
The object on which the properties will be serialized.
An array that filters which properties will be serialized.
Method
2.0.0.0
System.Void
The method is a helper method that derived classes can call. It looks at properties on the parameter that match the parameter, and then it serializes the properties into the invariant culture resource bundle. If the resource service returns a , the property values will be stored in the metadata section of the XML resource (.resx) file. The parameter is not used.
To be serialized as a resource, a property must be simple (not a content property) and its value must be serializable. Properties that do not conform to this pattern will be skipped.
requires an to obtain a to write resources for the invariant culture. If this service is not available, no resources will be written.
Serializes the properties on the given object into the invariant culture’s resource bundle.
The to use for serialization.
Not used.
The object whose properties will be serialized.
An array that filters which properties will be serialized.
Method
2.0.0.0
System.Void
The method retrieves a for the parameter and delegates to it.
places the and parameters on the .
Serializes a property on the given object.
The to use for serialization.
The into which the property will be serialized.
The object on which the property will be serialized.
The property to serialize.
Method
2.0.0.0
System.Void
The method is a helper method that serializes a value to a resource bundle under the given name. The culture that the resource is written to is determined by searching the serialization manager’s collection for a property called ResourceCulture. If this property exists, resources will be written to that culture. Otherwise, resources will be written to the invariant culture. The parameter must be serializable.
requires an to obtain a to write resources for the correct culture. If this service is not available, will instead build a binary object in code that represents the resource.
Serializes the given object into a resource bundle using the given resource name.
The to use for serialization.
The name of the resource bundle into which will be serialized.
The object to serialize.
Method
2.0.0.0
System.Void
The resource is always written to the invariant culture. The parameter must be serializable.
The method requires an to obtain a to write resources for the correct culture. If this service is not available, will instead build a binary object in code that represents the resource.
Serializes the given object into a resource bundle using the given resource name.
The to use for serialization.
The name of the resource bundle into which will be serialized.
The object to serialize.
Method
2.0.0.0
System.CodeDom.CodeExpression
To be added.
The parameter can be null, in which case a primitive expression will be returned.
The method uses the following rules for serializing types:
-
It first calls the method to see if an expression has already been created for the object. If so, it returns the existing expression.
-
It then locates the object’s serializer, and asks it to serialize.
-
If the return value of the object’s serializer is a , the expression is returned.
-
It makes one last call to to see if the serializer added an expression.
-
Finally, it returns null.
If no expression could be created and no suitable serializer could be found, an error will be reported through the serialization manager. No error will be reported if a serializer was found but it failed to produce an expression. In this case, it is assumed that the serializer either already reported the error or it did not attempt to serialize the object.
If the serializer returned a statement or a collection of statements, those statements will not be discarded. The method will first look for a on the context stack and add statements to the statement context object's property. If there is no statement context, the method will look in the context for a and add the statements there. If no place can be found to add the statements, an error will be generated.
You should not call the method within when serializing your own object. Instead, you should call . If it returns null, create your own expression and call . Then proceed with the rest of your serialization.
Serializes the given object into an expression.
A object if can be serialized; otherwise, null.
The to use for serialization.
Method
2.0.0.0
System.CodeDom.CodeExpression
The method is a helper method that serializes a value to a resource expression. This is in contrast to the method, which writes a value to a resource binary object. 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 , if one can be found on the context stack.
The method will look on the for the following objects:
-
—a collection of statements to add a resource manager to, if one needs to be declared.
-
—the root expression, which is needed to create a resource manager.
-
—used to fabricate a name for the resource and to decide what type of resource manager call to make.
Serializes the given object into an expression.
A containing as a serialized expression.
The to use for serialization.
The object to serialize.
Method
2.0.0.0
System.CodeDom.CodeExpression
If the parameter is true, the method will also write the resource value into the invariant culture’s resource file if the current ResourceCulture is not the invariant culture..
Serializes the given object into an expression appropriate for the invariant culture.
A containing as a serialized expression.
The to use for serialization.
The object to serialize.
true to serialize into the invariant culture; otherwise, false.
Method
2.0.0.0
System.Void
To be added.
The method is a helper method that associates a with an object. Objects that have been associated with expressions in this way are accessible through the method. stores its expression table as an appended object on the context stack so it is accessible by any serializer’s method.
Associates an object with an expression.
The to use for serialization.
The with which to associate .
Method
2.0.0.0
System.Void
To be added.
The method is a helper method that associates a with an object. Objects that have been associated with expressions in this way are accessible through the method. The stores its expression table as an appended object on the context stack so it is accessible by any serializer’s method.
Associates an object with an expression, optionally specifying a preset expression.
The to use for serialization.
The with which to associate .
true to specify a preset expression; otherwise, false.