Explorar el Código

.NET assembly collections are tagged with ClassInterfaceType.None to avoid warnings from regasm

Source commit: ba3dd86ad74d0ff76c29e653277a23ae5d46e07d
Martin Prikryl hace 1 año
padre
commit
cdb9effd31

+ 2 - 0
dotnet/internal/Constants.cs

@@ -5,5 +5,7 @@ namespace WinSCP
     internal static class Constants
     {
         public const ClassInterfaceType ClassInterface = ClassInterfaceType.AutoDispatch;
+        // Avoids warning from regasm and is probably the right choice anyway
+        public const ClassInterfaceType CollectionClassInterface = ClassInterfaceType.None;
     }
 }

+ 1 - 1
dotnet/interopcollections/ComparisonDifferenceCollection.cs

@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
 namespace WinSCP
 {
     [Guid("28957CC8-DEBC-48D0-841B-48AD3CB3B49F")]
-    [ClassInterface(Constants.ClassInterface)]
+    [ClassInterface(Constants.CollectionClassInterface)]
     [ComVisible(true)]
     [ComDefaultInterface(typeof(IEnumerable))] // See the comment at ReadOnlyInteropCollection
     public class ComparisonDifferenceCollection : ReadOnlyInteropCollection<ComparisonDifference>

+ 1 - 1
dotnet/interopcollections/RemoteFileInfoCollection.cs

@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
 namespace WinSCP
 {
     [Guid("39AA3D00-578C-49AF-B3E4-16CE26C710C6")]
-    [ClassInterface(Constants.ClassInterface)]
+    [ClassInterface(Constants.CollectionClassInterface)]
     [ComVisible(true)]
     [ComDefaultInterface(typeof(IEnumerable))] // See the comment at ReadOnlyInteropCollection
     public class RemoteFileInfoCollection : ReadOnlyInteropCollection<RemoteFileInfo>

+ 1 - 1
dotnet/interopcollections/RemovalEventArgsCollection.cs

@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
 namespace WinSCP
 {
     [Guid("574FF430-FD40-41F9-9A04-971D3CF844B7")]
-    [ClassInterface(Constants.ClassInterface)]
+    [ClassInterface(Constants.CollectionClassInterface)]
     [ComVisible(true)]
     [ComDefaultInterface(typeof(IEnumerable))] // See the comment at ReadOnlyInteropCollection
     public class RemovalEventArgsCollection : ReadOnlyInteropCollection<RemovalEventArgs>

+ 1 - 1
dotnet/interopcollections/SessionRemoteExceptionCollection.cs

@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
 namespace WinSCP
 {
     [Guid("2309282F-B89B-4F6B-AEB1-D3E1629B7033")]
-    [ClassInterface(Constants.ClassInterface)]
+    [ClassInterface(Constants.CollectionClassInterface)]
     [ComVisible(true)]
     [ComDefaultInterface(typeof(IEnumerable))] // See the comment at ReadOnlyInteropCollection
     public class SessionRemoteExceptionCollection : ReadOnlyInteropCollection<SessionRemoteException>

+ 1 - 1
dotnet/interopcollections/StringCollection.cs

@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
 namespace WinSCP
 {
     [Guid("E402CB1F-6219-4C79-9EDF-1914D9589909")]
-    [ClassInterface(Constants.ClassInterface)]
+    [ClassInterface(Constants.CollectionClassInterface)]
     [ComVisible(true)]
     [ComDefaultInterface(typeof(IEnumerable))] // See the comment at ReadOnlyInteropCollection
     public class StringCollection : ReadOnlyInteropCollection<string>

+ 1 - 1
dotnet/interopcollections/TransferEventArgsCollection.cs

@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
 namespace WinSCP
 {
     [Guid("0285917B-581A-4F6F-9A9D-1C34ABFB4E38")]
-    [ClassInterface(Constants.ClassInterface)]
+    [ClassInterface(Constants.CollectionClassInterface)]
     [ComVisible(true)]
     [ComDefaultInterface(typeof(IEnumerable))] // See the comment at ReadOnlyInteropCollection
     public class TransferEventArgsCollection : ReadOnlyInteropCollection<TransferEventArgs>