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; } }
protected void FillNestedContainers(ContainerTree a_Result, ItemAssets a_Parent, string a_CurrPath) { if (a_Parent.NestedAssembled == null) { return; } foreach (ItemAssets containedAsset in a_Parent.NestedAssembled) { if ((containedAsset.NestedPacked == null) && (containedAsset.NestedAssembled == null)) { continue; } string path = a_CurrPath; if (path != "") { path += " \\ "; } path += m_EveDatabase.GetTypeIdName(containedAsset.TypeID); a_Result.Add(containedAsset, path); FillNestedContainers(a_Result, containedAsset, path); } }
public ContainerTree GetContainerTree(ItemAssets a_Location) { ContainerTree result = new ContainerTree(); if (a_Location != null) { FillNestedContainers(result, a_Location, ""); return(result); } foreach (ItemAssets locationAssets in Assets.Values) { FillNestedContainers(result, locationAssets, ""); } return(result); }