コード例 #1
0
ファイル: Form1.cs プロジェクト: johannes85/xartools
        private void OpenFile(string filePath)
        {
            mnuToolbarExtract.Enabled = false;
            mnuToolbarInfo.Enabled    = false;
            lstFiles.Items.Clear();
            try
            {
                string fileName = Path.GetFileName(filePath);
                file = new Xar.File(filePath);

                foreach (Xar.File.Entry entry in file.GetEntries())
                {
                    var item = new ListViewItem(new String[] {
                        entry.Id,
                        entry.Size.Bytes().Humanize("0.00")
                    });
                    lstFiles.Items.Add(item);
                }

                Text = "XarViewer - " + fileName;
                mnuToolbarInfo.Enabled = true;
            } catch (Xar.FileException ex)
            {
                file = null;
                MessageBox.Show(ex.Message, "Could not open XAR file", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
ファイル: FormInfos.cs プロジェクト: johannes85/xartools
 public FormInfos(Xar.File file)
 {
     InitializeComponent();
     this.file = file;
 }
コード例 #3
0
ファイル: FormInfos.cs プロジェクト: johannes85/xartools
 public FormInfos(Xar.File file)
 {
     InitializeComponent();
     this.file = file;
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: johannes85/xartools
        private void OpenFile(string filePath)
        {
            mnuToolbarExtract.Enabled = false;
            mnuToolbarInfo.Enabled = false;
            lstFiles.Items.Clear();
            try
            {
                string fileName = Path.GetFileName(filePath);
                file = new Xar.File(filePath);

                foreach (Xar.File.Entry entry in file.GetEntries())
                {
                    var item = new ListViewItem(new String[] {
                        entry.Id,
                        entry.Size.Bytes().Humanize("0.00")
                    });
                    lstFiles.Items.Add(item);
                }

                Text = "XarViewer - " + fileName;
                mnuToolbarInfo.Enabled = true;
            } catch (Xar.FileException ex)
            {
                file = null;
                MessageBox.Show(ex.Message, "Could not open XAR file", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }