SftDirectory 2.5

SftDirectory.Do Method

Softel vdm, Inc.

Performs the specified action.

Syntax       

VB.NET

object.Do(ByVal Action As String)

VB

object.Do(ByVal Action As String)

C#.NET

void object.Do(string Action);

VC++

HRESULT object->Do(_bstr_t Action);

C

HRESULT object->raw_Do(BSTR Action);

Delphi

procedure object.Do_(Action : WideString);

object

A SftDirectory object.

Action

A string defining the action to be executed. The string is case-sensitive and must be entered as shown here, without leading or trailing blanks. Some of the standard Action strings (implemented by Windows and Shell extensions) are:

Action

Description

copy

Copy a file/folder to the clipboard

open 

Execute program or open a file

(null string)

Execute program or open a file/folder (default action for folder type).  This is only supported if only one file/folder is selected.

explore

Open a file/folder in a new window

cut

Copy a file/folder to the clipboard and remove it

delete

Remove a file/folder

link

Create a shortcut

move

Move a file/folder to another location

rename

Rename a file/folder - Not supported for multiple folders

droptarget

Tests if a file/folder is a valid target for a drag & drop operation

paste

Copy the clipboard contents to the specified location

properties

Display file/folder properties

NewFolder

Create a new file/folder.  Edit mode is entered automatically, so the file/folder name can be renamed.  If the RenameStyle property is set to renameSftDirectoryNone or if the control is a combo box style control (see ControlStyle property), edit mode is not used.

Comments

The Do method performs the specified action.

Strings provided as Action parameter are Windows operating system specific and may be implemented by Shell extensions.  Action parameters are not processed or implemented by SftDirectory, they are simply passed to the Windows Shell or Shell extensions.

The Do method will normalize the selections, if multiple folders are selected.  The process of normalizing selections involves creating a group of files/folders owned by the same immediate parent folder.  While it is possible to select any combination of files/folders, the Windows Shell can only execute a command for a group of files/folders owned by one parent folder.

The control's Can method can be used to test whether the specified action Action is supported by all selected files/folders. It does not guarantee that the action can be successfully executed.  The Folder.Can method can be used to test one particular folder only.

The Do method performs the specified action for all currently selected files/folders.  The Folder.Do method can be used to perform an action for one particular file/folder only.

Any error messages that may be issued by the Windows Shell or Shell extension as a result of the Do method are controlled using the ShowErrors and ErrorWindow properties.


Feedback / comments / error reports for this topic
© 2003, 2008 - Softel vdm, Inc. - www.softelvdm.com