-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve CLI, update workflow and update Be.Windows.Forms.HexBox to 1.6.0
- Loading branch information
Showing
17 changed files
with
544 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Be.Windows.Forms | ||
{ | ||
/// <summary> | ||
/// Defines the type of the Find operation. | ||
/// </summary> | ||
public enum FindType | ||
{ | ||
/// <summary> | ||
/// Used for Text Find operations | ||
/// </summary> | ||
Text, | ||
/// <summary> | ||
/// Used for Hex Find operations | ||
/// </summary> | ||
Hex | ||
} | ||
|
||
/// <summary> | ||
/// Defines all state information nee | ||
/// </summary> | ||
public class FindOptions | ||
{ | ||
/// <summary> | ||
/// Gets or sets whether the Find options are valid | ||
/// </summary> | ||
public bool IsValid { get; set; } | ||
/// <summary> | ||
/// Gets the Find buffer used for case insensitive Find operations. This is the binary representation of Text. | ||
/// </summary> | ||
internal byte[] FindBuffer { get; private set; } | ||
/// <summary> | ||
/// Gets the Find buffer used for case sensitive Find operations. This is the binary representation of Text in lower case format. | ||
/// </summary> | ||
internal byte[] FindBufferLowerCase { get; private set; } | ||
/// <summary> | ||
/// Gets the Find buffer used for case sensitive Find operations. This is the binary representation of Text in upper case format. | ||
/// </summary> | ||
internal byte[] FindBufferUpperCase { get; private set; } | ||
/// <summary> | ||
/// Contains the MatchCase value | ||
/// </summary> | ||
bool _matchCase; | ||
/// <summary> | ||
/// Gets or sets the value, whether the Find operation is case sensitive or not. | ||
/// </summary> | ||
public bool MatchCase | ||
{ | ||
get { return _matchCase; } | ||
set | ||
{ | ||
_matchCase = value; | ||
UpdateFindBuffer(); | ||
} | ||
} | ||
/// <summary> | ||
/// Contains the text that should be found. | ||
/// </summary> | ||
string _text; | ||
/// <summary> | ||
/// Gets or sets the text that should be found. Only used, when Type is FindType.Hex. | ||
/// </summary> | ||
public string Text | ||
{ | ||
get { return _text; } | ||
set | ||
{ | ||
_text = value; | ||
UpdateFindBuffer(); | ||
} | ||
} | ||
/// <summary> | ||
/// Gets or sets the hex buffer that should be found. Only used, when Type is FindType.Hex. | ||
/// </summary> | ||
public byte[] Hex { get; set; } | ||
/// <summary> | ||
/// Gets or sets the type what should be searched. | ||
/// </summary> | ||
public FindType Type { get; set; } | ||
/// <summary> | ||
/// Updates the find buffer. | ||
/// </summary> | ||
void UpdateFindBuffer() | ||
{ | ||
string text = this.Text != null ? this.Text : string.Empty; | ||
FindBuffer = ASCIIEncoding.ASCII.GetBytes(text); | ||
FindBufferLowerCase = ASCIIEncoding.ASCII.GetBytes(text.ToLower()); | ||
FindBufferUpperCase = ASCIIEncoding.ASCII.GetBytes(text.ToUpper()); | ||
} | ||
} | ||
} |
Oops, something went wrong.