public ICommand Translate(Confirmation confirmation)
 {
     return(_commandFactory.Create(
                _partFactory.GetPart(Command.PartType.ID, "_"),
                _partFactory.GetPart(Command.PartType.Target, GlobalConfig.DefaultTargets.ConfirmationTarget),
                _partFactory.GetPart(Command.PartType.Order, confirmation.Confirms),
                _partFactory.GetPart(Command.PartType.Data, confirmation.ContainedErrors.ToString())));
 }
Example #2
0
 public ICommand Create(IPart idPart, IPart targetPart, IPart orderPart, IPart dataPart)
 {
     return(new Command(idPart,
                        _factory.GetPart(PartType.HostID, HostSettings.HostID),
                        targetPart,
                        orderPart,
                        string.IsNullOrEmpty(dataPart.Data) ? _factory.GetPart(PartType.Empty, string.Empty) : dataPart,
                        TimestampFactory.Timestamp));
 }
Example #3
0
 public ICommand Translate(Reply reply)
 {
     return(_commandFactory.Create(
                _partFactory.GetPart(Command.PartType.ID, reply.ID),
                _partFactory.GetPart(Command.PartType.Target, DefaultTargets.ReplyTarget),
                _partFactory.GetPart(Command.PartType.Order, reply.ReplyTo),
                string.IsNullOrEmpty(reply.Data.GetDataInTransmittableFormat())
             ? _partFactory.GetPart(Command.PartType.Empty, string.Empty)
             : _partFactory.GetPart(Command.PartType.Data, reply.Data.GetDataInTransmittableFormat())));
 }
Example #4
0
 public ICommand Translate(Order order)
 {
     return(_commandFactory.Create(
                _partFactory.GetPart(Command.PartType.ID, order.ID),
                _partFactory.GetPart(Command.PartType.Target, order.Target),
                _partFactory.GetPart(Command.PartType.Order, order.ExactOrder),
                order.Data is EmptyDataPackSingleton
             ? _partFactory.GetPart(Command.PartType.Empty, string.Empty)
             : _partFactory.GetPart(Command.PartType.Data, order.Data.GetDataInTransmittableFormat())));
 }