private void OpenFileButton_Click(object sender, EventArgs e) { if (!isFileOpened) { using var ofd = new OpenFileDialog() { InitialDirectory = Environment.SpecialFolder.Desktop.ToString(), RestoreDirectory = true, Multiselect = false, CheckFileExists = true, CheckPathExists = true, Filter = "PDF|*.pdf|All Files|*.*", DefaultExt = "*.pdf", FilterIndex = 0 }; var result = ofd.ShowDialog(); if (result == DialogResult.OK) { if (fileView == null) { fileView = new FileView(this, ofd.FileName) { TopLevel = false, Text = Path.GetFileNameWithoutExtension(ofd.FileName) }; fileView.MdiParent = this; fileView.Show(); isFileOpened = true; } } } }
public ConvertedDocumentView(MainForm o, FileView c, ToolStripButton b, List <KeyValuePair <string, string> > pred, List <int> part, DocTemplate t, Size s, string p) { owner = o; caller = c; convertBtn = b; predictions = pred; partitions = part; template = t; inputImageSize = s; path = p; InitializeComponent(); BBoxes = new List <Rectangle>(); }
public void DeleteSelfReference(Form f) { if (f == inputDataView) { inputDataView = null; } if (f == managementView) { managementView = null; } if (f == fileView) { fileView = null; } }