Browse Source

Bug 2187: Implement generic ICollection implicitly by .NET assembly collections

https://winscp.net/tracker/2187

Source commit: 0bfc6c5ad6cc990d58144d207c2d20e85321c99c
Martin Prikryl 2 years ago
parent
commit
0d2808822c

+ 3 - 2
dotnet/interopcollections/ComparisonDifferenceCollection.cs

@@ -7,6 +7,7 @@ namespace WinSCP
     [Guid("28957CC8-DEBC-48D0-841B-48AD3CB3B49F")]
     [ClassInterface(Constants.ClassInterface)]
     [ComVisible(true)]
+    [ComDefaultInterface(typeof(IEnumerable))]
     public class ComparisonDifferenceCollection : ICollection<ComparisonDifference>
     {
         internal ComparisonDifferenceCollection()
@@ -66,7 +67,7 @@ namespace WinSCP
 
         #region IEnumerable<ComparisonDifference> Members
 
-        IEnumerator<ComparisonDifference> IEnumerable<ComparisonDifference>.GetEnumerator()
+        public IEnumerator<ComparisonDifference> GetEnumerator()
         {
             return _helper.GetEnumerator();
         }
@@ -75,7 +76,7 @@ namespace WinSCP
 
         #region IEnumerable Members
 
-        public IEnumerator GetEnumerator()
+        IEnumerator IEnumerable.GetEnumerator()
         {
             return _helper.GetEnumerator();
         }

+ 3 - 2
dotnet/interopcollections/RemoteFileInfoCollection.cs

@@ -7,6 +7,7 @@ namespace WinSCP
     [Guid("39AA3D00-578C-49AF-B3E4-16CE26C710C6")]
     [ClassInterface(Constants.ClassInterface)]
     [ComVisible(true)]
+    [ComDefaultInterface(typeof(IEnumerable))]
     public class RemoteFileInfoCollection : ICollection<RemoteFileInfo>
     {
         internal RemoteFileInfoCollection()
@@ -66,7 +67,7 @@ namespace WinSCP
 
         #region IEnumerable<RemoteFileInfo> Members
 
-        IEnumerator<RemoteFileInfo> IEnumerable<RemoteFileInfo>.GetEnumerator()
+        public IEnumerator<RemoteFileInfo> GetEnumerator()
         {
             return _helper.GetEnumerator();
         }
@@ -75,7 +76,7 @@ namespace WinSCP
 
         #region IEnumerable Members
 
-        public IEnumerator GetEnumerator()
+        IEnumerator IEnumerable.GetEnumerator()
         {
             return _helper.GetEnumerator();
         }

+ 3 - 2
dotnet/interopcollections/RemovalEventArgsCollection.cs

@@ -7,6 +7,7 @@ namespace WinSCP
     [Guid("574FF430-FD40-41F9-9A04-971D3CF844B7")]
     [ClassInterface(Constants.ClassInterface)]
     [ComVisible(true)]
+    [ComDefaultInterface(typeof(IEnumerable))]
     public class RemovalEventArgsCollection : ICollection<RemovalEventArgs>
     {
         internal RemovalEventArgsCollection()
@@ -66,7 +67,7 @@ namespace WinSCP
 
         #region IEnumerable<RemovalEventArgs> Members
 
-        IEnumerator<RemovalEventArgs> IEnumerable<RemovalEventArgs>.GetEnumerator()
+        public IEnumerator<RemovalEventArgs> GetEnumerator()
         {
             return _helper.GetEnumerator();
         }
@@ -75,7 +76,7 @@ namespace WinSCP
 
         #region IEnumerable Members
 
-        public IEnumerator GetEnumerator()
+        IEnumerator IEnumerable.GetEnumerator()
         {
             return _helper.GetEnumerator();
         }

+ 3 - 2
dotnet/interopcollections/SessionRemoteExceptionCollection.cs

@@ -7,6 +7,7 @@ namespace WinSCP
     [Guid("2309282F-B89B-4F6B-AEB1-D3E1629B7033")]
     [ClassInterface(Constants.ClassInterface)]
     [ComVisible(true)]
+    [ComDefaultInterface(typeof(IEnumerable))]
     public class SessionRemoteExceptionCollection : ICollection<SessionRemoteException>
     {
         internal SessionRemoteExceptionCollection()
@@ -66,7 +67,7 @@ namespace WinSCP
 
         #region IEnumerable<SessionRemoteException> Members
 
-        IEnumerator<SessionRemoteException> IEnumerable<SessionRemoteException>.GetEnumerator()
+        public IEnumerator<SessionRemoteException> GetEnumerator()
         {
             return _helper.GetEnumerator();
         }
@@ -75,7 +76,7 @@ namespace WinSCP
 
         #region IEnumerable Members
 
-        public IEnumerator GetEnumerator()
+        IEnumerator IEnumerable.GetEnumerator()
         {
             return _helper.GetEnumerator();
         }

+ 3 - 2
dotnet/interopcollections/StringCollection.cs

@@ -7,6 +7,7 @@ namespace WinSCP
     [Guid("E402CB1F-6219-4C79-9EDF-1914D9589909")]
     [ClassInterface(Constants.ClassInterface)]
     [ComVisible(true)]
+    [ComDefaultInterface(typeof(IEnumerable))]
     public class StringCollection : ICollection<string>
     {
         internal StringCollection()
@@ -66,7 +67,7 @@ namespace WinSCP
 
         #region IEnumerable<SessionRemoteException> Members
 
-        IEnumerator<string> IEnumerable<string>.GetEnumerator()
+        public IEnumerator<string> GetEnumerator()
         {
             return _helper.GetEnumerator();
         }
@@ -75,7 +76,7 @@ namespace WinSCP
 
         #region IEnumerable Members
 
-        public IEnumerator GetEnumerator()
+        IEnumerator IEnumerable.GetEnumerator()
         {
             return _helper.GetEnumerator();
         }

+ 3 - 2
dotnet/interopcollections/TransferEventArgsCollection.cs

@@ -7,6 +7,7 @@ namespace WinSCP
     [Guid("0285917B-581A-4F6F-9A9D-1C34ABFB4E38")]
     [ClassInterface(Constants.ClassInterface)]
     [ComVisible(true)]
+    [ComDefaultInterface(typeof(IEnumerable))]
     public class TransferEventArgsCollection : ICollection<TransferEventArgs>
     {
         internal TransferEventArgsCollection()
@@ -66,7 +67,7 @@ namespace WinSCP
 
         #region IEnumerable<SessionRemoteException> Members
 
-        IEnumerator<TransferEventArgs> IEnumerable<TransferEventArgs>.GetEnumerator()
+        public IEnumerator<TransferEventArgs> GetEnumerator()
         {
             return _helper.GetEnumerator();
         }
@@ -75,7 +76,7 @@ namespace WinSCP
 
         #region IEnumerable Members
 
-        public IEnumerator GetEnumerator()
+        IEnumerator IEnumerable.GetEnumerator()
         {
             return _helper.GetEnumerator();
         }