public BlockInfo(wCpuBlock block) { InitializeComponent(); Text = "Block Information - " + block.ToString(); txtBlock.Text = block.ToString(); txtName.Text = block.name; txtAuthor.Text = block.author; txtFamily.Text = block.family; txtLanguage.Text = block.language.ToString(); txtLocalData.Text = block.localData.ToString(); txtLoadSize.Text = block.loadSize.ToString() + " bytes"; txtMC7Size.Text = block.MC7Size.ToString() + " bytes"; txtSBBLength.Text = block.SBBLength.ToString() + " bytes"; txtCodeDate.Text = block.codeDate; txtInterfaceDate.Text = block.interfaceDate; //Format checksum as hex (ab cd) txtChecksum.Text = block.checksum.ToString("x4").Insert(2, " "); txtFlags.Text = block.blockFlags.ToString("x4").Insert(2, " "); txtVersion.Text = block.version.ToString("x4").Insert(2, " "); //TODO Fix this shit if (block.data != null && false) { ByteViewer bv = new ByteViewer(); bv.SetBytes(block.data); bv.Location = new Point(12, 148); bv.Size = new Size(419, 222); Controls.Add(bv); byte[] data = new byte[block.loadSize - 10]; Array.Copy(block.data, data, data.Length); txtTestChecksum.Text = Crc16.ComputeChecksum(data).ToString("x4").Insert(2, " "); } else { } }
/// <summary> /// /// </summary> public HexForm() { ThisMenu = new MainMenu(); DataMenuCollection = new MenuItem() { Text = "数据" }; ThisMenu.MenuItems.Add(DataMenuCollection); ThisForm = new Form() { Width = 650, Height = 800, MaximizeBox = false, FormBorderStyle = FormBorderStyle.FixedSingle, Menu = ThisMenu, }; ThisForm.FormClosing += ThisForm_FormClosing; ThisForm.FormClosed += ThisForm_FormClosed; HexEditor = new ByteViewer() { Dock = DockStyle.Fill }; var data = new byte[0]; HexEditor.SetBytes(data); ThisForm.Controls.Add(HexEditor); ThisForm.Show(); }
private void CopyTextMenuItem_Click(object sender, RoutedEventArgs e) { if (ByteViewer.CanCopy()) { ByteViewer.Copy(); } }
private void PasteTextMenuItem_Click(object sender, RoutedEventArgs e) { if (ByteViewer.CanPaste()) { ByteViewer.Paste(); } }
public void ByteViewer_SetDisplayMode_InvokeWithBytesWithHandle_GetReturnsExpected(DisplayMode value, int expectedInvalidatedCallCount1, int expectedInvalidatedCallCount2) { using var control = new ByteViewer(); control.SetBytes(new byte[] { 1, 2, 3 }); Assert.NotEqual(IntPtr.Zero, control.Handle); int invalidatedCallCount = 0; control.Invalidated += (sender, e) => invalidatedCallCount++; int styleChangedCallCount = 0; control.StyleChanged += (sender, e) => styleChangedCallCount++; int createdCallCount = 0; control.HandleCreated += (sender, e) => createdCallCount++; control.SetDisplayMode(value); Assert.Equal(value, control.GetDisplayMode()); Assert.True(control.IsHandleCreated); Assert.Equal(expectedInvalidatedCallCount1, invalidatedCallCount); Assert.Equal(0, styleChangedCallCount); Assert.Equal(0, createdCallCount); // Set same. control.SetDisplayMode(value); Assert.Equal(value, control.GetDisplayMode()); Assert.True(control.IsHandleCreated); Assert.Equal(expectedInvalidatedCallCount2, invalidatedCallCount); Assert.Equal(0, styleChangedCallCount); Assert.Equal(0, createdCallCount); }
public void ByteViewer_SetStartLine_InvokeWithBytesWithHandle_Success(byte[] bytes, int line) { using var control = new ByteViewer(); control.SetBytes(bytes); Assert.NotEqual(IntPtr.Zero, control.Handle); int invalidatedCallCount = 0; control.Invalidated += (sender, e) => invalidatedCallCount++; int styleChangedCallCount = 0; control.StyleChanged += (sender, e) => styleChangedCallCount++; int createdCallCount = 0; control.HandleCreated += (sender, e) => createdCallCount++; control.SetStartLine(line); Assert.True(control.IsHandleCreated); Assert.Equal(0, invalidatedCallCount); Assert.Equal(0, styleChangedCallCount); Assert.Equal(0, createdCallCount); // Call again. control.SetStartLine(line); Assert.True(control.IsHandleCreated); Assert.Equal(0, invalidatedCallCount); Assert.Equal(0, styleChangedCallCount); Assert.Equal(0, createdCallCount); }
public void ByteViewer_SetFile_InvokeNoBytes_Success() { using var control = new ByteViewer(); using TempFile file = TempFile.Create(new byte[] { 1, 2, 3 }); control.SetFile(file.Path); Assert.Equal(new byte[] { 1, 2, 3, 0 }, control.GetBytes()); }
public TrainDrukteForm() { InitializeComponent(); timer1.Start(); _arduino = null; _ledControl = null; _byteViewer = new ByteViewer(); _byteViewer.Dock = DockStyle.Fill; panel1.Controls.Add(_byteViewer); _trackBars = new TrackBar[6] { tb1, tb2, tb3, tb4, tb5, tb6 }; _colorCodes = new Color[3] { Color.White, Color.Green, Color.Red }; SetBarsState(false); foreach (TrackBar bar in _trackBars) { bar.ValueChanged += bars_ValueChanged; } _trafficStates = new Color[6]; Messages = new List <Message>(); cbCom.Items.AddRange(SerialPort.GetPortNames()); }
public frmHex(String filename) : base(filename) { InitializeComponent(); ByteViewer bv = new ByteViewer(); bv.Dock = DockStyle.Fill; bv.SetFile(filename); // or SetBytes Controls.Add(bv); }
public HexEditor() { InitializeComponent(); ByteViewer = new ByteViewer(); ByteViewer.Dock = DockStyle.Fill; stPanel1.Controls.Add(ByteViewer); }
public HexViewer(string filename) { InitializeComponent(); ByteViewer bv = new ByteViewer(); bv.SetFile(filename); bv.Dock = DockStyle.Fill; bv.SetDisplayMode(DisplayMode.Hexdump); Controls.Add(bv); }
private void Hex_Viewer_Load(object sender, EventArgs e) { HEXtextBox1.Enabled = false; HEXtextBox1.Text = dv.textOpen.Text; ByteViewer bv = new ByteViewer(); bv.SetFile(HEXtextBox1.Text); // or SetBytes Controls.Add(bv); }
public void ByteViewer_SetStartLine_InvokeNoBytes_Success(int line) { using var control = new ByteViewer(); control.SetStartLine(line); Assert.False(control.IsHandleCreated); // Call again. control.SetStartLine(line); Assert.False(control.IsHandleCreated); }
public MainForm() { InitializeComponent(); bvResponseBody = new ByteViewer(); bvResponseBody.TabIndex = 14; bvResponseBody.Dock = DockStyle.Fill; bvResponseBody.Visible = false; pnlResponseContent.Controls.Add(bvResponseBody); }
public EditValueBinary() { InitializeComponent(); _editor = new ByteViewer(); _editor.Location = new Point(9, 16); _editor.Margin = new Padding(3, 3, 0, 3); _editor.Name = "TextBoxValueData"; _editor.TabIndex = 1; Controls.Add(_editor); }
public frmHexViewer(byte[] data) { InitializeComponent(); var ctrl = new ByteViewer(); ctrl.SetBytes(data); ctrl.Dock = DockStyle.Fill; this.Controls.Add(ctrl); }
public HexEditor() { InitializeComponent(); ByteViewer = new ByteViewer(); ByteViewer.BackColor = FormThemes.BaseTheme.FormBackColor; ByteViewer.ForeColor = FormThemes.BaseTheme.FormForeColor; ByteViewer.Dock = DockStyle.Fill; stPanel1.Controls.Add(ByteViewer); }
public HexEditorControl() { InitializeComponent(); _byteViewer = new ByteViewer(); //_byteViewer.Anchor = AnchorStyles.Left | AnchorStyles.Top; //_byteViewer.Location = new Point(0, 0); //_byteViewer.Size = glPanel.Size; _byteViewer.Dock = DockStyle.Fill; pnlHexViewer.Controls.Add(_byteViewer); }
//TODO fix this. public override void Load(FileInfo file) { ByteViewer viewer = new ByteViewer(); viewer.Dock = DockStyle.Fill; viewer.SetFile(file.FullName); viewer.BackColor = Color.White; viewer.ForeColor = Color.Black; viewer.SetDisplayMode(DisplayMode.Hexdump); Controls.Add(viewer); }
public SEMEditor() { InitializeComponent(); entryList.DataSource = Entries; byteView = new ByteViewer(); byteView.Dock = DockStyle.Fill; groupBox1.Controls.Add(byteView); CenterToScreen(); }
public void ByteViewer_SetDisplayMode_InvokeNoBytes_ThrowsNullReferenceException(DisplayMode value) { using var control = new ByteViewer(); Assert.Throws <NullReferenceException>(() => control.SetDisplayMode(value)); Assert.Equal(value, control.GetDisplayMode()); Assert.False(control.IsHandleCreated); // Set same. Assert.Throws <NullReferenceException>(() => control.SetDisplayMode(value)); Assert.Equal(value, control.GetDisplayMode()); Assert.False(control.IsHandleCreated); }
public void ByteViewer_SetDisplayMode_InvokeNoBytes_GetReturnsExpected(DisplayMode value) { using var control = new ByteViewer(); control.SetDisplayMode(value); Assert.Equal(value, control.GetDisplayMode()); Assert.False(control.IsHandleCreated); // Set same. control.SetDisplayMode(value); Assert.Equal(value, control.GetDisplayMode()); Assert.False(control.IsHandleCreated); }
public void ByteViewer_SetBytes_Invoke_GetReturnExpected(byte[] bytes) { using var control = new ByteViewer(); control.SetBytes(bytes); Assert.Same(bytes, control.GetBytes()); Assert.False(control.IsHandleCreated); // Set same. control.SetBytes(bytes); Assert.Same(bytes, control.GetBytes()); Assert.False(control.IsHandleCreated); }
public MemoryView() { InitializeComponent(); m_ByteViewer = new ByteViewer(); m_ByteViewer.Dock = DockStyle.Fill; m_ByteViewer.Left = 0; m_ByteViewer.Top = 0; Controls.Add(m_ByteViewer); m_ByteViewer.SetFile(@"c:\windows\notepad.exe"); }
public static void Show(byte[] data) { Form f = new Form(); f.Text = "Hex editor"; ByteViewer bv = new ByteViewer(); bv.Dock = DockStyle.Fill; f.Controls.Add(bv); bv.SetBytes(data); f.TopMost = true; f.Show(); }
public ByteViewerForm() { // Initialize the controls other than the ByteViewer. InitializeForm(); // Initialize the ByteViewer. byteviewer = new ByteViewer(); byteviewer.Location = new Point(8, 46); byteviewer.Size = new Size(600, 338); byteviewer.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; byteviewer.SetBytes(new byte[] { }); this.Controls.Add(byteviewer); this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); }
private void MemoryView_Load(object sender, EventArgs e) { LogFile.WriteToLog("------------ Loaded Memory View ------------"); GoogleAnalyticsApi.TrackPageview("PatchEditor.cs", "MemoryView_Load", ""); FormShowing = true; bv = new ByteViewer(); bv.Dock = DockStyle.Fill; Controls.Add(bv); if (MainForm.HaloIsRunning) { LoadMemoryView(); } }
private void CreateByteViewer(OpenFileDialog ofd, Form form) { panel = new Panel(); byteViewer = new ByteViewer(); byteViewer.Dock = DockStyle.Fill; byteViewer.SetBytes(new byte[] { }); byteViewer.SetFile(ofd.FileName); panel.Location = new System.Drawing.Point(12, 54); panel.Name = "panel"; panel.Size = new System.Drawing.Size(617, 330); panel.TabIndex = 2; form.Controls.Add(panel); panel.Controls.Add(byteViewer); }
public Form1() { InitializeComponent(); InitializeForm(); byteviewer = new ByteViewer(); byteviewer.Location = new Point(8, 66); byteviewer.Size = new Size(700, 338); byteviewer.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; byteviewer.SetBytes(new byte[] { }); this.Controls.Add(byteviewer); MaximizeBox = false; MinimizeBox = false; FormBorderStyle = FormBorderStyle.FixedSingle; }
public HexEditorControl(byte[] data) { InitializeComponent(); var byteviewer = new ByteViewer(); byteviewer.Dock = DockStyle.Fill; byteviewer.SetBytes(data); byteviewer.SetDisplayMode(DisplayMode.Hexdump); Controls.Add(byteviewer); }