示例#1
0
        private void Init_TlbCmbLocation(bool a_IsSilent)
        {
            EventHandler      myHandler = new EventHandler(TlbCmbLocation_SelectedIndexChanged);
            ToolStripComboBox currCombo = TlbCmbLocation;

            currCombo.Items.Clear();

            TextItemWithObject newItem    = new TextItemWithObject("[All items]", null);
            TextItemWithObject selectItem = newItem;

            currCombo.Items.Add(newItem);

            foreach (KeyValuePair <UInt32, ItemAssets> keyValuePair in m_Assets.Assets)
            {
                UInt32 locationID   = keyValuePair.Key;
                string locationName = m_EveDatabase.GetLocationName(locationID);

                newItem = new TextItemWithObject(locationName, keyValuePair.Value);
                currCombo.Items.Add(newItem);
            }

            if (a_IsSilent)
            {
                SilentSetSelectedItem(currCombo, selectItem, myHandler);
            }
            else
            {
                currCombo.SelectedItem = selectItem;
            }
        }
示例#2
0
        private void Init_TlbCmbContainer(bool a_IsSilent)
        {
            EventHandler      myHandler = new EventHandler(TlbCmbContainer_SelectedIndexChanged);
            ToolStripComboBox currCombo = TlbCmbContainer;

            currCombo.Items.Clear();

            ItemAssets    locationAssets = (ItemAssets)TextItemWithObject.GetData(TlbCmbLocation.SelectedItem);
            ContainerTree containers     = m_Assets.GetContainerTree(locationAssets);

            TextItemWithObject newItem    = new TextItemWithObject("[All items]", locationAssets);
            TextItemWithObject selectItem = newItem;

            currCombo.Items.Add(newItem);

            foreach (KeyValuePair <ItemAssets, string> keyValuePair in containers)
            {
                newItem = new TextItemWithObject(keyValuePair.Value, keyValuePair.Key);
                currCombo.Items.Add(newItem);
            }

            if (a_IsSilent)
            {
                SilentSetSelectedItem(currCombo, selectItem, myHandler);
            }
            else
            {
                currCombo.SelectedItem = selectItem;
            }
        }
示例#3
0
        private void MakeRefineryItemList()
        {
            UInt32     characterID = ((TextItemWithUInt32)TlbCmbCharacter.SelectedItem).Data;
            ItemAssets container   = (ItemAssets)TextItemWithObject.GetData(TlbCmbContainer.SelectedItem);

            m_SelectedAssets = null;
            if (character_AllItems != characterID)
            {
                AssetFilter assetFilter = 0;
                if (TlbChkIgnoreContainers.Checked)
                {
                    assetFilter |= AssetFilter.NoAssembledContainers;
                }

                if (TlbChkIgnoreShips.Checked)
                {
                    assetFilter |= AssetFilter.NoAssembledShips;
                }

                if (TlbChkIgnoreAssembled.Checked)
                {
                    assetFilter |= AssetFilter.NoAssembled;
                }

                m_SelectedAssets = m_Assets.GetAssetsList(container, assetFilter);
            }

            ItemFilter filter = new ItemFilter();

            filter.Published      = TristateFilter.Yes;
            filter.PlainMaterials = TristateFilter.Yes;
            if (m_SelectedAssets != null)
            {
                filter.AssetsFilter = m_SelectedAssets;
            }

            SetupListItemsData(m_ItemsDB.FilterItems(filter), m_SelectedAssets);
            UpdateTotalsRow();

            // Optimization: pre-fill all column data (saves around 1 sec)
            Hashtable columnData = new Hashtable();

            foreach (MainListItem listItem in m_ItemList)
            {
                Object[] columnValues = GetListItemColumnData(listItem);
                columnData.Add(listItem.TypeID, columnValues);
            }

            CompareItemBase comparer = new CompareColumn(m_SortType, columnData);

            comparer.SetParameters(m_SortDirection);
            Array.Sort(m_ItemList, comparer);

            LstRefinery.VirtualListSize = m_ItemList.Count();
            UpdateLstRefinery();
        }