C# Класс Microsoft.VisualStudio.Project.FileNode

Наследование: HierarchyNode
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
extensionIcons int>.Dictionary

Private Properties

Свойство Тип Описание
GetSccSpecialFiles void
IProjectSourceNode int
IProjectSourceNode int

Открытые методы

Метод Описание
CreateSingleFileGenerator ( ) : ISingleFileGenerator

factory method for creating single file generators.

DeleteFromStorage ( string path ) : void

Delete the item corresponding to the specified path from storage.

FileNode ( ProjectNode root, ProjectElement element ) : System

Constructor for the FileNode

GetAutomationObject ( ) : object

Get an instance of the automation object for a FileNode

GetDocumentManager ( ) : DocumentManager

Returns a specific Document manager to handle files

GetDragTargetHandlerNode ( ) : HierarchyNode

Called by the drag&drop implementation to ask the node which is being dragged/droped over which nodes should process the operation. This allows for dragging to a node that cannot contain items to let its parent accept the drop, while a reference node delegate to the project and a folder/project node to itself.

GetEditLabel ( ) : string

Provides the node name for inline editing of caption. Overriden to diable this fuctionality for non member fodler node.

GetIconHandle ( bool open ) : object
GetMKDocument ( ) : string
GetProperty ( int propId ) : object

Gets the node property.

IsFileOnDisk ( bool showMessage ) : bool

Determine if this item is represented physical on disk and shows a messagebox in case that the file is not present and a UI is to be presented.

IsFileOnDisk ( string path ) : bool

Determine if the file represented by "path" exist in storage. Override this method if your files are not persisted on disk.

OnCustomToolChanged ( object sender, HierarchyNodeEventArgs e ) : void

Event handler for the Custom tool property changes

OnCustomToolNameSpaceChanged ( object sender, HierarchyNodeEventArgs e ) : void

Event handler for the Custom tool namespce property changes

RenameDocument ( string oldName, string newName ) : bool

Get's called to rename the eventually running document this hierarchyitem points to

RunGenerator ( ) : void

Runs a generator.

SetEditLabel ( string label ) : int

Renames a file node.

SetEditLabel ( string label, string relativePath ) : int

Rename the underlying document based on the change the user just made to the edit label.

SetProperty ( int propid, object value ) : int

Sets the node property.

Защищенные методы

Метод Описание
AfterSaveItemAs ( IntPtr docData, string newFilePath ) : int

Performs a SaveAs operation of an open document. Called from SaveItem after the running document table has been updated with the new doc data.

CanDeleteItem ( __VSDELETEITEMOPERATION deleteOperation ) : bool
CanShowDefaultIcon ( ) : bool

Determines if this is node a valid node for painting the default file icon.

CreatePropertiesObject ( ) : NodeProperties
DoDefaultAction ( ) : void
ExecCommandOnNode ( System.Guid cmdGroup, uint cmd, Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut ) : int
QueryStatusOnNode ( System.Guid cmdGroup, uint cmd, IntPtr pCmdText, EnvDTE.vsCommandStatus &result ) : int
RecoverFromRenameFailure ( string fileThatFailed, string originalFileName ) : void

Tries recovering from a rename failure.

RenameCaseOnlyChange ( string newFileName ) : void

Renames the file node for a case only change.

RenameChildNodes ( FileNode parentNode ) : void

Rename all childnodes

RenameFileNode ( string oldFileName, string newFileName ) : FileNode
RenameFileNode ( string oldFileName, string newFileName, string linkPath, HierarchyNode newParent ) : FileNode

Renames the file in the hierarchy by removing old node and adding a new node in the hierarchy.

While a new node will be used to represent the item, the underlying MSBuild item will be the same and as a result file properties saved in the project file will not be lost.

RenameInStorage ( string oldName, string newName ) : void

This should be overriden for node that are not saved on disk

Приватные методы

Метод Описание
GetSccSpecialFiles ( string sccFile, IList files, IList flags ) : void
IProjectSourceNode ( ) : int
IProjectSourceNode ( bool recursive ) : int

Описание методов

AfterSaveItemAs() защищенный Метод

Performs a SaveAs operation of an open document. Called from SaveItem after the running document table has been updated with the new doc data.
protected AfterSaveItemAs ( IntPtr docData, string newFilePath ) : int
docData System.IntPtr A pointer to the document in the rdt
newFilePath string The new file path to the document
Результат int

CanDeleteItem() защищенный Метод

protected CanDeleteItem ( __VSDELETEITEMOPERATION deleteOperation ) : bool
deleteOperation __VSDELETEITEMOPERATION
Результат bool

CanShowDefaultIcon() защищенный Метод

Determines if this is node a valid node for painting the default file icon.
protected CanShowDefaultIcon ( ) : bool
Результат bool

CreatePropertiesObject() защищенный Метод

protected CreatePropertiesObject ( ) : NodeProperties
Результат NodeProperties

CreateSingleFileGenerator() публичный Метод

factory method for creating single file generators.
public CreateSingleFileGenerator ( ) : ISingleFileGenerator
Результат ISingleFileGenerator

DeleteFromStorage() публичный Метод

Delete the item corresponding to the specified path from storage.
public DeleteFromStorage ( string path ) : void
path string
Результат void

DoDefaultAction() защищенный Метод

protected DoDefaultAction ( ) : void
Результат void

ExecCommandOnNode() защищенный Метод

