| 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 | Events | Private Member Functions | Private Attributes | List of all members
IG.Forms.FileSelector Class Reference
Inheritance diagram for IG.Forms.FileSelector:
[legend]
Collaboration diagram for IG.Forms.FileSelector:
[legend]

## Public Member Functions
| FileSelector ()
string | GetFilePathRepresentation (string filePath)
| Returns the presentational form of the specified file path, with eventual environment variables expanded and with conversion to the appropriate form (relative or absolute). More...
void | BrowseFile ()
| Browses for the file to be hashed. More...
void | ClearHistory ()

## Protected Member Functions
virtual void | UpdateErrorState ()
| Updates controls according to error state. More...
virtual void | OnFileSelected ()
| Called whenever the selected file changes. More...
virtual void | OnDirectoryChanged ()
| Called whenever the directory containing the selected file changes. More...
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
string | _directoryPath
string | _filePath

## Properties
bool | FileTextBoxInitialized`[get, set]`
string | InitialDirectoryPath`[get, protected set]`
| Directory where files are currently selected. More...
bool | AllowEnvironmentVariables`[get, set]`
| If true then environment variables can be used in paths. More...
bool | AllowExistentFiles`[get, set]`
| If true then existent files are allowed to be selected. More...
bool | AllowNonexistentFiles`[get, set]`
| If true then non-existend files are allowed to be selected. More...
bool | UseRelativePaths`[get, set]`
| If true then relative paths are used in representation of the selseted file path. More...
bool | UseAbsolutePaths`[get, set]`
| If true then absolute paths are used in representation of the selseted file path. More...
string | Filter`[get, set]`
string | FilePath`[get, set]`
| Path to the file that is currently selected. More...
string | OriginalFilePath`[get, set]`
| Gets the original file path representation (as set by user), without any post processing (like environment variables expansion or conversion to relative or absolute path). More...
virtual bool | IsErrorState`[get]`
| Returns true if the current selection is invalid, false if it is valid. More...
virtual Color | ErrorBackground`[get, set]`
| Background color of selection's text in case of error. More...
virtual Color | ErrorForeground`[get, set]`
| Foreground color of button in case of error. More...
virtual Color | NormalBackground`[get, set]`
| Background color of selection's text in case of NO error. More...
virtual Color | NormalForeground`[get, set]`
| Foreground color of button in case of NO error. More...
bool | IsBrowsable`[get, set]`
| Gets or sets the flag specifying whether one can browse for the file to be opened (e.g. by using the file selection dialog). More...
bool | IsDragAndDrop`[get, set]`
| Whether the selector provides drag & drop capability. More...

## Events
EventHandler | FileSelected
| Event that is fired whenever the selected file changes. More...
EventHandler | DirectoryChanged
| Event that is fired whenever directory containing the selected file changes. More...

## Private Member Functions
void | btnFileBrowse_Click (object sender, EventArgs e)
| Browses for the file whose hashRet values will be calculated. More...
void | txtFile_Click (object sender, EventArgs e)
void | comboBoxFile_SelectedIndexChanged (object sender, EventArgs e)
void | comboBoxFile_Enter (object sender, EventArgs e)
void | comboBoxFile_Validated (object sender, EventArgs e)
void | comboBoxFile_KeyUp (object sender, KeyEventArgs e)
void | comboBoxFile_MouseEnter (object sender, EventArgs e)
void | comboBoxFile_TextChanged (object sender, EventArgs e)
void | FileSelector_DragEnter (object sender, DragEventArgs e)
void | FileSelector_DragDrop (object sender, DragEventArgs e)
void | menuClearHistory_Click (object sender, EventArgs e)
void | menuAllowNonexistent_CheckedChanged (object sender, EventArgs e)
void | menuAllowExistent_CheckedChanged (object sender, EventArgs e)
void | menuExpandEnvironment_CheckedChanged (object sender, EventArgs e)
void | menuAbsolutePaths_CheckedChanged (object sender, EventArgs e)
void | menuRelativePaths_CheckedChanged (object sender, EventArgs e)
void | menuPathRepresentation_Click (object sender, EventArgs e)
void | menuInputTextBox_Click (object sender, EventArgs e)
void | menuInputTextBox_Validated (object sender, EventArgs e)
void | menuInputTextBox_KeyUp (object sender, KeyEventArgs e)
void | menuFilterValue_Validated (object sender, EventArgs e)
void | menuAllowNonexistent_Click (object sender, EventArgs e)
| Reopens the context menu at its previous position. More...
void | menuAllowExistent_Click (object sender, EventArgs e)
| Reopens the context menu at its previous position. More...
void | menuExpandEnvironment_Click (object sender, EventArgs e)
| Reopens the context menu at its previous position. More...
void | menuAbsolutePaths_Click (object sender, EventArgs e)
| Reopens the context menu at its previous position. More...
void | menuRelativePaths_Click (object sender, EventArgs e)
| Reopens the context menu at its previous position. More...
void | contextMenuMain_Opened (object sender, EventArgs e)
| Stores the position where the menu item has last opened. More...
void | InitializeComponent ()
| Required method for Designer support - do not modify the contents of this method with the code editor. More...

