[bcl] Updates referencesource to 4.7.1
[mono-project.git] / mcs / class / referencesource / System.Data / System / Data / BaseCollection.cs
blob90a3c41bfda146600cb799532184e2af37e6654b
1 //------------------------------------------------------------------------------
2 // <copyright file="BaseCollection.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">Microsoft</owner>
6 // <owner current="true" primary="false">Microsoft</owner>
7 // <owner current="false" primary="false">Microsoft</owner>
8 //------------------------------------------------------------------------------
10 namespace System.Data {
11 using System;
12 using System.Collections;
13 using System.ComponentModel;
14 using System.Globalization;
16 /// <devdoc>
17 /// <para>Provides the base functionality for creating collections.</para>
18 /// </devdoc>
19 public class InternalDataCollectionBase : ICollection {
20 internal static CollectionChangeEventArgs RefreshEventArgs = new CollectionChangeEventArgs(CollectionChangeAction.Refresh, null);
22 //==================================================
23 // the ICollection methods
24 //==================================================
25 /// <devdoc>
26 /// <para>Gets the total number of elements in a collection.</para>
27 /// </devdoc>
29 Browsable(false)
31 public virtual int Count {
32 get {
33 return List.Count;
37 public virtual void CopyTo(Array ar, int index) {
38 List.CopyTo(ar, index);
41 public virtual IEnumerator GetEnumerator() {
42 return List.GetEnumerator();
46 Browsable(false)
48 public bool IsReadOnly {
49 get {
50 return false;
54 [Browsable(false)]
55 public bool IsSynchronized {
56 get {
57 // so the user will know that it has to lock this object
58 return false;
62 // Return value:
63 // > 0 (1) : CaseSensitve equal
64 // < 0 (-1) : Case-Insensitive Equal
65 // = 0 : Not Equal
66 internal int NamesEqual(string s1, string s2, bool fCaseSensitive, CultureInfo locale) {
67 if (fCaseSensitive) {
68 if (String.Compare(s1, s2, false, locale) == 0)
69 return 1;
70 else
71 return 0;
74 // Case, kana and width -Insensitive compare
75 if (locale.CompareInfo.Compare(s1, s2,
76 CompareOptions.IgnoreCase | CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth) == 0) {
77 if (String.Compare(s1, s2, false, locale) == 0)
78 return 1;
79 else
80 return -1;
82 return 0;
86 [Browsable(false)]
87 public object SyncRoot {
88 get {
89 return this;
93 protected virtual ArrayList List {
94 get {
95 return null;