mirror of
https://github.com/winscp/winscp.git
synced 2026-10-24 02:28:55 +03:00
https://winscp.net/tracker/856 ---- @mjkent: Add interfaces to .NET assembly for improved testability This PR extracts interfaces from the main WinSCP .NET assembly classes (Session, SessionOptions, TransferOptions, etc.), enabling: Unit testing - Mock ISession to test code that uses WinSCP without requiring actual SFTP/FTP connections Dependency injection - Register interfaces in DI containers for cleaner architecture Decoupling - Program against abstractions rather than concrete implementations This change should be non-breaking, but I'm new to this project so review and feedback appreciated!
23 lines
642 B
C#
23 lines
642 B
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace WinSCP
|
|
{
|
|
[Guid("74F668E6-8EF2-4D01-84D8-DA2FE619C062")]
|
|
[ClassInterface(Constants.ClassInterface)]
|
|
[ComVisible(true)]
|
|
public sealed class TransferOperationResult : OperationResultBase, ITransferOperationResult
|
|
{
|
|
public TransferEventArgsCollection Transfers { get; private set; }
|
|
|
|
internal TransferOperationResult()
|
|
{
|
|
Transfers = new TransferEventArgsCollection();
|
|
}
|
|
|
|
internal void AddTransfer(TransferEventArgs operation)
|
|
{
|
|
Transfers.InternalAdd(operation);
|
|
}
|
|
}
|
|
}
|