Exemple #1
0
        /// <summary>
        /// Removes the offer.
        /// </summary>
        /// <param name="offer">The offer.</param>
        private void RemoveOffer(OfferViewModel offer)
        {
            if (offer != null)
            {
                Execute.OnUIThread(() =>
                {
                    if (offer.Active)
                    {
                        this._removeActive?.Invoke();
                    }

                    this.TradeOffers.Remove(offer);
                    this._activeOffers.Remove(offer);
                    var activeOffer = this.ActiveOffer;
                    if (activeOffer != null)
                    {
                        activeOffer.Active = true;
                        this.SendToLifeBulb(activeOffer.Event);
                    }
                    else
                    {
                        this._removeActive?.Invoke();
                    }

                    offer.Dispose();
                });
            }
        }