Exemplo n.º 1
0
        void setTabBuyout_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                IStashControl stash = getStash(sender);

                var tabName = ApplicationState.Stash[ApplicationState.CurrentLeague].GetTabNameByTabId(stash.TabNumber);

                var pricingInfo = new PricingInfo();

                if (Settings.TabsBuyouts.ContainsKey(tabName))
                {
                    pricingInfo.Update(Settings.TabsBuyouts[tabName]);
                }

                SetTabBuyoutView buyoutView = new SetTabBuyoutView(pricingInfo, tabName);
                buyoutView.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                buyoutView.Update += buyoutView_Update;
                buyoutView.ShowDialog();
            }
            catch (Exception ex)
            {
                Logger.Log("Exception in setTabBuyout_Click: " + ex.ToString());
                MessageBox.Show("Error setting tabwide buyout, error details logged to DebugInfo.log, please open a ticket at https://github.com/Stickymaddness/Procurement/issues", "Error setting tabwide buyout", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Exemplo n.º 2
0
        private static IStashControl getStash(object sender)
        {
            MenuItem      source = sender as MenuItem;
            IStashControl stash  = source.Tag as IStashControl;

            return(stash);
        }
Exemplo n.º 3
0
        void refresh_Click(object sender, RoutedEventArgs e)
        {
            IStashControl stash = getStash(sender);

            stash.RefreshTab(ApplicationState.AccountName);
            ScreenController.Instance.RefreshRecipeScreen();
            ScreenController.Instance.UpdateTrading();
        }
Exemplo n.º 4
0
        private MenuItem getMenuItem(IStashControl itemStash, string header, RoutedEventHandler handler)
        {
            MenuItem menuItem = new MenuItem()
            {
                Header = header
            };

            menuItem.Tag    = itemStash;
            menuItem.Click += new RoutedEventHandler(handler);

            return(menuItem);
        }
Exemplo n.º 5
0
        private void addContextMenu(TabItem item, IStashControl itemStash)
        {
            ContextMenu contextMenu = new ContextMenu();

            if (!ApplicationState.Model.Offline)
            {
                contextMenu.Items.Add(getMenuItem(itemStash, "Refresh", refresh_Click));
            }

            contextMenu.Items.Add(getMenuItem(itemStash, "Set Tabwide Buyout", setTabBuyout_Click));

            item.ContextMenu = contextMenu;
        }
Exemplo n.º 6
0
 public TabContent(int index, TabItem tabItem, IStashControl stash)
 {
     this.Index   = index;
     this.TabItem = tabItem;
     this.Stash   = stash;
 }
Exemplo n.º 7
0
 public TabContent(int index, TabItem tabItem, IStashControl stash)
 {
     Index   = index;
     TabItem = tabItem;
     Stash   = stash;
 }