[This is preliminary documentation and is subject to change.]

When overiden in derived class called to execute a file on the plugin's file system, or show its property sheet. It is also called to show a plugin configuration dialog when the user right clicks on the plugin root and chooses 'properties'. The plugin is then called with RemoteName="\" and Verb="properties" (requires TC>=5.51).

Namespace:  Tools.TotalCommanderT
Assembly:  Tools.TotalCommander (in Tools.TotalCommander.dll) Version: 1.5.2.0

Syntax

C#
[MethodNotSupportedAttribute]
public virtual ExecExitCode ExecuteFile(
	IntPtr hMainWin,
	ref string RemoteName,
	string Verb
)
Visual Basic (Declaration)
<MethodNotSupportedAttribute> _
Public Overridable Function ExecuteFile ( _
	hMainWin As IntPtr, _
	ByRef RemoteName As String, _
	Verb As String _
) As ExecExitCode
Visual C++
[MethodNotSupportedAttribute]
public:
virtual ExecExitCode ExecuteFile(
	IntPtr hMainWin, 
	String^% RemoteName, 
	String^ Verb
)
J#
/** @attribute MethodNotSupportedAttribute */
public ExecExitCode ExecuteFile(
	IntPtr hMainWin,
	/** @ref */String RemoteName,
	String Verb
)
JScript
public function ExecuteFile(
	hMainWin : IntPtr, 
	RemoteName : String, 
	Verb : String
) : ExecExitCode

Parameters

hMainWin
Type: System..::.IntPtr
Handle to parent window which can be used for showing a property sheet.
RemoteName
Type: System..::.String %
Name of the file to be executed, with full path. Do not assign string longer than MaxPath-1 or uncatchable PathTooLongException will be thrown.
Verb
Type: System..::.String
This can be either "open", "properties", "chmod number", "quote commandline" or "mode type" (case-insensitive).

Return Value

Return Yourself if Total Commander should download the file and execute it locally, OK if the command was executed successfully in the plugin (or if the command isn't applicable and no further action is needed), Error if execution failed, or Symlink if this was a (symbolic) link or .lnk file pointing to a different directory.

Remarks

Meaning of verbs:
verbmeaning
openThis is called when the user presses ENTER on a file. There are three ways to handle it: For internal commands like "Add new connection", execute it in the plugin and return OK or ErrorLet Total Commander download the file and execute it locally: return YourselfIf the file is a (symbolic) link, set RemoteName to the location to which the link points (including the full plugin path), and return Symlink. Total Commander will then switch to that directory. You can also switch to a directory on the local harddisk! To do this, return a path starting either with a drive letter, or an UNC location (\\server\share). The maximum allowed length of such a path is MaxPath-1 (= 259) characters!
propertiesShow a property sheet for the file (optional). Currently not handled by internal Totalcmd functions if Yourself is returned, so the plugin needs to do it internally.
chmod xxxThe xxx stands for the new Unix mode (attributes) to be applied to the file RemoteName. This verb is only used when returning Unix attributes through FindFirst(String, FindData%)/FindNext(Object, FindData%)
quote commandlineExecute the command line entered by the user in the directory RemoteName . This is called when the user enters a command in Totalcmd's command line, and presses ENTER. This is optional, and allows to send plugin-specific commands. It's up to the plugin writer what to support here. If the user entered e.g. a cd directory command, you can return the new path in RemoteName (max MaxPath-1 (= 259) characters), and give Symlink as return value. Return OK to cause a refresh (re-read) of the active panel.
mode XSends information to plugin about FTP transfer mode set up in Total Commander. Plugin can safelly ignore it. X is I for binary, A for text and X*.txt *.log *.php etc. (X followed by list of masks separated by space) fro text mode.

When most-derived method implementation is marked with MethodNotSupportedAttribute, it means that the most derived plugin implementation does not support operation provided by the method.

Note:
Do not thow any other exceptions. Such exception will be passed to Total Commander which cannot handle it.
Note:
Plugin must implement this method and call base class method to FtpModeAdvertisement(IntPtr, String, String), OpenFile(IntPtr, String%), ShowFileInfo(IntPtr, String) and ExecuteCommand(IntPtr, String%, String) to be called. Method implementation contained in FileSystemPlugin must be overriden.

Authors of FileSystemPlugin-derived classes can chose either to implement ExecuteFile(IntPtr, String%, String) functionality on theri own directly in this method or call base class method and implement functionality in methods mentioned above.

Exceptions

ExceptionCondition
System..::.UnauthorizedAccessExceptionThe user does not have required access
System.Security..::.SecurityExceptionSecurity error detected
System.IO..::.IOExceptionAn IO error occured
System..::.InvalidOperationExceptionExcution cannot be done from other reason
System..::.NotSupportedExceptionThe actual implementation is marked with MethodNotSupportedAttribute which means that the plugin doesnot support operation provided by the method and all most derived implementations of following methods are marked with MethodNotSupportedAttribute as well: FtpModeAdvertisement(IntPtr, String, String), OpenFile(IntPtr, String%), ShowFileInfo(IntPtr, String), ExecuteCommand(IntPtr, String%, String)

See Also