Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
295 lines (276 sloc) 17.7 KB
<Type Name="ITypeDescriptorContext" FullName="System.ComponentModel.ITypeDescriptorContext">
<TypeSignature Language="C#" Value="public interface ITypeDescriptorContext : IServiceProvider" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract ITypeDescriptorContext implements class System.IServiceProvider" />
<TypeSignature Language="DocId" Value="T:System.ComponentModel.ITypeDescriptorContext" />
<TypeSignature Language="VB.NET" Value="Public Interface ITypeDescriptorContext&#xA;Implements IServiceProvider" />
<TypeSignature Language="C++ CLI" Value="public interface class ITypeDescriptorContext : IServiceProvider" />
<TypeSignature Language="F#" Value="type ITypeDescriptorContext = interface&#xA; interface IServiceProvider" />
<AssemblyInfo>
<AssemblyName>System.ComponentModel.TypeConverter</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Interfaces>
<Interface>
<InterfaceName>System.IServiceProvider</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides contextual information about a component, such as its container and property descriptor.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.ComponentModel.ITypeDescriptorContext> interface provides contextual information about a component. <xref:System.ComponentModel.ITypeDescriptorContext> is typically used at design time to provide information about a design-time container. This interface is commonly used in type conversion. For details, see <xref:System.ComponentModel.TypeConverter>.
> [!NOTE]
> Do not rely on the presence of this interface when you design a type converter. If a particular interface, property, or service is necessary but not available, the type converter should return `null` rather than throw an exception. This interface's properties can return `null` at any time, and you should plan for this.
## Examples
The following code example demonstrates how to use the <xref:System.ComponentModel.ITypeDescriptorContext> interface to support type conversion.
[!code-cpp[InstanceDescriptorSample#1](~/samples/snippets/cpp/VS_Snippets_Winforms/InstanceDescriptorSample/CPP/instancedescriptor.cpp#1)]
[!code-csharp[InstanceDescriptorSample#1](~/samples/snippets/csharp/VS_Snippets_Winforms/InstanceDescriptorSample/CS/instancedescriptor.cs#1)]
[!code-vb[InstanceDescriptorSample#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/InstanceDescriptorSample/VB/instancedescriptor.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.ComponentModel.TypeDescriptor" />
<altmember cref="T:System.ComponentModel.TypeConverter" />
</Docs>
<Members>
<Member MemberName="Container">
<MemberSignature Language="C#" Value="public System.ComponentModel.IContainer Container { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.ComponentModel.IContainer Container" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.ITypeDescriptorContext.Container" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Container As IContainer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::ComponentModel::IContainer ^ Container { System::ComponentModel::IContainer ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Container : System.ComponentModel.IContainer" Usage="System.ComponentModel.ITypeDescriptorContext.Container" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.TypeConverter</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.ComponentModel.IContainer</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the container representing this <see cref="T:System.ComponentModel.TypeDescriptor" /> request.</summary>
<value>An <see cref="T:System.ComponentModel.IContainer" /> with the set of objects for this <see cref="T:System.ComponentModel.TypeDescriptor" />; otherwise, <see langword="null" /> if there is no container or if the <see cref="T:System.ComponentModel.TypeDescriptor" /> does not use outside objects.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.ComponentModel.ITypeDescriptorContext.Container%2A> property gets the logical container of the component associated with the type descriptor.
]]></format>
</remarks>
<altmember cref="T:System.ComponentModel.IContainer" />
</Docs>
</Member>
<Member MemberName="Instance">
<MemberSignature Language="C#" Value="public object Instance { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object Instance" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.ITypeDescriptorContext.Instance" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Instance As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ Instance { System::Object ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Instance : obj" Usage="System.ComponentModel.ITypeDescriptorContext.Instance" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.TypeConverter</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the object that is connected with this type descriptor request.</summary>
<value>The object that invokes the method on the <see cref="T:System.ComponentModel.TypeDescriptor" />; otherwise, <see langword="null" /> if there is no object responsible for the call.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.ComponentModel.ITypeDescriptorContext.Instance%2A> property gets the object that is invoking the <xref:System.ComponentModel.ITypeDescriptorContext> interface. For example, if a type converter is given a <xref:System.Drawing.Color> to convert, <xref:System.ComponentModel.ITypeDescriptorContext.Instance%2A> returns the actual instance of the control that is using the <xref:System.Drawing.Color>. You can subsequently query the control for further information about its services and its <xref:System.ComponentModel.ITypeDescriptorContext.Container%2A>.
]]></format>
</remarks>
<altmember cref="T:System.ComponentModel.Component" />
</Docs>
</Member>
<Member MemberName="OnComponentChanged">
<MemberSignature Language="C#" Value="public void OnComponentChanged ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void OnComponentChanged() cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.ITypeDescriptorContext.OnComponentChanged" />
<MemberSignature Language="VB.NET" Value="Public Sub OnComponentChanged ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void OnComponentChanged();" />
<MemberSignature Language="F#" Value="abstract member OnComponentChanged : unit -&gt; unit" Usage="iTypeDescriptorContext.OnComponentChanged " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.TypeConverter</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Raises the <see cref="E:System.ComponentModel.Design.IComponentChangeService.ComponentChanged" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.ComponentModel.ITypeDescriptorContext.OnComponentChanged%2A> method to send notification that an instance of an object has changed.
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.ComponentModel.ITypeDescriptorContext.OnComponentChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.ComponentModel.ITypeDescriptorContext.OnComponentChanged" /> in a derived class, be sure to call the base class' <see cref="M:System.ComponentModel.ITypeDescriptorContext.OnComponentChanged" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.ComponentModel.Design.IComponentChangeService.ComponentChanged" />
<altmember cref="M:System.ComponentModel.ITypeDescriptorContext.OnComponentChanging" />
</Docs>
</Member>
<Member MemberName="OnComponentChanging">
<MemberSignature Language="C#" Value="public bool OnComponentChanging ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool OnComponentChanging() cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.ITypeDescriptorContext.OnComponentChanging" />
<MemberSignature Language="VB.NET" Value="Public Function OnComponentChanging () As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool OnComponentChanging();" />
<MemberSignature Language="F#" Value="abstract member OnComponentChanging : unit -&gt; bool" Usage="iTypeDescriptorContext.OnComponentChanging " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.TypeConverter</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Raises the <see cref="E:System.ComponentModel.Design.IComponentChangeService.ComponentChanging" /> event.</summary>
<returns>
<see langword="true" /> if this object can be changed; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.ComponentModel.ITypeDescriptorContext.OnComponentChanging%2A> method to send notification that an instance of an object is about to be changed. This method also returns a value indicating whether this object can be changed. When `false` is returned, do not change the object.
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.ComponentModel.ITypeDescriptorContext.OnComponentChanging%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.ComponentModel.ITypeDescriptorContext.OnComponentChanging" /> in a derived class, be sure to call the base class' <see cref="M:System.ComponentModel.ITypeDescriptorContext.OnComponentChanging" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.ComponentModel.Design.IComponentChangeService.ComponentChanging" />
<altmember cref="M:System.ComponentModel.ITypeDescriptorContext.OnComponentChanged" />
</Docs>
</Member>
<Member MemberName="PropertyDescriptor">
<MemberSignature Language="C#" Value="public System.ComponentModel.PropertyDescriptor PropertyDescriptor { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.ComponentModel.PropertyDescriptor PropertyDescriptor" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.ITypeDescriptorContext.PropertyDescriptor" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property PropertyDescriptor As PropertyDescriptor" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::ComponentModel::PropertyDescriptor ^ PropertyDescriptor { System::ComponentModel::PropertyDescriptor ^ get(); };" />
<MemberSignature Language="F#" Value="member this.PropertyDescriptor : System.ComponentModel.PropertyDescriptor" Usage="System.ComponentModel.ITypeDescriptorContext.PropertyDescriptor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.TypeConverter</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.ComponentModel.PropertyDescriptor</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the <see cref="T:System.ComponentModel.PropertyDescriptor" /> that is associated with the given context item.</summary>
<value>The <see cref="T:System.ComponentModel.PropertyDescriptor" /> that describes the given context item; otherwise, <see langword="null" /> if there is no <see cref="T:System.ComponentModel.PropertyDescriptor" /> responsible for the call.</value>
<remarks>To be added.</remarks>
<altmember cref="T:System.ComponentModel.PropertyDescriptor" />
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.