## Private Attributes
bool | _fileTextBoxInitialized = false
bool | _allowEnvironmentVariables = true
bool | _allowExistentFiles = true
bool | _allowNonexistentFiles = true
bool | _useRelativePaths = false
bool | _useAbsolutePaths = false
string | _filter = null
Color | _errorBackground = Color.Orange
Color | _errorForeground = Color.Red
Color | _normalBackground = Color.White
Color | _normalforeground = Color.Black
bool | _isBrowsable = true
bool | _isDragAndDrop = true
bool | _skipFileValidationEvent = false
Point | _lasContectMenuPosition = new Point(0, 0)
System.ComponentModel.IContainer | components = null
| Required designer variable. More...
System.Windows.Forms.Button | btnFileBrowse
System.Windows.Forms.Label | lblFile
System.Windows.Forms.OpenFileDialog | openFileDialog1
System.Windows.Forms.ComboBox | comboBoxFile
System.Windows.Forms.ContextMenuStrip | contextMenuMain
System.Windows.Forms.ToolStripMenuItem | menuClearHistory
System.Windows.Forms.ToolStripMenuItem | menuAllowNonexistent
System.Windows.Forms.ToolStripMenuItem | menuAllowExistent
System.Windows.Forms.ToolStripMenuItem | menuExpandEnvironment
System.Windows.Forms.ToolStripMenuItem | menuAbsolutePaths
System.Windows.Forms.ToolStripMenuItem | menuRelativePaths
System.Windows.Forms.ToolStripMenuItem | menuShowPath
System.Windows.Forms.ToolStripMenuItem | menuPathRepresentation
System.Windows.Forms.ToolStripMenuItem | menuInputPath
System.Windows.Forms.ToolStripTextBox | menuInputTextBox
System.Windows.Forms.ToolStripMenuItem | menuFilter
System.Windows.Forms.ToolStripTextBox | menuFilterValue

## Constructor & Destructor Documentation

IG.Forms.FileSelector.FileSelector | ( |  | ) |
| inline

## Member Function Documentation

string IG.Forms.FileSelector.GetFilePathRepresentation | ( | string | filePath | ) |
| inline

Returns the presentational form of the specified file path, with eventual environment variables expanded and with conversion to the appropriate form (relative or absolute).

Parameters

  filePath | Fille path whose presentational form is returned.

Presentational form depends on the following properties: <pra> - AllowEnvironmentVariables: If true then environment variable references are expanded.

In Unix-like systems, enviironment variables are referenced as $varName, and on Windows with varName%.

</pra>

- UseAbsolutePaths: If true then paths are presented as absolute paths (independend of the current working directory).

- UseRelativePaths: If true then paths are represented relative to the current working directory.

References IG.Lib.UtilSystem.GetAbsolutePath(), and IG.Lib.UtilSystem.GetRelativePath().

virtual void IG.Forms.FileSelector.UpdateErrorState | ( |  | ) |
| inline protected virtual

Updates controls according to error state.

void IG.Forms.FileSelector.BrowseFile | ( |  | ) |
| inline

Browses for the file to be hashed.

