2002-05-03 Rodrigo Moya <rodrigo@ximian.com>
authorRodrigo Moya <rodrigo@mono-cvs.ximian.com>
Sat, 4 May 2002 20:56:53 +0000 (20:56 -0000)
committerRodrigo Moya <rodrigo@mono-cvs.ximian.com>
Sat, 4 May 2002 20:56:53 +0000 (20:56 -0000)
* AttributeCollection.cs:
* EventDescriptor.cs:
* EventDescriptorCollection.cs:
* ICustomTypeDescriptor.cs: new files.

svn path=/trunk/mcs/; revision=4282

mcs/class/System/System.ComponentModel/AttributeCollection.cs [new file with mode: 0644]
mcs/class/System/System.ComponentModel/ChangeLog
mcs/class/System/System.ComponentModel/EventDescriptor.cs [new file with mode: 0644]
mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs [new file with mode: 0644]
mcs/class/System/System.ComponentModel/ICustomTypeDescriptor.cs [new file with mode: 0644]

diff --git a/mcs/class/System/System.ComponentModel/AttributeCollection.cs b/mcs/class/System/System.ComponentModel/AttributeCollection.cs
new file mode 100644 (file)
index 0000000..b3de98c
--- /dev/null
@@ -0,0 +1,92 @@
+//
+// System.ComponentModel.AttributeCollection.cs
+//
+// Author: Rodrigo Moya (rodrigo@ximian.com)
+//
+// (C) Ximian, Inc.
+//
+
+using System;
+using System.Collections;
+
+namespace System.ComponentModel
+{
+       public class AttributeCollection : ICollection, IEnumerable
+       {
+               private ArrayList attrList;
+               public static readonly AttributeCollection Empty;
+               
+               public AttributeCollection (Attribute[] attributes) {
+                       for (int i = 0; i < attributes.Length; i++)
+                               attrList.Add (attributes[i]);
+               }
+
+               public bool Contains (Attribute attr) {
+                       for (int i = 0; i < attrList.Count; i++) {
+                               if (attrList[i] == attr)
+                                       return true;
+                       }
+
+                       return false;
+               }
+
+               [MonoTODO]
+               public bool Contains (Attribute[] attributes) {
+                       throw new NotImplementedException ();
+               }
+
+               public void CopyTo (Array array, int index) {
+                       attrList.CopyTo (array, index);
+               }
+
+               public IEnumerator GetEnumerator () {
+                       return attrList.GetEnumerator ();
+               }
+
+               [MonoTODO]
+               public bool Matches (Attribute attr) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public bool Matches (Attribute[] attributes) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               protected Attribute GetDefaultAttribute (Type attributeType) {
+                       throw new NotImplementedException ();
+               }
+
+               public bool IsSynchronized {
+                       get {
+                               return attrList.IsSynchronized;
+                       }
+               }
+
+               public object SyncRoot {
+                       get {
+                               return attrList.SyncRoot;
+                       }
+               }
+               
+               public int Count {
+                       get {
+                               return attrList.Count;
+                       }
+               }
+
+               public virtual Attribute this[Type type] {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public virtual Attribute this[int index] {
+                       get {
+                               return attrList[index];
+                       }
+               }
+       }
+}
index 039bdb73d660bb9321ecda3868d00655ecde2b9c..8230b468330764fc7d52957dd7e8b1c15df87b68 100644 (file)
@@ -1,3 +1,10 @@
+2002-05-03  Rodrigo Moya <rodrigo@ximian.com>
+
+       * AttributeCollection.cs:
+       * EventDescriptor.cs:
+       * EventDescriptorCollection.cs:
+       * ICustomTypeDescriptor.cs: new files.
+
 2002-05-01  Duncan Mak  <duncan@ximian.com>
 
        * ListChangedType.cs: 
diff --git a/mcs/class/System/System.ComponentModel/EventDescriptor.cs b/mcs/class/System/System.ComponentModel/EventDescriptor.cs
new file mode 100644 (file)
index 0000000..623319a
--- /dev/null
@@ -0,0 +1,18 @@
+//
+// System.ComponentModel.EventDescriptor.cs
+//
+// Author: Rodrigo Moya (rodrigo@ximian.com)
+//
+// (C) Ximian, Inc.
+//
+
+namespace System.ComponentModel
+{
+       public abstract class EventDescriptor : MemberDescriptor
+       {
+               [MonoTODO]
+               protected EventDescriptor (MemberDescriptor desc) {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs b/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs
new file mode 100644 (file)
index 0000000..f197475
--- /dev/null
@@ -0,0 +1,111 @@
+//
+// System.ComponentModel.EventDescriptorCollection.cs
+//
+// Author: Rodrigo Moya (rodrigo@ximian.com)
+//
+// (C) Ximian, Inc.
+//
+
+using System.Collections;
+
+namespace System.ComponentModel
+{
+       public class EventDescriptorCollection : IList, ICollection, IEnumerable
+       {
+               private ArrayList eventList;
+               
+               public static readonly EventDescriptorCollection Empty;
+               
+               public EventDescriptorCollection (EventDescriptor[] events) {
+                       for (int i = 0; i < events.Length; i++)
+                               this.Add (events[i]);
+               }
+
+               public int Add (EventDescriptor value) {
+                       return eventList.Add (value);
+               }
+
+               public void Clear () {
+                       eventList.Clear ();
+               }
+
+               public bool Contains (EventDescriptor value) {
+                       return eventList.Contains (value);
+               }
+
+               [MonoTODO]
+               public virtual EventDescriptor Find (string name, bool ignoreCase) {
+                       throw new NotImplementedException ();
+               }
+
+               public IEnumerator GetEnumerator () {
+                       return eventList.GetEnumerator ();
+               }
+
+               public int IList.IndexOf (EventDescriptor value) {
+                       return eventList.IndexOf (value);
+               }
+
+               public void IList.Insert (int index, EventDescriptor value) {
+                       eventList.Insert (index, value);
+               }
+
+               public void IList.Remove (EventDescriptor value) {
+                       eventList.Remove (value);
+               }
+
+               public void RemoveAt (int index) {
+                       eventList.RemoveAt (index);
+               }
+
+               [MonoTODO]
+               public virtual EventDescriptorCollection Sort () {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public virtual EventDescriptorCollection Sort (IComparer comparer) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public virtual EventDescriptorCollection Sort (string[] order) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public virtual EventDescriptorCollection Sort (string[] order,
+                                                              IComparer comparer) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public virtual EventDescriptorCollection InternalSort (IComparer comparer) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public virtual EventDescriptorCollection InternalSort (string[] order) {
+                       throw new NotImplementedException ();
+               }
+               
+               public int Count {
+                       get {
+                               return eventList.Count;
+                       }
+               }
+
+                public virtual EventDescriptor this[string name] {
+                        [MonoTODO]
+                        get {
+                                throw new NotImplementedException ();
+                        }
+                }
+
+               public virtual EventDescriptor this[int index] {
+                       get {
+                               return eventList[index];
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System/System.ComponentModel/ICustomTypeDescriptor.cs b/mcs/class/System/System.ComponentModel/ICustomTypeDescriptor.cs
new file mode 100644 (file)
index 0000000..89b7452
--- /dev/null
@@ -0,0 +1,37 @@
+//
+// System.ComponentModel.ICustomTypeDescriptor.cs
+//
+// Author: Rodrigo Moya (rodrigo@ximian.com)
+//
+// (C) Ximian, Inc.
+//
+
+namespace System.ComponentModel
+{
+       public interface ICustomTypeDescriptor
+       {
+               AttributeCollection GetAttributes();
+
+               string GetClassName();
+
+               string GetComponentName();
+
+               TypeConverter GetConverter();
+
+               EventDescriptor GetDefaultEvent();
+
+               PropertyDescriptor GetDefaultProperty();
+
+               object GetEditor(Type editorBaseType);
+
+               EventDescriptorCollection GetEvents();
+
+               EventDescriptorCollection GetEvents(Attribute[] arr);
+
+               PropertyDescriptorCollection GetProperties();
+
+               PropertyDescriptorCollection GetProperties(Attribute[] arr);
+
+               object GetPropertyOwner(PropertyDescriptor pd);
+       }
+}