/// <summary> /// Default constructor /// </summary> /// <param name="itemPriceWatch">The item's price watch information</param> /// <param name="notificationType">The notification type</param> /// <param name="price">The current price of the item, in copper</param> public PriceNotificationViewModel(PriceWatchViewModel itemPriceWatch, PriceNotificationType notificationType, int price, ICollection <PriceNotificationViewModel> displayedNotificationsCollection) { this.itemPriceWatch = itemPriceWatch; this.notificationType = notificationType; this.price = new Price(); this.price.Value = price; this.isRemovingNotification = false; this.displayedNotifications = displayedNotificationsCollection; }
/// <summary> /// Determines if we can show a notification for the given price notification, based on user settings /// </summary> /// <param name="objectiveData">The price watch's data</param> /// <param name="notificationType">The type of notification</param> /// <returns>True if the notification can be shown, else false</returns> private bool CanShowNotification(ItemPriceViewModel priceWatch, PriceNotificationType notificationType) { bool canShow = false; switch (notificationType) { case PriceNotificationType.BuyOrder: canShow = this.UserData.AreBuyOrderPriceNotificationsEnabled && !priceWatch.IsBuyOrderNotificationShown; break; case PriceNotificationType.SellListing: canShow = this.UserData.AreSellListingPriceNotificationsEnabled && !priceWatch.IsSellListingNotificationShown; break; default: break; } return(canShow); }
/// <summary> /// Determines if we can show a notification for the given price notification, based on user settings /// </summary> /// <param name="objectiveData">The price watch's data</param> /// <param name="notificationType">The type of notification</param> /// <returns>True if the notification can be shown, else false</returns> private bool CanShowNotification(ItemPriceViewModel priceWatch, PriceNotificationType notificationType) { bool canShow = false; switch (notificationType) { case PriceNotificationType.BuyOrder: canShow = this.UserData.AreBuyOrderPriceNotificationsEnabled && !priceWatch.IsBuyOrderNotificationShown; break; case PriceNotificationType.SellListing: canShow = this.UserData.AreSellListingPriceNotificationsEnabled && !priceWatch.IsSellListingNotificationShown; break; default: break; } return canShow; }
/// <summary> /// Default constructor /// </summary> /// <param name="itemPriceWatch">The item's price watch information</param> /// <param name="notificationType">The notification type</param> /// <param name="price">The current price of the item, in copper</param> public PriceNotificationViewModel(ItemPriceViewModel itemPriceWatch, PriceNotificationType notificationType, int price, ICollection<PriceNotificationViewModel> displayedNotificationsCollection) { this.itemPriceWatch = itemPriceWatch; this.notificationType = notificationType; this.price = new Price(); this.price.Value = price; this.isRemovingNotification = false; this.displayedNotifications = displayedNotificationsCollection; }