Пример #1
0
 public ChangeIdTool(HasId elementWithTargetId, string newId, bool updateTree, bool reloadPanel)
 {
     this.elementWithTargetId = elementWithTargetId;
     this.id          = newId;
     this.oldId       = elementWithTargetId.getId();
     this.updateTree  = updateTree;
     this.reloadPanel = reloadPanel;
     this.controller  = Controller.getInstance();
 }
Пример #2
0
        public override bool doTool()
        {
            bool done = false;

            if (!elementWithTargetId.getId().Equals(id))
            {
                elementWithTargetId.setId(id);
                done = true;
                if (updateTree)
                {
                    controller.updateStructure();
                }
                if (reloadPanel)
                {
                    controller.updatePanel();
                }
            }
            return(done);
        }
Пример #3
0
 public static bool IsRemoved(this HasId element)
 {
     return(Game.Instance.GameState.GetRemovedElements().Contains(element.getId()));
 }