Beispiel #1
0
        /// <summary>
        /// Add playlist by name.
        /// </summary>
        /// <param name="name">Dialog name.</param>
        public void AddPlaylist(string name)
        {
            var playlist = new JRPGOrderLine(new Item(name, 0), 0)
            {
                IsPlaylist = true
            };

            TraderTreeView.Nodes.Add(new TreeNode <JRPGOrderLine>(playlist));
        }
Beispiel #2
0
        /// <summary>
        /// Init this instance.
        /// </summary>
        protected void Init()
        {
            var list_items = new List <Item>()
            {
                new Item("Sword", 10),
                new Item("Short Sword", 5),
                new Item("Long Sword", 5),
                new Item("Knife", -1),
                new Item("Dagger", -1),
                new Item("Hammer", -1),
                new Item("Shield", -1),
                new Item("Leather Armor", 3),
                new Item("Ring", 2),
                new Item("Bow", -1),
                new Item("Crossbow", -1),

                new Item("HP Potion", -1),
                new Item("Mana Potion", -1),
                new Item("HP UP", 10),
                new Item("Mana UP", 10),
            };

            TraderListView.DataSource.AddRange(CreateOrderLines(list_items));

            var nodes = new ObservableList <TreeNode <JRPGOrderLine> >();

            var playlist1 = new JRPGOrderLine(new Item("Playlist 1", 0), 0)
            {
                IsPlaylist = true
            };
            var node1 = new TreeNode <JRPGOrderLine>(playlist1);

            nodes.Add(node1);

            var playlist2 = new JRPGOrderLine(new Item("Playlist 2", 0), 0)
            {
                IsPlaylist = true
            };
            var node2 = new TreeNode <JRPGOrderLine>(playlist2);

            nodes.Add(node2);

            TraderTreeView.Nodes = nodes;
        }