Example #1
0
 public AuctionItem(string description, SpecialFeatures specialFeatures, int currentPrice)
 {
     this.description     = description;
     this.specialFeatures = specialFeatures;
     this.currentPrice    = currentPrice;
     this.images          = new ObservableCollection <string>();
 }
Example #2
0
 public AuctionItem(string description, ProductCategory category, int startPrice, DateTime startDate, User owner, SpecialFeatures specialFeatures)
 {
     this.description = description;
     this.category = category;
     this.startPrice = startPrice;
     this.startDate = startDate;
     this.owner = owner;
     this.specialFeatures = specialFeatures;
     this.bids = new ObservableCollection<Bid>();
 }
Example #3
0
 public AuctionItem(string description, ProductCategory category, int startPrice, DateTime startDate, User owner, SpecialFeatures specialFeatures)
 {
     this.description     = description;
     this.category        = category;
     this.startPrice      = startPrice;
     this.startDate       = startDate;
     this.owner           = owner;
     this.specialFeatures = specialFeatures;
     this.bids            = new ObservableCollection <Bid>();
 }
Example #4
0
 public AuctionItem(string description, ProductCategory category, int startPrice, DateTime startDate, User owner,
                    SpecialFeatures specialFeatures)
 {
     _description     = description;
     _category        = category;
     _startPrice      = startPrice;
     _startDate       = startDate;
     Owner            = owner;
     _specialFeatures = specialFeatures;
     _bids            = new ObservableCollection <Bid>();
 }
Example #5
0
 public AuctionItem(string description, ProductCategory category, int startPrice, DateTime startDate, User owner,
     SpecialFeatures specialFeatures)
 {
     _description = description;
     _category = category;
     _startPrice = startPrice;
     _startDate = startDate;
     Owner = owner;
     _specialFeatures = specialFeatures;
     _bids = new ObservableCollection<Bid>();
 }
Example #6
0
        /// <summary>
        /// Finds an item by ID, recursively
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="user">The user.</param>
        /// <returns>BaseItem.</returns>
        public override BaseItem FindItemById(Guid id, User user)
        {
            var item = base.FindItemById(id, user);

            if (item != null)
            {
                return(item);
            }

            if (SpecialFeatures != null)
            {
                return(SpecialFeatures.FirstOrDefault(i => i.Id == id));
            }

            return(null);
        }
Example #7
0
        /// <summary>
        /// Overrides the base implementation to refresh metadata for special features
        /// </summary>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <param name="forceSave">if set to <c>true</c> [is new item].</param>
        /// <param name="forceRefresh">if set to <c>true</c> [force].</param>
        /// <param name="allowSlowProviders">if set to <c>true</c> [allow slow providers].</param>
        /// <param name="resetResolveArgs">if set to <c>true</c> [reset resolve args].</param>
        /// <returns>Task{System.Boolean}.</returns>
        public override async Task <bool> RefreshMetadata(CancellationToken cancellationToken, bool forceSave = false, bool forceRefresh = false, bool allowSlowProviders = true, bool resetResolveArgs = true)
        {
            // Lazy load these again
            SpecialFeatures = null;

            // Kick off a task to refresh the main item
            var result = await base.RefreshMetadata(cancellationToken, forceSave, forceRefresh, allowSlowProviders, resetResolveArgs).ConfigureAwait(false);

            var tasks = SpecialFeatures.Select(item => item.RefreshMetadata(cancellationToken, forceSave, forceRefresh, allowSlowProviders));

            await Task.WhenAll(tasks).ConfigureAwait(false);

            cancellationToken.ThrowIfCancellationRequested();

            return(result);
        }