Example #1
0
 /// <summary>
 /// フォルダーを選択するダイアログ表示します。
 /// </summary>
 /// <returns></returns>
 public async Task <ShellFolder> ShowSelectFolderDialogAsync()
 {
     using (var selector = new FolderSelector())
     {
         return(await selector.SelectSingleFolderAsync());
     }
 }
        // Add To Wath Folder

        private void BtnWatchFolder_Click(object sender, EventArgs e)
        {
            var openResult = FolderSelector.ShowDialog();

            if (openResult == DialogResult.OK)
            {
                Aborting = true;
                Task.Run(async() => await AddWatchFolder());
            }
        }
Example #3
0
        public FolderSelectorSample()
        {
            FolderSelector fsel;
            Label          label;

            PackStart(new Label("An open file selector:"));
            PackStart(fsel      = new FolderSelector());
            PackStart(label     = new Label());
            fsel.FolderChanged += (sender, e) => { label.Text = "Folder changed: " + fsel.Folder; };
        }
Example #4
0
        public ProcessRunConfigurationEditorWidget()
        {
            VBox mainBox = this;

            mainBox.Margin = 12;
            var table = new Table();

            var argumentsLabel = new Label(GettextCatalog.GetString("Arguments:"));

            table.Add(argumentsLabel, 0, 0);
            table.Add(argumentsEntry = new TextEntry(), 1, 0, hexpand: true);
            argumentsEntry.Accessible.LabelWidget = argumentsLabel;
            argumentsEntry.Accessible.Description = GettextCatalog.GetString("Set any additional arguments to pass to the project.");

            var workingDirLabel = new Label(GettextCatalog.GetString("Run in directory:"));

            table.Add(workingDirLabel, 0, 1);
            table.Add(workingDir = new FolderSelector(), 1, 1, hexpand: true);
            workingDir.Accessible.LabelWidget = workingDirLabel;
            workingDir.Accessible.Description = GettextCatalog.GetString("Choose the directory to run the project in.");

            mainBox.PackStart(table);

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });

            var envVarsLabel = new Label(GettextCatalog.GetString("Environment Variables"));

            mainBox.PackStart(envVarsLabel);
            envVars = new EnvironmentVariableCollectionEditor();
            envVars.Accessible.LabelWidget = envVarsLabel;
            envVars.Accessible.Description = GettextCatalog.GetString("Set additional environment variables for the project.");

            mainBox.PackStart(envVars, true);

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });

            HBox cbox = new HBox();

            cbox.PackStart(externalConsole = new CheckBox(GettextCatalog.GetString("Run on external console")));
            cbox.PackStart(pauseConsole    = new CheckBox(GettextCatalog.GetString("Pause console output")));
            mainBox.PackStart(cbox);

            argumentsEntry.Changed   += (s, a) => NotifyChanged();
            workingDir.FolderChanged += (s, a) => NotifyChanged();
            envVars.Changed          += (s, a) => NotifyChanged();
            externalConsole.Toggled  += (s, a) => NotifyChanged();
            pauseConsole.Toggled     += (s, a) => NotifyChanged();
        }
        public ProcessRunConfigurationEditorWidget()
        {
            VBox mainBox = this;

            mainBox.Margin = 12;
            var table = new Table();

            table.Add(new Label(GettextCatalog.GetString("Arguments:")), 0, 0);
            table.Add(argumentsEntry = new TextEntry(), 1, 0, hexpand: true);

            table.Add(new Label(GettextCatalog.GetString("Run in directory:")), 0, 1);
            table.Add(workingDir = new FolderSelector(), 1, 1, hexpand: true);

            mainBox.PackStart(table);

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });

            mainBox.PackStart(new Label(GettextCatalog.GetString("Environment Variables")));
            envVars = new EnvironmentVariableCollectionEditor();

            mainBox.PackStart(envVars, true);

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });

            HBox cbox = new HBox();

            cbox.PackStart(externalConsole = new CheckBox(GettextCatalog.GetString("Run on external console")));
            cbox.PackStart(pauseConsole    = new CheckBox(GettextCatalog.GetString("Pause console output")));
            mainBox.PackStart(cbox);

            argumentsEntry.Changed   += (s, a) => NotifyChanged();
            workingDir.FolderChanged += (s, a) => NotifyChanged();
            envVars.Changed          += (s, a) => NotifyChanged();
            externalConsole.Toggled  += (s, a) => NotifyChanged();
            pauseConsole.Toggled     += (s, a) => NotifyChanged();
        }
