* TraceListenerCollection.cs: Corrected indexer property to provide the
[mono.git] / mcs / class / System / System.Diagnostics / TraceListenerCollection.cs
index 8dd0c9a1b16ac72c0187a67c0da14f5f06816bc4..dacded7f8512d3fba4b7ee8d9d110b28128f7ed0 100644 (file)
@@ -54,11 +54,16 @@ namespace System.Diagnostics {
                        }
                }
 
-               public object this [int index] {
-                       get {return listeners[index];}
+               public TraceListener this [int index] {
+                       get {return (TraceListener) listeners[index];}
                        set {listeners[index] = value;}
                }
 
+               object IList.this [int index] {
+                       get {return listeners[index];}
+                       set {((IList)this).Insert (index, value);}
+               }
+
                bool ICollection.IsSynchronized {
                        get {return listeners.IsSynchronized;}
                }