C# Class GitForce.Main.Left.Panels.PanelView

Inheritance: System.Windows.Forms.UserControl
Mostrar archivo Open project: gdevic/GitForce

Public Methods

Method Description
CustomToolClicked ( object sender, EventArgs e ) : void

A specific custom tool is clicked (selected). Tag contains the tool class.

GetContextMenu ( ToolStrip owner ) : ToolStripItemCollection

Builds ands returns a context menu for files

PanelView ( ) : System

PanelView constructor

RegisterToolstripFileButtons ( ToolStripButton>.Dictionary buttons ) : void
SelectAll ( ) : void

Select All function handler: select all files

SetView ( int mode ) : void

Sets the current view mode

ViewRefresh ( ) : void

Panel view class refresh function

ViewSetByMenuItem ( object sender, EventArgs e ) : void

Set the view mode by sending a menu item whose Tag contains the mode number. This function is called from a menu handlers that select view mode.

Private Methods

Method Description
BtListViewClick ( object sender, EventArgs e ) : void

Toggle between list view and tree view. This button is disabled if there is no repo to view (Status is null)

GetSelectedDir ( ) : string

Returns the directory path of a selected file or directory

GetSelectedFile ( ) : string

Returns the full path of a single selected file, or empty if no file was selected

MenuRefresh ( object sender, EventArgs e ) : void

Refresh the tree view pane

MenuSortFilesByExtensionClick ( object sender, EventArgs e ) : void

Track the checked setting and refresh the local view when changed This button is disabled if there is no repo to view (Status is null)

MenuViewAddFilesClick ( object sender, EventArgs e ) : void

Add untracked files to Git

MenuViewCommandClick ( object sender, EventArgs e ) : void

Open command prompt in the directory containing a selected file

MenuViewDiffClick ( object sender, EventArgs e ) : void

Diff selected file versus one of several options, specified in the Tag field

MenuViewEditClick ( object sender, EventArgs e ) : void

Edit selected file using either the default editor (native OS file association, if the tag is null, or the editor program specified in the tag field. This is a handler for both the context menu and the edit tool bar button.

MenuViewExploreClick ( object sender, EventArgs e ) : void

Run the Windows Explorer in the directory containing a selected file

MenuViewOpenForDeleteClick ( object sender, EventArgs e ) : void

Open files for delete

MenuViewRemoveFromFsClick ( object sender, EventArgs e ) : void

Remove files from the local file system

MenuViewRenameClick ( object sender, EventArgs e ) : void

Open a rename file dialog to rename or move one or a set of files

MenuViewRevHistClick ( object sender, EventArgs e ) : void

Show the revision history dialog for a selected file. This dialog is _not_ modal, so user can view multiple files.

MenuViewRevertClick ( object sender, EventArgs e ) : void

Discard changes to selected files

MenuViewUpdateAllClick ( object sender, EventArgs e ) : void

Update changelist (index) with all files that need updating (disregarding the selection) TODO: Disregarding the selection?!?

MenuViewUpdateChangelistClick ( object sender, EventArgs e ) : void

Update changelist (index) with files that are modified, deleted or renamed

OnFileChanged ( object source, FileSystemEventArgs e ) : void

Called by the callback thread when a file that has been watched was changed. We are watching files that user edits in an external editor.

TreeViewAfterCollapse ( object sender, TreeViewEventArgs e ) : void

Callback called when user clicks on a node to collapse it

TreeViewAfterExpand ( object sender, TreeViewEventArgs e ) : void

Callback called when user clicks on a node to expand it

TreeViewAfterSelect ( object sender, TreeViewEventArgs e ) : void

Selection changed. Rebuild the set of allowed operations on the current set of selected files.

TreeViewDoubleClick ( object sender, EventArgs e ) : void

Handle double-clicking on a tree view Depending on the saved options, we either do nothing ("0"), open a file using a default Explorer file association ("1"), or open a file using a specified application ("2")

TreeViewDragEnter ( object sender, DragEventArgs e ) : void
TreeViewItemDrag ( object sender, ItemDragEventArgs e ) : void

Drag and drop handler. User selected one or more files and started to drag them (away). Send a set of files through their full path name.

TreeViewMouseMove ( object sender, MouseEventArgs e ) : void

As the mouse moves over nodes, show the human readable description of files that the mouse points to

TreeViewMouseUp ( object sender, MouseEventArgs e ) : void

Right-mouse button opens a popup with the context menu

ViewExpand ( TreeNode rootNode ) : void

Traverse tree and expand those nodes which are marked as expanded

WatchAndRefresh ( string file ) : void

Sets up a file watcher in order to refresh the view when a file is being modified by an external editor.

Method Details

CustomToolClicked() public method

A specific custom tool is clicked (selected). Tag contains the tool class.
public CustomToolClicked ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

GetContextMenu() public method

Builds ands returns a context menu for files
public GetContextMenu ( ToolStrip owner ) : ToolStripItemCollection
owner System.Windows.Forms.ToolStrip
return System.Windows.Forms.ToolStripItemCollection

PanelView() public method

PanelView constructor
public PanelView ( ) : System
return System

RegisterToolstripFileButtons() public method

public RegisterToolstripFileButtons ( ToolStripButton>.Dictionary buttons ) : void
buttons ToolStripButton>.Dictionary
return void

SelectAll() public method

Select All function handler: select all files
public SelectAll ( ) : void
return void

SetView() public method

Sets the current view mode
public SetView ( int mode ) : void
mode int
return void

ViewRefresh() public method

Panel view class refresh function
public ViewRefresh ( ) : void
return void

ViewSetByMenuItem() public method

Set the view mode by sending a menu item whose Tag contains the mode number. This function is called from a menu handlers that select view mode.
public ViewSetByMenuItem ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void