1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00
Files
winscp/dotnet/OperationResultBase.cs
Martin Prikryl 2e4b4738f0 5.2
2018-01-11 15:30:21 +01:00

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);
}
}
}