private void StartSRAMHexViewer() { if (m_trionicFileInformation.SRAMfilename != "") { dockManager1.BeginUpdate(); try { DevExpress.XtraBars.Docking.DockPanel dockPanel = dockManager1.AddPanel(DevExpress.XtraBars.Docking.DockingStyle.Right); dockPanel.Text = "SRAM Hexviewer: " + Path.GetFileName(m_trionicFileInformation.SRAMfilename); dockPanel.ClosedPanel += new DockPanelEventHandler(dockPanel_ClosedPanel); dockPanel.Tag = m_trionicFileInformation.SRAMfilename; HexViewer hv = new HexViewer(); hv.onClose +=new HexViewer.ViewerClose(hv_onClose); hv.Issramviewer = true; hv.Dock = DockStyle.Fill; dockPanel.Width = 580; if (File.Exists(m_trionicFileInformation.SRAMfilename + ".hexview")) File.Delete(m_trionicFileInformation.SRAMfilename + ".hexview"); File.Copy(m_trionicFileInformation.SRAMfilename, m_trionicFileInformation.SRAMfilename + ".hexview"); hv.LoadDataFromFile(m_trionicFileInformation.SRAMfilename + ".hexview", m_trionicFileInformation.SymbolCollection); dockPanel.Controls.Add(hv); } catch (Exception E) { Console.WriteLine(E.Message); } dockManager1.EndUpdate(); } }
private void StartHexViewer() { if (m_trionicFileInformation.Filename != "") { if (MessageBox.Show("Opening a hexviewer will require full access to the binary file. No other data can be read from or written to the file while the hexviewer is open! Do you wish to continue?", "Warning!", MessageBoxButtons.YesNo) == DialogResult.Yes) { dockManager1.BeginUpdate(); try { DevExpress.XtraBars.Docking.DockPanel dockPanel; //= dockManager1.AddPanel(DevExpress.XtraBars.Docking.DockingStyle.Right); if (!m_appSettings.NewPanelsFloating) { dockPanel = dockManager1.AddPanel(DevExpress.XtraBars.Docking.DockingStyle.Right); } else { System.Drawing.Point floatpoint = this.PointToClient(new System.Drawing.Point(dockSymbols.Location.X + dockSymbols.Width + 30, dockSymbols.Location.Y + 10)); dockPanel = dockManager1.AddPanel(floatpoint); } dockPanel.ClosedPanel += new DockPanelEventHandler(dockPanel_ClosedPanel); dockPanel.Tag = m_trionicFileInformation.Filename; dockPanel.Text = "Hexviewer: " + Path.GetFileName(m_trionicFileInformation.Filename); //dockPanel.ClosedPanel += new DockPanelEventHandler(dockPanel_ClosedPanel); HexViewer hv = new HexViewer(); hv.onClose += new HexViewer.ViewerClose(hv_onClose); hv.Issramviewer = false; hv.Dock = DockStyle.Fill; dockPanel.Width = 580; //if (File.Exists(m_trionicFileInformation.Filename + ".hexview")) File.Delete(m_trionicFileInformation.Filename + ".hexview"); //File.Copy(m_trionicFileInformation.Filename, m_trionicFileInformation.Filename + ".hexview"); hv.LoadDataFromFile(m_trionicFileInformation.Filename /*+ ".hexview"*/, m_trionicFileInformation.SymbolCollection); dockPanel.Controls.Add(hv); } catch (Exception E) { Console.WriteLine(E.Message); } dockManager1.EndUpdate(); } } }