/// <summary> /// Initializes a new instance of the <see cref="TradebarViewModel" /> class. /// </summary> /// <param name="eventAggregator">The event aggregator.</param> /// <param name="clientLurker">The client lurker.</param> /// <param name="processLurker">The process lurker.</param> /// <param name="keyboardLurker">The keyboard lurker.</param> /// <param name="dockingHelper">The docking helper.</param> /// <param name="keyboardHelper">The keyboard helper.</param> /// <param name="settingsService">The settings service.</param> /// <param name="windowManager">The window manager.</param> /// <param name="soundService">The sound service.</param> /// <param name="pushBulletService">The PushBullet service.</param> public TradebarViewModel( IEventAggregator eventAggregator, ClientLurker clientLurker, ProcessLurker processLurker, KeyboardLurker keyboardLurker, DockingHelper dockingHelper, PoeKeyboardHelper keyboardHelper, SettingsService settingsService, IWindowManager windowManager, SoundService soundService, PushBulletService pushBulletService) : base(windowManager, dockingHelper, processLurker, settingsService) { this._eventAggregator = eventAggregator; this._keyboardHelper = keyboardHelper; this._soundService = soundService; this._clientLurker = clientLurker; this._pushBulletService = pushBulletService; this._keyboardLurker = keyboardLurker; this.TradeOffers = new ObservableCollection <OfferViewModel>(); this._soldOffers = new List <TradeEvent>(); this._context = new TradebarContext(this.RemoveOffer, this.AddActiveOffer, this.AddToSoldOffer, this.SetActiveOffer, this.ClearAll); this.DisplayName = "Poe Lurker"; }
/// <summary> /// Registers the instances. /// </summary> private void ShowOverlays(int processId) { Execute.OnUIThread(() => { this._currentDockingHelper = new DockingHelper(processId, this._settingsService); // Keyboard var keyboarHelper = new PoeKeyboardHelper(processId); this._keyboardLurker = new KeyboardLurker(processId, this._settingsService, keyboarHelper); // Mouse this._mouseLurker = new MouseLurker(processId, this._settingsService); this._mouseLurker.Newitem += this.MouseLurker_Newitem; // Clipboard this._clipboardLurker = new ClipboardLurker(); this._container.RegisterInstance(typeof(ProcessLurker), null, this._processLurker); this._container.RegisterInstance(typeof(ClientLurker), null, this._currentLurker); this._container.RegisterInstance(typeof(ClipboardLurker), null, this._clipboardLurker); this._container.RegisterInstance(typeof(DockingHelper), null, this._currentDockingHelper); this._container.RegisterInstance(typeof(PoeKeyboardHelper), null, keyboarHelper); this._incomingTradeBarOverlay = this._container.GetInstance <TradebarViewModel>(); this._outgoingTradeBarOverlay = this._container.GetInstance <OutgoingbarViewModel>(); this._lifeBulbOverlay = this._container.GetInstance <LifeBulbViewModel>(); this._manaBulbOverlay = this._container.GetInstance <ManaBulbViewModel>(); this._afkService = this._container.GetInstance <AfkService>(); this._hideoutOverlay = this._container.GetInstance <HideoutViewModel>(); this._helpOverlay = this._container.GetInstance <HelpViewModel>(); this._helpOverlay.Initialize(this.ToggleBuildHelper); this._buildViewModel = this._container.GetInstance <BuildViewModel>(); if (this._settingsService.BuildHelper) { this.ActivateItem(this._helpOverlay); } this.ActivateItem(this._incomingTradeBarOverlay); this.ActivateItem(this._outgoingTradeBarOverlay); this.ActivateItem(this._lifeBulbOverlay); this.ActivateItem(this._manaBulbOverlay); this.ActivateItem(this._hideoutOverlay); }); }
/// <summary> /// Registers the instances. /// </summary> private void ShowOverlays(int processId) { Execute.OnUIThread(() => { this._currentDockingHelper = new DockingHelper(processId, this._settingsService); // Keyboard var keyboarHelper = new PoeKeyboardHelper(processId); this._keyboardLurker = new KeyboardLurker(processId, this._settingsService, this._keyCodeService, keyboarHelper); this._keyboardLurker.BuildToggled += this.KeyboardLurker_BuildToggled; this._keyboardLurker.OpenWikiPressed += this.KeyboardLurker_OpenWikiPressed; // Mouse this._mouseLurker = new MouseLurker(processId, this._settingsService); this._mouseLurker.ItemDetails += this.ShowItemDetails; this._mouseLurker.ItemIdentified += this.ShowMap; // Clipboard this._clipboardLurker = new ClipboardLurker(); this._container.RegisterInstance(typeof(ProcessLurker), null, this._processLurker); this._container.RegisterInstance(typeof(MouseLurker), null, this._mouseLurker); this._container.RegisterInstance(typeof(ClientLurker), null, this._currentLurker); this._container.RegisterInstance(typeof(PlayerService), null, this._currentCharacterService); this._container.RegisterInstance(typeof(ClipboardLurker), null, this._clipboardLurker); this._container.RegisterInstance(typeof(DockingHelper), null, this._currentDockingHelper); this._container.RegisterInstance(typeof(PoeKeyboardHelper), null, keyboarHelper); this._container.RegisterInstance(typeof(KeyboardLurker), null, this._keyboardLurker); this._skillTimelineOverlay = this._container.GetInstance <BuildTimelineViewModel>(); this._incomingTradeBarOverlay = this._container.GetInstance <TradebarViewModel>(); this._outgoingTradeBarOverlay = this._container.GetInstance <OutgoingbarViewModel>(); this._popup = this._container.GetInstance <PopupViewModel>(); this._lifeBulbOverlay = this._container.GetInstance <LifeBulbViewModel>(); this._manaBulbOverlay = this._container.GetInstance <ManaBulbViewModel>(); this._afkService = this._container.GetInstance <AfkService>(); this._hideoutOverlay = this._container.GetInstance <HideoutViewModel>(); this._helpOverlay = this._container.GetInstance <HelpViewModel>(); this._helpOverlay.Initialize(this.ToggleBuildHelper); this._buildViewModel = this._container.GetInstance <BuildViewModel>(); if (this._settingsService.BuildHelper) { this.ActivateItem(this._buildViewModel); } if (this._settingsService.BuildHelper) { if (this._settingsService.TimelineEnabled) { this.ActivateItem(this._skillTimelineOverlay); } this.ActivateItem(this._helpOverlay); } if (this._settingsService.IncomingTradeEnabled) { this.ActivateItem(this._incomingTradeBarOverlay); } if (this._settingsService.OutgoingTradeEnabled) { this.ActivateItem(this._outgoingTradeBarOverlay); } if (this._settingsService.HideoutEnabled) { this.ActivateItem(this._hideoutOverlay); } this.ActivateItem(this._lifeBulbOverlay); this.ActivateItem(this._manaBulbOverlay); }); }