mirror of
https://github.com/winscp/winscp.git
synced 2026-10-24 02:28:55 +03:00
33 lines
809 B
C#
33 lines
809 B
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace WinSCP
|
|
{
|
|
[Guid("B4CC583A-B64E-4797-9967-0FCB2F07C977")]
|
|
[ClassInterface(Constants.ClassInterface)]
|
|
[ComVisible(true)]
|
|
public class OperationResultBase
|
|
{
|
|
public SessionRemoteExceptionCollection Failures { get; private set; }
|
|
|
|
public bool IsSuccess { get { return (Failures.Count == 0); } }
|
|
|
|
internal OperationResultBase()
|
|
{
|
|
Failures = new SessionRemoteExceptionCollection();
|
|
}
|
|
|
|
public void Check()
|
|
{
|
|
if (!IsSuccess)
|
|
{
|
|
throw Failures[0];
|
|
}
|
|
}
|
|
|
|
internal void AddFailure(SessionRemoteException failure)
|
|
{
|
|
Failures.InternalAdd(failure);
|
|
}
|
|
}
|
|
}
|