Class GorgonFolderBrowser
A file folder browser.
Inheritance
Implements
Inherited Members
Namespace: Gorgon.UI
Assembly: Gorgon.Windows.dll
Syntax
public class GorgonFolderBrowser : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl
Remarks
This control is meant as a drop in component to allow for easy selection of file folders on a drive. This can be considered a replacement for the built-in .NET folder browser dialog as the UI for this control is much easier to navigate around.
The control is patterned after the FileDialogBrowser control, but without needing to have a file name. It is also more customizable allowing users to supply their own icons for folders and drive types.
Constructors
| Edit this page View SourceGorgonFolderBrowser()
Initializes a new instance of the GorgonFolderBrowser class.
Declaration
public GorgonFolderBrowser()
Properties
| Edit this page View SourceBackColor
Property to set or return the background color.
Declaration
[Browsable(true)]
public Color BackColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
CaptionFont
Property to set or return the font to use for the caption.
Declaration
[Browsable(true)]
public Font CaptionFont { get; set; }
Property Value
Type | Description |
---|---|
Font |
CdRomImage
Property to set or return the image to use as the icon for a hard drive.
Declaration
[Browsable(true)]
public Image CdRomImage { get; set; }
Property Value
Type | Description |
---|---|
Image |
Remarks
If this value is null, the image used will be the default for the operating system.
CurrentDirectory
Property to return the current directory.
Declaration
[Browsable(false)]
public string CurrentDirectory { get; }
Property Value
Type | Description |
---|---|
string |
DirectoryImage
Property to set or return the image to use as the icon for a directory.
Declaration
[Browsable(true)]
public Image DirectoryImage { get; set; }
Property Value
Type | Description |
---|---|
Image |
Remarks
If this value is null, the image used will be the default for the operating system.
DirectoryListFont
Property to set or return the font to use for the directory list items.
Declaration
[Browsable(true)]
public Font DirectoryListFont { get; set; }
Property Value
Type | Description |
---|---|
Font |
DirectoryNameFont
Property to set or return the font to use for the directory name text box.
Declaration
[Browsable(true)]
public Font DirectoryNameFont { get; set; }
Property Value
Type | Description |
---|---|
Font |
DirectorySeparator
Property to set or return the character to use as the directory separator.
Declaration
[Browsable(false)]
public char DirectorySeparator { get; set; }
Property Value
Type | Description |
---|---|
char |
FileImage
Property to set or return the image to use as the icon for a directory.
Declaration
[Browsable(true)]
public Image FileImage { get; set; }
Property Value
Type | Description |
---|---|
Image |
Remarks
If this value is null, the image used will be the default for the operating system.
HardDriveImage
Property to set or return the image to use as the icon for a hard drive.
Declaration
[Browsable(true)]
public Image HardDriveImage { get; set; }
Property Value
Type | Description |
---|---|
Image |
Remarks
If this value is null, the image used will be the default for the operating system.
IsDesignTime
Property to return whether or not the control is in design mode.
Declaration
[Browsable(false)]
public bool IsDesignTime { get; }
Property Value
Type | Description |
---|---|
bool |
IsErrorPaneOpen
Property to return whether or not the error pane is open on the control.
Declaration
[Browsable(false)]
public bool IsErrorPaneOpen { get; }
Property Value
Type | Description |
---|---|
bool |
IsReadOnly
Property to set or return whether the browser is in read only mode.
Declaration
[Browsable(true)]
public bool IsReadOnly { get; set; }
Property Value
Type | Description |
---|---|
bool |
NetworkDriveImage
Property to set or return the image to use as the icon for a hard drive.
Declaration
[Browsable(true)]
public Image NetworkDriveImage { get; set; }
Property Value
Type | Description |
---|---|
Image |
Remarks
If this value is null, the image used will be the default for the operating system.
RamDriveImage
Property to set or return the image to use as the icon for a hard drive.
Declaration
[Browsable(true)]
public Image RamDriveImage { get; set; }
Property Value
Type | Description |
---|---|
Image |
Remarks
If this value is null, the image used will be the default for the operating system.
RemovableDriveImage
Property to set or return the image to use as the icon for a hard drive.
Declaration
[Browsable(true)]
public Image RemovableDriveImage { get; set; }
Property Value
Type | Description |
---|---|
Image |
Remarks
If this value is null, the image used will be the default for the operating system.
RootFolder
Property to set or return the folder that should be used as the root of the file system.
Declaration
[Browsable(false)]
public DirectoryInfo RootFolder { get; set; }
Property Value
Type | Description |
---|---|
DirectoryInfo |
Text
Gets or sets the text associated with this control.
Declaration
[Browsable(true)]
[Bindable(false)]
public string Text { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceAssignInitialDirectory(DirectoryInfo)
Function to set the initial directory.
Declaration
public void AssignInitialDirectory(DirectoryInfo dir)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | dir | The directory to assign. |
Dispose(bool)
Clean up any resources being used.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | true if managed resources should be disposed; otherwise, false. |
Overrides
| Edit this page View SourceOnLoad(EventArgs)
Raises the Load event.
Declaration
protected override void OnLoad(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
EventArgs | e | An EventArgs that contains the event data. |
Overrides
| Edit this page View SourceSetErrorMessage(string)
Function to show an error message for the folder selector.
Declaration
public void SetErrorMessage(string message)
Parameters
Type | Name | Description |
---|---|---|
string | message | The message to display. |
Remarks
Passing null, or an empty string to the message
parameter will reset and hide the message bar on the control.
Events
| Edit this page View SourceFolderAdding
Event triggered when a folder is about to be created on the file system.
Declaration
public event EventHandler<FolderAddArgs> FolderAdding
Event Type
Type | Description |
---|---|
EventHandler<FolderAddArgs> |
FolderDeleting
Event triggered when a folder is about to be deleted from the file system.
Declaration
public event EventHandler<FolderDeleteArgs> FolderDeleting
Event Type
Type | Description |
---|---|
EventHandler<FolderDeleteArgs> |
FolderEntered
Event triggered when a folder is entered.
Declaration
public event EventHandler<FolderSelectedArgs> FolderEntered
Event Type
Type | Description |
---|---|
EventHandler<FolderSelectedArgs> |
FolderRenaming
Event triggered when a folder is about to be renamed on the file system.
Declaration
public event EventHandler<FolderRenameArgs> FolderRenaming
Event Type
Type | Description |
---|---|
EventHandler<FolderRenameArgs> |
FolderSelected
Event triggered when a folder is selected.
Declaration
public event EventHandler<FolderSelectedArgs> FolderSelected
Event Type
Type | Description |
---|---|
EventHandler<FolderSelectedArgs> |