/// <summary> /// Default constructor /// </summary> public EctoSalvageHelperViewModel(CommerceUserData userData) { this.EctoplasmBuyOrder = new Price(); this.EctoplasmSellListing = new Price(); this.Tax = new Price(); this.SalvageThreshold = new Price(); this.userData = userData; this.EctoplasmBuyOrder.PropertyChanged += (o, e) => this.CalculateSalvageThreshold(); this.EctoplasmSellListing.PropertyChanged += (o, e) => this.CalculateSalvageThreshold(); }
public CommerceMenu(ICommerceViewController viewFactory, CommerceUserData userData) { logger.Debug("Initializing menu items"); this.SubMenuItems = new ObservableCollection<IMenuItem>(); // Build up the sub menu items this.SubMenuItems.Add(new MenuItem(Properties.Resources.Configure, () => Commands.OpenCommerceSettingsCommand.Execute(null))); this.SubMenuItems.Add(new MenuItem(Properties.Resources.PriceTracker, viewFactory.DisplayPriceTracker, viewFactory.CanDisplayPriceTracker)); this.SubMenuItems.Add(null); // Null for a seperator this.SubMenuItems.Add(new CheckableMenuItem(Properties.Resources.BuyOrderPriceNotifications, true, () => userData.AreBuyOrderPriceNotificationsEnabled, userData)); this.SubMenuItems.Add(new CheckableMenuItem(Properties.Resources.SellListingPriceNotifications, true, () => userData.AreSellListingPriceNotificationsEnabled, userData)); this.SubMenuItems.Add(null); // Null for a seperator this.SubMenuItems.Add(new MenuItem(Properties.Resources.TPCalculator, viewFactory.DisplayTPCalculator, viewFactory.CanDisplayTPCalculator)); }
public CommerceController(ICommerceService commerceService, CommerceUserData userData) { logger.Debug("Initializing Commerce Controller"); this.commerceService = commerceService; this.UserData = userData; this.ItemPrices = new ObservableCollection<ItemPriceViewModel>(); this.PriceNotifications = new ObservableCollection<PriceNotificationViewModel>(); // Initialize the refresh timer this.refreshTimer = new Timer(this.Refresh); this.RefreshInterval = 30000; // 30 seconds... really only need to do this once a minute, but twice a minute isn't terrible // Initialize the start call count to 0 this.startCallCount = 0; logger.Info("Commerce Controller initialized"); }
public CommerceSettingsViewModel(ICommerceViewController viewController, CommerceUserData userData, MonitoredItemsConfigViewModel monitoredItemsConfigViewModel) { this.UserData = userData; this.MonitoredItemsConfigViewModel = monitoredItemsConfigViewModel; this.RebuildNamesDatabaseCommand = new DelegateCommand(viewController.DisplayRebuildItemNamesView, viewController.CanDisplayRebuildItemNamesView); }