Example #1
0
        /// <summary>
        /// Performs all neccesary shutdown activities for this module
        /// </summary>
        private void Shutdown()
        {
            logger.Debug("Shutting down Commerce Module");

            // Shut down the commerce controller
            this.commerceController.Shutdown();

            // Shutdown the view controller
            this.viewController.Shutdown();

            // Make sure we have saved all user data
            // Note that this is a little redundant given the AutoSave feature,
            // but it does help to make sure the user's data is really saved
            CommerceUserData.SaveData(this.UserData, CommerceUserData.Filename);
        }
Example #2
0
        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.PriceTracker, viewFactory.DisplayPriceTracker, viewFactory.CanDisplayPriceTracker));

            this.SubMenuItems.Add(null); // Null for a seperator
            this.SubMenuItems.Add(new MenuItem(Properties.Resources.TPCalculator, viewFactory.DisplayTPCalculator, viewFactory.CanDisplayTPCalculator));
            this.SubMenuItems.Add(new MenuItem(Properties.Resources.EctoSalvageHelper, viewFactory.DisplayEctoSalvageTracker, viewFactory.CanDisplayEctoSalvageTracker));

            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(new MenuItem(Properties.Resources.Configure, () => Commands.OpenCommerceSettingsCommand.Execute(null)));
        }
Example #3
0
        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>();
            this.EcoSalvageData     = new EctoSalvageHelperViewModel(userData);

            // 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");
        }