Exemplo n.º 1
0
        public FormPropertiesFile(TreeNodeFile f)
        {
            InitializeComponent();

            this.textBoxTitle.Text = f.GetName();

            if (f.GetSize() >= 0)
            {
                this.textBoxDescription.Text += "File Size: " + f.GetSize() + " bytes\r\n";
            }

            this.textBoxDescription.Text += "Creation date : " + f.GetDate().ToString();

            this.Text = f.GetName() + " - Properties";
        }
Exemplo n.º 2
0
        /// <summary>
        /// Causes tree node to get its child nodes
        /// </summary>
        public override void LoadTreeNodeChilds()
        {
            if (true == isNodesLoaded)
            {
                return;
            }

            this.Nodes.Clear();

            var files = disk.Files;

            if (null != files)
            {
                this.files = new ArrayList();

                foreach (DataBase.File f in files)
                {
                    TreeNodeFile nf = new TreeNodeFile(f, (TreeViewCatalog)this.TreeView);
                    this.files.Add(nf);
                    if (f.Attributes == 1)
                    {
                        this.Nodes.Add(nf);
                    }
                }
            }

            isNodesLoaded = true;
        }
Exemplo n.º 3
0
        private TreeNodeFile GoToFile(TreeNodeFile parent, long fileId)
        {
            if (parent.InternalFile.Id == fileId)
            {
                return parent;
            }

            foreach (TreeNode tn in parent.ChildNodes)
            {
                if (tn is TreeNodeFile)
                {
                    TreeNodeFile tnf = (TreeNodeFile)tn;

                    if (tnf.InternalFile.Attributes == 1)
                    {
                        TreeNodeFile tf = GoToFile(tnf, fileId);

                        if (null != tf)
                        {
                            return tf;
                        }
                    }
                }
            }

            return null;
        }