Beispiel #1
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;
            }
        }
Beispiel #2
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();
        }