-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
ITypeDescriptorContext.xml
295 lines (276 loc) · 17.7 KB
/
ITypeDescriptorContext.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<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
Implements IServiceProvider" />
<TypeSignature Language="C++ CLI" Value="public interface class ITypeDescriptorContext : IServiceProvider" />
<TypeSignature Language="F#" Value="type ITypeDescriptorContext = interface
 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:
 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:
 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:
 void OnComponentChanged();" />
<MemberSignature Language="F#" Value="abstract member OnComponentChanged : unit -> 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:
 bool OnComponentChanging();" />
<MemberSignature Language="F#" Value="abstract member OnComponentChanging : unit -> 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:
 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>