From f1c67c6a4898fa16e4aae651345efa525c9513f5 Mon Sep 17 00:00:00 2001 From: Gert Driesen Date: Wed, 31 May 2006 13:20:33 +0000 Subject: [PATCH] * TypeConverter.cs: Added explicit interface implementation for ICollection.CopyTo and IEnumerable.GetEnumerator. Fixes corcompare warnings. * Component.cs: Remove TypeConverter attribute. Fixes corcompare warning. * AttributeCollection.cs: Added explicit interface implemenation for IEnumerable.GetEnumerator, IList.RemoveAt and ICollection.Count. Fixes corcompare warnings. * PropertyDescriptorCollection.cs: Added explicit interface implemenation for ICollection.Count. Fixes corcompare warning. svn path=/trunk/mcs/; revision=61323 --- .../System.ComponentModel/AttributeCollection.cs | 12 +++++++++++- mcs/class/System/System.ComponentModel/ChangeLog | 13 +++++++++++++ .../System/System.ComponentModel/Component.cs | 1 - .../EventDescriptorCollection.cs | 16 ++++++++++++++++ .../PropertyDescriptorCollection.cs | 4 ++++ .../System.ComponentModel/TypeConverter.cs | 8 ++++++++ 6 files changed, 52 insertions(+), 2 deletions(-) diff --git a/mcs/class/System/System.ComponentModel/AttributeCollection.cs b/mcs/class/System/System.ComponentModel/AttributeCollection.cs index 658117ac1af..ed36edd9fea 100644 --- a/mcs/class/System/System.ComponentModel/AttributeCollection.cs +++ b/mcs/class/System/System.ComponentModel/AttributeCollection.cs @@ -37,7 +37,7 @@ using System.Runtime.InteropServices; namespace System.ComponentModel { [ComVisible (true)] - public class AttributeCollection : ICollection, IEnumerable + public class AttributeCollection : ICollection { private ArrayList attrList = new ArrayList (); public static readonly AttributeCollection Empty = new AttributeCollection ((ArrayList)null); @@ -80,6 +80,10 @@ namespace System.ComponentModel attrList.CopyTo (array, index); } + IEnumerator IEnumerable.GetEnumerator () { + return GetEnumerator (); + } + public IEnumerator GetEnumerator () { return attrList.GetEnumerator (); @@ -132,6 +136,12 @@ namespace System.ComponentModel } } + int ICollection.Count { + get { + return Count; + } + } + public int Count { get { return attrList.Count; diff --git a/mcs/class/System/System.ComponentModel/ChangeLog b/mcs/class/System/System.ComponentModel/ChangeLog index 0ebe54b43c3..ec0459c34cc 100644 --- a/mcs/class/System/System.ComponentModel/ChangeLog +++ b/mcs/class/System/System.ComponentModel/ChangeLog @@ -1,3 +1,16 @@ +2006-05-31 Gert Driesen + + * TypeConverter.cs: Added explicit interface implementation for + ICollection.CopyTo and IEnumerable.GetEnumerator. Fixes corcompare + warnings. + * Component.cs: Remove TypeConverter attribute. Fixes corcompare + warning. + * AttributeCollection.cs: Added explicit interface implemenation for + IEnumerable.GetEnumerator, IList.RemoveAt and ICollection.Count. + Fixes corcompare warnings. + * PropertyDescriptorCollection.cs: Added explicit interface + implemenation for ICollection.Count. Fixes corcompare warning. + 2006-05-22 Atsushi Enomoto * TypeDescriptor.cs : GetProperties() does not return indexers. diff --git a/mcs/class/System/System.ComponentModel/Component.cs b/mcs/class/System/System.ComponentModel/Component.cs index a3871b3c20b..e370a6aa683 100644 --- a/mcs/class/System/System.ComponentModel/Component.cs +++ b/mcs/class/System/System.ComponentModel/Component.cs @@ -36,7 +36,6 @@ using System.ComponentModel; namespace System.ComponentModel { [DesignerCategory ("Component")] - [TypeConverter(typeof(ComponentConverter))] public class Component : MarshalByRefObject, IComponent, IDisposable { diff --git a/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs b/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs index 9b3fbaf93de..3c61fe50f0e 100644 --- a/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs +++ b/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs @@ -64,6 +64,10 @@ namespace System.ComponentModel return eventList.Add (value); } + void IList.Clear () { + Clear (); + } + public void Clear () { eventList.Clear (); } @@ -81,6 +85,10 @@ namespace System.ComponentModel return null; } + IEnumerator IEnumerable.GetEnumerator () { + return GetEnumerator (); + } + public IEnumerator GetEnumerator () { return eventList.GetEnumerator (); } @@ -97,6 +105,10 @@ namespace System.ComponentModel eventList.Remove (value); } + void IList.RemoveAt (int index) { + RemoveAt (index); + } + public void RemoveAt (int index) { eventList.RemoveAt (index); } @@ -176,6 +188,10 @@ namespace System.ComponentModel return col; } + int ICollection.Count { + get { return Count; } + } + public int Count { get { return eventList.Count; diff --git a/mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs b/mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs index 7c3e3fa2dd9..3b1aa926d44 100644 --- a/mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs +++ b/mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs @@ -334,6 +334,10 @@ namespace System.ComponentModel } } + int ICollection.Count { + get { return Count; } + } + public int Count { get { diff --git a/mcs/class/System/System.ComponentModel/TypeConverter.cs b/mcs/class/System/System.ComponentModel/TypeConverter.cs index aad81d86c43..f0e605098f1 100644 --- a/mcs/class/System/System.ComponentModel/TypeConverter.cs +++ b/mcs/class/System/System.ComponentModel/TypeConverter.cs @@ -265,11 +265,19 @@ namespace System.ComponentModel this.values = values; } + void ICollection.CopyTo (Array array, int index) { + CopyTo (array, index); + } + public void CopyTo (Array array, int index) { values.CopyTo (array, index); } + IEnumerator IEnumerable.GetEnumerator () { + return GetEnumerator (); + } + public IEnumerator GetEnumerator () { return values.GetEnumerator (); -- 2.25.1