// Update is called once per frame
    public void OnSelectionChange()
    {
        IEnumerator ienObj = selectedListViewManager.Selected();

        int count = 0;

        while (ienObj.MoveNext())
        {
            var guid = (System.Guid)ienObj.Current;
            text.text = string.Format("Loading {0}...", selectedListViewManager.listData[guid]["Name"]);
            count++;
        }

        if (count == 0)
        {
            text.text = "";
        }
    }
示例#2
0
    void PrintSelectedRows()
    {
        // The ListViewManager contains a Dictionary<Guid, Dictionary<string, object>>
        // instance storing the data. This variable is public and called listData.
        // If you want to iterate over all the key, value pairs you can just manipulate
        // this directly

        IEnumerator ienObj = listViewManager.Selected();

        while (ienObj.MoveNext())
        {
            Dictionary <string, object> rowData = listViewManager.listData[(System.Guid)ienObj.Current];

            string s = "";
            foreach (var item in rowData)
            {
                s += string.Format("{0}={1}, ", item.Key, item.Value);
            }
            Debug.Log(s);
        }
    }
示例#3
0
    // Update is called once per frame
    public void OnSelectionChange()
    {
        IEnumerator ienObj     = listViewManager.Selected();
        var         inListView = new List <System.Guid>();

        while (ienObj.MoveNext())
        {
            var guid = (System.Guid)ienObj.Current;
            inListView.Add(guid);

            if (!thisListViewManager.listData.ContainsKey(guid))
            {
                thisListViewManager.AddRow(new object[] { listViewManager.listData[guid]["Name"] }, guid);
            }
        }

        foreach (var item in thisListViewManager.listData)
        {
            if (!inListView.Contains(item.Key))
            {
                thisListViewManager.Remove(item.Key);
            }
        }
    }