Skip to content

OpenFolderDialog

class cAlgo.API Since 5.1

DesktopCLICloud

Represents a common dialog box that allows the user to open one or more folders.

Environment behaviour

CLI — not supported. No dialog can be shown in the CLI: ShowDialog returns FileDialogResult.None and the dialog settings are only stored.

Cloud — not supported. No dialog can be shown in the cloud: ShowDialog returns FileDialogResult.None and the dialog settings are only stored.

Definition

public class OpenFolderDialog

Namespace: cAlgo.API · Group: Dialogs

Examples

using cAlgo.API;

namespace cAlgo.Robots;

public partial class TestExample : Robot
{
    protected override void OnStart()
    {
        var openFolderDialog = new OpenFolderDialog
        {
            Title = "Select File(s)",
        };

        var result = openFolderDialog.ShowDialog();

        if (result == FileDialogResult.Cancel)
            return;

        Print(openFolderDialog.FolderName);
    }
}
import clr

clr.AddReference("cAlgo.API")

# Import cAlgo API types
from cAlgo.API import *
# Import trading wrapper functions
from robot_wrapper import *

class Test():
    def on_start(self):
        openFolderDialog = OpenFolderDialog()
        openFolderDialog.Title = "Select File(s)"
        result = openFolderDialog.ShowDialog()

        if result == FileDialogResult.Cancel:
            return

        api.Print(openFolderDialog.FolderName)
{
  "AccessRights": "None"
}

Constructors

Name Description
OpenFolderDialogDesktopCLICloud Creates an OpenFolderDialog.

Methods

Name Description
ResetDesktopCLICloudvoid Resets all dialog properties to their default values.
ShowDialog 2 overloadsDesktopCLICloudFileDialogResult Shows a file dialog, with the owner as the main Window

Properties

Name Description
FolderNameDesktopCLICloudstring Gets a string containing the full path of the folder selected in an open folder dialog.
InitialDirectoryDesktopCLICloudstring Gets or sets the initial directory that is displayed by a file dialog.
TitleDesktopCLICloudstring Gets or sets a string shown in the title bar of the dialog. If this property is null, a localized default from the operating system itself will be used.