private void _AddTrashBox(RssTargetInfo targetInfo) { TrashBox trashBox = targetInfo.TrashBox; _trashBoxes.Add(trashBox); TreeViewImgItem targetNode = new TreeViewImgItem(TRASH_NODE_TARGET); targetNode.Text = targetInfo.Title; targetNode.SelectedImage = (targetInfo.IsZeptDist) ? _zeptairIcon : _feedIcon; targetNode.IsExpanded = true; ArrayList channels = new ArrayList(); foreach (InfoItem infoItem in trashBox.InfoItems) { if (!channels.Contains(infoItem.Channel)) { channels.Add(infoItem.Channel); } } Hashtable channelHash = new Hashtable(); foreach (string channel in channels) { TreeViewImgItem channelNode = new TreeViewImgItem(TRASH_NODE_CHANNEL); channelNode.Text = channel; channelNode.SelectedImage = _channelIcon; channelNode.IsExpanded = false; channelHash[channel] = channelNode; targetNode.Items.Add(channelNode); } foreach (InfoItem infoItem in trashBox.InfoItems) { TreeViewImgItem itemNode = new TreeViewImgItem(TRASH_NODE_ITEM); itemNode.Text = infoItem.Title; itemNode.SelectedImage = _itemIcon; itemNode.AdditionalInfo = infoItem; ((TreeViewImgItem)channelHash[infoItem.Channel]).Items.Add(itemNode); } trvTrash.Items.Add(targetNode); }
protected internal void spawnTrashBox() { _trashBoxInst = Instantiate(_trashBoxPref); }
// Start is called before the first frame update void Start() { trashBox = FindObjectOfType <TrashBox>(); audioSource = this.gameObject.GetComponent <AudioSource>(); }