Class HexView
Assembly: Terminal.Gui.dll
Syntax
public class HexView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Constructors
|
Edit this page
View Source
HexView()
Declaration
|
Edit this page
View Source
HexView(Stream)
Declaration
public HexView(Stream source)
Parameters
| Type |
Name |
Description |
| Stream |
source |
The Stream to view and edit as hex, this Stream must support seeking, or an exception will be thrown. |
Properties
|
Edit this page
View Source
AllowEdits
Declaration
public bool AllowEdits { get; set; }
Property Value
| Type |
Description |
| bool |
true if allow edits; otherwise, false. |
|
Edit this page
View Source
BytesPerLine
The bytes length per line.
Declaration
public int BytesPerLine { get; }
Property Value
|
Edit this page
View Source
CursorPosition
Gets the current cursor position starting at one for both, line and column.
Declaration
public Point CursorPosition { get; }
Property Value
|
Edit this page
View Source
DesiredCursorVisibility
Get / Set the wished cursor when the field is focused
Declaration
public CursorVisibility DesiredCursorVisibility { get; set; }
Property Value
|
Edit this page
View Source
DisplayStart
Sets or gets the offset into the
Stream that will displayed at the top of the
HexView
Declaration
public long DisplayStart { get; set; }
Property Value
| Type |
Description |
| long |
The display start. |
|
Edit this page
View Source
Edits
Declaration
public IReadOnlyDictionary<long, byte> Edits { get; }
Property Value
|
Edit this page
View Source
Frame
Gets or sets the frame for the view. The frame is relative to the view's container (
SuperView).
Declaration
public override Rect Frame { get; set; }
Property Value
| Type |
Description |
| Rect |
The frame. |
Overrides
|
Edit this page
View Source
Position
Gets the current character position starting at one, related to the
Stream.
Declaration
public long Position { get; }
Property Value
|
Edit this page
View Source
Source
Sets or gets the
Stream the
HexView is operating on; the stream must support seeking (
CanSeek == true).
Declaration
public Stream Source { get; set; }
Property Value
| Type |
Description |
| Stream |
The source. |
Methods
|
Edit this page
View Source
ApplyEdits(Stream)
This method applies and edits made to the
Stream and resets the
contents of the
Edits property.
Declaration
public void ApplyEdits(Stream stream = null)
Parameters
| Type |
Name |
Description |
| Stream |
stream |
If provided also applies the changes to the passed Stream |
|
Edit this page
View Source
DiscardEdits()
This method discards the edits made to the
Stream by resetting the
contents of the
Edits property.
Declaration
public void DiscardEdits()
|
Edit this page
View Source
MouseEvent(MouseEvent)
Method invoked when a mouse event is generated
Declaration
public override bool MouseEvent(MouseEvent me)
Parameters
Returns
| Type |
Description |
| bool |
true, if the event was handled, false otherwise. |
Overrides
|
Edit this page
View Source
OnEdited(KeyValuePair<long, byte>)
Declaration
public virtual void OnEdited(KeyValuePair<long, byte> keyValuePair)
Parameters
|
Edit this page
View Source
OnEnter(View)
Method invoked when a view gets focus.
Declaration
public override bool OnEnter(View view)
Parameters
| Type |
Name |
Description |
| View |
view |
The view that is losing focus. |
Returns
| Type |
Description |
| bool |
true, if the event was handled, false otherwise. |
Overrides
|
Edit this page
View Source
OnPositionChanged()
Declaration
public virtual void OnPositionChanged()
|
Edit this page
View Source
PositionCursor()
Positions the cursor in the right position based on the currently focused view in the chain.
Declaration
public override void PositionCursor()
Overrides
|
Edit this page
View Source
ProcessKey(KeyEvent)
If the view is focused, gives the view a
chance to process the keystroke.
Declaration
public override bool ProcessKey(KeyEvent keyEvent)
Parameters
| Type |
Name |
Description |
| KeyEvent |
keyEvent |
Contains the details about the key that produced the event. |
Returns
Overrides
|
Edit this page
View Source
Redraw(Rect)
Redraws this view and its subviews; only redraws the views that have been flagged for a re-display.
Declaration
public override void Redraw(Rect bounds)
Parameters
| Type |
Name |
Description |
| Rect |
bounds |
The bounds (view-relative region) to redraw. |
Overrides
Events
|
Edit this page
View Source
Edited
Event to be invoked when an edit is made on the
Stream.
Declaration
public event Action<KeyValuePair<long, byte>> Edited
Event Type
|
Edit this page
View Source
PositionChanged
Event to be invoked when the position and cursor position changes.
Declaration
public event Action<HexView.HexViewEventArgs> PositionChanged
Event Type
Implements