| IGLib 1.7.2 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Private Member Functions | Private Attributes | List of all members
IG.Forms.HashControl Class Reference
Inheritance diagram for IG.Forms.HashControl:
[legend]
Collaboration diagram for IG.Forms.HashControl:
[legend]

## Public Member Functions
| HashControl ()
void | ReportError (string errorMessage)
void | ReportWarning (string warningMessage)
void | ReportInfo (string message)

## Protected Member Functions
void | ClearHashes ()
| Clears all text fields with calculated hashRet values. More...
void | CalculateHashes ()
void | SaveHashesToFile ()
void | BrowseFile ()
| Browses for the file to be hashed. More...
void | GenerateFilePreview ()
| Generates file preview in the text preview box if the rbFile is checked. More...
void | VerifyHash ()
void | Handle_CtrlA_CtrlBackspace (TextBox textBox, object sender, KeyEventArgs e)
| Handle the Ctrl-A (select all) and Ctrl-Backspace events for the specified text box. More...
override void | Dispose (bool disposing)
| Clean up any resources being used. More...

## Protected Attributes
bool | FileTextBoxInitialized = false
Color | FileOnForeColor = Color.Black
Color | FileOffForeColor = Color.DarkGray
bool | ContentsTextBoxInitialized = false
Color | ContentsFileBackColor = Color.LightGray
Color | ContentsFileBinaryBackColor = Color.Wheat
Color | ContentsTextBackColor = Color.White
Color | ContentsFileForeColor = Color.Black
Color | ContentsTextForeColor = Color.Blue
string | _directoryPath
string | _filePath
OpenFileDialog | fileDialog
int | NumCharsFilePreview = 1000
int | NumInsertTextInfo = 0
int | MaxInsertTextInfo = 1
bool | TextBeingDropped = false

## Properties
string | DirectoryPath`[get, set]`
| Directory where files are currently selected. More...
string | FilePath`[get, set]`
| Path to the file whose hashRet values are calculated. More...

## Private Member Functions
void | btnGenerate_Click (object sender, EventArgs e)
| Requested hashs are generated and shown in the appropriate text boxes. More...
void | btnClearHashes_Click (object sender, EventArgs e)
| Hash values are cleared from the appropriate text fields. More...
void | btnVerify_Click (object sender, EventArgs e)
| Hash value is verified for the specified file or text. More...
void | txtFile_Validated (object sender, EventArgs e)
| After file has been validated. More...
void | btnFileBrowse_Click (object sender, EventArgs e)
| Browses for the file whose hashRet values will be calculated. More...
void | chkMd5_CheckedChanged (object sender, EventArgs e)
void | chkSha1_CheckedChanged (object sender, EventArgs e)
void | chkSha256_CheckedChanged (object sender, EventArgs e)
void | chkSha512_CheckedChanged (object sender, EventArgs e)
void | btnMd5Copy_Click (object sender, EventArgs e)
void | btnSha1Copy_Click (object sender, EventArgs e)
void | btnSha256Copy_Click (object sender, EventArgs e)
void | bthSha512_Click (object sender, EventArgs e)
void | btnVerifyPaste_Click (object sender, EventArgs e)
void | rbFile_CheckedChanged (object sender, EventArgs e)
| Handles things that need to be done when we switch between hashing the file or hashing text from the textbox. More...
void | chkGenerateFile_CheckedChanged (object sender, EventArgs e)
| Handles situation when one changes the setting whether to store file's hashRet values to a file. If the check box gets checked then hashes are immediately saved to a file. More...
void | txtContents_Enter (object sender, EventArgs e)
void | txtContents_MouseEnter (object sender, EventArgs e)
void | txtContents_TextChanged (object sender, EventArgs e)
void | txtContents_Validated (object sender, EventArgs e)
| After text is inserted, calculate appropriate hashes immediately. More...
void | chkUpperCase_CheckedChanged (object sender, EventArgs e)
| Recalculates hashes because the requested lower/upper case form has changed. More...
void | txtFile_Enter (object sender, EventArgs e)
void | txtFile_MouseEnter (object sender, EventArgs e)
void | txtFile_TextChanged (object sender, EventArgs e)
void | txtFile_DragEnter (object sender, DragEventArgs e)
void | txtFile_DragDrop (object sender, DragEventArgs e)
void | txtContents_DragEnter (object sender, DragEventArgs e)
void | txtContents_DragDrop (object sender, DragEventArgs e)
void | txtFile_KeyDown (object sender, KeyEventArgs e)
void | txtContents_KeyDown (object sender, KeyEventArgs e)
void | InitializeComponent ()
| Required method for Designer support - do not modify the contents of this method with the code editor. More...

