C# Class Raccoom.Windows.Forms.TreeViewFolderBrowser

Inheritance: System.Windows.Forms.TreeView
显示文件 Open project: MediaPortal/MPTagThat Class Usage Examples

Public Properties

Property Type Description
CheckboxBehaviorModeChanged EventHandler
DataSourceChanged EventHandler
DriveTypesChanged EventHandler

Protected Properties

Property Type Description
boldFont_ System.Drawing.Font
folderList_ System.Collections.Specialized.StringCollection

Private Properties

Property Type Description
InitializeComponent void
OnContextMenu_Popup void

Public Methods

Method Description
Populate ( ) : void

Clears the TreeView and popluates the root level.

Populate ( Environment specialFolder ) : void

Clears the TreeView and popluates the root level.

Populate ( string selectedFolderPath ) : void

Clears the TreeView and popluates the root level.

ShowFolder ( string directoryPath ) : void

Focus the specified folder and scroll it in to view.

TreeViewFolderBrowser ( ) : System

Required designer variable.

Protected Methods

Method Description
CheckNodesRec ( TreeNode parent, bool check ) : void

Toggle the check flag for tree nodes, works recursive

ExchangeFoldersRec ( TreeNodePath parent, bool add ) : void

Add or removes the nodes recursive to or from the folderList_.

ExchangePath ( string path, bool add ) : void

Add or removes path from the folderList_.

GetRootCollection ( ) : TreeNodeCollection

Gets the root TreeNodeCollection depended on current RootFolder.

GetSubDirs ( TreeNodePath parent, System.Windows.Forms.TreeViewCancelEventArgs e ) : void

Populates the Directory structure for a given path.

MarkNode ( TreeNodePath node ) : void

Set the text bold if there is a child node checked.

MarkNodesRec ( TreeNodePath parent ) : void

Set the text bold for each parent node if there is a child node checked.

OnBeforeCheck ( System.Windows.Forms.TreeViewCancelEventArgs e ) : void

Fired before check action occurs, manages the folderList_.

OnBeforeExpand ( System.Windows.Forms.TreeViewCancelEventArgs e ) : void

Fired before node expands, used to fill next level in directory structure.

OnCheckboxBehaviorModeChanged ( EventArgs e ) : void

Raises the CheckboxBehaviorModeChanged event.

OnContextMenuPopup ( EventArgs e ) : void
OnDataSourceChanged ( EventArgs e ) : void

Raises the DataSourceChanged event.

OnDoubleClick ( EventArgs e ) : void

Used for drives like floppy, cd - rom ect. where it can be that no valid medium is inserted. in this case the click on the + will remove the +, after double click there's a new + to give the user the chance to browse this device after inserting a valid medium.

OnDriveTypesChanged ( EventArgs e ) : void

Raises the DriveTypesChanged event.

OnSelectedDirectoriesChanged ( SelectedDirectoriesChangedEventArgs e ) : void

Raises the SelectedDirectoriesChanged event.SelectedDirectoriesChangedDelegate

SupressCheckEvent ( bool supressEvent ) : void

True to supress OnBeforeCheck Execution, otherwise false to allow it.

Private Methods

Method Description
InitializeComponent ( ) : void

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

OnContextMenu_Popup ( object sender, EventArgs e ) : void

Method Details

CheckNodesRec() protected method

Toggle the check flag for tree nodes, works recursive
protected CheckNodesRec ( TreeNode parent, bool check ) : void
parent System.Windows.Forms.TreeNode
check bool
return void

ExchangeFoldersRec() protected method

Add or removes the nodes recursive to or from the folderList_.
protected ExchangeFoldersRec ( TreeNodePath parent, bool add ) : void
parent TreeNodePath
add bool
return void

ExchangePath() protected method

Add or removes path from the folderList_.
protected ExchangePath ( string path, bool add ) : void
path string
add bool
return void

GetRootCollection() protected method

Gets the root TreeNodeCollection depended on current RootFolder.
protected GetRootCollection ( ) : TreeNodeCollection
return System.Windows.Forms.TreeNodeCollection

