Ejemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new FolderBrowserForWPF.Dialog();

            if (dlg.ShowDialog() == true)
            {
                DirText.Text = dlg.FileName;
            }
        }
Ejemplo n.º 2
0
        public void Execute(object?parameter)
        {
            var resultPath = parameter as string;
            var fileDialog = new FolderBrowserForWPF.Dialog();

            if (fileDialog.ShowDialog() == true)
            {
                resultPath = fileDialog.FileName;
            }
        }
        private void SetWorkingDirectory()
        {
            var dlg = new FolderBrowserForWPF.Dialog
            {
                Title = "Choose a working directory containing " + AppSettings.XwaExeFileName + " or a child directory"
            };

            if (dlg.ShowDialog() == true)
            {
                string fileName = dlg.FileName;

                if (!System.IO.File.Exists(System.IO.Path.Combine(fileName, "XWingAlliance.exe")))
                {
                    fileName = System.IO.Path.GetDirectoryName(fileName);

                    if (!System.IO.File.Exists(System.IO.Path.Combine(fileName, "XWingAlliance.exe")))
                    {
                        return;
                    }
                }

                AppSettings.WorkingDirectory = fileName + System.IO.Path.DirectorySeparatorChar;
            }
        }