View unanswered posts | View active topics It is currently 2020-05-26 7:53



This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
 设置对象的out属性再取消,树和network未同步? 
Author Message
新手上路

Joined: 2014-04-17 13:34
Posts: 11
 设置对象的out属性再取消,树和network未同步?
代码如下,点击设置OUTER_STYLE,再次点击取消OUTER_STYLE属性,发现树节点的OUTER_STYLE未消失。
Code:
       private bool set = true;
        private void DetailedInformationCommandExecute()
        {
            IElement element = network.ElementBox.GetDataByID(SelectedDeviceID.ToString());
            if (set)
            {
                element.SetStyle(Styles.OUTER_STYLE, Consts.OUTER_STYLE_BORDER);
                element.SetStyle(Styles.OUTER_SHAPE, Consts.SHAPE_RECTANGLE);
                element.SetStyle(Styles.OUTER_COLOR, Utils.CreateColor(0xFFFF0000));
            }
            else
            {
                element.SetStyle(Styles.OUTER_STYLE, Consts.OUTER_STYLE_NONE);
            }
            set = !set;
        }


Attachments:
2.png
2.png [ 28.88 KiB | Viewed 6827 times ]
1.png
1.png [ 27.63 KiB | Viewed 6827 times ]
2014-06-05 23:25
Profile
TWaver开发组
User avatar

Joined: 2009-04-20 18:37
Posts: 3115
Post Re: 设置对象的out属性再取消,树和network未同步?
还需要设置Styles.TREE_OUTER_STYLE。
Code:
            DemoUtils.AddToolBarButton(this.Toolbar, "", "add", (sender, e) =>
            {
                IElement element = network.ElementBox.SelectionModel.LastData;
                element.SetStyle(Styles.OUTER_STYLE, Consts.OUTER_STYLE_BORDER);
                element.SetStyle(Styles.TREE_OUTER_STYLE, Consts.OUTER_STYLE_BORDER);
                element.SetStyle(Styles.OUTER_SHAPE, Consts.SHAPE_RECTANGLE);
                element.SetStyle(Styles.OUTER_COLOR, Utils.CreateColor(0xFFFF0000));
            });
            DemoUtils.AddToolBarButton(this.Toolbar, "", "remove", (sender, e) =>
            {
                IElement element = network.ElementBox.SelectionModel.LastData;
                element.SetStyle(Styles.OUTER_STYLE, Consts.OUTER_STYLE_NONE);
                element.SetStyle(Styles.TREE_OUTER_STYLE, Consts.OUTER_STYLE_NONE);
            });


2014-06-09 10:31
Profile
新手上路

Joined: 2014-04-17 13:34
Posts: 11
Post Re: 设置对象的out属性再取消,树和network未同步?
谢谢。


2014-06-09 19:17
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron