public override void AddNodeToTree(TreeListControl treeList)
        {
            treeList.BeginDataUpdate();

            var rel = _db.RelationManager.GetRelationById(Id);

            AddToInstances(treeList, rel.FirstBlockId);

            if (rel.FirstBlock is Idea)
            {
                var tag = _db.TagsManager.GetTagWithIdeaId(rel.FirstBlockId);
                if (tag != null)
                    AddToInstances(treeList, tag.Id);
            }

            AddToInstances(treeList, rel.SecondBlockId);

            if (rel.SecondBlock is Idea)
            {
                var tag = _db.TagsManager.GetTagWithIdeaId(rel.SecondBlockId);
                if (tag != null)
                    AddToInstances(treeList, tag.Id);
            }

            treeList.EndDataUpdate();
        }
Exemple #2
0
        public override void AnnihilateNode(TreeListControl treeList)
        {
            treeList.BeginDataUpdate();

            var nodes = TagTreeHelper.FindNode(treeList.View, Id);
            foreach (var node in nodes)
                treeList.View.DeleteNode(node);

            treeList.EndDataUpdate();
        }
        public override void AddNodeToTree(TreeListControl treeList)
        {
            treeList.BeginDataUpdate();

            var insts = TagTreeHelper.FindNode(treeList.View, SecondBlockId);
            foreach (var inst in insts)
            {
                inst.IsExpandButtonVisible = DefaultBoolean.True;
                var treeNode = TagTreeHelper.NodeFromItem(this);
                inst.Nodes.Add(treeNode);
            }
            treeList.EndDataUpdate();
        }
        public override void AddNodeToTree(TreeListControl treeList)
        {
            treeList.BeginDataUpdate();

            var nodes = TagTreeHelper.FindNode(treeList.View, _targetId);
            foreach (var node in nodes)
            {
                node.IsExpandButtonVisible = DefaultBoolean.True;
                var treeNode = TagTreeHelper.NodeFromItem(this);
                node.Nodes.Add(treeNode);
            }

            treeList.EndDataUpdate();
        }
        public override void AddNodeToTree(TreeListControl treeList)
        {
            treeList.BeginDataUpdate();
            var myTags = _db.MaterialManager.GetMaterialById(Id).Tags.ToList();

            if (myTags.Count > 0)
                foreach (var myTag in myTags)
                {
                    var nodes = TagTreeHelper.FindNode(treeList.View, myTag.Id);
                    foreach (var node in nodes)
                    {
                        if (IsContainsIn(node.Nodes)) continue;
                        node.IsExpandButtonVisible = DefaultBoolean.True;
                        var treeNode = TagTreeHelper.NodeFromItem(this);
                        node.Nodes.Add(treeNode);
                    }
                }

            treeList.EndDataUpdate();
        }
Exemple #6
0
        public override void AddNodeToTree(TreeListControl treeList)
        {
            treeList.BeginDataUpdate();
            var myTags = _db.IdeaManager.GetIdeaById(Id).Tags.ToList();

            if (myTags.Count > 0)
                foreach (var myTag in myTags)
                {
                    var nodes = TagTreeHelper.FindNode(treeList.View, myTag.Id);
                    foreach (var node in nodes)
                    {
                        node.IsExpandButtonVisible = DefaultBoolean.True;
                        var treeNode = TagTreeHelper.NodeFromItem(this);
                        node.Nodes.Add(treeNode);
                    }
                }
            else
            {
                var treeNode = TagTreeHelper.NodeFromItem(this);
                treeList.View.Nodes.Add(treeNode); //add to root
            }

            treeList.EndDataUpdate();
        }
        public void UpdateMaterialInTree(TreeListControl treeList)
        {
            treeList.BeginDataUpdate();
            var me = _db.MaterialManager.GetMaterialById(Id);

            var nodes = TagTreeHelper.FindNode(treeList.View, Id);
            foreach (var node in nodes)
            {
                node.IsExpandButtonVisible = DefaultBoolean.False;
                var toDel = node.Nodes.ToList();
                foreach (var td in toDel)
                    treeList.View.DeleteNode(td);

                var children = GetChildren().ToList();
                if (children.Any())
                {
                    foreach (var child in children)
                        node.Nodes.Add(TagTreeHelper.NodeFromItem(child));
                    node.IsExpandButtonVisible = DefaultBoolean.True;
                }
            }

            treeList.EndDataUpdate();
        }