-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathBindingContext.xml
1130 lines (1009 loc) · 77.8 KB
/
BindingContext.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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Type Name="BindingContext" FullName="System.Windows.Forms.BindingContext">
<TypeSignature Language="C#" Value="public class BindingContext : System.Collections.ICollection" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit BindingContext extends System.Object implements class System.Collections.ICollection, class System.Collections.IEnumerable" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.BindingContext" />
<TypeSignature Language="VB.NET" Value="Public Class BindingContext
Implements ICollection" />
<TypeSignature Language="F#" Value="type BindingContext = class
 interface ICollection
 interface IEnumerable" />
<TypeSignature Language="C++ CLI" Value="public ref class BindingContext : System::Collections::ICollection" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Collections.ICollection</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Collections.IEnumerable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DefaultEvent("CollectionChanged")]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultEvent("CollectionChanged")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="windowsdesktop-10.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Manages the collection of <see cref="T:System.Windows.Forms.BindingManagerBase" /> objects for any object that inherits from the <see cref="T:System.Windows.Forms.Control" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Each Windows Form has at least one <xref:System.Windows.Forms.BindingContext> object that manages the <xref:System.Windows.Forms.BindingManagerBase> objects for the form. Because the <xref:System.Windows.Forms.BindingManagerBase> class is abstract, the return type of the <xref:System.Windows.Forms.BindingContext.Item%2A> property is either a <xref:System.Windows.Forms.CurrencyManager> or a <xref:System.Windows.Forms.PropertyManager>. If the data source is an object that can return only a single property (instead of a list of objects), the <xref:System.Type> is a <xref:System.Windows.Forms.PropertyManager>. For example, if you specify a <xref:System.Windows.Forms.TextBox> as the data source, a <xref:System.Windows.Forms.PropertyManager> is returned. On the other hand, if the data source is an object that implements <xref:System.Collections.IList> or <xref:System.ComponentModel.IBindingList>, a <xref:System.Windows.Forms.CurrencyManager> is returned.
For each data source on a Windows Form, there is a single <xref:System.Windows.Forms.CurrencyManager> or <xref:System.Windows.Forms.PropertyManager>. Because there may be multiple data sources associated with a Windows Form, the <xref:System.Windows.Forms.BindingContext> enables you to retrieve any particular <xref:System.Windows.Forms.CurrencyManager> associated with a data source.
> [!NOTE]
> When using the <xref:System.Windows.Forms.BindingContext.Item%2A> property, the <xref:System.Windows.Forms.BindingContext> creates a new <xref:System.Windows.Forms.BindingManagerBase> if one does not already exist. This can lead to some confusion, as the returned object may not manage the list (or any list) that you intend. To prevent returning an invalid <xref:System.Windows.Forms.BindingManagerBase>, use the <xref:System.Windows.Forms.BindingContext.Contains%2A> method to determine if the intended <xref:System.Windows.Forms.BindingManagerBase> already exists.
If you use a container control, such as a <xref:System.Windows.Forms.GroupBox>, <xref:System.Windows.Forms.Panel>, or <xref:System.Windows.Forms.TabControl>, to contain data-bound controls, you can create a <xref:System.Windows.Forms.BindingContext> for just that container control and its controls. Then, each part of your form can be managed by its own <xref:System.Windows.Forms.BindingManagerBase>. See the <xref:System.Windows.Forms.BindingContext.%23ctor%2A> constructor for more information about creating multiple <xref:System.Windows.Forms.BindingManagerBase> objects for the same data source.
If you add a <xref:System.Windows.Forms.TextBox> control to a form and bind it to a column of a table in a dataset, the control communicates with the <xref:System.Windows.Forms.BindingContext> of that form. The <xref:System.Windows.Forms.BindingContext>, in turn, talks to the specific <xref:System.Windows.Forms.CurrencyManager> for that data association. If you queried the `Position` property of the <xref:System.Windows.Forms.CurrencyManager>, it would report the current record for the binding of that <xref:System.Windows.Forms.TextBox> control. In the following code example, a <xref:System.Windows.Forms.TextBox> control is bound to the `FirstName` column of a `Customers` table on the `dataSet1` dataset through the <xref:System.Windows.Forms.BindingContext> for the form it is on.
```vb
TextBox1.DataBindings.Add("Text", dataSet1, "Customers.FirstName")
```
```csharp
textBox1.DataBindings.Add("Text", dataSet1, "Customers.FirstName");
```
```cpp
textBox1->DataBindings->Add("Text", dataSet1, "Customers.FirstName");
```
You can add a second <xref:System.Windows.Forms.TextBox> control (`TextBox2`) to the form and bind it to the `LastName` column of the `Customers` table in the same dataset. The <xref:System.Windows.Forms.BindingContext> is aware of the first binding (`TextBox1` to `Customers.FirstName`), so it would use the same <xref:System.Windows.Forms.CurrencyManager>, as both text boxes are bound to the same dataset (`DataSet1`).
```vb
TextBox2.DataBindings.Add("Text", dataSet1, "Customers.LastName")
```
```csharp
textBox2.DataBindings.Add("Text", dataSet1, "Customers.LastName");
```
```cpp
textBox2->DataBindings->Add("Text", dataSet1, "Customers.LastName");
```
If you bind `TextBox2` to a different dataset, the <xref:System.Windows.Forms.BindingContext> creates and manages a second <xref:System.Windows.Forms.CurrencyManager>.
It is important to be consistent about how you set the <xref:System.Windows.Forms.ListControl.DataSource%2A> and <xref:System.Windows.Forms.ListControl.DisplayMember%2A> properties; otherwise, the <xref:System.Windows.Forms.BindingContext> creates multiple currency managers for the same dataset, which results in errors. The following code example shows a few ways to set the properties and their associated <xref:System.Windows.Forms.BindingContext> objects. You can set the properties using either of the following methods, as long as you are consistent throughout your code.
```vb
ComboBox1.DataSource = DataSet1
ComboBox1.DisplayMember = "Customers.FirstName"
Me.BindingContext(dataSet1, "Customers").Position = 1
```
```csharp
comboBox1.DataSource = DataSet1;
comboBox1.DisplayMember = "Customers.FirstName";
this.BindingContext[dataSet1, "Customers"].Position = 1;
```
```cpp
comboBox1->DataSource = dataSet1;
comboBox1->DisplayMember = "Customers.FirstName";
this->BindingContext->get_Item(dataSet1, "Customers")->Position = 1;
```
```vb
ComboBox1.DataSource = DataSet1.Customers
ComboBox1.DisplayMember = "FirstName"
Me.BindingContext(dataSet1.Customers).Position = 1
```
```csharp
comboBox1.DataSource = DataSet1.Customers;
comboBox1.DisplayMember = "FirstName";
this.BindingContext[dataSet1.Customers].Position = 1;
```
```cpp
comboBox1->DataSource = dataSet1->Customers;
comboBox1->DisplayMember = "FirstName";
this->BindingContext->get_Item(dataSet1->Customers)->Position = 1;
```
> [!NOTE]
> Most Windows Forms applications bind through a <xref:System.Windows.Forms.BindingSource>. The <xref:System.Windows.Forms.BindingSource> component encapsulates a <xref:System.Windows.Forms.CurrencyManager> and exposes the <xref:System.Windows.Forms.CurrencyManager> programming interface. When using a <xref:System.Windows.Forms.BindingSource> for binding, you should use the members exposed by the <xref:System.Windows.Forms.BindingSource> to manipulate "currency" (that is, `Position`) rather than go through the <xref:System.Windows.Forms.BindingContext>.
## Examples
The following code example creates four <xref:System.Windows.Forms.Binding> objects to bind five controls - a <xref:System.Windows.Forms.DateTimePicker> and four <xref:System.Windows.Forms.TextBox> controls - to several data sources. The <xref:System.Windows.Forms.BindingContext> is then used to get the <xref:System.Windows.Forms.BindingManagerBase> for each data source.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic BindingContext Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingContext/Overview/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic BindingContext Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.BindingManagerBase" />
<altmember cref="T:System.Windows.Forms.Binding" />
<altmember cref="T:System.Windows.Forms.BindingsCollection" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BindingContext ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.BindingContext.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 BindingContext();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="windowsdesktop-10.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Binding is not supported with trimming")]</AttributeName>
<AttributeName Language="F#">[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Binding is not supported with trimming")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.BindingContext" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If you want to have multiple <xref:System.Windows.Forms.BindingManagerBase> instances for the same data source, create a new <xref:System.Windows.Forms.BindingContext> and set it to the <xref:System.Windows.Forms.Control.BindingContext%2A> property of an object that inherits from the <xref:System.Windows.Forms.Control> class. For example, if you have two <xref:System.Windows.Forms.BindingManagerBase> objects (from two different <xref:System.Windows.Forms.BindingContext> objects), you can set the <xref:System.Windows.Forms.BindingManagerBase.Position%2A> properties of each <xref:System.Windows.Forms.BindingManagerBase> to different values. This causes each set of data-bound controls to display different values from the same data source.
## Examples
The following code example creates two new <xref:System.Windows.Forms.BindingContext> objects and assigns each object to the <xref:System.Windows.Forms.BindingContext> property of a <xref:System.Windows.Forms.GroupBox> control. `GroupBox1` contains `TextBox1`, and `GroupBox2` contains `TextBox2` (which is accomplished by using the <xref:System.Windows.Forms.Control.ControlCollection.AddRange%2A> method of the <xref:System.Windows.Forms.Control.ControlCollection> class). The example then adds <xref:System.Windows.Forms.Binding> objects to the two <xref:System.Windows.Forms.TextBox> controls, binding each to the same data source and data member. The example also shows two event handlers that use the <xref:System.Windows.Forms.BindingContext> from the <xref:System.Windows.Forms.GroupBox> controls to set the <xref:System.Windows.Forms.BindingManagerBase.Position%2A> property on different <xref:System.Windows.Forms.BindingManagerBase> objects.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic BindingContext.BindingContext Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingContext/.ctor/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic BindingContext.BindingContext Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.BindingManagerBase" />
</Docs>
</Member>
<Member MemberName="Add">
<MemberSignature Language="C#" Value="protected internal void Add (object dataSource, System.Windows.Forms.BindingManagerBase listManager);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig instance void Add(object dataSource, class System.Windows.Forms.BindingManagerBase listManager) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.BindingContext.Add(System.Object,System.Windows.Forms.BindingManagerBase)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Sub Add (dataSource As Object, listManager As BindingManagerBase)" />
<MemberSignature Language="F#" Value="member this.Add : obj * System.Windows.Forms.BindingManagerBase -> unit" Usage="bindingContext.Add (dataSource, listManager)" />
<MemberSignature Language="C++ CLI" Value="protected public:
 void Add(System::Object ^ dataSource, System::Windows::Forms::BindingManagerBase ^ listManager);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Object" />
<Parameter Name="listManager" Type="System.Windows.Forms.BindingManagerBase" />
</Parameters>
<Docs>
<param name="dataSource">The <see cref="T:System.Object" /> associated with the <see cref="T:System.Windows.Forms.BindingManagerBase" />.</param>
<param name="listManager">The <see cref="T:System.Windows.Forms.BindingManagerBase" /> to add.</param>
<summary>Adds the <see cref="T:System.Windows.Forms.BindingManagerBase" /> associated with a specific data source to the collection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is obsolete and unused.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="AddCore">
<MemberSignature Language="C#" Value="protected virtual void AddCore (object dataSource, System.Windows.Forms.BindingManagerBase listManager);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void AddCore(object dataSource, class System.Windows.Forms.BindingManagerBase listManager) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.BindingContext.AddCore(System.Object,System.Windows.Forms.BindingManagerBase)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub AddCore (dataSource As Object, listManager As BindingManagerBase)" />
<MemberSignature Language="F#" Value="abstract member AddCore : obj * System.Windows.Forms.BindingManagerBase -> unit
override this.AddCore : obj * System.Windows.Forms.BindingManagerBase -> unit" Usage="bindingContext.AddCore (dataSource, listManager)" />
<MemberSignature Language="C++ CLI" Value="protected:
 virtual void AddCore(System::Object ^ dataSource, System::Windows::Forms::BindingManagerBase ^ listManager);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Object" />
<Parameter Name="listManager" Type="System.Windows.Forms.BindingManagerBase" />
</Parameters>
<Docs>
<param name="dataSource">The object associated with the <see cref="T:System.Windows.Forms.BindingManagerBase" />.</param>
<param name="listManager">The <see cref="T:System.Windows.Forms.BindingManagerBase" /> to add.</param>
<summary>Adds the <see cref="T:System.Windows.Forms.BindingManagerBase" /> associated with a specific data source to the collection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is obsolete and unused.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="dataSource" /> is <see langword="null" />.
-or-
<paramref name="listManager" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Clear">
<MemberSignature Language="C#" Value="protected internal void Clear ();" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig instance void Clear() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.BindingContext.Clear" />
<MemberSignature Language="VB.NET" Value="Protected Friend Sub Clear ()" />
<MemberSignature Language="F#" Value="member this.Clear : unit -> unit" Usage="bindingContext.Clear " />
<MemberSignature Language="C++ CLI" Value="protected public:
 void Clear();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Clears the collection of any <see cref="T:System.Windows.Forms.BindingManagerBase" /> objects.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is obsolete and unused.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ClearCore">
<MemberSignature Language="C#" Value="protected virtual void ClearCore ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void ClearCore() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.BindingContext.ClearCore" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub ClearCore ()" />
<MemberSignature Language="F#" Value="abstract member ClearCore : unit -> unit
override this.ClearCore : unit -> unit" Usage="bindingContext.ClearCore " />
<MemberSignature Language="C++ CLI" Value="protected:
 virtual void ClearCore();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Clears the collection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is obsolete and unused.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CollectionChanged">
<MemberSignature Language="C#" Value="public event System.ComponentModel.CollectionChangeEventHandler CollectionChanged;" 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;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0" />
<MemberSignature Language="ILAsm" Value=".event class System.ComponentModel.CollectionChangeEventHandler CollectionChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.BindingContext.CollectionChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event CollectionChanged As CollectionChangeEventHandler " />
<MemberSignature Language="F#" Value="member this.CollectionChanged : System.ComponentModel.CollectionChangeEventHandler " Usage="member this.CollectionChanged : System.ComponentModel.CollectionChangeEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:
 event System::ComponentModel::CollectionChangeEventHandler ^ CollectionChanged;" />
<MemberSignature Language="C#" Value="public event System.ComponentModel.CollectionChangeEventHandler? CollectionChanged;" FrameworkAlternate="windowsdesktop-10.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="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;netframework-4.8;netframework-4.8.1;windowsdesktop-10.0;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.ComponentModel.Browsable(false)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Browsable(false)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="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;netframework-4.8;netframework-4.8.1;windowsdesktop-10.0;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="windowsdesktop-10.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.ComponentModel.CollectionChangeEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Always raises a <see cref="T:System.NotImplementedException" /> when handled.</summary>
<remarks>
<format type="text/markdown"><.
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Occurs in all cases.</exception>
</Docs>
</Member>
<MemberGroup MemberName="Contains">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Gets a value indicating whether the <see cref="T:System.Windows.Forms.BindingContext" /> contains the specified <see cref="T:System.Windows.Forms.BindingManagerBase" />.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Contains">
<MemberSignature Language="C#" Value="public bool Contains (object dataSource);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Contains(object dataSource) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.BindingContext.Contains(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Function Contains (dataSource As Object) As Boolean" />
<MemberSignature Language="F#" Value="member this.Contains : obj -> bool" Usage="bindingContext.Contains dataSource" />
<MemberSignature Language="C++ CLI" Value="public:
 bool Contains(System::Object ^ dataSource);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Object" />
</Parameters>
<Docs>
<param name="dataSource">An <see cref="T:System.Object" /> that represents the data source.</param>
<summary>Gets a value indicating whether the <see cref="T:System.Windows.Forms.BindingContext" /> contains the <see cref="T:System.Windows.Forms.BindingManagerBase" /> associated with the specified data source.</summary>
<returns>
<see langword="true" /> if the <see cref="T:System.Windows.Forms.BindingContext" /> contains the specified <see cref="T:System.Windows.Forms.BindingManagerBase" />; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
See the <xref:System.Windows.Forms.Binding> class for a list of possible data sources and information about creating bindings between controls and data sources.
See the <xref:System.Windows.Forms.BindingContext.Item%2A> property for information about returning a <xref:System.Windows.Forms.BindingManagerBase> using only a data source.
## Examples
The following code example uses the <xref:System.Windows.Forms.BindingContext.Contains%2A> method to determine whether a <xref:System.Windows.Forms.BindingManagerBase> exists for each control on a form. The example passes each <xref:System.Data.DataTable> in a <xref:System.Data.DataSet> to the method.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic BindingContext.Contains Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingContext/Contains/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic BindingContext.Contains Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.BindingContext.Item(System.Object)" />
</Docs>
</Member>
<Member MemberName="Contains">
<MemberSignature Language="C#" Value="public bool Contains (object dataSource, string dataMember);" 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;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Contains(object dataSource, string dataMember) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.BindingContext.Contains(System.Object,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Function Contains (dataSource As Object, dataMember As String) As Boolean" />
<MemberSignature Language="F#" Value="member this.Contains : obj * string -> bool" Usage="bindingContext.Contains (dataSource, dataMember)" />
<MemberSignature Language="C++ CLI" Value="public:
 bool Contains(System::Object ^ dataSource, System::String ^ dataMember);" />
<MemberSignature Language="C#" Value="public bool Contains (object dataSource, string? dataMember);" FrameworkAlternate="windowsdesktop-10.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Object" />
<Parameter Name="dataMember" Type="System.String">
<Attributes>
<Attribute FrameworkAlternate="windowsdesktop-10.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="dataSource">An <see cref="T:System.Object" /> that represents the data source.</param>
<param name="dataMember">The information needed to resolve to a specific <see cref="T:System.Windows.Forms.BindingManagerBase" />.</param>
<summary>Gets a value indicating whether the <see cref="T:System.Windows.Forms.BindingContext" /> contains the <see cref="T:System.Windows.Forms.BindingManagerBase" /> associated with the specified data source and data member.</summary>
<returns>
<see langword="true" /> if the <see cref="T:System.Windows.Forms.BindingContext" /> contains the specified <see cref="T:System.Windows.Forms.BindingManagerBase" />; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
See the <xref:System.Windows.Forms.Binding> class for a list of possible data sources and for information about creating bindings between controls and data sources.
See the <xref:System.Windows.Forms.BindingContext.Item%2A> property for information about returning a <xref:System.Windows.Forms.BindingManagerBase> using a data source and data member.
## Examples
The following code example uses the <xref:System.Windows.Forms.BindingContext.Contains%2A> method to test whether a specific <xref:System.Windows.Forms.BindingManagerBase> exists before attempting to get it through the <xref:System.Windows.Forms.BindingContext.Item%2A> property.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic BindingContext.Contains1 Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingContext/Contains/source1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic BindingContext.Contains1 Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.BindingContext.Item(System.Object)" />
</Docs>
</Member>
<Member MemberName="IsReadOnly">
<MemberSignature Language="C#" Value="public bool IsReadOnly { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsReadOnly" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.BindingContext.IsReadOnly" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsReadOnly As Boolean" />
<MemberSignature Language="F#" Value="member this.IsReadOnly : bool" Usage="System.Windows.Forms.BindingContext.IsReadOnly" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool IsReadOnly { bool get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the collection is read-only.</summary>
<value>
<see langword="true" /> if the collection is read-only; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is derived from <xref:System.Collections.ICollection>, and is overridden to always return `false`.
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Item">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Gets a <see cref="T:System.Windows.Forms.BindingManagerBase" />.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Item">
<MemberSignature Language="C#" Value="public System.Windows.Forms.BindingManagerBase this[object dataSource] { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.BindingManagerBase Item(object)" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.BindingContext.Item(System.Object)" />
<MemberSignature Language="VB.NET" Value="Default Public ReadOnly Property Item(dataSource As Object) As BindingManagerBase" />
<MemberSignature Language="F#" Value="member this.Item(obj) : System.Windows.Forms.BindingManagerBase" Usage="System.Windows.Forms.BindingContext.Item" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Windows::Forms::BindingManagerBase ^ default[System::Object ^] { System::Windows::Forms::BindingManagerBase ^ get(System::Object ^ dataSource); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.BindingManagerBase</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Object" />
</Parameters>
<Docs>
<param name="dataSource">The data source associated with a particular <see cref="T:System.Windows.Forms.BindingManagerBase" />.</param>
<summary>Gets the <see cref="T:System.Windows.Forms.BindingManagerBase" /> that is associated with the specified data source.</summary>
<value>A <see cref="T:System.Windows.Forms.BindingManagerBase" /> for the specified data source.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this overload if the <xref:System.Windows.Forms.BindingManagerBase> you want does not require a navigation path. For example, if the <xref:System.Windows.Forms.BindingManagerBase> manages a set of <xref:System.Windows.Forms.Binding> objects that use an <xref:System.Collections.ArrayList> or <xref:System.Data.DataTable> as the <xref:System.Windows.Forms.Binding.DataSource%2A>, no navigation path is required.
> [!NOTE]
> The <xref:System.Windows.Forms.BindingContext.Item%2A> property will always return a <xref:System.Windows.Forms.BindingManagerBase>, and never return `null`.
See the <xref:System.Windows.Forms.Binding> class for a list of possible data sources and for information about creating bindings between controls and data sources.
## Examples
The following code example returns three <xref:System.Windows.Forms.BindingManagerBase> objects: one for a <xref:System.Data.DataView>, one for an <xref:System.Collections.ArrayList>, and one for the <xref:System.Windows.Forms.Binding.DataSource%2A> of a <xref:System.Windows.Forms.Binding> that belongs to a <xref:System.Windows.Forms.TextBox> control.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic BindingContext.this Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingContext/Item/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic BindingContext.this Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.BindingsCollection" />
<altmember cref="T:System.Windows.Forms.Binding" />
</Docs>
</Member>
<Member MemberName="Item">
<MemberSignature Language="C#" Value="public System.Windows.Forms.BindingManagerBase this[object dataSource, string dataMember] { get; }" 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;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.BindingManagerBase Item(object, string)" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.BindingContext.Item(System.Object,System.String)" />
<MemberSignature Language="VB.NET" Value="Default Public ReadOnly Property Item(dataSource As Object, dataMember As String) As BindingManagerBase" />
<MemberSignature Language="F#" Value="member this.Item(obj * string) : System.Windows.Forms.BindingManagerBase" Usage="System.Windows.Forms.BindingContext.Item" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Windows::Forms::BindingManagerBase ^ default[System::Object ^, System::String ^] { System::Windows::Forms::BindingManagerBase ^ get(System::Object ^ dataSource, System::String ^ dataMember); };" />
<MemberSignature Language="C#" Value="public System.Windows.Forms.BindingManagerBase this[object dataSource, string? dataMember] { get; }" FrameworkAlternate="windowsdesktop-10.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.BindingManagerBase</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Object" />
<Parameter Name="dataMember" Type="System.String">
<Attributes>
<Attribute FrameworkAlternate="windowsdesktop-10.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="dataSource">The data source associated with a particular <see cref="T:System.Windows.Forms.BindingManagerBase" />.</param>
<param name="dataMember">A navigation path containing the information that resolves to a specific <see cref="T:System.Windows.Forms.BindingManagerBase" />.</param>
<summary>Gets a <see cref="T:System.Windows.Forms.BindingManagerBase" /> that is associated with the specified data source and data member.</summary>
<value>The <see cref="T:System.Windows.Forms.BindingManagerBase" /> for the specified data source and data member.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this overload when the <xref:System.Windows.Forms.BindingManagerBase> manages a set of <xref:System.Windows.Forms.Binding> objects for which the data source contains multiple objects. For example, a <xref:System.Data.DataSet> can contain several <xref:System.Data.DataTable> objects linked by <xref:System.Data.DataRelation> objects. In such a case, the navigation path is required to enable the <xref:System.Windows.Forms.BindingContext> to return the correct <xref:System.Windows.Forms.BindingManagerBase>.
> [!NOTE]
> The <xref:System.Windows.Forms.BindingContext.Item%2A> property will always return a <xref:System.Windows.Forms.BindingManagerBase>, when the `dataMember` parameter is valid. It will never return `null`.
See the <xref:System.Windows.Forms.Binding> class for a list of possible data sources and for information about creating bindings between controls and data sources.
If the desired <xref:System.Windows.Forms.BindingManagerBase> manages a list, the navigation path must also end with a list. For example, the following C# code binds a <xref:System.Windows.Forms.TextBox> control to the order date in a table of orders. The navigation path includes the <xref:System.Data.DataTable.TableName%2A>, the <xref:System.Data.DataRelation.RelationName%2A>, and the <xref:System.Data.DataColumn.ColumnName%2A>. However, the <xref:System.Windows.Forms.BindingManagerBase> must be retrieved using only the <xref:System.Data.DataTable.TableName%2A> and <xref:System.Data.DataRelation.RelationName%2A> (which resolves to a list).
```
// The navigation path for a Binding ends with a property.
textBox1.DataBindings.Add
("Text", dataSet1, "Customers.custToOrders.OrderDate");
// The navigation path for the BindingManagerBase ends with a list.
BindingManagerBase bmOrders = this.BindingContext
[dataSet1, "Customers.custToOrders"];
```
When returning a <xref:System.Windows.Forms.BindingManagerBase>, you should use the same data source as the <xref:System.Windows.Forms.Binding> and modify only the navigation path.
Use the <xref:System.Windows.Forms.BindingContext.Contains%2A> method to determine if the desired <xref:System.Windows.Forms.BindingManagerBase> already exists.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.BindingContext.Item%2A> to retrieve the <xref:System.Windows.Forms.BindingManagerBase> for a particular binding. It also shows how to handle the <xref:System.Windows.Forms.BindingManagerBase.BindingComplete> event for the <xref:System.Windows.Forms.BindingManagerBase> to ensure multiple controls bound to the same data source remain synchronized when one of the control values is changed. To run this example, paste the code into a Windows Form and call the `InitializeControlsAndData` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method.
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingCompleteEventArgs/Binding/Form1.cs" id="Snippet11":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.BindingSourceMultipleControls/VB/Form1.vb" id="Snippet11":::
]]></format>
</remarks>
<exception cref="T:System.Exception">The specified <paramref name="dataMember" /> does not exist within the data source.</exception>
<altmember cref="T:System.Windows.Forms.BindingsCollection" />
<altmember cref="T:System.Windows.Forms.Binding" />
</Docs>
</Member>
<Member MemberName="OnCollectionChanged">
<MemberSignature Language="C#" Value="protected virtual void OnCollectionChanged (System.ComponentModel.CollectionChangeEventArgs ccevent);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnCollectionChanged(class System.ComponentModel.CollectionChangeEventArgs ccevent) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.BindingContext.OnCollectionChanged(System.ComponentModel.CollectionChangeEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnCollectionChanged (ccevent As CollectionChangeEventArgs)" />
<MemberSignature Language="F#" Value="abstract member OnCollectionChanged : System.ComponentModel.CollectionChangeEventArgs -> unit
override this.OnCollectionChanged : System.ComponentModel.CollectionChangeEventArgs -> unit" Usage="bindingContext.OnCollectionChanged ccevent" />
<MemberSignature Language="C++ CLI" Value="protected:
 virtual void OnCollectionChanged(System::ComponentModel::CollectionChangeEventArgs ^ ccevent);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ccevent" Type="System.ComponentModel.CollectionChangeEventArgs" />
</Parameters>
<Docs>
<param name="ccevent">A <see cref="T:System.ComponentModel.CollectionChangeEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.BindingContext.CollectionChanged" /> event.</summary>
<remarks>
<format type="text/markdown"><.
The <xref:System.Windows.Forms.BindingContext.OnCollectionChanged%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.Windows.Forms.BindingContext.OnCollectionChanged(System.ComponentModel.CollectionChangeEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.BindingContext.OnCollectionChanged(System.ComponentModel.CollectionChangeEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
</Docs>
</Member>
<Member MemberName="Remove">
<MemberSignature Language="C#" Value="protected internal void Remove (object dataSource);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig instance void Remove(object dataSource) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.BindingContext.Remove(System.Object)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Sub Remove (dataSource As Object)" />
<MemberSignature Language="F#" Value="member this.Remove : obj -> unit" Usage="bindingContext.Remove dataSource" />
<MemberSignature Language="C++ CLI" Value="protected public:
 void Remove(System::Object ^ dataSource);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Object" />
</Parameters>
<Docs>
<param name="dataSource">The data source associated with the <see cref="T:System.Windows.Forms.BindingManagerBase" /> to remove.</param>
<summary>Deletes the <see cref="T:System.Windows.Forms.BindingManagerBase" /> associated with the specified data source.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is obsolete and unused.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="RemoveCore">
<MemberSignature Language="C#" Value="protected virtual void RemoveCore (object dataSource);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void RemoveCore(object dataSource) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.BindingContext.RemoveCore(System.Object)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub RemoveCore (dataSource As Object)" />
<MemberSignature Language="F#" Value="abstract member RemoveCore : obj -> unit
override this.RemoveCore : obj -> unit" Usage="bindingContext.RemoveCore dataSource" />
<MemberSignature Language="C++ CLI" Value="protected:
 virtual void RemoveCore(System::Object ^ dataSource);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Object" />
</Parameters>
<Docs>
<param name="dataSource">The data source associated with the <see cref="T:System.Windows.Forms.BindingManagerBase" /> to remove.</param>
<summary>Removes the <see cref="T:System.Windows.Forms.BindingManagerBase" /> associated with the specified data source.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is obsolete and unused.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="System.Collections.ICollection.CopyTo">
<MemberSignature Language="C#" Value="void ICollection.CopyTo (Array ar, int index);" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.ICollection.CopyTo(class System.Array ar, int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.BindingContext.System#Collections#ICollection#CopyTo(System.Array,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Sub CopyTo (ar As Array, index As Integer) Implements ICollection.CopyTo" />
<MemberSignature Language="F#" Value="abstract member System.Collections.ICollection.CopyTo : Array * int -> unit
override this.System.Collections.ICollection.CopyTo : Array * int -> unit" Usage="bindingContext.System.Collections.ICollection.CopyTo (ar, index)" />
<MemberSignature Language="C++ CLI" Value=" virtual void System.Collections.ICollection.CopyTo(Array ^ ar, int index) = System::Collections::ICollection::CopyTo;" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Collections.ICollection.CopyTo(System.Array,System.Int32)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ar" Type="System.Array" />
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<param name="ar">An <see cref="T:System.Array" /> to copy into.</param>
<param name="index">The collection index to begin copying from.</param>
<summary>Copies the elements of the collection into a specified array, starting at the collection index.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic BindingContext.ICollection.CopyTo Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingContext/System.Collections.ICollection.CopyTo/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic BindingContext.ICollection.CopyTo Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="System.Collections.ICollection.Count">
<MemberSignature Language="C#" Value="int System.Collections.ICollection.Count { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 System.Collections.ICollection.Count" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.BindingContext.System#Collections#ICollection#Count" />
<MemberSignature Language="VB.NET" Value=" ReadOnly Property Count As Integer Implements ICollection.Count" />
<MemberSignature Language="F#" Value="member this.System.Collections.ICollection.Count : int" Usage="System.Collections.ICollection.Count" />
<MemberSignature Language="C++ CLI" Value="property int System::Collections::ICollection::Count { int get(); };" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Collections.ICollection.Count</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the total number of <see cref="T:System.Windows.Forms.CurrencyManager" /> objects managed by the <see cref="T:System.Windows.Forms.BindingContext" />.</summary>
<value>The number of data sources managed by the <see cref="T:System.Windows.Forms.BindingContext" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example returns the number of <xref:System.Windows.Forms.CurrencyManager> objects managed by the <xref:System.Windows.Forms.BindingContext>.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic BindingContext.ICollection.Count Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingContext/System.Collections.ICollection.Count/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic BindingContext.ICollection.Count Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="System.Collections.ICollection.IsSynchronized">
<MemberSignature Language="C#" Value="bool System.Collections.ICollection.IsSynchronized { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool System.Collections.ICollection.IsSynchronized" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.BindingContext.System#Collections#ICollection#IsSynchronized" />
<MemberSignature Language="VB.NET" Value=" ReadOnly Property IsSynchronized As Boolean Implements ICollection.IsSynchronized" />
<MemberSignature Language="F#" Value="member this.System.Collections.ICollection.IsSynchronized : bool" Usage="System.Collections.ICollection.IsSynchronized" />
<MemberSignature Language="C++ CLI" Value="property bool System::Collections::ICollection::IsSynchronized { bool get(); };" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Collections.ICollection.IsSynchronized</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the collection is synchronized.</summary>
<value>
<see langword="true" /> if the collection is thread safe; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is derived from <xref:System.Collections.ICollection>, and is overridden to always return `false`.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="System.Collections.ICollection.SyncRoot">
<MemberSignature Language="C#" Value="object System.Collections.ICollection.SyncRoot { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object System.Collections.ICollection.SyncRoot" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.BindingContext.System#Collections#ICollection#SyncRoot" />
<MemberSignature Language="VB.NET" Value=" ReadOnly Property SyncRoot As Object Implements ICollection.SyncRoot" />
<MemberSignature Language="F#" Value="member this.System.Collections.ICollection.SyncRoot : obj" Usage="System.Collections.ICollection.SyncRoot" />
<MemberSignature Language="C++ CLI" Value="property System::Object ^ System::Collections::ICollection::SyncRoot { System::Object ^ get(); };" />
<MemberType>Property</MemberType>