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

## Public Member Functions
| FileViewerControl ()
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 string | GetTextFromUrl (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

## Static Protected Attributes
static long | _lastWebStreamLength = 0

## Properties
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...
Properties inherited from IG.Forms.IFileViewer
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 | menuShowControls_Click (object sender, EventArgs e)
void | menuClearHistory_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
bool | _closeStreamAfterUse = false
bool | _isControlsVisible = true
System.ComponentModel.IContainer | components = null
| Required designer variable. More...
IG.Forms.FileSelector | fileSelector1
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
System.Windows.Forms.TextBox | txtOutput

## Constructor & Destructor Documentation

IG.Forms.FileViewerControl.FileViewerControl | ( |  | ) |
| inline

## Member Function Documentation

static bool IG.Forms.FileViewerControl.IsValidHttpUrl | ( | string | uriNamme | ) |
| inline static

Chechks whether the specified URI is a valid HTTP URL.

Parameters

  uriNamme | URL to be tested.

Returns
  True iif the specified string is a valid HTTP URL, false otherwise.

static string IG.Forms.FileViewerControl.GetTextFromUrl | ( | string | url | ) |
| inline static

Gets an image from the specified URL.

Parameters

  url | URL of the image.

Returns
  Image object (of class Image) obtained from the specified URL.

void IG.Forms.FileViewerControl.ShowViewedItem | ( |  | ) |
| 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.

void IG.Forms.FileViewerControl.Clear | ( |  | ) |
| inline

Clears the viewer and eventually releases any resources used.

Implements IG.Forms.IFileViewer.

bool IG.Forms.FileViewerControl.IsEligibleForViewing | ( | string | fileLocation | ) |
| 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.

Parameters

  fileLocation | Path to the file on a file system, or file URL.

Returns
  True if the file can be viewed in the current viewer, false otherwise.

Implements IG.Forms.IFileViewer.

bool IG.Forms.FileViewerControl.IsEligibleForViewing | ( | Stream | stream | ) |
| inline

Returnns a flag indicating whether the specified stream is eligible for vieiwnig or not.

Parameters

  stream | Path to the file on a file system, or file URL.

Returns
  True if the stream can be viewed in the current viewer, false otherwise.

Implements IG.Forms.IFileViewer.

void IG.Forms.FileViewerControl.UpdateControlsVisible | ( |  | ) |
| inline protected

Updates dependencies on IsControlsVisible.

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

Opens a browser to select the file shown.

Available only when IsBrowsable property is true.

Implements IG.Forms.IFileViewer.

void IG.Forms.FileViewerControl.UpdateBrowsable | ( |  | ) |
| inline protected

Updates dependencies on IsBrowsable.

void IG.Forms.FileViewerControl.UpdateDragAndDrop | ( |  | ) |
| inline protected

Updates dependencies on IsDragAndDrop.

void IG.Forms.FileViewerControl.fileSelector1_FileSelected | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Triggered when file is selected by the embedded file selector control.

void IG.Forms.FileViewerControl.pictureBox1_DragDrop | ( | object | sender,
|  | DragEventArgs | e
| ) |  |
| inline private

void IG.Forms.FileViewerControl.pictureBox1_DragEnter | ( | object | sender,
|  | DragEventArgs | e
| ) |  |
| inline private

void IG.Forms.FileViewerControl.menuShowControls_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

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

void IG.Forms.FileViewerControl.menuDragDrop_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileViewerControl.menuBrowse_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileViewerControl.showControlsToolStripMenuItem_Click | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

void IG.Forms.FileViewerControl.ImageViewerControl_Load | ( | object | sender,
|  | EventArgs | e
| ) |  |
| inline private

Handles the load event of the current control.

override void IG.Forms.FileViewerControl.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.FileViewerControl.InitializeComponent | ( |  | ) |
| inline private

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

## Member Data Documentation

List<PictureBoxSizeMode> IG.Forms.FileViewerControl._availableSizeModes = Util.GetEnumValues<PictureBoxSizeMode>()
| protected

long IG.Forms.FileViewerControl._lastWebStreamLength = 0
| static protected

string IG.Forms.FileViewerControl._viewedFile
| protected

bool IG.Forms.FileViewerControl._closeStreamAfterUse = false
| private

Stream IG.Forms.FileViewerControl._stream
| protected

bool IG.Forms.FileViewerControl._isShownImmediately = true
| protected

bool IG.Forms.FileViewerControl._canViewFiles = true
| protected

bool IG.Forms.FileViewerControl._canViewUrls = true
| protected

bool IG.Forms.FileViewerControl._canViewStreams = true
| protected

Whether the current viewer can read streams.

bool IG.Forms.FileViewerControl._isControlsVisible = true
| private

bool IG.Forms.FileViewerControl._isBrowsable = true
| protected

bool IG.Forms.FileViewerControl._isDragAndDrop = true
| protected

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

Required designer variable.

IG.Forms.FileSelector IG.Forms.FileViewerControl.fileSelector1
| private

System.Windows.Forms.Panel IG.Forms.FileViewerControl.pnlPicture
| private

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

System.Windows.Forms.Panel IG.Forms.FileViewerControl.pnlOuter
| private

System.Windows.Forms.Panel IG.Forms.FileViewerControl.pnlControls
| private

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

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileViewerControl.menuOptions
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileViewerControl.menuDragDrop
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileViewerControl.menuBrowse
| private

System.Windows.Forms.ToolStripMenuItem IG.Forms.FileViewerControl.menuShowControls
| private

System.Windows.Forms.TextBox IG.Forms.FileViewerControl.txtOutput
| private

## Property Documentation

string IG.Forms.FileViewerControl.ViewedFile
| get set

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).

Stream IG.Forms.FileViewerControl.ViewedStream
| get set

Gets or sets the stream containing the file that is currently being viewed.

Whether it is actually shown depends on the IsShownImmediately flag).

bool IG.Forms.FileViewerControl.IsShownImmediately
| get set

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).

bool IG.Forms.FileViewerControl.CanViewFiles
| get set

Whether the current viewer can view files from the file system.

bool IG.Forms.FileViewerControl.CanViewUrls
| get set

Whether the current viewer can view web resources (files on the internet).

bool IG.Forms.FileViewerControl.CanViewStreams
| get set

bool IG.Forms.FileViewerControl.IsControlsVisible
| get set

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.

bool IG.Forms.FileViewerControl.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 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).

bool IG.Forms.FileViewerControl.IsDragAndDrop
| get set

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).

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

- igforms/Utilities/Viewers/FileViewerControl.cs
- igforms/Utilities/Viewers/FileViewerControl.Designer.cs