## Private Attributes
bool | _skipFileValidationEvent = false
System.ComponentModel.IContainer | components = null
| Required designer variable. More...
System.Windows.Forms.GroupBox | grpHashGeneration
System.Windows.Forms.CheckBox | chkSha512
System.Windows.Forms.Button | bthSha512
System.Windows.Forms.TextBox | txtSha512
System.Windows.Forms.Label | lblSha512
System.Windows.Forms.CheckBox | chkSha256
System.Windows.Forms.CheckBox | chkSha1
System.Windows.Forms.CheckBox | chkMd5
System.Windows.Forms.Button | btnSha256Copy
System.Windows.Forms.Button | btnSha1Copy
System.Windows.Forms.Button | btnMd5Copy
System.Windows.Forms.TextBox | txtSha256
System.Windows.Forms.Label | lblSha256
System.Windows.Forms.TextBox | txtSha1
System.Windows.Forms.Label | lblSha1
System.Windows.Forms.TextBox | txtMd5
System.Windows.Forms.Label | lblMd5
System.Windows.Forms.Button | btnFileBrowse
System.Windows.Forms.TextBox | txtFile
System.Windows.Forms.Label | lblFile
System.Windows.Forms.RadioButton | rbText
System.Windows.Forms.RadioButton | rbFile
System.Windows.Forms.GroupBox | grpTextPreview
System.Windows.Forms.TextBox | txtContents
System.Windows.Forms.Button | btnGenerate
System.Windows.Forms.CheckBox | chkGenerateFile
System.Windows.Forms.Label | lvlVerifyMain
System.Windows.Forms.Button | btnVerify
System.Windows.Forms.Button | btnVerifyPaste
System.Windows.Forms.TextBox | txtVerify
System.Windows.Forms.Label | lblVerify
System.Windows.Forms.OpenFileDialog | openFileDialog1
System.Windows.Forms.Button | btnClearHashes
System.Windows.Forms.CheckBox | chkUpperCase

## Constructor & Destructor Documentation

IG.Forms.HashControl.HashControl | ( |  | ) |
| inline

## Member Function Documentation

void IG.Forms.HashControl.ReportError | ( | string | errorMessage | ) |
| inline

void IG.Forms.HashControl.ReportWarning | ( | string | warningMessage | ) |
| inline

void IG.Forms.HashControl.ReportInfo | ( | string | message | ) |
| inline

void IG.Forms.HashControl.ClearHashes | ( |  | ) |
| inline protected

Clears all text fields with calculated hashRet values.

void IG.Forms.HashControl.CalculateHashes | ( |  | ) |
| inline protected

References IG.Crypto.UtilCrypto.GetFileHashMd5Hex(), IG.Crypto.UtilCrypto.GetFileHashSha1Hex(), IG.Crypto.UtilCrypto.GetFileHashSha256Hex(), IG.Crypto.UtilCrypto.GetFileHashSha512Hex(), IG.Crypto.UtilCrypto.GetStringHashMd5Hex(), IG.Crypto.UtilCrypto.GetStringHashSha1Hex(), IG.Crypto.UtilCrypto.GetStringHashSha256Hex(), and IG.Crypto.UtilCrypto.GetStringHashSha512Hex().

void IG.Forms.HashControl.SaveHashesToFile | ( |  | ) |
| inline protected

References IG.Crypto.ConstCrypto.HashFileExtension.

void IG.Forms.HashControl.BrowseFile | ( |  | ) |
| inline protected

