Ejemplo n.º 1
0
        private void LoadUserDefinedRegion()
        {
            _groups = new List <BlockItemGroup>();
            _tree.Nodes.Clear();
            DefinedRegionParse p = new DefinedRegionParse();

            _blockRef = p.BlockDefined;
            BlockItemGroup[] blockGroup = _blockRef.UserDefineRegion;
            if (blockGroup == null || blockGroup.Length == 0)
            {
                return;
            }
            for (int i = 0; i < blockGroup.Length; i++)
            {
                BlockItemGroup group = blockGroup[i];
                _groups.Add(group);
                AddGroupToTree(group);
            }
            if (_tree.Nodes.Count > 0)
            {
                _tree.SelectedNode = _tree.Nodes[_tree.Nodes.Count - 1];
                _tree.SelectedNode.ExpandAll();
            }
            //_tree.ExpandAll();
        }
Ejemplo n.º 2
0
        private void LoadDefinedRegion()
        {
            _tree.Nodes.Clear();
            DefinedRegionParse defineRegion = new DefinedRegionParse();
            BlockDefined       blockDefined = defineRegion.BlockDefined;

            if (blockDefined == null || blockDefined.BlockItemGroups == null || blockDefined.BlockItemGroups.Length == 0)
            {
                return;
            }
            foreach (BlockItemGroup group in blockDefined.BlockItemGroups)
            {
                PrjEnvelopeItem[] envs = group.BlockItems;
                RadTreeNode       node = new RadTreeNode(string.Format("{0}[{1}]({2})", group.Name, group.Description, envs.Length));
                node.Tag       = group;
                node.CheckType = CheckType.CheckBox;
                foreach (PrjEnvelopeItem env in envs)
                {
                    RadTreeNode item = new RadTreeNode(env.Name);
                    item.CheckType = CheckType.CheckBox;
                    item.Tag       = env;
                    node.Nodes.Add(item);
                }
                _tree.Nodes.Add(node);
            }
        }
Ejemplo n.º 3
0
 private void SaveUserDefineRegion()
 {
     _blockRef.SetUserDefineRegion(_groups.ToArray());
     DefinedRegionParse.Save(_blockRef);
 }