本文整理汇总了C#中HexBox类的典型用法代码示例。如果您正苦于以下问题:C# HexBox类的具体用法?C# HexBox怎么用?C# HexBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HexBox类属于命名空间,在下文中一共展示了HexBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BinaryViewer
/// <summary>
/// Implements a Binary viewer (More Hex-Editor) using the Be.HexBox control
/// </summary>
public BinaryViewer(string title, byte[] content)
{
InitializeComponent();
this.Text = title;
HexBox hb = new HexBox();
hb.Dock = DockStyle.Fill;
hb.ByteProvider = new MemoryByteProvider(content);
hb.VScrollBarVisible = true;
hb.UseFixedBytesPerLine = true;
hb.StringViewVisible = true;
this.Controls.Add(hb);
}
示例2: EditHexEditor
public EditHexEditor()
{
InitializeComponent();
hexBox = new HexBox();
hexBox.UseFixedBytesPerLine = true;
hexBox.LineInfoVisible = true;
hexBox.VScrollBarVisible = true;
hexBox.Size = this.ClientSize;
/*hexBox.GroupSeparatorVisible = true;
hexBox.GroupSize = 4;*/
hexBox.Paint += new PaintEventHandler(hexBox_Paint);
this.Controls.Add(hexBox);
hexBox.ByteProvider = new DynamicByteProvider(Globals.romdata);
}
示例3: InsertUsingEncoding
private void InsertUsingEncoding(Encoding encoding, HexBox _hexbox, bool Multiline)
{
PromptBox prompt = new PromptBox(Multiline);
if (prompt.ShowDialog() == DialogResult.OK)
{
byte[] bytes = new byte[prompt.Value.Length * encoding.GetByteCount("A")];
encoding.GetBytes(prompt.Value, 0, prompt.Value.Length, bytes, 0);
_hexbox.ByteProvider.DeleteBytes(_hexbox.SelectionStart, _hexbox.SelectionLength);
_hexbox.ByteProvider.InsertBytes(_hexbox.SelectionStart, bytes);
_hexbox.Select(_hexbox.SelectionStart, bytes.Length);
}
}
示例4: GetControl
public Control GetControl()
{
var provider = new DynamicFileByteProvider(_fileName, true);
var control = new HexBox
{
ByteProvider = provider,
Dock = DockStyle.Fill,
GroupSeparatorVisible = false,
ColumnInfoVisible = true,
LineInfoVisible = true,
StringViewVisible = true,
UseFixedBytesPerLine = true,
VScrollBarVisible = true,
};
return control;
}
示例5: GetControl
public Control GetControl()
{
// TODO can't display GLB files yet so just return the hex viewer for now
var provider = new DynamicFileByteProvider(_args.Filename, true);
var control = new HexBox
{
ByteProvider = provider,
Dock = DockStyle.Fill,
GroupSeparatorVisible = false,
ColumnInfoVisible = true,
LineInfoVisible = true,
StringViewVisible = true,
UseFixedBytesPerLine = true,
VScrollBarVisible = true,
};
return control;
}
示例6: InsertNumber
private void InsertNumber(HexBox _hexbox, int byteCount, bool BigEndian)
{
PromptBox prompt = new PromptBox();
if (prompt.ShowDialog() == DialogResult.OK)
{
byte[] bytes = new byte[byteCount];
long number = (long)BaseConverter.ToNumberParse(prompt.Value);
for (int i = 0; i < bytes.Length; i++)
{
bytes[BigEndian ? (bytes.Length - i - 1) : i] = (byte)((number >> (i * 8)) & 0xff);
}
_hexbox.ByteProvider.DeleteBytes(_hexbox.SelectionStart, _hexbox.SelectionLength);
_hexbox.ByteProvider.InsertBytes(_hexbox.SelectionStart, bytes);
_hexbox.Select(_hexbox.SelectionStart, bytes.Length);
}
}
示例7: MysteryBox
public MysteryBox(byte[] data)
{
this.data = data;
tbbExport = new ToolStripButton();
tbbExport.Text = "Export";
tbbExport.Click += new EventHandler(tbbExport_Click);
tsToolbar = new ToolStrip();
tsToolbar.Dock = DockStyle.Top;
tsToolbar.Items.Add(tbbExport);
hbData = new HexBox();
hbData.Dock = DockStyle.Fill;
hbData.Data = data;
Controls.Add(hbData);
Controls.Add(tsToolbar);
}
示例8: ResourceControl
public ResourceControl()
{
SplitContainer mainContainer = new SplitContainer()
{
Dock = DockStyle.Fill,
};
SplitContainer treeSplitter = new SplitContainer()
{
Dock = DockStyle.Fill,
Orientation = Orientation.Horizontal,
SplitterDistance = 400,
};
resourcesTree = new TreeView()
{
Dock = DockStyle.Fill,
};
propertyGrid = new PropertyGrid()
{
Dock = DockStyle.Fill,
HelpVisible = false,
};
hexBox = new HexBox()
{
Dock = DockStyle.Fill,
StringViewVisible = true,
LineInfoVisible = true,
LineInfoForeColor = Color.Blue,
UseFixedBytesPerLine = true,
BytesPerLine = 16,
VScrollBarVisible = true,
};
resourcesTree.AfterSelect += resourcesTree_AfterSelect;
treeSplitter.Panel1.Controls.Add(resourcesTree);
treeSplitter.Panel2.Controls.Add(propertyGrid);
mainContainer.Panel1.Controls.Add(treeSplitter);
mainContainer.Panel2.Controls.Add(hexBox);
this.Controls.Add(mainContainer);
}
示例9: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this._hexBox = new Be.Windows.Forms.HexBox();
this._txtString = new System.Windows.Forms.TextBox();
this._rbString = new System.Windows.Forms.RadioButton();
this._rbHex = new System.Windows.Forms.RadioButton();
this._btnOk = new System.Windows.Forms.Button();
this._btnCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// hexBox
//
this._hexBox.Anchor =
((System.Windows.Forms.AnchorStyles)
((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
//
//
//
this._hexBox.BuiltInContextMenu.CopyMenuItemImage = global::Reflexil.Properties.Resources.CopyHS;
this._hexBox.BuiltInContextMenu.CutMenuItemImage = global::Reflexil.Properties.Resources.CutHS;
this._hexBox.BuiltInContextMenu.PasteMenuItemImage = global::Reflexil.Properties.Resources.PasteHS;
this._hexBox.Enabled = false;
this._hexBox.Font = new System.Drawing.Font("Courier New", 9F);
this._hexBox.HexCasing = Be.Windows.Forms.HexCasing.Lower;
this._hexBox.LineInfoForeColor = System.Drawing.Color.Empty;
this._hexBox.Location = new System.Drawing.Point(12, 76);
this._hexBox.Name = "_hexBox";
this._hexBox.ShadowSelectionColor = System.Drawing.Color.FromArgb(((int) (((byte) (100)))), ((int) (((byte) (60)))),
((int) (((byte) (188)))), ((int) (((byte) (255)))));
this._hexBox.Size = new System.Drawing.Size(304, 126);
this._hexBox.TabIndex = 3;
//
// txtString
//
this._txtString.Anchor =
((System.Windows.Forms.AnchorStyles)
(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this._txtString.Location = new System.Drawing.Point(12, 28);
this._txtString.Name = "_txtString";
this._txtString.Size = new System.Drawing.Size(304, 21);
this._txtString.TabIndex = 1;
//
// rbString
//
this._rbString.Checked = true;
this._rbString.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this._rbString.Location = new System.Drawing.Point(12, 12);
this._rbString.Name = "_rbString";
this._rbString.Size = new System.Drawing.Size(104, 16);
this._rbString.TabIndex = 0;
this._rbString.TabStop = true;
this._rbString.Text = "Text";
//
// rbHex
//
this._rbHex.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this._rbHex.Location = new System.Drawing.Point(12, 60);
this._rbHex.Name = "_rbHex";
this._rbHex.Size = new System.Drawing.Size(104, 16);
this._rbHex.TabIndex = 2;
this._rbHex.Text = "Hex";
//
// btnOK
//
this._btnOk.Anchor =
((System.Windows.Forms.AnchorStyles)
((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this._btnOk.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this._btnOk.Location = new System.Drawing.Point(160, 211);
this._btnOk.Name = "_btnOk";
this._btnOk.Size = new System.Drawing.Size(75, 23);
this._btnOk.TabIndex = 4;
this._btnOk.Text = "Find next";
this._btnOk.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this._btnCancel.Anchor =
((System.Windows.Forms.AnchorStyles)
((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this._btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this._btnCancel.Location = new System.Drawing.Point(241, 211);
this._btnCancel.Name = "_btnCancel";
this._btnCancel.Size = new System.Drawing.Size(75, 23);
this._btnCancel.TabIndex = 5;
this._btnCancel.Text = "Cancel";
this._btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// HexFindForm
//
this.AcceptButton = this._btnOk;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
this.BackColor = System.Drawing.SystemColors.Control;
//.........这里部分代码省略.........
示例10: UpdateValues_workingMemory
public virtual void UpdateValues_workingMemory(HexBox hb)
{
hb.ByteProvider = new DynamicByteProvider(machine.workingMemory.bank);
}
示例11: UpdateValues_programMemory
public override void UpdateValues_programMemory(HexBox hb)
{
}
示例12: UpdateValues_videoMemory
public virtual void UpdateValues_videoMemory(HexBox hb)
{
}
示例13: EmptyKeyInterpreter
public EmptyKeyInterpreter(HexBox hexBox)
{
_hexBox = hexBox;
}
示例14: SetHexBox
public void SetHexBox(HexBox hexBox)
{
_hexBox = hexBox;
}
示例15: EntityHexViewer_Validating
private void EntityHexViewer_Validating(HexBox hexbox, Entity.EntityType type)
{
if (PGMEBackend.Program.glEntityEditor.currentEntities != null && PGMEBackend.Program.glEntityEditor.currentEntities[0].GetEnum() == type && !loadingEntityView)
{
Entity currentEnt = PGMEBackend.Program.glEntityEditor.currentEntities[0];
byte[] oldValue = currentEnt.rawData;
currentEnt.rawData = (hexbox.ByteProvider as DynamicByteProvider).Bytes.ToArray();
if (!currentEnt.rawData.SequenceEqual(oldValue))
{
PGMEBackend.Program.isEdited = true;
currentEnt.LoadDataFromRaw();
LoadEntityView(currentEnt);
}
}
}