Exemplo n.º 1
0
        public void Add(MartialArt input, ContextMenuStrip strip)
        {
            TreeNode newNode = new TreeNode();

            newNode.Text             = input.DisplayName;
            newNode.Tag              = input.Name;
            newNode.ContextMenuStrip = strip;
            if (input.Notes != string.Empty)
            {
                newNode.ForeColor = Color.SaddleBrown;
            }
            newNode.ToolTipText = CommonFunctions.WordWrap(input.Notes, 100);

            foreach (MartialArtAdvantage objAdvantage in input.Advantages)
            {
                TreeNode objAdvantageNode = new TreeNode();
                objAdvantageNode.Text = objAdvantage.DisplayName;
                objAdvantageNode.Tag  = objAdvantage.InternalId;
                newNode.Nodes.Add(objAdvantageNode);
                newNode.Expand();
            }

            if (input.IsQuality)
            {
                this.Nodes[1].Nodes.Add(newNode);
                this.Nodes[1].Expand();
            }
            else
            {
                this.Nodes[0].Nodes.Add(newNode);
                this.Nodes[0].Expand();
            }
        }
Exemplo n.º 2
0
        public void Add(MartialArt input, ContextMenuStrip strip)
        {
            TreeNode newNode = new TreeNode();
            newNode.Text = input.DisplayName;
            newNode.Tag = input.Name;
            newNode.ContextMenuStrip = strip;
            if (input.Notes != string.Empty)
                newNode.ForeColor = Color.SaddleBrown;
            newNode.ToolTipText = CommonFunctions.WordWrap(input.Notes, 100);

            foreach (MartialArtAdvantage objAdvantage in input.Advantages)
            {
                TreeNode objAdvantageNode = new TreeNode();
                objAdvantageNode.Text = objAdvantage.DisplayName;
                objAdvantageNode.Tag = objAdvantage.InternalId;
                newNode.Nodes.Add(objAdvantageNode);
                newNode.Expand();
            }

            if (input.IsQuality)
            {
                this.Nodes[1].Nodes.Add(newNode);
                this.Nodes[1].Expand();
            }
            else
            {
                this.Nodes[0].Nodes.Add(newNode);
                this.Nodes[0].Expand();
            }
        }