Exemple #1
0
        public override void Execute()
        {
            var errors = GivePackage.Errors.Concat(ReceivePackage.Errors);

            if (errors.Any())
            {
                Executor.Log.Add(Recipient.CreateLogMessage("We could not execute a trade with the " + Recipient + " because: " + errors.First()));
                Recipient.Log.Add(Executor.CreateLogMessage("We could not execute a trade with the " + Executor + " because: " + errors.First()));
            }
            else
            {
                if (GivePackage != null)
                {
                    GivePackage.Transfer(Recipient);
                }
                if (ReceivePackage != null)
                {
                    ReceivePackage.Transfer(Executor);
                }
            }
        }