Пример #1
0
 public void OnSelectionChanged(object sender, NodeEventArgs e, string name)
 {
     ShowBranch(e.Node);
 }
Пример #2
0
 public void OnTreeNodeCreated(object sender, NodeEventArgs e)
 {
     Pic.DAL.SQLite.PPDataContext db = new Pic.DAL.SQLite.PPDataContext();
     Pic.DAL.SQLite.TreeNode nodeNew = Pic.DAL.SQLite.TreeNode.GetById(db, e.Node);
     TreeNode parentNode = FindNode(null, new NodeTag(NodeTag.NodeType.NT_TREENODE, nodeNew.ParentNodeID.Value));
     // clear
     parentNode.Nodes.Clear();
     // insert dummy node
     parentNode.Nodes.Add("_DUMMY_");
     // collapse
     parentNode.Collapse();
     // reload
     parentNode.Expand();
 }
Пример #3
0
 private void BranchViewBranchSelected(object sender, NodeEventArgs e)
 {
     // get selected tree node
     _treeViewCtrl.PopulateAndSelectNode(new NodeTag(NodeTag.NodeType.NT_TREENODE, e.Node));
 }
Пример #4
0
 public void OnSelectionChanged(object sender, NodeEventArgs e, string name)
 {
     PopulateAndSelectNode(new NodeTag(e.Type, e.Node)); 
 }
Пример #5
0
        private void OnSelectionChanged(object sender, NodeEventArgs e, string name)
        {

            // changed caption
            Text = Application.ProductName + " - " + name;
            UpdateTextPosition(null, null);

            // show/hide controls
            _startPageCtrl.Visible = false;
            _downloadPageCtrl.Visible = false;
            _branchViewCtrl.Visible = (NodeTag.NodeType.NT_TREENODE == e.Type);
            _pluginViewCtrl.Visible = false;
            _factoryViewCtrl.Visible = false;
            _webBrowser4PDF.Visible = false;
            if (NodeTag.NodeType.NT_DOCUMENT == e.Type)
            {
                PPDataContext db = new PPDataContext();
                Pic.DAL.SQLite.TreeNode treeNode = Pic.DAL.SQLite.TreeNode.GetById(db, e.Node);
                Document doc = treeNode.Documents(db)[0];

                DocumentName = doc.Name;

                // select document handler depending on document type
                string docTypeName = doc.DocumentType.Name;
                string filePath = doc.File.Path(db);

                DocumentPath = filePath;

                if (string.Equals("Parametric Component", docTypeName, StringComparison.CurrentCultureIgnoreCase))
                {
                    if (doc.Components.Count > 0)
                        _profileLoaderImpl.Component = doc.Components[0];
                    LoadParametricComponent(filePath);
                }
                else if (string.Equals("treeDim des", docTypeName, StringComparison.CurrentCultureIgnoreCase))
                    LoadPicadorFile(filePath, "des");
                else if (string.Equals("autodesk dxf", docTypeName, StringComparison.CurrentCultureIgnoreCase))
                    LoadPicadorFile(filePath, "dxf");
                else if (string.Equals("Adobe Acrobat", docTypeName, StringComparison.CurrentCultureIgnoreCase))
                    LoadPdfWithActiveX(filePath);
                else if (string.Equals("raster image", docTypeName, StringComparison.CurrentCultureIgnoreCase))
                    LoadImageFile(filePath);
                else
                    LoadUnknownFileFormat(filePath);
            }
            // update toolbar
            UpdateToolCommands();
            // select treeview control
            _treeViewCtrl.Select();
        }