Example #6
0
        public DotNetRunConfigurationEditorWidget(bool includeAdvancedTab)
        {
            VBox mainBox = new VBox();

            mainBox.Margin = 12;
            var startActionlabel = new Label {
                Markup = GettextCatalog.GetString("Start Action")
            };

            mainBox.PackStart(startActionlabel);
            var table = new Table();

            table.Add(radioStartProject = new RadioButton(GettextCatalog.GetString("Start project")), 0, 0);
            table.Add(radioStartApp     = new RadioButton(GettextCatalog.GetString("Start external program:")), 0, 1);
            table.Add(appEntry          = new Xwt.FileSelector(), 1, 1, hexpand: true);
            table.Add(appEntryInfoIcon  = new InformationPopoverWidget(), 2, 1);
            appEntryInfoIcon.Hide();
            radioStartProject.Group = radioStartApp.Group;
            table.MarginLeft        = 12;
            mainBox.PackStart(table);

            radioStartProject.Accessible.LabelWidget = startActionlabel;
            radioStartApp.Accessible.LabelWidget     = startActionlabel;

            appEntry.Accessible.Label = GettextCatalog.GetString("External Program");

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });
            table = new Table();

            var argumentsLabel = new Label(GettextCatalog.GetString("Arguments:"));

            table.Add(argumentsLabel, 0, 0);
            table.Add(argumentsEntry = new TextEntry(), 1, 0, hexpand: true);
            argumentsEntry.Accessible.LabelWidget = argumentsLabel;

            var workingDirLabel = new Label(GettextCatalog.GetString("Run in directory:"));

            table.Add(workingDirLabel, 0, 1);
            table.Add(workingDir = new FolderSelector(), 1, 1, hexpand: true);
            workingDir.Accessible.LabelWidget = workingDirLabel;

            mainBox.PackStart(table);

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });

            var envVarsLabel = new Label(GettextCatalog.GetString("Environment Variables"));

            mainBox.PackStart(envVarsLabel);
            envVars = new EnvironmentVariableCollectionEditor();
            envVars.Accessible.LabelWidget = envVarsLabel;

            mainBox.PackStart(envVars, true);

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });

            HBox cbox = new HBox();

            cbox.PackStart(externalConsole = new CheckBox(GettextCatalog.GetString("Run on external console")));
            cbox.PackStart(pauseConsole    = new CheckBox(GettextCatalog.GetString("Pause console output")));
            mainBox.PackStart(cbox);

            Add(mainBox, GettextCatalog.GetString("General"));

            var adBox = new VBox();

            adBox.Margin = 12;

            table = new Table();
            table.Add(new Label(GettextCatalog.GetString("Execute in .NET Runtime:")), 0, 0);
            table.Add(runtimesCombo        = new ComboBox(), 1, 0, hexpand: true);
            runtimesCombo.Accessible.Label = GettextCatalog.GetString(".NET Runtime");

            var monoLabel = new Label(GettextCatalog.GetString("Mono runtime settings:"));

            table.Add(monoLabel, 0, 1);

            var    box = new HBox();
            Button monoSettingsButton = new Button(GettextCatalog.GetString("\u2026"));

            box.PackStart(monoSettingsEntry = new TextEntry {
                PlaceholderText = GettextCatalog.GetString("Default settings")
            }, true);
            box.PackStart(monoSettingsButton);
            monoSettingsEntry.ReadOnly = true;
            table.Add(box, 1, 1, hexpand: true);
            adBox.PackStart(table);

            monoSettingsButton.Accessible.LabelWidget = monoLabel;

            if (includeAdvancedTab)
            {
                Add(adBox, GettextCatalog.GetString("Advanced"));
            }

            monoSettingsButton.Clicked      += EditRuntimeClicked;
            radioStartProject.ActiveChanged += (sender, e) => UpdateStatus();
            externalConsole.Toggled         += (sender, e) => UpdateStatus();

            LoadRuntimes();

            appEntry.FileChanged           += (sender, e) => NotifyChanged();
            argumentsEntry.Changed         += (sender, e) => NotifyChanged();
            workingDir.FolderChanged       += (sender, e) => NotifyChanged();
            envVars.Changed                += (sender, e) => NotifyChanged();
            externalConsole.Toggled        += (sender, e) => NotifyChanged();
            pauseConsole.Toggled           += (sender, e) => NotifyChanged();
            runtimesCombo.SelectionChanged += (sender, e) => NotifyChanged();
            monoSettingsEntry.Changed      += (sender, e) => NotifyChanged();
        }
Example #7
0
        private void Start_Scan_Click(object sender, RoutedEventArgs e)
        {
            FolderSelector q = new FolderSelector();

            q.ShowDialog(); //*********弹出FolderSelector窗口并且可以返回结果,判断DialogResult即可,后续逻辑待补充*********
        }