IValueSerializerContext 接口

定义

定义提供给 ValueSerializer 的上下文。Defines a context that is provided to a ValueSerializer. 此上下文可用于实现序列化的特例或序列化的其他模式。The context can be used to enable special cases of serialization or different modes of serialization.

public interface class IValueSerializerContext : IServiceProvider, System::ComponentModel::ITypeDescriptorContext
public interface IValueSerializerContext : IServiceProvider, System.ComponentModel.ITypeDescriptorContext
type IValueSerializerContext = interface
    interface ITypeDescriptorContext
    interface IServiceProvider
Public Interface IValueSerializerContext
Implements IServiceProvider, ITypeDescriptorContext
实现

注解

CanConvert*String / Convert*String ITypeDescriptorContext接口是ITypeDescriptorContext上下文的专用形式, 用作值序列化程序的方法的输入参数之一, 其方式与用于的上下文相同IValueSerializerContextConvert* 适用于TypeConverter。 / CanConvert*The IValueSerializerContext interface is a specialized form of the ITypeDescriptorContext context, and is used as one of the input parameters for Convert*String / CanConvert*String methods of a value serializer in the same way as ITypeDescriptorContext is used for context of Convert* / CanConvert* for a TypeConverter.

ValueSerializer WPF 中实现了并因此用于IValueSerializerContext System.Windows.Converters上下文的公共类型可在和System.Windows.Media.Converters命名空间中找到。Public types in WPF that implement a ValueSerializer and thus use IValueSerializerContext for context are found in the System.Windows.Converters and System.Windows.Media.Converters namespaces.

在 .NET Framework 的以前版本中, 此接口存在于 WPF 特定的程序集 WindowsBase 中。In previous versions of the .NET Framework, this interface existed in the WPF-specific assembly WindowsBase. .NET Framework 4.NET Framework 4IValueSerializerContext , 为 system.exception 程序集。In .NET Framework 4.NET Framework 4, IValueSerializerContext is in the System.Xaml assembly. 有关详细信息,请参阅 Types Migrated from WPF to System.XamlFor more information, see Types Migrated from WPF to System.Xaml.

属性

Container

获取表示此 TypeDescriptor 请求的容器。Gets the container representing this TypeDescriptor request.

(继承自 ITypeDescriptorContext)
Instance

获取与此类型说明符请求相连接的对象。Gets the object that is connected with this type descriptor request.

(继承自 ITypeDescriptorContext)
PropertyDescriptor

获取与给定上下文项相关联的 PropertyDescriptorGets the PropertyDescriptor that is associated with the given context item.

(继承自 ITypeDescriptorContext)

方法

GetService(Type)

获取指定类型的服务对象。Gets the service object of the specified type.

(继承自 IServiceProvider)
GetValueSerializerFor(PropertyDescriptor)

获取给定属性描述符的 ValueSerializerGets a ValueSerializer for the given property descriptor.

GetValueSerializerFor(Type)

获取与指定类型关联的 ValueSerializerGets the ValueSerializer associated with the specified type.

OnComponentChanged()

引发 ComponentChanged 事件。Raises the ComponentChanged event.

(继承自 ITypeDescriptorContext)
OnComponentChanging()

引发 ComponentChanging 事件。Raises the ComponentChanging event.

(继承自 ITypeDescriptorContext)

适用于

另请参阅