Ejemplo n.º 1
0
        //给文档添加一个映射ID
        public void MapProjectID(Document doc)
        {
            string path = doc.Name;

            if (!DwgFilesId.ContainsKey(path))
            {
                DwgFilesId.Add(path, CheckDBFlag.GetDbFlag(doc));
            }
        }
Ejemplo n.º 2
0
        public DBEntityControl GetMainEntCol(string dwgname)
        {
            string projectID = DwgFilesId.ContainsKey(dwgname) ? DwgFilesId[dwgname] : null;

            if (projectID == null)
            {
                return(null);
            }
            if (dbMainEntFiles.ContainsKey(projectID))
            {
                return(dbMainEntFiles[projectID]);
            }
            else
            {
                throw new Exception("找不到main database");
            }
        }
Ejemplo n.º 3
0
        public GridList GetActiveGridList(string dwgname)
        {
            string projectID = DwgFilesId.ContainsKey(dwgname) ? DwgFilesId[dwgname] : null;

            if (projectID == null)
            {
                return(null);
            }
            GridList gridList = null;

            GridLists.TryGetValue(projectID, out gridList);

            if (gridList != null)
            {
                return(gridList);
            }
            else
            {
                BindPaletteSet.BindGridList(out gridList);
                GridLists.Add(projectID, gridList);
                return(gridList);
            }
        }
Ejemplo n.º 4
0
        public DevExpress.XtraTreeList.TreeList GetActiveTreeLst(string dwgname)
        {
            string projectID = DwgFilesId.ContainsKey(dwgname) ? DwgFilesId[dwgname] : null;

            if (projectID == null)
            {
                return(null);
            }
            DevExpress.XtraTreeList.TreeList treelist = null;
            ProjectTreeLists.TryGetValue(projectID, out treelist);

            if (treelist != null)
            {
                return(treelist);
            }
            else
            {
                treelist = new DevExpress.XtraTreeList.TreeList();
                ProjectTreeLists.Add(projectID, treelist);
                // Global.TreeManager.BindProjectData();
                return(treelist);
            }
        }
Ejemplo n.º 5
0
        public PropertyControl GetActivePropCtl(string dwgname)
        {
            string projectID = DwgFilesId.ContainsKey(dwgname) ? DwgFilesId[dwgname] : null;

            if (projectID == null)
            {
                return(null);
            }
            PropertyControl propertyControl = null;

            PropControls.TryGetValue(projectID, out propertyControl);

            if (propertyControl != null)
            {
                return(propertyControl);
            }
            else
            {
                BindPaletteSet.BindPropertyControl(out propertyControl);
                PropControls.Add(projectID, propertyControl);
                return(propertyControl);
            }
        }
Ejemplo n.º 6
0
        //通过文档对象获取该文档ID
        public string GetDwgId(Document doc)
        {
            string id = "";

            try
            {
                id = DwgFilesId[doc.Name];
            }
            catch (System.Collections.Generic.KeyNotFoundException)
            {
                foreach (var pair in DwgFilesId)
                {
                    if (pair.Value == CheckDBFlag.GetDbFlag(doc))
                    {
                        DwgFilesId.Remove(pair.Key);
                        MapProjectID(doc);
                        id = DwgFilesId[doc.Name];
                        break;
                    }
                }
            }
            return(id);
        }