CodeDomSerializerBase.DeserializePropertiesFromResources(IDesignerSerializationManager, Object, Attribute[]) 方法


在给定对象上将属性从固定区域性资源包反序列化。Deserializes properties on the given object from the invariant culture's resource bundle.

 void DeserializePropertiesFromResources(System::ComponentModel::Design::Serialization::IDesignerSerializationManager ^ manager, System::Object ^ value, cli::array <Attribute ^> ^ filter);
protected void DeserializePropertiesFromResources (System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, object value, Attribute[] filter);
member this.DeserializePropertiesFromResources : System.ComponentModel.Design.Serialization.IDesignerSerializationManager * obj * Attribute[] -> unit
Protected Sub DeserializePropertiesFromResources (manager As IDesignerSerializationManager, value As Object, filter As Attribute())



用于序列化的 IDesignerSerializationManagerThe IDesignerSerializationManager to use for serialization.


要从其中对属性进行反序列化的对象。The object from which the properties are to be deserialized.


筛选将反序列化哪些属性的 Attribute 数组。An Attribute array that filters which properties will be deserialized.


DeserializePropertiesFromResources方法是派生类可调用的帮助器方法。The DeserializePropertiesFromResources 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.

此方法检查与value filter参数指定的特性匹配的参数的所有属性,然后在资源二进制对象中检查这些属性。This method inspects all of the properties of the value parameter that match the attributes specified by the filter 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.

此方法要求设计器加载程序提供读取IResourceService资源的。This method requires that a designer loader offers an IResourceService to read resources. 如果为固定DeserializePropertiesFromResources区域性IResourceService ResXResourceReader提供,则将从 XML 资源(.resx)文件的元数据部分读取资源,最终编译的代码中未包含此内容。If the IResourceService provides a ResXResourceReader for the invariant culture, then DeserializePropertiesFromResources 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.