public void SetFile(ArchivedFile file)
        {
            TreeNode node = file.Node;

            for (TreeNode node2 = node.Parent; node2 != null; node2 = node2.Parent)
            {
                node2.Expand();
            }
            if (this.tvwFolders.SelectedNode != node)
            {
                this.tvwFolders.SelectedNode = node;
            }
            base.SuspendLayout();
            Panel pn = new Panel
            {
                Size = this.pnPanel.Size,
                Dock = DockStyle.Fill
            };

            FileDecoder.FindDecoder(Path.GetExtension(file.FileName)).FillPanel(file, pn);
            Control control = null;

            if (this.pnPanel.Controls.Count > 0)
            {
                control = this.pnPanel.Controls[0];
            }
            this.pnPanel.Controls.Clear();
            if (control != null)
            {
                control.Dispose();
            }
            this.pnPanel.Controls.Add(pn);
            base.ResumeLayout();
        }
 static FileDecoder()
 {
     FileDecoder[] fileDecoderArr = new FileDecoder[] {
                                                        new ImageDecoder(".img")
                                                        };
     FileDecoder.m_Decoders = fileDecoderArr;
 }
 static FileDecoder()
 {
     FileDecoder[] fileDecoderArr = new FileDecoder[] {
         new ImageDecoder(".img")
     };
     FileDecoder.m_Decoders = fileDecoderArr;
 }
Exemple #4
0
 public FileListItem(ArchivedFile archivedFile, int icon)
     : base(new string[] { archivedFile.FileName, GetFileSize(archivedFile.Length), FileDecoder.FindDecoder(Path.GetExtension(archivedFile.FileName)).GetType(archivedFile) })
 {
     string[] sArr = new string[] {
         archivedFile.FileName,
         FileListItem.GetFileSize(archivedFile.Length),
         FileDecoder.FindDecoder(Path.GetExtension(archivedFile.FileName)).GetType(archivedFile)
     };
     ImageIndex     = 2 + (icon * 2);
     m_ArchivedFile = archivedFile;
 }