GetSubDirs() protected method

Populates the Directory structure for a given path.
protected GetSubDirs ( TreeNodePath parent, System.Windows.Forms.TreeViewCancelEventArgs e ) : void
parent TreeNodePath
e System.Windows.Forms.TreeViewCancelEventArgs
return void

MarkNode() protected method

Set the text bold if there is a child node checked.
protected MarkNode ( TreeNodePath node ) : void
node TreeNodePath
return void

MarkNodesRec() protected method

Set the text bold for each parent node if there is a child node checked.
protected MarkNodesRec ( TreeNodePath parent ) : void
parent TreeNodePath
return void

OnBeforeCheck() protected method

Fired before check action occurs, manages the folderList_.
protected OnBeforeCheck ( System.Windows.Forms.TreeViewCancelEventArgs e ) : void
e System.Windows.Forms.TreeViewCancelEventArgs
return void

OnBeforeExpand() protected method

Fired before node expands, used to fill next level in directory structure.
protected OnBeforeExpand ( System.Windows.Forms.TreeViewCancelEventArgs e ) : void
e System.Windows.Forms.TreeViewCancelEventArgs
return void

OnCheckboxBehaviorModeChanged() protected method

Raises the CheckboxBehaviorModeChanged event.
protected OnCheckboxBehaviorModeChanged ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnContextMenuPopup() protected method

protected OnContextMenuPopup ( EventArgs e ) : void
e System.EventArgs
return void

OnDataSourceChanged() protected method

Raises the DataSourceChanged event.
protected OnDataSourceChanged ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnDoubleClick() protected method

Used for drives like floppy, cd - rom ect. where it can be that no valid medium is inserted. in this case the click on the + will remove the +, after double click there's a new + to give the user the chance to browse this device after inserting a valid medium.
protected OnDoubleClick ( EventArgs e ) : void
e System.EventArgs
return void

OnDriveTypesChanged() protected method

Raises the DriveTypesChanged event.
protected OnDriveTypesChanged ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnSelectedDirectoriesChanged() protected method

Raises the SelectedDirectoriesChanged event.SelectedDirectoriesChangedDelegate
protected OnSelectedDirectoriesChanged ( SelectedDirectoriesChangedEventArgs e ) : void
e SelectedDirectoriesChangedEventArgs
return void

Populate() public method

Clears the TreeView and popluates the root level.
public Populate ( ) : void
return void

Populate() public method

Clears the TreeView and popluates the root level.
public Populate ( Environment specialFolder ) : void
specialFolder System.Environment The SpecialFolder which should be selected after population.
return void

Populate() public method

Clears the TreeView and popluates the root level.
public Populate ( string selectedFolderPath ) : void
selectedFolderPath string The path of the folder that should be selected after population.
return void

ShowFolder() public method

Focus the specified folder and scroll it in to view.
public ShowFolder ( string directoryPath ) : void
directoryPath string The path which should be focused
return void

SupressCheckEvent() protected method

True to supress OnBeforeCheck Execution, otherwise false to allow it.
protected SupressCheckEvent ( bool supressEvent ) : void
supressEvent bool
return void

TreeViewFolderBrowser() public method

Required designer variable.
public TreeViewFolderBrowser ( ) : System
return System

Property Details

CheckboxBehaviorModeChanged public_oe property

Fired if a CheckboxBehaviorMode has changed
public EventHandler CheckboxBehaviorModeChanged
return EventHandler

DataSourceChanged public_oe property

Fired if a data provider has changed
public EventHandler DataSourceChanged
return EventHandler

DriveTypesChanged public_oe property

Fired if a drive types has changed
public EventHandler DriveTypesChanged
return EventHandler

boldFont_ protected_oe property

font used to mark nodes which contains checked sub nodes
protected Font,System.Drawing boldFont_
return System.Drawing.Font

folderList_ protected_oe property

holds the path list
protected StringCollection,System.Collections.Specialized folderList_
return System.Collections.Specialized.StringCollection