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!
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace WinSCP
|
|
{
|
|
[Guid("D0ADB4F7-47AE-43AC-AA41-9114650EA51A")]
|
|
[ClassInterface(Constants.ClassInterface)]
|
|
[ComVisible(true)]
|
|
public sealed class SynchronizationResult : OperationResultBase, ISynchronizationResult
|
|
{
|
|
public TransferEventArgsCollection Uploads { get; private set; }
|
|
public TransferEventArgsCollection Downloads { get; private set; }
|
|
public RemovalEventArgsCollection Removals { get; private set; }
|
|
|
|
internal SynchronizationResult()
|
|
{
|
|
Uploads = new TransferEventArgsCollection();
|
|
Downloads = new TransferEventArgsCollection();
|
|
Removals = new RemovalEventArgsCollection();
|
|
}
|
|
|
|
internal void AddUpload(TransferEventArgs upload)
|
|
{
|
|
Uploads.InternalAdd(upload);
|
|
}
|
|
|
|
internal void AddDownload(TransferEventArgs download)
|
|
{
|
|
Downloads.InternalAdd(download);
|
|
}
|
|
|
|
internal void AddRemoval(RemovalEventArgs removal)
|
|
{
|
|
Removals.InternalAdd(removal);
|
|
}
|
|
}
|
|
}
|