/// <summary> /// Get the Sprite location from the tab /// </summary> /// <param name="tab"></param> /// <returns></returns> private PopUpHelper.SPITE_LOCATIONS GetEnumFromItemTab(ITEM_TAB tab) { PopUpHelper.SPITE_LOCATIONS loc = PopUpHelper.SPITE_LOCATIONS.ITEMS; switch (tab) { case ITEM_TAB.Weapon: loc = PopUpHelper.SPITE_LOCATIONS.WEAPONS; break; case ITEM_TAB.Armor: loc = PopUpHelper.SPITE_LOCATIONS.ARMOR; break; case ITEM_TAB.Jewelry: loc = PopUpHelper.SPITE_LOCATIONS.JEWELRY; break; case ITEM_TAB.Misc: loc = PopUpHelper.SPITE_LOCATIONS.MISC; break; } return(loc); }
/// <summary> /// Simple helper to return the listbox of the currect tab we are on /// weapon0, armor1, jewel2, misc3 /// </summary> /// <param name="tab"></param> /// <returns>the list box (cotent) of the selected tab</returns> private ListBox getListboxFromTab(ITEM_TAB tab) { ListBox mybox = new ListBox(); switch (tab) { case ITEM_TAB.Weapon: mybox = weaponList; break; case ITEM_TAB.Armor: mybox = armorList; break; case ITEM_TAB.Jewelry: mybox = JewelryList; break; case ITEM_TAB.Misc: mybox = miscList; break; } return(mybox); }
/// <summary> /// When the tab selection changes /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (sender != null) { //weapon0, armor1, jewel2, misc3 selectedTab = (ITEM_TAB)(sender as TabControl).SelectedIndex; //change the display for what we are creating SelectItemType(selectedTab.ToString()); } }
/// <summary> /// Export all items /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Export_All_Click(object sender, RoutedEventArgs e) { for (int i = 0; i < (int)ITEM_TAB.End_Tab; i++) { //Loop over all the tabs and select them selectedTab = (ITEM_TAB)i; WriteOutXML(false); } System.Windows.Forms.MessageBox.Show("Items successfully exported!"); }