AddItem() public method

Adds a new value to the collection of list items
public AddItem ( string item ) : void
item string
return void
Example #1
0
    /**
     * The Refresh button has been pushed
     */
    public void RefreshGamesList()
    {
        Action <HostData[]> gamesLoaded =
            (pHosts) => {
            mHosts           = pHosts;
            mGamesList.Items = new string[] {};

            foreach (HostData h in pHosts)
            {
                if (h.comment == "Closed")
                {
                    continue;
                }
                mGamesList.AddItem(h.gameName + " (" + h.connectedPlayers.ToString() + "/" + h.playerLimit.ToString() + ")");
            }
            mLoadingPanel.HideAlert();
        };

        mLoadingPanel.ShowAlert("Refreshing Games List...");
        mNetworkManager.RefreshHostList(gamesLoaded);
    }
    void PopulateAvailableProps()
    {
        mAvailablePropsList.Items = new string[] {};

        mAvailablePropsList.AddItem("[color#ff0000]Props[/color]");

        foreach (Prop p in mNetworkManager.myPlayer.uUnpurchasedProps)
        {
            mAvailablePropsList.AddItem("[color#000000]" + p.uName + " ($" + p.uPrice + ")[/color]");
        }
        mAvailablePropsList.AddItem("[color#ff0000]Backdrops[/color]");
        foreach (Backdrop b in mNetworkManager.myPlayer.uUnpurchasedBackdrops)
        {
            mAvailablePropsList.AddItem("[color#000000]" + b.uName + " ($" + b.uPrice + ")[/color]");
        }

        mAvailablePropsList.AddItem("[color#ff0000]Sound Effects[/color]");
        foreach (Audio b in mNetworkManager.myPlayer.uUnpurchasedAudio)
        {
            mAvailablePropsList.AddItem("[color#000000]" + b.uName + " ($" + b.uPrice + ")[/color]");
        }
    }