Browses for the file to be hashed.

void IG.Forms.HashControl.GenerateFilePreview | ( |  | ) |
| inline protected

Generates file preview in the text preview box if the rbFile is checked.

References IG.Lib.UtilSystem.IsTextFile().

void IG.Forms.HashControl.VerifyHash | ( |  | ) |
| inline protected

References IG.Crypto.UtilCrypto.CheckFileHashSupportedTypesHex(), and IG.Crypto.UtilCrypto.CheckStringHashSupportedTypesHex().

void IG.Forms.HashControl.btnGenerate_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Requested hashs are generated and shown in the appropriate text boxes.

void IG.Forms.HashControl.btnClearHashes_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Hash values are cleared from the appropriate text fields.

void IG.Forms.HashControl.btnVerify_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Hash value is verified for the specified file or text.

void IG.Forms.HashControl.txtFile_Validated | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

After file has been validated.

void IG.Forms.HashControl.btnFileBrowse_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Browses for the file whose hashRet values will be calculated.

void IG.Forms.HashControl.chkMd5_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.chkSha1_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.chkSha256_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.chkSha512_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.btnMd5Copy_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.btnSha1Copy_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.btnSha256Copy_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.bthSha512_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.btnVerifyPaste_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.rbFile_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Handles things that need to be done when we switch between hashing the file or hashing text from the textbox.

void IG.Forms.HashControl.chkGenerateFile_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Handles situation when one changes the setting whether to store file's hashRet values to a file. If the check box gets checked then hashes are immediately saved to a file.

void IG.Forms.HashControl.txtContents_Enter | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.txtContents_MouseEnter | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.txtContents_TextChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.txtContents_Validated | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

After text is inserted, calculate appropriate hashes immediately.

void IG.Forms.HashControl.chkUpperCase_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Recalculates hashes because the requested lower/upper case form has changed.

