Ejemplo n.º 1
0
        public static WindowController Instance()
        {
            if (_instance == null)
            {
                _instance = new WindowController();
            }

            return(_instance);
        }
Ejemplo n.º 2
0
        private async Task HandleLogin()
        {
            MessageController.Instance().Log("Authenticating...");
            await Session.Instance().SetConnectedPlayer(new Player()
            {
                SessionId = WindowController.Instance().LoginWin.POESESSID
            });

            MessageController.Instance().Log($"{Session.Instance().Player.AccountName} authenticated.");
            btnAccount.Content = Session.Instance().Player.AccountName;
        }
Ejemplo n.º 3
0
        private async void HandleShopWinClosed()
        {
            await Session.Instance().AddShop(WindowController.Instance().ShopFormWin.ThreadId, WindowController.Instance().ShopFormWin.League, WindowController.Instance().ShopFormWin.GenerateNewThread);

            Session.Instance().SetCurrentThreadId(WindowController.Instance().ShopFormWin.ThreadId);

            HamburgerMenuGlyphItem item = new HamburgerMenuGlyphItem();

            item.Label = Session.Instance().GetShop().Title;
            item.Glyph = WindowController.Instance().ShopFormWin.League;
            AddHamMenuItem(item);

            _ = InitUI(WindowController.Instance().ShopFormWin.ThreadId, WindowController.Instance().ShopFormWin.League);
        }
Ejemplo n.º 4
0
 private void ShopFormWin_Closed()
 {
     if (WindowController.Instance().ShopFormWin.Success)
     {
         if (!Session.Instance().AnyShops(WindowController.Instance().ShopFormWin.ThreadId))
         {
             HandleShopWinClosed();
         }
     }
     else if (!Session.Instance().AnyShops())
     {
         WindowController.Instance().ShopFormWin.SetLeagues(Session.Instance().GetAvailableLeagues());
         WindowController.Instance().ShopFormWin.ShowDialog();
     }
 }
Ejemplo n.º 5
0
        private void Init()
        {
            MessageController.Instance().AddLogger(new FileLogger());
            MessageController.Instance().AddLogger(new ConsoleLogger(console));

            var lastPlayer = Session.Instance().GetLastPlayer().Result;

            if (lastPlayer != null)
            {
                WindowController.Instance().LoginWin.SetPlayer(lastPlayer);
            }

            InitHamburgerMenuItems();

            SetupEvents();
        }
Ejemplo n.º 6
0
 private void SetupEvents()
 {
     WindowController.Instance().LoginWin.Closed += LoginWin_Closed;
     WindowController.Instance().ShopFormWin.IsVisibleChanged += ShopFormWin_IsVisibleChanged;
     stashTabSelectorControl.OnStashTabSelected           += StashTabSelectorControl_OnStashTabSelected;
     Session.OnLocalStashTabsUpdated                      += Session_OnLocalStashTabsUpdated;
     webBrowser_PoENinja_Builds.FrameLoadEnd              += WebBrowser_FrameLoadEnd;
     webBrowser_PoENinja_Builds.FrameLoadStart            += WebBrowser_FrameLoadStart;
     webBrowser_PoENinja_ChallengeCurrency.FrameLoadEnd   += WebBrowser_FrameLoadEnd;
     webBrowser_PoENinja_ChallengeCurrency.FrameLoadStart += WebBrowser_FrameLoadStart;
     webBrowser_PoENinja_StandardCurrency.FrameLoadEnd    += WebBrowser_FrameLoadEnd;
     webBrowser_PoENinja_StandardCurrency.FrameLoadStart  += WebBrowser_FrameLoadStart;
     webBrowser_PoETrade.FrameLoadEnd                     += WebBrowser_FrameLoadEnd;
     webBrowser_PoETrade.FrameLoadStart                   += WebBrowser_FrameLoadStart;
     webBrowser_PoETrade.IsBrowserInitializedChanged      += WebBrowser_PoETrade_IsBrowserInitializedChanged;
     console.OnErrorLogFound += Console_OnErrorLogFound;
 }
Ejemplo n.º 7
0
 private void btnPriceWholeTab_Click(object sender, RoutedEventArgs e)
 {
     WindowController.Instance().PricingFormWin.SetPricingWholeTab(Session.Instance().GetSelectedTabIndex(), true);
     WindowController.Instance().PricingFormWin.ShowDialog();
 }
Ejemplo n.º 8
0
 private void btnAddShop_Click(object sender, RoutedEventArgs e)
 {
     WindowController.Instance().ShopFormWin.SetLeagues(Session.Instance().GetAvailableLeagues());
     WindowController.Instance().ShopFormWin.ShowDialog();
 }