IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Public Member Functions | |
ImageViewerControl () | |
void | ShowViewedItem () |
Shows / plays the viewed contents. More... | |
void | Clear () |
Clears the viewer and eventually releases any resources used. More... | |
bool | IsEligibleForViewing (string fileLocation) |
Rerurns a flag indicating whether the file (or web resource) at the specified location is eligible for vieiwnig in the current viewer or not. More... | |
bool | IsEligibleForViewing (Stream stream) |
Returnns a flag indicating whether the specified stream is eligible for vieiwnig or not. More... | |
void | BrowseFile () |
Opens a browser to select the file shown. More... | |
Static Public Member Functions | |
static bool | IsValidHttpUrl (string uriNamme) |
Chechks whether the specified URI is a valid HTTP URL. More... | |
static Image | GetImageFromUrl (string url) |
Gets an image from the specified URL. More... | |
Protected Member Functions | |
void | UpdateControlsVisible () |
Updates dependencies on IsControlsVisible. More... | |
void | UpdateBrowsable () |
Updates dependencies on IsBrowsable. More... | |
void | UpdateDragAndDrop () |
Updates dependencies on IsDragAndDrop. More... | |
override void | Dispose (bool disposing) |
Clean up any resources being used. More... | |
Protected Attributes | |
List< PictureBoxSizeMode > | _availableSizeModes = Util.GetEnumValues<PictureBoxSizeMode>() |
string | _viewedFile |
Stream | _stream |
bool | _isShownImmediately = true |
bool | _canViewFiles = true |
bool | _canViewUrls = true |
bool | _canViewStreams = true |
Whether the current viewer can read streams. More... | |
bool | _isBrowsable = true |
bool | _isDragAndDrop = true |
Properties | |
PictureBoxSizeMode | SizeMode [get, set] |
Enumeraton of type PictureBoxSizeMode that specifies how the image is sized and positioned witin the PictureBox control. More... | |
string | ViewedFile [get, set] |
Gets or sets path to the file or URL of the file that is currently being viewed. More... | |
Stream | ViewedStream [get, set] |
Gets or sets the stream containing the file that is currently being viewed. More... | |
bool | IsShownImmediately [get, set] |
Flag that specifies whether content is shown immediately after the viewed object is set. More... | |
bool | CanViewFiles [get, set] |
Whether the current viewer can view files from the file system. More... | |
bool | CanViewUrls [get, set] |
Whether the current viewer can view web resources (files on the internet). More... | |
bool | CanViewStreams [get, set] |
bool | IsControlsVisible [get, set] |
Gets / sets a flag that specified whether the viewer's controls are visible or not. 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 viewer provides drag & drop capability. More... | |
![]() | |
string | ViewedFile [get, set] |
Gets or sets path to the file or URL of the file that is currently being viewed. More... | |
Stream | ViewedStream [get, set] |
Gets or sets the stream containing the file that is currently being viewed. More... | |
bool | IsShownImmediately [get, set] |
Flag that specifies whether content is shown / played immediately after the viewed object is set. More... | |
bool | CanViewFiles [get, set] |
Whether the current viewer can view files from the file system. More... | |
bool | CanViewUrls [get, set] |
Whether the current viewer can view web resources (files on the internet). More... | |
bool | CanViewStreams [get, set] |
Whether the current viewer can read streams. More... | |
bool | IsControlsVisible [get, set] |
Gets / sets a flag that specified whether the viewer's controls are visible or not. 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 viewer provides drag & drop capability. More... | |
Private Member Functions | |
void | fileSelector1_FileSelected (object sender, EventArgs e) |
Triggered when file is selected by the embedded file selector control. More... | |
void | pictureBox1_DragDrop (object sender, DragEventArgs e) |
void | pictureBox1_DragEnter (object sender, DragEventArgs e) |
void | comboSizeMode_SelectedIndexChanged (object sender, EventArgs e) |
void | menuShowControls_Click (object sender, EventArgs e) |
void | menuClearHistory_Click (object sender, EventArgs e) |
void | comboSizeMode_Click (object sender, EventArgs e) |
void | menuDragDrop_Click (object sender, EventArgs e) |
void | menuBrowse_Click (object sender, EventArgs e) |
void | showControlsToolStripMenuItem_Click (object sender, EventArgs e) |
void | ImageViewerControl_Load (object sender, EventArgs e) |
Handles the load event of the current control. More... | |
void | InitializeComponent () |
Required method for Designer support - do not modify the contents of this method with the code editor. More... | |
Private Attributes | |
PictureBoxSizeMode | _sizeMode = PictureBoxSizeMode.CenterImage |
bool | _closeStreamAfterUse = false |
bool | _isControlsVisible = true |
System.ComponentModel.IContainer | components = null |
Required designer variable. More... | |
System.Windows.Forms.PictureBox | pictureBox1 |
IG.Forms.FileSelector | fileSelector1 |
System.Windows.Forms.Panel | pnlOptions |
System.Windows.Forms.Label | lblSzeMode |
System.Windows.Forms.ComboBox | comboSizeMode |
System.Windows.Forms.Panel | pnlPicture |
System.Windows.Forms.ContextMenuStrip | contextMenuMain |
System.Windows.Forms.Panel | pnlOuter |
System.Windows.Forms.Panel | pnlControls |
System.Windows.Forms.ToolStripMenuItem | menuClearHistory |
System.Windows.Forms.ToolStripMenuItem | menuOptions |
System.Windows.Forms.ToolStripMenuItem | menuDragDrop |
System.Windows.Forms.ToolStripMenuItem | menuBrowse |
System.Windows.Forms.ToolStripMenuItem | menuShowControls |
|
inline |
|
inlinestatic |
Chechks whether the specified URI is a valid HTTP URL.
uriNamme | URL to be tested. |
|
inlinestatic |
Gets an image from the specified URL.
url | URL of the image. |
|
inline |
Shows / plays the viewed contents.
Can have the role of refresh when IsShownImmediately is true, or is used to actually show the contents after assigning it.
Implements IG.Forms.IFileViewer.
|
inline |
Clears the viewer and eventually releases any resources used.
Implements IG.Forms.IFileViewer.
|
inline |
Rerurns a flag indicating whether the file (or web resource) at the specified location is eligible for vieiwnig in the current viewer or not.
fileLocation | Path to the file on a file system, or file URL. |
Implements IG.Forms.IFileViewer.
|
inline |
Returnns a flag indicating whether the specified stream is eligible for vieiwnig or not.
stream | Path to the file on a file system, or file URL. |
Implements IG.Forms.IFileViewer.
|
inlineprotected |
Updates dependencies on IsControlsVisible.
|
inline |
Opens a browser to select the file shown.
Available only when IsBrowsable property is true.
Implements IG.Forms.IFileViewer.
|
inlineprotected |
Updates dependencies on IsBrowsable.
|
inlineprotected |
Updates dependencies on IsDragAndDrop.
|
inlineprivate |
Triggered when file is selected by the embedded file selector control.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
Handles the load event of the current control.
|
inlineprotected |
Clean up any resources being used.
disposing | true if managed resources should be disposed; otherwise, false. |
|
inlineprivate |
Required method for Designer support - do not modify the contents of this method with the code editor.
|
protected |
|
private |
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Whether the current viewer can read streams.
|
private |
|
protected |
|
protected |
|
private |
Required designer variable.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
getset |
Enumeraton of type PictureBoxSizeMode that specifies how the image is sized and positioned witin the PictureBox control.
|
getset |
Gets or sets path to the file or URL of the file that is currently being viewed.
Whether it is actually shown depends on the IsShownImmediately flag).
|
getset |
Gets or sets the stream containing the file that is currently being viewed.
Whether it is actually shown depends on the IsShownImmediately flag).
|
getset |
Flag that specifies whether content is shown immediately after the viewed object is set.
If set to true and the viewer does not at all have such capability, this should NOT throw an exception (thus, user should check success by verifying if flag changed).
|
getset |
Whether the current viewer can view files from the file system.
|
getset |
Whether the current viewer can view web resources (files on the internet).
|
getset |
|
getset |
Gets / sets a flag that specified whether the viewer's controls are visible or not.
Setting should have immediate effect and make controls visible / invisible.
This is important because viewers must be able to be used embedded in other controls, where all behavior is handled by those controls and viewer just provides the viewing area.
|
getset |
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 drag & drop (e.g. for security, or when used as embedded control and drag & drop would be disturbing). If the viewer does not at all have drag & drop capability, setting this flag to true should NOT throw an exception (thus, user should check if it was successful).
|
getset |
Whether the viewer provides drag & drop capability.
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 drag & drop (e.g. for security, or when used as embedded control and drag & drop would be disturbing). If the viewer does not at all have drag & drop capability, setting this flag to true should NOT throw an exception (thus, user should check if it was successful).