void IG.Forms.HashControl.txtFile_Enter | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.txtFile_MouseEnter | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.txtFile_TextChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.txtFile_DragEnter | ( | object | sender,
|  | DragEventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.txtFile_DragDrop | ( | object | sender,
|  | DragEventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.txtContents_DragEnter | ( | object | sender,
|  | DragEventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.txtContents_DragDrop | ( | object | sender,
|  | DragEventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.Handle_CtrlA_CtrlBackspace | ( | TextBox | textBox,
|  | object | sender,
|  | KeyEventArgs | e
| ) |  |
| inline protected

Handle the Ctrl-A (select all) and Ctrl-Backspace events for the specified text box.

Parameters

  textBox | Text box for wich the event is handled.

void IG.Forms.HashControl.txtFile_KeyDown | ( | object | sender,
|  | KeyEventArgs | e
| ) |  |
| inline private

void IG.Forms.HashControl.txtContents_KeyDown | ( | object | sender,
|  | KeyEventArgs | e
| ) |  |
| inline private

override void IG.Forms.HashControl.Dispose | ( | bool | disposing | ) |
| inline protected

Clean up any resources being used.

Parameters

  disposing | true if managed resources should be disposed; otherwise, false.

void IG.Forms.HashControl.InitializeComponent | ( |  | ) |
| inline private

Required method for Designer support - do not modify the contents of this method with the code editor.

## Member Data Documentation

bool IG.Forms.HashControl.FileTextBoxInitialized = false
| protected

Color IG.Forms.HashControl.FileOnForeColor = Color.Black
| protected

Color IG.Forms.HashControl.FileOffForeColor = Color.DarkGray
| protected

bool IG.Forms.HashControl.ContentsTextBoxInitialized = false
| protected

Color IG.Forms.HashControl.ContentsFileBackColor = Color.LightGray
| protected

Color IG.Forms.HashControl.ContentsFileBinaryBackColor = Color.Wheat
| protected

Color IG.Forms.HashControl.ContentsTextBackColor = Color.White
| protected

Color IG.Forms.HashControl.ContentsFileForeColor = Color.Black
| protected

Color IG.Forms.HashControl.ContentsTextForeColor = Color.Blue
| protected

string IG.Forms.HashControl._directoryPath
| protected

string IG.Forms.HashControl._filePath
| protected

OpenFileDialog IG.Forms.HashControl.fileDialog
| protected

int IG.Forms.HashControl.NumCharsFilePreview = 1000
| protected

bool IG.Forms.HashControl._skipFileValidationEvent = false
| private

int IG.Forms.HashControl.NumInsertTextInfo = 0
| protected

int IG.Forms.HashControl.MaxInsertTextInfo = 1
| protected

bool IG.Forms.HashControl.TextBeingDropped = false
| protected

System.ComponentModel.IContainer IG.Forms.HashControl.components = null
| private

Required designer variable.

System.Windows.Forms.GroupBox IG.Forms.HashControl.grpHashGeneration
| private

System.Windows.Forms.CheckBox IG.Forms.HashControl.chkSha512
| private

System.Windows.Forms.Button IG.Forms.HashControl.bthSha512
| private

System.Windows.Forms.TextBox IG.Forms.HashControl.txtSha512
| private

System.Windows.Forms.Label IG.Forms.HashControl.lblSha512
| private

System.Windows.Forms.CheckBox IG.Forms.HashControl.chkSha256
| private

System.Windows.Forms.CheckBox IG.Forms.HashControl.chkSha1
| private

System.Windows.Forms.CheckBox IG.Forms.HashControl.chkMd5
| private

System.Windows.Forms.Button IG.Forms.HashControl.btnSha256Copy
| private

System.Windows.Forms.Button IG.Forms.HashControl.btnSha1Copy
| private

System.Windows.Forms.Button IG.Forms.HashControl.btnMd5Copy
| private

System.Windows.Forms.TextBox IG.Forms.HashControl.txtSha256
| private

System.Windows.Forms.Label IG.Forms.HashControl.lblSha256
| private

System.Windows.Forms.TextBox IG.Forms.HashControl.txtSha1
| private

System.Windows.Forms.Label IG.Forms.HashControl.lblSha1
| private

System.Windows.Forms.TextBox IG.Forms.HashControl.txtMd5
| private

System.Windows.Forms.Label IG.Forms.HashControl.lblMd5
| private

System.Windows.Forms.Button IG.Forms.HashControl.btnFileBrowse
| private

System.Windows.Forms.TextBox IG.Forms.HashControl.txtFile
| private

System.Windows.Forms.Label IG.Forms.HashControl.lblFile
| private

System.Windows.Forms.RadioButton IG.Forms.HashControl.rbText
| private

System.Windows.Forms.RadioButton IG.Forms.HashControl.rbFile
| private

System.Windows.Forms.GroupBox IG.Forms.HashControl.grpTextPreview
| private

System.Windows.Forms.TextBox IG.Forms.HashControl.txtContents
| private

System.Windows.Forms.Button IG.Forms.HashControl.btnGenerate
| private

System.Windows.Forms.CheckBox IG.Forms.HashControl.chkGenerateFile
| private

System.Windows.Forms.Label IG.Forms.HashControl.lvlVerifyMain
| private

System.Windows.Forms.Button IG.Forms.HashControl.btnVerify
| private

System.Windows.Forms.Button IG.Forms.HashControl.btnVerifyPaste
| private

System.Windows.Forms.TextBox IG.Forms.HashControl.txtVerify
| private

System.Windows.Forms.Label IG.Forms.HashControl.lblVerify
| private

System.Windows.Forms.OpenFileDialog IG.Forms.HashControl.openFileDialog1
| private

System.Windows.Forms.Button IG.Forms.HashControl.btnClearHashes
| private

System.Windows.Forms.CheckBox IG.Forms.HashControl.chkUpperCase
| private

## Property Documentation

string IG.Forms.HashControl.DirectoryPath
| get set

Directory where files are currently selected.

string IG.Forms.HashControl.FilePath
| get set

Path to the file whose hashRet values are calculated.

The documentation for this class was generated from the following files:

- igforms/Utilities/Cryptography/HashControl.cs
- igforms/Utilities/Cryptography/HashControl.Designer.cs