1 <?xml version="1.0" encoding="utf-8"?>
2 <Type Name="ListBindingHelper" FullName="System.Windows.Forms.ListBindingHelper">
3 <TypeSignature Language="C#" Value="public static class ListBindingHelper" />
5 <AssemblyName>System.Windows.Forms</AssemblyName>
6 <AssemblyVersion>2.0.0.0</AssemblyVersion>
9 <BaseTypeName>System.Object</BaseTypeName>
14 <attribution license="cc4" from="Microsoft" modified="false" />
15 <para>This class is used by classes such as <see cref="T:System.Windows.Forms.BindingSource" />.</para>
16 <para>Note that for Smartphone applications, this class requires Windows Mobile Version 5.0 software for Smartphones.</para>
19 <attribution license="cc4" from="Microsoft" modified="false" />
20 <para>Provides functionality to discover a bindable list and the properties of the items contained in the list when they differ from the public properties of the object to which they bind.</para>
24 <Member MemberName="GetList">
25 <MemberSignature Language="C#" Value="public static object GetList (object list);" />
26 <MemberType>Method</MemberType>
28 <AssemblyVersion>2.0.0.0</AssemblyVersion>
31 <ReturnType>System.Object</ReturnType>
34 <Parameter Name="list" Type="System.Object" />
38 <attribution license="cc4" from="Microsoft" modified="false" />
39 <para>If the data source specified by the <paramref name="list" /> parameter implements the <see cref="T:System.ComponentModel.IListSource" /> interface, then the <see cref="M:System.Windows.Forms.ListBindingHelper.GetList(System.Object)" /> method will return an object of type <see cref="T:System.Collections.IList" /> that represents the associated list. Otherwise, this method will just return the specified data source since there is no underlying list.</para>
42 <attribution license="cc4" from="Microsoft" modified="false" />
43 <para>Returns a list associated with the specified data source.</para>
46 <attribution license="cc4" from="Microsoft" modified="false" />
47 <para>An <see cref="T:System.Object" /> representing the underlying list if it exists; otherwise, the original data source specified by <paramref name="list" />.</para>
50 <attribution license="cc4" from="Microsoft" modified="false" />The data source to examine for its underlying list.</param>
53 <Member MemberName="GetList">
54 <MemberSignature Language="C#" Value="public static object GetList (object dataSource, string dataMember);" />
55 <MemberType>Method</MemberType>
57 <AssemblyVersion>2.0.0.0</AssemblyVersion>
60 <ReturnType>System.Object</ReturnType>
63 <Parameter Name="dataSource" Type="System.Object" />
64 <Parameter Name="dataMember" Type="System.String" />
68 <attribution license="cc4" from="Microsoft" modified="false" />
69 <para>If the data member is null or an empty string (""), the <see cref="M:System.Windows.Forms.ListBindingHelper.GetList(System.Object,System.String)" /> method returns <paramref name="dataSource" />. </para>
70 <para>If <paramref name="dataSource" /> is not a list, <see cref="M:System.Windows.Forms.ListBindingHelper.GetList(System.Object,System.String)" /> returns the value of the <paramref name="dataSource" /> property that matches the <paramref name="dataMember" /> value.</para>
71 <para>If <paramref name="dataSource" /> is a list, in that it implements either the <see cref="T:System.Windows.Forms.ICurrencyManagerProvider" /> or <see cref="T:System.Collections.IEnumerable" /> interfaces, then the underlying list is obtained by choosing an item from the list and querying that item for the value of the property named by <paramref name="dataMember" />. </para>
74 <attribution license="cc4" from="Microsoft" modified="false" />
75 <para>Returns an object, typically a list, from the evaluation of a specified data source and optional data member.</para>
78 <attribution license="cc4" from="Microsoft" modified="false" />
79 <para>An <see cref="T:System.Object" /> representing the underlying list if it was found; otherwise, <paramref name="dataSource" />.</para>
81 <param name="dataSource">
82 <attribution license="cc4" from="Microsoft" modified="false" />The data source from which to find the list.</param>
83 <param name="dataMember">
84 <attribution license="cc4" from="Microsoft" modified="false" />The name of the data source property that contains the list. This can be null.</param>
87 <Member MemberName="GetListItemProperties">
88 <MemberSignature Language="C#" Value="public static System.ComponentModel.PropertyDescriptorCollection GetListItemProperties (object list);" />
89 <MemberType>Method</MemberType>
91 <AssemblyVersion>2.0.0.0</AssemblyVersion>
94 <ReturnType>System.ComponentModel.PropertyDescriptorCollection</ReturnType>
97 <Parameter Name="list" Type="System.Object" />
101 <attribution license="cc4" from="Microsoft" modified="false" />
102 <para>The <see cref="M:System.Windows.Forms.ListBindingHelper.GetListItemProperties(System.Object)" /> method is used to examine the collection of properties for a data source. The action of this method depends on the actual type of the <paramref name="list" /> parameter according to the following table:</para>
107 <para>Parameter type</para>
116 <para>A type that is a list or collection of items.</para>
119 <para>Returns a <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> describing the properties of the item type contained in the list.</para>
124 <para>A type that is not a list or collection.</para>
127 <para>Returns a <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> describing the properties of the type.</para>
135 <para>Returns an empty <see cref="T:System.ComponentModel.PropertyDescriptorCollection" />.</para>
141 <attribution license="cc4" from="Microsoft" modified="false" />
142 <para>Returns the <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> that describes the properties of an item type contained in a specified data source, or properties of the specified data source.</para>
145 <attribution license="cc4" from="Microsoft" modified="false" />
146 <para>The <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> containing the properties of the items contained in <paramref name="list" />, or properties of <paramref name="list." /></para>
149 <attribution license="cc4" from="Microsoft" modified="false" />The data source to examine for property information.</param>
152 <Member MemberName="GetListItemProperties">
153 <MemberSignature Language="C#" Value="public static System.ComponentModel.PropertyDescriptorCollection GetListItemProperties (object list, System.ComponentModel.PropertyDescriptor[] listAccessors);" />
154 <MemberType>Method</MemberType>
156 <AssemblyVersion>2.0.0.0</AssemblyVersion>
159 <ReturnType>System.ComponentModel.PropertyDescriptorCollection</ReturnType>
162 <Parameter Name="list" Type="System.Object" />
163 <Parameter Name="listAccessors" Type="System.ComponentModel.PropertyDescriptor[]" />
167 <attribution license="cc4" from="Microsoft" modified="false" />
168 <para>The <see cref="M:System.Windows.Forms.ListBindingHelper.GetListItemProperties(System.Object,System.ComponentModel.PropertyDescriptor[])" /> method is useful when the data source has properties that are a collection of items and you need to know properties of the item type in the collection, not the properties of the collection type. </para>
171 <attribution license="cc4" from="Microsoft" modified="false" />
172 <para>Returns the <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> that describes the properties of an item type contained in a collection property of a data source. Uses the specified <see cref="T:System.ComponentModel.PropertyDescriptor" /> array to indicate which properties to examine.</para>
175 <attribution license="cc4" from="Microsoft" modified="false" />
176 <para>The <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> describing the properties of the item type contained in a collection property of the data source.</para>
179 <attribution license="cc4" from="Microsoft" modified="false" />The data source to be examined for property information.</param>
180 <param name="listAccessors">
181 <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.ComponentModel.PropertyDescriptor" /> array describing which properties of the data source to examine. This can be null.</param>
184 <Member MemberName="GetListItemProperties">
185 <MemberSignature Language="C#" Value="public static System.ComponentModel.PropertyDescriptorCollection GetListItemProperties (object dataSource, string dataMember, System.ComponentModel.PropertyDescriptor[] listAccessors);" />
186 <MemberType>Method</MemberType>
188 <AssemblyVersion>2.0.0.0</AssemblyVersion>
191 <ReturnType>System.ComponentModel.PropertyDescriptorCollection</ReturnType>
194 <Parameter Name="dataSource" Type="System.Object" />
195 <Parameter Name="dataMember" Type="System.String" />
196 <Parameter Name="listAccessors" Type="System.ComponentModel.PropertyDescriptor[]" />
200 <attribution license="cc4" from="Microsoft" modified="false" />
201 <para>The <paramref name="dataMember" /> parameter can be null, in which case the <see cref="M:System.Windows.Forms.ListBindingHelper.GetListItemProperties(System.Object,System.String,System.ComponentModel.PropertyDescriptor[])" /> method will return property descriptions using the data source and the <see cref="T:System.ComponentModel.PropertyDescriptor" /> array.</para>
203 <see cref="M:System.Windows.Forms.ListBindingHelper.GetListItemProperties(System.Object,System.ComponentModel.PropertyDescriptor[])" /> is useful when the data member has properties that are a collection of items and you need to know properties of the item type in the collection, not the properties of the collection type. </para>
206 <attribution license="cc4" from="Microsoft" modified="false" />
207 <para>Returns the <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> that describes the properties of an item type contained in the specified data member of a data source. Uses the specified <see cref="T:System.ComponentModel.PropertyDescriptor" /> array to indicate which properties to examine.</para>
210 <attribution license="cc4" from="Microsoft" modified="false" />
211 <para>The <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> describing the properties of an item type contained in a collection property of the specified data source.</para>
213 <param name="dataSource">
214 <attribution license="cc4" from="Microsoft" modified="false" />The data source to be examined for property information.</param>
215 <param name="dataMember">
216 <attribution license="cc4" from="Microsoft" modified="false" />The optional data member to be examined for property information. This can be null.</param>
217 <param name="listAccessors">
218 <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.ComponentModel.PropertyDescriptor" /> array describing which properties of the data member to examine. This can be null.</param>
221 <Member MemberName="GetListItemType">
222 <MemberSignature Language="C#" Value="public static Type GetListItemType (object list);" />
223 <MemberType>Method</MemberType>
225 <AssemblyVersion>2.0.0.0</AssemblyVersion>
228 <ReturnType>System.Type</ReturnType>
231 <Parameter Name="list" Type="System.Object" />
235 <attribution license="cc4" from="Microsoft" modified="false" />
236 <para>If the <paramref name="list" /> parameter is not a list or array, the type returned will be that of the <paramref name="list" /> parameter itself.</para>
239 <attribution license="cc4" from="Microsoft" modified="false" />
240 <para>Returns the data type of the items in the specified list.</para>
243 <attribution license="cc4" from="Microsoft" modified="false" />
244 <para>The <see cref="T:System.Type" /> of the items contained in the list.</para>
247 <attribution license="cc4" from="Microsoft" modified="false" />The list to be examined for type information. </param>
250 <Member MemberName="GetListItemType">
251 <MemberSignature Language="C#" Value="public static Type GetListItemType (object dataSource, string dataMember);" />
252 <MemberType>Method</MemberType>
254 <AssemblyVersion>2.0.0.0</AssemblyVersion>
257 <ReturnType>System.Type</ReturnType>
260 <Parameter Name="dataSource" Type="System.Object" />
261 <Parameter Name="dataMember" Type="System.String" />
265 <attribution license="cc4" from="Microsoft" modified="false" />
266 <para>This version of the <see cref="M:System.Windows.Forms.ListBindingHelper.GetListItemType(System.Object,System.String)" /> method is used to determine the type of items used in complex or simple data-binding schemes. This static method may be useful in determining whether a proposed data-binding scheme is appropriate before attempting it.</para>
267 <para>If <paramref name="dataSource" /> is null, the property descriptors cannot be found for the list items of the specified data member, or the property descriptor for the list item is an <see cref="T:System.ComponentModel.ICustomTypeDescriptor" />, then this method returns the type of the <see cref="T:System.Object" /> class. </para>
268 <para>If <paramref name="dataMember" /> is null or empty, then this method returns the <see cref="T:System.Type" /> of the items in the data source, if it is a list; otherwise, this method returns the <see cref="T:System.Type" /> of the data source itself.</para>
271 <attribution license="cc4" from="Microsoft" modified="false" />
272 <para>Returns the data type of the items in the specified data source.</para>
275 <attribution license="cc4" from="Microsoft" modified="false" />
276 <para>For complex data binding, the <see cref="T:System.Type" /> of the items represented by the <paramref name="dataMember" /> in the data source; otherwise, the <see cref="T:System.Type" /> of the item in the list itself.</para>
278 <param name="dataSource">
279 <attribution license="cc4" from="Microsoft" modified="false" />The data source to examine for items. </param>
280 <param name="dataMember">
281 <attribution license="cc4" from="Microsoft" modified="false" />The optional name of the property on the data source that is to be used as the data member. This can be null.</param>
284 <Member MemberName="GetListName">
285 <MemberSignature Language="C#" Value="public static string GetListName (object list, System.ComponentModel.PropertyDescriptor[] listAccessors);" />
286 <MemberType>Method</MemberType>
288 <AssemblyVersion>2.0.0.0</AssemblyVersion>
291 <ReturnType>System.String</ReturnType>
294 <Parameter Name="list" Type="System.Object" />
295 <Parameter Name="listAccessors" Type="System.ComponentModel.PropertyDescriptor[]" />
299 <attribution license="cc4" from="Microsoft" modified="false" />
300 <para>If <paramref name="listAccessors" /> is null or empty, the <see cref="M:System.Windows.Forms.ListBindingHelper.GetListName(System.Object,System.ComponentModel.PropertyDescriptor[])" /> method returns the name of the data source type.</para>
303 <attribution license="cc4" from="Microsoft" modified="false" />
304 <para>Returns the name of an underlying list, given a data source and optional <see cref="T:System.ComponentModel.PropertyDescriptor" /> array.</para>
307 <attribution license="cc4" from="Microsoft" modified="false" />
308 <para>The name of the list in the data source, as described by <paramref name="listAccessors" />, or<paramref name=" " />the name of the data source type.</para>
311 <attribution license="cc4" from="Microsoft" modified="false" />The data source to examine for the list name.</param>
312 <param name="listAccessors">
313 <attribution license="cc4" from="Microsoft" modified="false" />An array of <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects to find in the data source. This can be null.</param>