示例#1
0
 public ProgressDialog(BigFile file)
 {
     InitializeComponent();
     this.ShowInTaskbar = false;
     this.StartPosition = FormStartPosition.CenterParent;
     this.progressBar.Style = ProgressBarStyle.Blocks;
     this.progressStatusRichTextBox.HideSelection = false;
     file.ImportProgressChanged += file_ImportProgressChanged;
     file.ExportProgressChanged += file_ExportProgressChanged;
 }
示例#2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.openFileDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    this.file = new BigFile();
                    this.file.Read(File.Open(openFileDialog.FileName, FileMode.Open, FileAccess.Read, FileShare.Read));

                    this.entriesObjectListView.SetObjects(this.file.Entries);
                    this.Text = Properties.Resources.AppTitleShort + " - " + Path.GetFileName(openFileDialog.FileName);
                    this.fileCountToolStripStatusLabel.Text = this.file.Entries.Count.ToString();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Failed to open file!" + Environment.NewLine + Environment.NewLine +
                        ex.Message, "Fail", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }