Ejemplo n.º 1
0
        void doImageNode(TreeNode tn)
        {
            EFSNodeTranslation t = (EFSNodeTranslation)tn.Tag;

            if (t.Node.Type == et.EFSNodeType.Folder)
            {
                tn.ImageIndex         = 0;
                tn.SelectedImageIndex = 0;
            }
            else
            {
                int  c = imageList1.Images.Count;
                Icon i = FileIconLoader.GetFileIcon(t.Node.Name, false);
                if (i != null)
                {
                    imageList1.Images.Add(i);
                    tn.ImageIndex         = c;
                    tn.SelectedImageIndex = c;
                }
            }
            foreach (var n in tn.Nodes)
            {
                doImageNode((TreeNode)n);
            }
        }
Ejemplo n.º 2
0
        void select(TreeNode n)
        {
            if (n == null || (efsnt_of(n).Parent == null))
            {
                groupBox1.Enabled = false;
                textBox1.Text     = textBox2.Text = textBox3.Text = textBox4.Text = "";
                sizelabel.Text    = "bytes";
            }
            else
            {
                EFSNodeTranslation nt = n.Tag as EFSNodeTranslation;
                if (nt.Node != null)
                {
                    groupBox1.Enabled = true;
                    int order;
                    et.EFSNodeInformation ni = nt.Node.Metadata;
                    textBox1.Text = nt.Node.Name;
                    textBox2.Text = ni.TimeCreatedUTC.ToString();
                    textBox3.Text = ni.TimeModifiedUTC.ToString();
                    if (nt.Node.Data != null)
                    {
                        textBox4.Text  = humanBytes(nt.Node.Data.Length, out order).ToString("0.##");
                        sizelabel.Text = hb_sizes[order];
                    }
                    else
                    {
                        textBox4.Text  = "";
                        sizelabel.Text = "bytes";
                    }

                    button3.Enabled = button4.Enabled = nt.Node.Type == et.EFSNodeType.File;
                }
            }
        }
Ejemplo n.º 3
0
        TreeNode createTreeNode(et.EFSNode n, EFSNodeTranslation parent)
        {
            TreeNode nt = new TreeNode(n.Name + (n.Type == et.EFSNodeType.Folder ? "/" : ""));

            nt.Tag = new EFSNodeTranslation(n, parent);

            return(nt);
        }
Ejemplo n.º 4
0
        void parseNode(et.EFSNode node, EFSNodeTranslation n_parent, TreeNode parent)
        {
            var tn = createTreeNode(node, n_parent);

            parent.Nodes.Add(tn);
            if (node.Children != null)
            {
                foreach (var r in node.Children)
                {
                    parseNode(r, (tn.Tag as EFSNodeTranslation), tn);
                }
            }
        }
Ejemplo n.º 5
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (treeView1.SelectedNode != null)
            {
                EFSNodeTranslation current = treeView1.SelectedNode.Tag as EFSNodeTranslation;
                string             path    = current.Node.Name;
                while (current.Parent != null)
                {
                    path    = current.Parent.Node.Name + "/" + path;
                    current = current.Parent;
                }
                toolStripStatusLabel1.Text = path;

                select(e.Node);
            }
            else
            {
                toolStripStatusLabel1.Text = "";
                select(null);
            }
        }
Ejemplo n.º 6
0
 public EFSNodeTranslation(et.EFSNode node, EFSNodeTranslation parent)
 {
     Node   = node;
     Parent = parent;
 }