Ver Fonte

in System.Diagnostics:

2007-08-03  Jb Evain  <[email protected]>

	* ProcessThreadCollection.cs
	  ProcessModuleCollection.cs: use our own collection base
	  for the 2.1 profile, as ReadOnlyCollectionBase does not exist
	  in 2.1, and they are internalized by the linker.

in System.ComponentModel:

2007-08-03  Jb Evain  <[email protected]>

	* ComponentCollection.cs: use our own collection base
	  for the 2.1 profile, as ReadOnlyCollectionBase does not exist
	  in 2.1, and they are internalized by the linker.

svn path=/trunk/mcs/; revision=83421
Jb Evain há 18 anos atrás
pai
commit
e8dcf3eef8

+ 6 - 0
mcs/class/System/System.ComponentModel/ChangeLog

@@ -1,3 +1,9 @@
+2007-08-03  Jb Evain  <[email protected]>
+
+	* ComponentCollection.cs: use our own collection base
+	  for the 2.1 profile, as ReadOnlyCollectionBase does not exist
+	  in 2.1, and they are internalized by the linker.
+
 2007-08-01  Atsushi Enomoto  <[email protected]>
 
 	* BackgroundWorker.cs : remove extra MonoTODOs.

+ 17 - 2
mcs/class/System/System.ComponentModel/ComponentCollection.cs

@@ -37,9 +37,24 @@ using System.Runtime.InteropServices;
 using System.Reflection;
 
 namespace System.ComponentModel {
-	[ComVisible (true)]
-	public class ComponentCollection : ReadOnlyCollectionBase {
 
+#if NET_2_1
+	public class ComponentCollectionBase : System.Collections.Generic.List<IComponent>
+	{
+		protected ComponentCollectionBase InnerList {
+			get { return this; }
+		}
+	}
+#endif
+
+	[ComVisible (true)]
+	public class ComponentCollection :
+#if !NET_2_1
+		ReadOnlyCollectionBase
+#else
+		ComponentCollectionBase
+#endif
+	{
 		#region Constructors
 
 		public ComponentCollection (IComponent[] components)

+ 7 - 0
mcs/class/System/System.Diagnostics/ChangeLog

@@ -1,3 +1,10 @@
+2007-08-03  Jb Evain  <[email protected]>
+
+	* ProcessThreadCollection.cs
+	  ProcessModuleCollection.cs: use our own collection base
+	  for the 2.1 profile, as ReadOnlyCollectionBase does not exist
+	  in 2.1, and they are internalized by the linker.
+
 2007-08-02  Atsushi Enomoto  <[email protected]>
 
 	* EventLogTraceListener.cs : fixed wrong 2.0 dependency in 1.x.

+ 15 - 2
mcs/class/System/System.Diagnostics/ProcessModuleCollection.cs

@@ -33,9 +33,22 @@ using System.Collections;
 
 namespace System.Diagnostics 
 {
-	public class ProcessModuleCollection : ReadOnlyCollectionBase 
+#if NET_2_1
+	public class ProcessModuleCollectionBase : System.Collections.Generic.List<ProcessModule>
+	{
+		protected ProcessModuleCollectionBase InnerList {
+			get { return this; }
+		}
+	}
+#endif
+
+	public class ProcessModuleCollection :
+#if !NET_2_1	
+		ReadOnlyCollectionBase
+#else
+		ProcessModuleCollectionBase
+#endif
 	{
-		
 		protected ProcessModuleCollection() 
 		{
 		}

+ 21 - 1
mcs/class/System/System.Diagnostics/ProcessThreadCollection.cs

@@ -33,7 +33,27 @@ using System.Collections;
 
 namespace System.Diagnostics 
 {
-	public class ProcessThreadCollection : ReadOnlyCollectionBase 
+#if NET_2_1
+	public class ProcessThreadCollectionBase : System.Collections.Generic.List<ProcessThread>
+	{
+		protected ProcessThreadCollectionBase InnerList {
+			get { return this; }
+		}
+
+		public new int Add (ProcessThread thread)
+		{
+			base.Add (thread);
+			return Count - 1;
+		}
+	}
+#endif
+
+	public class ProcessThreadCollection :
+#if !NET_2_1
+		ReadOnlyCollectionBase
+#else
+		ProcessThreadCollectionBase
+#endif
 	{
 		protected ProcessThreadCollection() 
 		{