Referenced by IG.Forms.VectorFunctionScriptControl.btnLoad_Click(), and IG.Forms.VectorFunctionScriptControl.btnSave_Click().

void IG.Forms.FileSelector.ClearHistory | ( |  | ) |
| inline

virtual void IG.Forms.FileSelector.OnFileSelected | ( |  | ) |
| inline protected virtual

Called whenever the selected file changes.

virtual void IG.Forms.FileSelector.OnDirectoryChanged | ( |  | ) |
| inline protected virtual

Called whenever the directory containing the selected file changes.

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

Browses for the file whose hashRet values will be calculated.

void IG.Forms.FileSelector.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.FileSelector.txtFile_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.comboBoxFile_SelectedIndexChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.comboBoxFile_Enter | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.comboBoxFile_Validated | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.comboBoxFile_KeyUp | ( | object | sender,
|  | KeyEventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.comboBoxFile_MouseEnter | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.comboBoxFile_TextChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.FileSelector_DragEnter | ( | object | sender,
|  | DragEventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.FileSelector_DragDrop | ( | object | sender,
|  | DragEventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuClearHistory_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuAllowNonexistent_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuAllowExistent_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuExpandEnvironment_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuAbsolutePaths_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuRelativePaths_CheckedChanged | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuPathRepresentation_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuInputTextBox_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuInputTextBox_Validated | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuInputTextBox_KeyUp | ( | object | sender,
|  | KeyEventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuFilterValue_Validated | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileSelector.menuAllowNonexistent_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Reopens the context menu at its previous position.

void IG.Forms.FileSelector.menuAllowExistent_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Reopens the context menu at its previous position.

void IG.Forms.FileSelector.menuExpandEnvironment_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Reopens the context menu at its previous position.

void IG.Forms.FileSelector.menuAbsolutePaths_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Reopens the context menu at its previous position.

void IG.Forms.FileSelector.menuRelativePaths_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Reopens the context menu at its previous position.

void IG.Forms.FileSelector.contextMenuMain_Opened | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Stores the position where the menu item has last opened.

override void IG.Forms.FileSelector.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.FileSelector.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.FileSelector._fileTextBoxInitialized = false
| private

string IG.Forms.FileSelector._directoryPath
| protected

bool IG.Forms.FileSelector._allowEnvironmentVariables = true
| private

bool IG.Forms.FileSelector._allowExistentFiles = true
| private

bool IG.Forms.FileSelector._allowNonexistentFiles = true
| private

bool IG.Forms.FileSelector._useRelativePaths = false
| private

bool IG.Forms.FileSelector._useAbsolutePaths = false
| private

string IG.Forms.FileSelector._filter = null
| private

string IG.Forms.FileSelector._filePath
| protected

Color IG.Forms.FileSelector._errorBackground = Color.Orange
| private

Color IG.Forms.FileSelector._errorForeground = Color.Red
| private

Color IG.Forms.FileSelector._normalBackground = Color.White
| private

Color IG.Forms.FileSelector._normalforeground = Color.Black
| private

bool IG.Forms.FileSelector._isBrowsable = true
| private

bool IG.Forms.FileSelector._isDragAndDrop = true
| private

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

Point IG.Forms.FileSelector._lasContectMenuPosition = new Point(0, 0)
| private

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

Required designer variable.

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

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

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

System.Windows.Forms.ComboBox IG.Forms.FileSelector.comboBoxFile
| private

System.Windows.Forms.ContextMenuStrip IG.Forms.FileSelector.contextMenuMain
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileSelector.menuClearHistory
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileSelector.menuAllowNonexistent
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileSelector.menuAllowExistent
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileSelector.menuExpandEnvironment
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileSelector.menuAbsolutePaths
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileSelector.menuRelativePaths
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileSelector.menuShowPath
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileSelector.menuPathRepresentation
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileSelector.menuInputPath
| private

System.Windows.Forms.ToolStripTextBox IG.Forms.FileSelector.menuInputTextBox
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileSelector.menuFilter
| private

System.Windows.Forms.ToolStripTextBox IG.Forms.FileSelector.menuFilterValue
| private

## Property Documentation

bool IG.Forms.FileSelector.FileTextBoxInitialized
| get set protected

string IG.Forms.FileSelector.InitialDirectoryPath
| get protected set

Directory where files are currently selected.

bool IG.Forms.FileSelector.AllowEnvironmentVariables
| get set

If true then environment variables can be used in paths.

bool IG.Forms.FileSelector.AllowExistentFiles
| get set

If true then existent files are allowed to be selected.

It might be impossible to insert such a path through the file dialog (launched by the "Browse" button), but one can insert it in the text box.

Referenced by IG.Forms.VectorFunctionScriptControl.btnLoad_Click(), and IG.Forms.VectorFunctionScriptControl.btnSave_Click().

bool IG.Forms.FileSelector.AllowNonexistentFiles
| get set

If true then non-existend files are allowed to be selected.

It might be impossible to insert such a path through the file dialog (launched by the "Browse" button), but one can insert it in the text box.

Referenced by IG.Forms.VectorFunctionScriptControl.btnLoad_Click(), and IG.Forms.VectorFunctionScriptControl.btnSave_Click().

bool IG.Forms.FileSelector.UseRelativePaths
| get set

If true then relative paths are used in representation of the selseted file path.

This property is mutually exclusive with UseAbsolutePaths (only one can be true, but both can be false).

bool IG.Forms.FileSelector.UseAbsolutePaths
| get set

If true then absolute paths are used in representation of the selseted file path.

This property is mutually exclusive with UseRelativePaths (only one can be true, but both can be false).

string IG.Forms.FileSelector.Filter
| get set

Referenced by IG.Forms.VectorFunctionScriptControl.btnLoad_Click(), and IG.Forms.VectorFunctionScriptControl.btnSave_Click().

string IG.Forms.FileSelector.FilePath
| get set

Path to the file that is currently selected.

Getter returns the output representation of the path, with eventual environment variables expansion (dependent on AllowEnvironmentVariables properties) and in appropriate form (relative or absolute path, according to UseRelativePaths and UseAbsolutePaths properties).

Original path ca be retrieved by the OriginalFilePath property.

Referenced by IG.Forms.VectorFunctionScriptControl.btnLoad_Click(), and IG.Forms.VectorFunctionScriptControl.btnSave_Click().

string IG.Forms.FileSelector.OriginalFilePath
| get set

Gets the original file path representation (as set by user), without any post processing (like environment variables expansion or conversion to relative or absolute path).

Setter just calls the setter of the FilePath property.

virtual bool IG.Forms.FileSelector.IsErrorState
| get

Returns true if the current selection is invalid, false if it is valid.

In the case of invalid selection, OriginalFilePath may return a non-null path but FilePath does not.

virtual Color IG.Forms.FileSelector.ErrorBackground
| get set

Background color of selection's text in case of error.

virtual Color IG.Forms.FileSelector.ErrorForeground
| get set

Foreground color of button in case of error.

virtual Color IG.Forms.FileSelector.NormalBackground
| get set

Background color of selection's text in case of NO error.

virtual Color IG.Forms.FileSelector.NormalForeground
| get set

Foreground color of button in case of NO error.

bool IG.Forms.FileSelector.IsBrowsable
| get set

Gets or sets the flag specifying whether one can browse for the file to be opened (e.g. by using the file selection dialog).

If the viewer does not at all have browser capability then setting to true should NOT throw an exception (therefore, the user should verify by getter if setting actually worked).

Setter can be used to disable browsing (e.g. for security, or when used as embedded control and browsing would be disturbing).

bool IG.Forms.FileSelector.IsDragAndDrop
| get set

Whether the selector provides drag & drop capability.

Setter can be used to disable drag & drop (e.g. for security, or when used with an embedded control and drag & drop would be disturbing).

## Event Documentation

EventHandler IG.Forms.FileSelector.FileSelected

Event that is fired whenever the selected file changes.

EventHandler IG.Forms.FileSelector.DirectoryChanged

Event that is fired whenever directory containing the selected file changes.

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

- igforms/Utilities/BasicControls/FileSelector.cs
- igforms/Utilities/BasicControls/FileSelector.Designer.cs