/// <summary> /// Registers the instances. /// </summary> private void ShowOverlays(Process parentProcess) { Execute.OnUIThread(() => { this._mouseLurker = new MouseLurker(parentProcess, this._settingsService); this._mouseLurker.Newitem += this.MouseLurker_Newitem; var keyboarHelper = new PoeKeyboardHelper(parentProcess); this._currentDockingHelper = new DockingHelper(parentProcess, this._settingsService); this._clipboardLurker = new ClipboardLurker(this._settingsService, keyboarHelper); 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.ActivateItem(this._incomingTradeBarOverlay); this.ActivateItem(this._outgoingTradeBarOverlay); this.ActivateItem(this._lifeBulbOverlay); this.ActivateItem(this._manaBulbOverlay); this.ActivateItem(this._hideoutOverlay); }); }
/// <summary> /// Initializes a new instance of the <see cref="WikiViewModel" /> class. /// </summary> /// <param name="windowManager">The window manager.</param> /// <param name="dockingHelper">The docking helper.</param> /// <param name="processLurker">The process lurker.</param> /// <param name="settingsService">The settings service.</param> /// <param name="githubService">The github service.</param> /// <param name="mouseLurker">The mouse lurker..</param> public WikiViewModel(IWindowManager windowManager, DockingHelper dockingHelper, ProcessLurker processLurker, SettingsService settingsService, GithubService githubService, MouseLurker mouseLurker) : base(windowManager, dockingHelper, processLurker, settingsService) { this._githubService = githubService; this.Items = new ObservableCollection <WikiItemBaseViewModel>(); this._mouseLurker = mouseLurker; }
/// <summary> /// Cleans up. /// </summary> private void CleanUp() { this.ActivePlayer = null; this._container.UnregisterHandler <ClientLurker>(); this._container.UnregisterHandler <PlayerService>(); this._container.UnregisterHandler <ProcessLurker>(); this._container.UnregisterHandler <DockingHelper>(); this._container.UnregisterHandler <PoeKeyboardHelper>(); this._container.UnregisterHandler <ClipboardLurker>(); this._container.UnregisterHandler <MouseLurker>(); if (this._clipboardLurker != null) { this._clipboardLurker.Dispose(); this._clipboardLurker = null; } if (this._currentLurker != null) { this._currentLurker.AdminRequested -= this.CurrentLurker_AdminRequested; this._currentLurker.Dispose(); this._currentLurker = null; } if (this._currentCharacterService != null) { this._currentCharacterService.Dispose(); } if (this._processLurker != null) { this._processLurker.ProcessClosed -= this.PoeClosed; this._processLurker.Dispose(); this._processLurker = null; } if (this._currentDockingHelper != null) { this._currentDockingHelper.Dispose(); this._currentDockingHelper = null; } if (this._afkService != null) { this._afkService.Dispose(); this._afkService = null; } if (this._mouseLurker != null) { this._mouseLurker.Newitem -= this.MouseLurker_Newitem; this._mouseLurker.Dispose(); this._mouseLurker = null; } if (this._keyboardLurker != null) { this._keyboardLurker.Dispose(); } }
/// <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> /// Initializes a new instance of the <see cref="BuildViewModel" /> class. /// </summary> /// <param name="windowManager">The window manager.</param> /// <param name="dockingHelper">The docking helper.</param> /// <param name="processLurker">The process lurker.</param> /// <param name="settingsService">The settings service.</param> /// <param name="buildService">The build service.</param> /// <param name="playerService">The player service.</param> /// <param name="settingsViewModel">The settings view model.</param> /// <param name="githubService">The github service.</param> /// <param name="mouseLurker">The mouse lurker.</param> public BuildViewModel(IWindowManager windowManager, DockingHelper dockingHelper, ProcessLurker processLurker, SettingsService settingsService, BuildService buildService, PlayerService playerService, SettingsViewModel settingsViewModel, GithubService githubService, MouseLurker mouseLurker) : base(windowManager, dockingHelper, processLurker, settingsService) { this._settings = settingsViewModel; this._playerService = playerService; this._buildService = buildService; this._githubService = githubService; this._activePlayer = playerService.FirstPlayer; this._skillTimelineEnabled = this.SettingsService.TimelineEnabled; this._eventAggregator = IoC.Get <IEventAggregator>(); this.Skills = new ObservableCollection <SkillViewModel>(); this.UniqueItems = new ObservableCollection <UniqueItemViewModel>(); this._mouseLurker = mouseLurker; if (this._activePlayer != null && !string.IsNullOrEmpty(this._activePlayer.Build.BuildId)) { var build = buildService.Builds.FirstOrDefault(b => b.Id == this._activePlayer.Build.BuildId); if (build == null) { this._hasNoBuild = true; } else { this._currentBuild = build; this._currentTask = this.Initialize(build.PathOfBuildingCode, false); } } else { this._hasNoBuild = true; } this.IsVisible = true; this.ActivePlayer = new PlayerViewModel(playerService); this.Builds = new ObservableCollection <SimpleBuild>(); this.BuildSelector = new BuildSelectorViewModel(buildService); }
/// <summary> /// Cleans up. /// </summary> private void CleanUp() { this.ActivePlayer = null; this._container.UnregisterHandler <ClientLurker>(); this._container.UnregisterHandler <PlayerService>(); this._container.UnregisterHandler <ProcessLurker>(); this._container.UnregisterHandler <DockingHelper>(); this._container.UnregisterHandler <PoeKeyboardHelper>(); this._container.UnregisterHandler <ClipboardLurker>(); this._container.UnregisterHandler <MouseLurker>(); this._container.UnregisterHandler <KeyboardLurker>(); if (this._clipboardLurker != null) { this._clipboardLurker.Dispose(); this._clipboardLurker = null; } if (this._currentLurker != null) { this._currentLurker.AdminRequested -= this.CurrentLurker_AdminRequested; this._currentLurker.Dispose(); this._currentLurker = null; } if (this._currentCharacterService != null) { this._currentCharacterService.Dispose(); } if (this._processLurker != null) { this._processLurker.ProcessClosed -= this.PoeClosed; this._processLurker.Dispose(); this._processLurker = null; } if (this._currentDockingHelper != null) { this._currentDockingHelper.Dispose(); this._currentDockingHelper = null; } if (this._afkService != null) { this._afkService.Dispose(); this._afkService = null; } if (this._mouseLurker != null) { this._mouseLurker.ItemDetails -= this.ShowItemDetails; this._mouseLurker.ItemIdentified -= this.ShowMap; this._mouseLurker.Dispose(); this._mouseLurker = null; } if (this._keyboardLurker != null) { this._keyboardLurker.OpenWikiPressed -= this.KeyboardLurker_OpenWikiPressed; this._keyboardLurker.BuildToggled -= this.KeyboardLurker_BuildToggled; this._keyboardLurker.Dispose(); } }
/// <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); }); }
/// <summary> /// Initializes a new instance of the <see cref="PopupViewModel"/> class. /// </summary> /// <param name="windowManager">The window manager.</param> /// <param name="dockingHelper">The docking helper.</param> /// <param name="processLurker">The process lurker.</param> /// <param name="settingsService">The settings service.</param> /// <param name="mouseLurker">The mouse lurker.</param> public PopupViewModel(IWindowManager windowManager, DockingHelper dockingHelper, ProcessLurker processLurker, SettingsService settingsService, MouseLurker mouseLurker) : base(windowManager, dockingHelper, processLurker, settingsService) { this._mouseLurker = mouseLurker; this._opacity = 1; }