Ejemplo n.º 1
0
        public void MarkNode(TreeNode a_node)
        {
            if (a_node == null)
                return;

            Sprite sp = this.SpriteFromNode(a_node);
            if (sp != null)
            {
                //check if there's already a marker on the sprite:
                if (this._markedSprites.Contains(sp))
                {
                    ////yes, so remove it:
                    this._markedSprites.Remove(sp);
                    //TODO: it shouldn't be a behavior, but a plain child sprite. Easier to manage...
                    BhSpriteTransformer bhXform = (BhSpriteTransformer)sp.GetBehaviorByIndex(0);
                    bhXform.Dispose();
                    a_node.ForeColor = Color.Black;
                }
                else
                {
                    //no; add a transformer:
                    BhSpriteTransformer bhXform = new BhSpriteTransformer();
                    sp.AddBehavior(bhXform);
                    bhXform.Init();
                    a_node.ForeColor = Color.Red;
                    this._markedSprites.Add(sp);
                }
            }
        }