IDesignerSerializationService 接口

定义

提供一个可调用序列化和反序列化的接口。Provides an interface that can invoke serialization and deserialization.

public interface class IDesignerSerializationService
public interface IDesignerSerializationService
type IDesignerSerializationService = interface
Public Interface IDesignerSerializationService
派生

注解

此服务提供将对象集合转换为可序列化对象的方法,并将序列化数据转换为它所表示的对象。This service provides methods to convert a collection of objects to a serializable object that represents them, and to convert serialization data to the object or objects that it represents.

支持设计器的所有组件都必须支持每个组件的类型的序列化。All components that support a designer must support serialization of each component's type. 如果设计器扫描每个类型的公共属性、方法和事件,并在类型描述符中表示这些属性,则会发生这种情况。This occurs when the designer scans the public properties, methods, and events of each type and represents these within a type descriptor.

此接口使用扫描成员的技术将组件集合转换为支持运行时序列化的单个对象。This interface uses the technique of scanning members to convert a collection of components into a single object that supports run-time serialization. 这并不一定为属于类的自定义类型的序列化提供。This does not necessarily provide for the serialization of custom types that belong to the class. 许多对象需要自定义序列化程序才能在运行时序列化其值。Many objects require a custom serializer to have their values serialized at run time. 若要指定自定义类型的序列化程序,请使用 DesignerSerializerAttribute 特性或实现 IDesignerSerializationProviderTo specify a serializer for a custom type, use a DesignerSerializerAttribute attribute or implement an IDesignerSerializationProvider.

方法

Deserialize(Object)

反序列化指定的序列化数据对象并返回由这些数据表示的对象的集合。Deserializes the specified serialization data object and returns a collection of objects represented by that data.

Serialize(ICollection)

序列化指定的对象集合并将其存储在序列化数据对象中。Serializes the specified collection of objects and stores them in a serialization data object.

适用于

另请参阅