Class HexView
An hex viewer and editor
View over a
System.IO.Stream
Inheritance
System.Object
HexView
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Terminal.Gui.dll
Syntax
public class HexView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Constructors
|
Improve this Doc
View Source
HexView()
Declaration
|
Improve this Doc
View Source
HexView(Stream)
Declaration
public HexView(Stream source)
Parameters
Type |
Name |
Description |
System.IO.Stream |
source |
The System.IO.Stream to view and edit as hex, this System.IO.Stream must support seeking, or an exception will be thrown. |
Properties
|
Improve this Doc
View Source
AllowEdits
Gets or sets whether this
HexView allow editing of the
System.IO.Stream
of the underlying
System.IO.Stream.
Declaration
public bool AllowEdits { get; set; }
Property Value
Type |
Description |
System.Boolean |
true if allow edits; otherwise, false . |
|
Improve this Doc
View Source
BytesPerLine
The bytes length per line.
Declaration
public int BytesPerLine { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
CursorPosition
Gets the current cursor position starting at one for both, line and column.
Declaration
public Point CursorPosition { get; }
Property Value
|
Improve this Doc
View Source
DesiredCursorVisibility
Get / Set the wished cursor when the field is focused
Declaration
public CursorVisibility DesiredCursorVisibility { get; set; }
Property Value
|
Improve this Doc
View Source
DisplayStart
Sets or gets the offset into the
System.IO.Stream that will displayed at the top of the
HexView
Declaration
public long DisplayStart { get; set; }
Property Value
Type |
Description |
System.Int64 |
The display start. |
|
Improve this Doc
View Source
Edits
Gets a
System.Collections.Generic.SortedDictionary`2 describing the edits done to the
HexView.
Each Key indicates an offset where an edit was made and the Value is the changed byte.
Declaration
public IReadOnlyDictionary<long, byte> Edits { get; }
Property Value
Type |
Description |
System.Collections.Generic.IReadOnlyDictionary<System.Int64, System.Byte> |
The edits. |
|
Improve this Doc
View Source
Frame
Declaration
public override Rect Frame { get; set; }
Property Value
Overrides
|
Improve this Doc
View Source
Position
Gets the current character position starting at one, related to the System.IO.Stream.
Declaration
public long Position { get; }
Property Value
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
Source
Sets or gets the
System.IO.Stream the
HexView is operating on; the stream must support seeking (
System.IO.Stream.CanSeek == true).
Declaration
public Stream Source { get; set; }
Property Value
Type |
Description |
System.IO.Stream |
The source. |
Methods
|
Improve this Doc
View Source
ApplyEdits(Stream)
This method applies and edits made to the
System.IO.Stream and resets the
contents of the
Edits property.
Declaration
public void ApplyEdits(Stream stream = null)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
If provided also applies the changes to the passed System.IO.Stream |
|
Improve this Doc
View Source
DiscardEdits()
This method discards the edits made to the
System.IO.Stream by resetting the
contents of the
Edits property.
Declaration
public void DiscardEdits()
|
Improve this Doc
View Source
MouseEvent(MouseEvent)
Declaration
public override bool MouseEvent(MouseEvent me)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
|
Improve this Doc
View Source
OnEdited(KeyValuePair<Int64, Byte>)
Method used to invoke the
Edited event passing the
System.Collections.Generic.KeyValuePair<TKey, TValue>.
Declaration
public virtual void OnEdited(KeyValuePair<long, byte> keyValuePair)
Parameters
Type |
Name |
Description |
System.Collections.Generic.KeyValuePair<System.Int64, System.Byte> |
keyValuePair |
The key value pair. |
|
Improve this Doc
View Source
OnEnter(View)
Declaration
public override bool OnEnter(View view)
Parameters
Type |
Name |
Description |
View |
view |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
|
Improve this Doc
View Source
OnPositionChanged()
Declaration
public virtual void OnPositionChanged()
|
Improve this Doc
View Source
PositionCursor()
Declaration
public override void PositionCursor()
Overrides
|
Improve this Doc
View Source
ProcessKey(KeyEvent)
Declaration
public override bool ProcessKey(KeyEvent keyEvent)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
|
Improve this Doc
View Source
Redraw(Rect)
Declaration
public override void Redraw(Rect bounds)
Parameters
Type |
Name |
Description |
Rect |
bounds |
|
Overrides
Events
|
Improve this Doc
View Source
Edited
Event to be invoked when an edit is made on the System.IO.Stream.
Declaration
public event Action<KeyValuePair<long, byte>> Edited
Event Type
Type |
Description |
System.Action<System.Collections.Generic.KeyValuePair<System.Int64, System.Byte>> |
|
|
Improve this Doc
View Source
PositionChanged
Event to be invoked when the position and cursor position changes.
Declaration
public event Action<HexView.HexViewEventArgs> PositionChanged
Event Type
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize