コード例 #1
0
        /// <summary>
        /// Registers the instances.
        /// </summary>
        private void ShowOverlays(IntPtr windowHandle)
        {
            Execute.OnUIThread(() =>
            {
                var keyboarHelper              = new PoeKeyboardHelper(windowHandle);
                this._currentDockingHelper     = new DockingHelper(windowHandle, this._settingsService);
                this._clipboardLurker          = new ClipboardLurker(this._settingsService, keyboarHelper);
                this._clipboardLurker.Newitem += this.ClipboardLurker_Newitem;

                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.ActivateItem(this._incomingTradeBarOverlay);
                this.ActivateItem(this._outgoingTradeBarOverlay);
                this.ActivateItem(this._lifeBulbOverlay);
                this.ActivateItem(this._manaBulbOverlay);
            });
        }
コード例 #2
0
        /// <summary>
        /// Cleans up.
        /// </summary>
        private void CleanUp()
        {
            this._container.UnregisterHandler <ClientLurker>();
            this._container.UnregisterHandler <DockingHelper>();
            this._container.UnregisterHandler <PoeKeyboardHelper>();
            this._container.UnregisterHandler <ClipboardLurker>();

            if (this._clipboardLurker != null)
            {
                this._clipboardLurker.Newitem -= this.ClipboardLurker_Newitem;
                this._clipboardLurker.Dispose();
                this._clipboardLurker = null;
            }

            if (this._currentLurker != null)
            {
                this._currentLurker.PoeClosed      -= this.CurrentLurker_PoeClosed;
                this._currentLurker.AdminRequested -= this.CurrentLurker_AdminRequested;
                this._currentLurker.Dispose();
                this._currentLurker = null;
            }

            if (this._currentDockingHelper != null)
            {
                this._currentDockingHelper.Dispose();
                this._currentDockingHelper = null;
            }
        }
コード例 #3
0
ファイル: ShellViewModel.cs プロジェクト: bopodada/Poe-Lurker
        /// <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);
            });
        }
コード例 #4
0
ファイル: ShellViewModel.cs プロジェクト: Z0ld3n/Poe-Lurker
        /// <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();
            }
        }
コード例 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OutgoingbarViewModel" /> class.
        /// </summary>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="clipboardLurker">The clipboard lurker.</param>
        /// <param name="clientLurker">The client lurker.</param>
        /// <param name="processLurker">The process 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="playerService">The player service.</param>
        public OutgoingbarViewModel(IEventAggregator eventAggregator, ClipboardLurker clipboardLurker, ClientLurker clientLurker, ProcessLurker processLurker, DockingHelper dockingHelper, PoeKeyboardHelper keyboardHelper, SettingsService settingsService, IWindowManager windowManager, PlayerService playerService)
            : base(windowManager, dockingHelper, processLurker, settingsService)
        {
            this.Offers           = new ObservableCollection <OutgoingOfferViewModel>();
            this.FilteredOffers   = new ObservableCollection <OutgoingOfferViewModel>();
            this._timer           = new Timer(50);
            this._timer.Elapsed  += this.Timer_Elapsed;
            this._keyboardHelper  = keyboardHelper;
            this._clipboardLurker = clipboardLurker;
            this._eventAggregator = eventAggregator;
            this._clientLurker    = clientLurker;
            this._playerService   = playerService;

            this.Offers.CollectionChanged  += this.Offers_CollectionChanged;
            this._clipboardLurker.NewOffer += this.ClipboardLurker_NewOffer;
        }
コード例 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OutgoingbarViewModel"/> class.
        /// </summary>
        /// <param name="lurker">The lurker.</param>
        /// <param name="windowManager">The window manager.</param>
        public OutgoingbarViewModel(IEventAggregator eventAggregator, ClipboardLurker clipboardLurker, ClientLurker clientLurker, DockingHelper dockingHelper, PoeKeyboardHelper keyboardHelper, SettingsService settingsService, IWindowManager windowManager)
            : base(windowManager, dockingHelper, clientLurker, settingsService)
        {
            this.Offers           = new ObservableCollection <OutgoingOfferViewModel>();
            this._timer           = new Timer(50);
            this._timer.Elapsed  += this.Timer_Elapsed;
            this._keyboardHelper  = keyboardHelper;
            this._clientLurker    = clientLurker;
            this._clipboardLurker = clipboardLurker;
            this._eventAggregator = eventAggregator;

            this._clipboardLurker.NewOffer   += this.ClipboardLurker_NewOffer;
            this._clientLurker.OutgoingOffer += this.Lurker_OutgoingOffer;
            this._clientLurker.TradeAccepted += this.Lurker_TradeAccepted;
            this.Offers.CollectionChanged    += this.Offers_CollectionChanged;
            this._context = new OutgoingbarContext(this.RemoveOffer, this.SetActiveOffer);
        }
コード例 #7
0
ファイル: ShellViewModel.cs プロジェクト: Rhulen/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);
            });
        }
コード例 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateManager" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="clipboardLurker">The clipboard lurker.</param>
 /// <param name="clientLurker">The client lurker.</param>
 public UpdateManager(SettingsService settingsService, ClipboardLurker clipboardLurker, ClientLurker clientLurker)
 {
     this._clipboardLurker = clipboardLurker;
     this._clientLurker    = clientLurker;
     this._settingsService = settingsService;
 }
コード例 #9
0
        /// <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();
            }
        }
コード例 #10
0
        /// <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);
            });
        }