public MoneyService(
     IEnumerable <ICurrencyProvider> currencyProviders,
     IOptions <CommerceSettings> options)
 {
     _currencyProviders = currencyProviders ?? Array.Empty <ICurrencyProvider>();
     _options           = options?.Value;
 }
 public MoneyService(
     IEnumerable <ICurrencyProvider> currencyProviders,
     IOptions <CommerceSettings> options)
 {
     _currencyProviders = currencyProviders;
     _options           = options.Value;
 }
Пример #3
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="dungeonsService">The dungeons service object</param>
        /// <param name="userSettings">The dungeons user settings object</param>
        public CommerceController(ICommerceService commerceService, CommerceSettings userSettings)
        {
            logger.Debug("Initializing Commerce Controller");
            this.commerceService    = commerceService;
            this.UserSettings       = userSettings;
            this.PriceWatches       = new ObservableCollection <PriceWatchViewModel>();
            this.PriceNotifications = new ObservableCollection <PriceNotificationViewModel>();

            this.InitializePriceWatches();

            // 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");
        }
Пример #4
0
 public workareaCommerce(CommerceSettings eCommerceSettings, Workarea.workareabase workareaRef)
 {
     this.m_CommerceSettings = eCommerceSettings;
     m_WorkAreaBase = workareaRef;
 }
Пример #5
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public ApplicationController()
        {
            // Create services
            logger.Debug("Creating services");
            this.EventsService    = new EventsService();
            this.PlayerService    = new PlayerService();
            this.SystemService    = new SystemService();
            this.ZoneService      = new ZoneService();
            this.DungeonsService  = new DungeonsService();
            this.WvWService       = new WvWService();
            this.GuildService     = new GuildService();
            this.TeamspeakService = new TeamspeakService();
            this.CommerceService  = new CommerceService();

            // Create ZoneName view model for the Zone Completion Assistant
            this.ZoneName = new ZoneNameViewModel();

            // Create WvWMap view model for the WvW Tracker
            this.WvWMap = new WvWMapViewModel();

            // Load user settings
            logger.Debug("Loading event user settings");
            this.EventSettings = EventSettings.LoadSettings(EventSettings.Filename);
            if (this.EventSettings == null)
            {
                this.EventSettings = new EventSettings();
            }

            logger.Debug("Loading zone completion assistant user settings");
            this.ZoneCompletionSettings = ZoneCompletionSettings.LoadSettings(ZoneCompletionSettings.Filename);
            if (this.ZoneCompletionSettings == null)
            {
                this.ZoneCompletionSettings = new ZoneCompletionSettings();
            }

            logger.Debug("Loading dungeon user settings");
            this.DungeonSettings = DungeonSettings.LoadSettings(DungeonSettings.Filename);
            if (this.DungeonSettings == null)
            {
                this.DungeonSettings = new DungeonSettings();
            }

            logger.Debug("Loading wvw user settings");
            this.WvWSettings = WvWSettings.LoadSettings(WvWSettings.Filename);
            if (this.WvWSettings == null)
            {
                this.WvWSettings = new WvWSettings();
            }

            logger.Debug("Loading teamspeak settings");
            this.TeamspeakSettings = TeamspeakSettings.LoadSettings(TeamspeakSettings.Filename);
            if (this.TeamspeakSettings == null)
            {
                this.TeamspeakSettings = new TeamspeakSettings();
            }

            logger.Debug("Loading commerce settings");
            this.CommerceSettings = CommerceSettings.LoadSettings(CommerceSettings.Filename);
            if (this.CommerceSettings == null)
            {
                this.CommerceSettings = new CommerceSettings();
            }

            // Enable autosave on the user settings
            logger.Debug("Enabling autosave of user settings");
            this.EventSettings.EnableAutoSave();
            this.ZoneCompletionSettings.EnableAutoSave();
            this.DungeonSettings.EnableAutoSave();
            this.WvWSettings.EnableAutoSave();
            this.TeamspeakSettings.EnableAutoSave();
            this.CommerceSettings.EnableAutoSave();

            // Create the controllers
            logger.Debug("Creating browser controller");
            this.BrowserController = new BrowserController();

            logger.Debug("Creating events controller");
            this.EventsController = new EventsController(this.EventsService, this.EventSettings);
            this.EventsController.Start(); // Get it started for event notifications

            logger.Debug("Creating zone completion assistant controller");
            this.ZoneCompletionController = new ZoneCompletionController(this.ZoneService, this.PlayerService, this.SystemService, this.ZoneName, this.ZoneCompletionSettings);

            logger.Debug("Creating dungeons controller");
            this.DungeonsController = new DungeonsController(this.DungeonsService, this.BrowserController, this.DungeonSettings);

            logger.Debug("Creating wvw controller");
            this.WvWController = new WvWController(this.WvWService, this.PlayerService, this.GuildService, this.WvWMap, this.WvWSettings);
            this.WvWController.Start(); // Get it started for wvw notifications

            logger.Debug("Creating commerce controller");
            this.CommerceController = new CommerceController(this.CommerceService, this.CommerceSettings);
            this.CommerceController.Start(); // Get it started for price-watch notifications

            // Create the event notifications view
            logger.Debug("Initializing event notifications");
            this.eventNotificationsView = new EventNotificationWindow(this.EventsController);
            this.eventNotificationsView.Show(); // Transparent window, just go ahead and show it

            // Create the wvw notifications view
            logger.Debug("Initializing WvW notifications");
            this.wvwNotificationsView = new WvWNotificationWindow(this.WvWController);
            this.wvwNotificationsView.Show(); // Transparent window, just go ahead and show it

            logger.Debug("Initializing price notifications");
            this.priceNotificationsView = new PriceNotificationWindow(this.CommerceController);
            this.priceNotificationsView.Show(); // Transparent window, just go ahead and show it

            // Initialize the menu items
            logger.Debug("Initializing application menu items");
            this.BuildMenuItems();

            logger.Info("Application controller initialized");
        }