/// <summary> /// Create/open an MXF file /// </summary> /// <param name="fileName"></param> public MXFFile(string fileName, BackgroundWorker worker, FileParseOptions options = FileParseOptions.Normal) { this.Filename = fileName; this.Partitions = new List <MXFPartition>(); this.m_results = new List <MXFValidationResult>(); switch (options) { case FileParseOptions.Normal: ParseFull(worker); break; case FileParseOptions.Fast: ParsePartial(worker); break; } }
/// <summary> /// Initialize the UI /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MXFView_Load(object sender, EventArgs e) { ObjectListView.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default; this.Text = this.Filename; this.btnSelectReference.Enabled = false; this.btnNext.Enabled = false; this.btnPrevious.Enabled = false; //bool hideFillers = true; //FormProgress fp = new FormProgress(this.Filename, this.treeListViewMain, this.txtOverall, hideFillers); //fp.StartPosition = FormStartPosition.CenterParent; //fp.ShowDialog(this); this.MinimizeBox = false; this.MaximizeBox = false; this.splitMain.Visible = false; this.prbProcessing.Visible = true; //bug that means you have to set the desired icon again otherwise it reverts to default when child form is maximised this.Icon = Myriadbits.MXFInspect.Properties.Resources.ChildIcon; this.MinimizeBox = false; this.MaximizeBox = false; this.chkInfo.Checked = true; this.propGrid.HelpVisible = this.chkInfo.Checked; // // Set the tree styles OLVColumn col = (OLVColumn)this.treeListViewMain.Columns[0]; col.Renderer = null; col = (OLVColumn)this.treeListViewMain.Columns[1]; col.Renderer = this.treeListViewMain.TreeColumnRenderer; col = (OLVColumn)this.treeListViewLogical.Columns[0]; col.Renderer = null; col = (OLVColumn)this.treeListViewLogical.Columns[1]; col.Renderer = this.treeListViewLogical.TreeColumnRenderer; Pen pen = new Pen(Color.Black, 1.001f); pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; this.treeListViewMain.TreeColumnRenderer.LinePen = pen; this.treeListViewLogical.TreeColumnRenderer.LinePen = pen; // Set tree delegates this.treeListViewMain.CanExpandGetter = Tree_HasChildren; this.treeListViewMain.ChildrenGetter = Tree_ChildGetter; this.treeListViewLogical.CanExpandGetter = Tree_HasLogicalChildren; this.treeListViewLogical.ChildrenGetter = Tree_LogicalChildGetter; // Determine the filesize m_eFileParseOptions = FileParseOptions.Normal; long fileThreshold = ((long)MXFInspect.Properties.Settings.Default.PartialLoadThresholdMB) * 1024 * 1024; FileInfo f = new FileInfo(this.Filename); if (f.Length > fileThreshold) { m_eFileParseOptions = FileParseOptions.Fast; if (MXFInspect.Properties.Settings.Default.PartialLoadWarning) { MessageBox.Show(string.Format("The file {0} is larger then the threshold and will be loaded partially.\nA partition will be loaded when expanding the partition in the tree.", this.Filename), "Partial loading active", MessageBoxButtons.OK, MessageBoxIcon.Information); } } this.bgwProcess.RunWorkerAsync(this); FormMain frmMain = this.MdiParent as FormMain; if (frmMain != null) { frmMain.EnableUI(false); } }