1 //------------------------------------------------------------------------------
2 // <copyright file="BaseCollection.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
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
{
12 using System
.Collections
;
13 using System
.ComponentModel
;
14 using System
.Globalization
;
17 /// <para>Provides the base functionality for creating collections.</para>
19 public class InternalDataCollectionBase
: ICollection
{
20 internal static CollectionChangeEventArgs RefreshEventArgs
= new CollectionChangeEventArgs(CollectionChangeAction
.Refresh
, null);
22 //==================================================
23 // the ICollection methods
24 //==================================================
26 /// <para>Gets the total number of elements in a collection.</para>
31 public virtual int Count
{
37 public virtual void CopyTo(Array ar
, int index
) {
38 List
.CopyTo(ar
, index
);
41 public virtual IEnumerator
GetEnumerator() {
42 return List
.GetEnumerator();
48 public bool IsReadOnly
{
55 public bool IsSynchronized
{
57 // so the user will know that it has to lock this object
63 // > 0 (1) : CaseSensitve equal
64 // < 0 (-1) : Case-Insensitive Equal
66 internal int NamesEqual(string s1
, string s2
, bool fCaseSensitive
, CultureInfo locale
) {
68 if (String
.Compare(s1
, s2
, false, locale
) == 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)
87 public object SyncRoot
{
93 protected virtual ArrayList List
{