protected ExecCommandOnNode ( System.Guid cmdGroup, uint cmd, Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut ) : int
cmdGroup System.Guid
cmd uint
nCmdexecopt Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT
pvaIn System.IntPtr
pvaOut System.IntPtr
Результат int

FileNode() публичный Метод

Constructor for the FileNode
public FileNode ( ProjectNode root, ProjectElement element ) : System
root ProjectNode Root of the hierarchy
element ProjectElement Associated project element
Результат System

GetAutomationObject() публичный Метод

Get an instance of the automation object for a FileNode
public GetAutomationObject ( ) : object
Результат object

GetDocumentManager() публичный Метод

Returns a specific Document manager to handle files
public GetDocumentManager ( ) : DocumentManager
Результат DocumentManager

GetDragTargetHandlerNode() публичный Метод

Called by the drag&drop implementation to ask the node which is being dragged/droped over which nodes should process the operation. This allows for dragging to a node that cannot contain items to let its parent accept the drop, while a reference node delegate to the project and a folder/project node to itself.
public GetDragTargetHandlerNode ( ) : HierarchyNode
Результат HierarchyNode

GetEditLabel() публичный Метод

Provides the node name for inline editing of caption. Overriden to diable this fuctionality for non member fodler node.
public GetEditLabel ( ) : string
Результат string

GetIconHandle() публичный Метод

public GetIconHandle ( bool open ) : object
open bool
Результат object

GetMKDocument() публичный Метод

public GetMKDocument ( ) : string
Результат string

GetProperty() публичный Метод

Gets the node property.
public GetProperty ( int propId ) : object
propId int Property id.
Результат object

IsFileOnDisk() публичный Метод

Determine if this item is represented physical on disk and shows a messagebox in case that the file is not present and a UI is to be presented.
public IsFileOnDisk ( bool showMessage ) : bool
showMessage bool true if user should be presented for UI in case the file is not present
Результат bool

IsFileOnDisk() публичный Метод

Determine if the file represented by "path" exist in storage. Override this method if your files are not persisted on disk.
public IsFileOnDisk ( string path ) : bool
path string Url representing the file
Результат bool

OnCustomToolChanged() публичный Метод

Event handler for the Custom tool property changes
public OnCustomToolChanged ( object sender, HierarchyNodeEventArgs e ) : void
sender object FileNode sending it
e HierarchyNodeEventArgs Node event args
Результат void

OnCustomToolNameSpaceChanged() публичный Метод

Event handler for the Custom tool namespce property changes
public OnCustomToolNameSpaceChanged ( object sender, HierarchyNodeEventArgs e ) : void
sender object FileNode sending it
e HierarchyNodeEventArgs Node event args
Результат void

QueryStatusOnNode() защищенный Метод

protected QueryStatusOnNode ( System.Guid cmdGroup, uint cmd, IntPtr pCmdText, EnvDTE.vsCommandStatus &result ) : int
cmdGroup System.Guid
cmd uint
pCmdText System.IntPtr
result EnvDTE.vsCommandStatus
Результат int

RecoverFromRenameFailure() защищенный Метод

Tries recovering from a rename failure.
protected RecoverFromRenameFailure ( string fileThatFailed, string originalFileName ) : void
fileThatFailed string The file that failed to be renamed.
originalFileName string The original filenamee
Результат void

RenameCaseOnlyChange() защищенный Метод

Renames the file node for a case only change.
protected RenameCaseOnlyChange ( string newFileName ) : void
newFileName string The new file name.
Результат void

RenameChildNodes() защищенный Метод

Rename all childnodes
protected RenameChildNodes ( FileNode parentNode ) : void
parentNode FileNode The newly added Parent node.
Результат void

RenameDocument() публичный Метод

Get's called to rename the eventually running document this hierarchyitem points to
public RenameDocument ( string oldName, string newName ) : bool
oldName string
newName string
Результат bool

RenameFileNode() защищенный Метод

protected RenameFileNode ( string oldFileName, string newFileName ) : FileNode
oldFileName string
newFileName string
Результат FileNode

RenameFileNode() защищенный Метод

Renames the file in the hierarchy by removing old node and adding a new node in the hierarchy.
While a new node will be used to represent the item, the underlying MSBuild item will be the same and as a result file properties saved in the project file will not be lost.
protected RenameFileNode ( string oldFileName, string newFileName, string linkPath, HierarchyNode newParent ) : FileNode
oldFileName string The old file name.
newFileName string The new file name
linkPath string
newParent HierarchyNode The new parent of the item.
Результат FileNode

RenameInStorage() защищенный Метод

This should be overriden for node that are not saved on disk
protected RenameInStorage ( string oldName, string newName ) : void
oldName string Previous name in storage
newName string New name in storage
Результат void

RunGenerator() публичный Метод

Runs a generator.
public RunGenerator ( ) : void
Результат void

SetEditLabel() публичный Метод

Renames a file node.
if the file cannot be validated
public SetEditLabel ( string label ) : int
label string The new name.
Результат int

SetEditLabel() публичный Метод

Rename the underlying document based on the change the user just made to the edit label.
public SetEditLabel ( string label, string relativePath ) : int
label string
relativePath string
Результат int

SetProperty() публичный Метод

Sets the node property.
public SetProperty ( int propid, object value ) : int
propid int Property id.
value object Property value.
Результат int

Описание свойств

extensionIcons защищенное статическое свойство

protected static Dictionary extensionIcons
Результат int>.Dictionary