DocSpace-buildtools/common/ASC.Core.Common/Notify/Messages/SendResponse.cs

68 lines
1.8 KiB
C#
Raw Normal View History

2022-02-15 11:52:43 +00:00
namespace ASC.Notify.Messages;
[Serializable]
public class SendResponse
2019-05-15 14:56:09 +00:00
{
2022-02-15 11:52:43 +00:00
public SendResponse()
2019-05-15 14:56:09 +00:00
{
2022-02-15 11:52:43 +00:00
Result = SendResult.OK;
}
2019-05-15 14:56:09 +00:00
2022-02-15 11:52:43 +00:00
public SendResponse(INotifyAction action, IRecipient recipient, Exception exc)
{
Result = SendResult.Impossible;
Exception = exc;
Recipient = recipient;
NotifyAction = action;
}
2019-05-15 14:56:09 +00:00
2022-02-15 11:52:43 +00:00
public SendResponse(INotifyAction action, string senderName, IRecipient recipient, Exception exc)
{
Result = SendResult.Impossible;
SenderName = senderName;
Exception = exc;
Recipient = recipient;
NotifyAction = action;
}
2019-05-15 14:56:09 +00:00
2022-02-15 11:52:43 +00:00
public SendResponse(INotifyAction action, string senderName, IRecipient recipient, SendResult sendResult)
{
SenderName = senderName;
Recipient = recipient;
Result = sendResult;
NotifyAction = action;
}
2019-05-15 14:56:09 +00:00
2022-02-15 11:52:43 +00:00
public SendResponse(INoticeMessage message, string sender, SendResult result)
{
NoticeMessage = message;
SenderName = sender;
Result = result;
if (message != null)
2019-05-15 14:56:09 +00:00
{
2022-02-15 11:52:43 +00:00
Recipient = message.Recipient;
NotifyAction = message.Action;
2019-05-15 14:56:09 +00:00
}
2022-02-15 11:52:43 +00:00
}
2019-05-15 14:56:09 +00:00
2022-02-15 11:52:43 +00:00
public SendResponse(INoticeMessage message, string sender, Exception exc)
{
NoticeMessage = message;
SenderName = sender;
Result = SendResult.Impossible;
Exception = exc;
if (message != null)
2019-05-15 14:56:09 +00:00
{
2022-02-15 11:52:43 +00:00
Recipient = message.Recipient;
NotifyAction = message.Action;
2019-05-15 14:56:09 +00:00
}
}
2022-02-15 11:52:43 +00:00
public INoticeMessage NoticeMessage { get; internal set; }
public INotifyAction NotifyAction { get; internal set; }
public SendResult Result { get; set; }
public Exception Exception { get; set; }
public string SenderName { get; internal set; }
public IRecipient Recipient { get; internal set; }
}