Example #1
0
        public void runUpdate()
        {
            modelsCellsForUpdate_.Clear();
            cellFrames_.Clear();

            ElementScanCriteria scanCriteria = new ElementScanCriteriaClass();

            scanCriteria.ExcludeNonGraphical();
            scanCriteria.IncludeOnlyVisible();

            scanRecurse(App.ActiveModelReference, scanCriteria, true);

            // TODO запустить progressBar

            foreach (CellElement cell in checkedCellsForUpdate_)
            {
                var frame = cellFrames_[cell.MdlElementRef()];
                AppTF.ModelReferenceRewriteFrameList(cell.ModelReference, frame);
            }
        }
Example #2
0
        public void scanForUpdate(TreeView treeView) // TODO без TreeView
        {
            treeView.AfterCheck -= TreeView_AfterCheck;
            treeView.AfterCheck += TreeView_AfterCheck;

            checkedCellsForUpdate_.Clear();
            modelsCellsForUpdate_.Clear();
            cellFrames_.Clear();

            /* TODO
             * Поиск:
             * - по имени Cell;
             * - по CatalogGroupName
             */

            ElementScanCriteria scanCriteria = new ElementScanCriteriaClass();

            scanCriteria.ExcludeNonGraphical();
            scanCriteria.IncludeOnlyVisible();

            scanRecurse(App.ActiveModelReference, scanCriteria, false);

            treeView.Nodes.Clear();

            foreach (var pair in modelsCellsForUpdate_)
            {
                ModelReference     model      = pair.Key;
                List <CellElement> updateList = pair.Value;

                TreeNode modelNode =
                    treeView.Nodes.Add(model.Name + $" ({updateList.Count})");

                foreach (var cell in updateList)
                {
                    TFFrameListClass frame    = cellFrames_[cell.MdlElementRef()];
                    TreeNode         cellNode = modelNode.Nodes.Add(cell.ID.ToString());
                    cellNode.Tag = cell;
                }
                modelNode.Checked = true;
            }
        }