コード例 #1
0
        private void exportAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FolderSelectDialog fsd = new FolderSelectDialog();
            fsd.Title = "Export all files";

            if (fsd.ShowDialog())
            {
                ProgressDialog progress = new ProgressDialog();
                progress.title.Text = "Exporting all files";
                progress.action.Text = String.Empty;

                BackgroundWorker bw = new BackgroundWorker();
                bw.WorkerReportsProgress = true;
                bw.DoWork += delegate(object sender2, DoWorkEventArgs e2)
                {
                    gameISO.ExportDirectory(gameISO.FileSystem.Root, fsd.FileName, sender2 as BackgroundWorker);
                };
                bw.RunWorkerCompleted += delegate(object sender2, RunWorkerCompletedEventArgs e2)
                {
                    progress.Close();
                    this.Enabled = true;
                    this.Focus();
                };
                bw.ProgressChanged += delegate(object sender2, ProgressChangedEventArgs e2)
                {
                    progress.action.Text = (string)e2.UserState;
                    progress.progressBar.Value = e2.ProgressPercentage;
                };

                this.Enabled = false;
                progress.Show();
                bw.RunWorkerAsync();
            }
        }
コード例 #2
0
ファイル: SettingsDialog.cs プロジェクト: CryZe/WindEditor
 private void btnBrowse_Click(object sender, EventArgs e)
 {
     FolderSelectDialog fsd = new FolderSelectDialog();
     fsd.InitialDirectory = "C:\\";
     fsd.Title = "Choose the root dir of your WindWaker ISO extract.";
     if(fsd.ShowDialog())
     {
         textDir.Text = fsd.FileName;
         UpdateButtonStates();
     }
 }
コード例 #3
0
ファイル: SettingsForm.cs プロジェクト: kidaa/DissDlcToolkit
 private void browseMainDlcFolderButton_Click(object sender, EventArgs e)
 {
     FolderSelectDialog dialog = new FolderSelectDialog();
     dialog.ShowDialog();
     string folder = dialog.FileName;
     if (!folder.Equals(""))
         // Show new folder
         settingsMainDlcFolderTextBox.Text = folder;
         // Save data to settings
         Settings.setDlcMainFolder(settingsMainDlcFolderTextBox.Text);
 }
コード例 #4
0
ファイル: frmMain.cs プロジェクト: OpNop/Documents-Reclaimer
 private void btnMove_Click(object sender, EventArgs e)
 {
     var dialog = new FolderSelectDialog
     {
         InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
         Title = "Select a Destination"
     };
     if (dialog.Show(Handle))
     {
         txtDirectory.Text = dialog.FileName;
     }
 }
コード例 #5
0
    private void btnDirectoryClick(object sender, EventArgs e)
    {
      if (dialog == null)
      {
        dialog = new FolderSelectDialog();
        dialog.Title = dirDescription;
      }

      if (dialog.ShowDialog(Form.ActiveForm.Handle))
      {
        FullName = dialog.FileName;
      }
    }
コード例 #6
0
 private void MediaPath_Click(object sender, EventArgs e)
 {
     FolderSelectDialog fsd = new FolderSelectDialog();
     if(fsd.ShowDialog())
     {
         if (Directory.Exists(fsd.FileName))
         {
             textBox_rootMedia.Text = fsd.FileName;
         }
         else
             MessageBox.Show("Errore nel recupero della cartella");
     }
 }
コード例 #7
0
ファイル: formMain.cs プロジェクト: topher-au/SnakeBite
        private void buttonSelectPath_Click(object sender, EventArgs e)
        {
            FolderSelectDialog fsd = new FolderSelectDialog();

            if (fsd.ShowDialog() != true) return;

            listModFiles.Items.Clear();

            string modPath = fsd.FileName;
            textModPath.Text = modPath;
            PopulateBoxes(modPath);
            Properties.Settings.Default.LastModDir = modPath;
            Properties.Settings.Default.Save();
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: kidaa/DissDlcToolkit
		static void Main(string[] args)
		{
			Console.WriteLine(Environment.OSVersion.Platform.ToString());
			Console.WriteLine(Environment.OSVersion.Version.Major);

			{
				var fsd = new FolderSelectDialog();
				fsd.Title = "What to select";
				fsd.InitialDirectory = @"c:\";
				if (fsd.ShowDialog(IntPtr.Zero))
				{
					Console.WriteLine(fsd.FileName);
				}
			}
		}
コード例 #9
0
ファイル: MainForm.cs プロジェクト: Wiebbe/WoWmapper
        public MainForm()
        {
            InitializeComponent();

            DoVersionCheck();

            // Load resources
            Icon = Properties.Resources.WoWConsolePort;

            groupStatus.Text = Resources.STRING_STATUS;
            labelConnectionStatus.Text = Resources.STRING_CONTROLLER_DISCONNECTED;
            checkWindowAttached.Text = Resources.STRING_WOW_WINDOW_FOUND;

            groupAdvancedHaptics.Text = Resources.STRING_HAPTIC_STATUS;
            checkHapticsAttached.Text = Resources.STRING_HAPTIC_ATTACHED;
            checkHapticsUserLoggedIn.Text = Resources.STRING_HAPTIC_CHARLOGGEDIN;
            labelPlayerInfo.Text = string.Empty;

            buttonConfig.Text = Resources.STRING_SHOW_CONFIG;
            buttonKeybinds.Text = Resources.STRING_SHOW_KEYBINDS;
            buttonSelectPlugin.Text = Resources.STRING_SHOW_PLUGINS;

            // Set up tray icon
            notifyIcon.Icon = Icon;
            notifyIcon.Text = Properties.Resources.STRING_NOTIFY_TOOLTIP;
            notifyIcon.Visible = true;
            notifyIcon.DoubleClick += NotifyIcon_DoubleClick;
            notifyIcon.ContextMenuStrip = menuNotify;

            // Check for a valid wow directory
            if (!Functions.CheckWoWPath()) // check for valid install path
            {
                var findWoWNow = MessageBox.Show(Resources.STRING_MESSAGE_NO_WOW_PATH, "WoWmapper", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (findWoWNow == DialogResult.Yes)
                {
                    FolderSelectDialog fbd = new FolderSelectDialog();
                    var res = fbd.ShowDialog();
                    if (res && Directory.Exists(fbd.FileName))
                    {
                        Properties.Settings.Default.WoWInstallPath = fbd.FileName;
                        Properties.Settings.Default.Save();
                    }
                }
            }
        }
コード例 #10
0
ファイル: DataUI.cs プロジェクト: Measter/TitleGenerator
		public DataUI()
		{
			InitializeComponent();

			m_fsd = new FolderSelectDialog();
			m_fsd.Title = "Please select your Crusader Kings II install directory.";

			m_log = new Logger();
			m_log.LogLength = 100;
			m_progressPopup = new ProgressPopup( m_log );

			m_ck2Data = new CK2Data( m_log );

			m_settings = new SettingsStore();
			m_settings.Filename = "settings.dat";
			m_settings.Version = 5;

			LogHeader();
		}
コード例 #11
0
ファイル: FolderEditing.cs プロジェクト: Cardanis/MonoGame
        public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            var project = context.Instance as PipelineProjectProxy;
            
            var initialDir = (string)value;
            if (initialDir == null || !Directory.Exists(initialDir))
                initialDir = project.Location;

            var dlg = new FolderSelectDialog()
                {                    
                    InitialDirectory = initialDir,
                    Title = "Select Folder",
                };

            if (dlg.ShowDialog(MainView.Form.Handle))
                return dlg.FileName;

            return value;            
        }
コード例 #12
0
        private void cmdInputFolder_Click(object sender, EventArgs e)
        {
            FolderSelectDialog Dialog = new FolderSelectDialog();

            Dialog.Title            = "Select input location";
            Dialog.InitialDirectory = txtInputFolder.Text;
            try
            {
                Dialog.InitialDirectory = txtInputFolder.Text;
            }
            catch { }
            bool Result = Dialog.ShowDialog();

            if (Result)
            {
                txtInputFolder.Text  = Dialog.FileName;
                txtOutputFolder.Text = "";
            }
        }
コード例 #13
0
ファイル: AnimList.cs プロジェクト: PictoChat/Smash-Forge
        private void exportAllAsOMOToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (var ofd = new FolderSelectDialog())
            {
                ofd.Title = "Character Folder";
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    string path = ofd.SelectedPath;

                    foreach (TreeNode v in MainForm.animNode.Nodes)
                    {
                        if (v is Animation)
                        {
                            OMOOld.createOMO(((Animation)v), Runtime.TargetVBN, path + "\\" + v.Text + ".omo");
                        }
                    }
                }
            }
        }
コード例 #14
0
ファイル: FSKL.cs プロジェクト: jakeroo123/Switch-Toolbox
            public void ExportAl()
            {
                if (Nodes.Count <= 0)
                {
                    return;
                }

                string formats = FileFilters.BONE;

                string[] forms = formats.Split('|');

                List <string> Formats = new List <string>();

                for (int i = 0; i < forms.Length; i++)
                {
                    if (i > 1 || i == (forms.Length - 1)) //Skip lines with all extensions
                    {
                        if (!forms[i].StartsWith("*"))
                        {
                            Formats.Add(forms[i]);
                        }
                    }
                }

                FolderSelectDialog sfd = new FolderSelectDialog();

                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    string folderPath = sfd.SelectedPath;

                    BatchFormatExport form = new BatchFormatExport(Formats);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        string extension = form.GetSelectedExtension();

                        foreach (BfresBone node in fskl.bones)
                        {
                            ((BfresBone)node).Export($"{folderPath}\\{node.Text}{extension}");
                        }
                    }
                }
            }
コード例 #15
0
        public FileResultModel ShowFolderSelectDialog(SelectFolderDialogConfigModel config)
        {
            var dialog = new FolderSelectDialog
            {
                Title        = config.Title,
                SelectedPath = config.SelectedPath,
            };

            var result = Application.Invoke(() => dialog.Show(parent));

            return(new FileResultModel
            {
                DialogResult = result,
                File = dialog.SelectedPath,
                Files = dialog.SelectedPath == null?Array.Empty <string>() : new string[]
                {
                    dialog.SelectedPath
                },
            });
        }
コード例 #16
0
        private void btnSplitInFileAdd_Click(object sender, EventArgs e)
        {
            var a = new FolderSelectDialog
            {
                Title       = Properties.Resources.FileDialogTitle,
                Filter      = Constants.SplitInFilterText,
                Multiselect = true
            };

            if (a.ShowDialog(string.Empty) == DialogResult.OK)
            {
                string inFile = string.Empty;
                foreach (string file in a.Files)
                {
                    inFile = file.Trim().Replace("/", @"\");
                    AddFile(inFile, true);
                }
                bindInFiles();
            }
        }
コード例 #17
0
        private async void ChangePath()
        {
            var folderDialog = new FolderSelectDialog
            {
                Title = "Select a folder where the master script should be saved"
            };
            var folderPath = string.Empty;

            if (folderDialog.ShowDialog())
            {
                folderPath = folderDialog.FileName;
            }
            if (!string.IsNullOrEmpty(folderPath))
            {
                var masterScript = await _masterScriptDb.GetMasterScript();

                masterScript.Location = folderPath;
                await _masterScriptDb.UpdateScript(masterScript);
            }
        }
コード例 #18
0
        public void ReplaceImport(object sender, EventArgs args)
        {
            using (var ofd = new FolderSelectDialog())
            {
                ofd.Title = "Animation Folder";
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    String Files = ofd.SelectedPath;

                    string[] fls = Directory.GetFiles(ofd.SelectedPath);

                    foreach (string s in fls)
                    {
                        string f   = Path.GetFileName(s);
                        string key = f.Substring(0, f.IndexOf("-"));
                        //Console.WriteLine(key);
                    }
                }
            }
        }
コード例 #19
0
        private void exportNutAsPngSeparateAlphaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (FolderSelectDialog f = new FolderSelectDialog())
            {
                if (f.ShowDialog() == DialogResult.OK)
                {
                    if (!Directory.Exists(f.SelectedPath))
                    {
                        Directory.CreateDirectory(f.SelectedPath);
                    }

                    foreach (NutTexture texture in currentNut.Nodes)
                    {
                        string texId = texture.HashId.ToString("X");
                        RenderTextureToPng(texture, f.SelectedPath + "\\" + texId + "_rgb.png");
                        RenderTextureToPng(texture, f.SelectedPath + "\\" + texId + "_alpha.png", false, false, false, true);
                    }
                }
            }
        }
コード例 #20
0
        //Show add folder dialog
        private void btnAddFolder_Click(object sender, EventArgs e)
        {
            if (_folderDialog == null)
            {
                _folderDialog = new FolderSelectDialog();
            }

            if (_folderDialog.ShowDialog(Handle))
            {
                var folder = _folderDialog.FileName;
                var items  = folderList.Items;
                //add folder
                if (!items.Contains(folder))
                {
                    items.Add(folder);
                }
                //prevent the dialog enter the folder
                _folderDialog.InitialDirectory = Path.GetDirectoryName(folder);
            }
        }
コード例 #21
0
        private void btnDownloadPath_Click(object sender, EventArgs e)
        {
            FolderSelectDialog dlg = new FolderSelectDialog();

            dlg.Title            = Messages.MSG_DOWNLOAD_FOLDER_SELECTION_TITLE;
            dlg.InitialDirectory = DownloadPath;
            if (dlg.ShowDialog(this.Handle))
            {
                DownloadPath = dlg.FileName;
                Messenger.AddInfo(string.Format(Messages.MSG_DOWNLOAD_PATH_CHANGED_0, dlg.FileName));
            }

            ////FolderBrowserDialog dlg = new FolderBrowserDialog();
            ////dlg.SelectedPath = DownloadPath;
            ////if (dlg.ShowDialog(this) == DialogResult.OK)
            ////{
            ////    DownloadPath = dlg.SelectedPath;
            ////    Messenger.AddInfo(string.Format(Messages.MSG_DOWNLOAD_PATH_CHANGED_0, dlg.SelectedPath));
            ////}
        }
コード例 #22
0
        private void chkTpFileTable_CheckedChanged(object sender, EventArgs e)
        {
            if (!System.IO.Directory.Exists(Runtime.TpGamePath) || !IsValidTPHDDirectory(Runtime.TpGamePath))
            {
                FolderSelectDialog sfd = new FolderSelectDialog();
                sfd.Title = "Select Modded Game Path!!!";
                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    if (!IsValidTPHDDirectory(sfd.SelectedPath))
                    {
                        throw new Exception($"Invalid path choosen. Make sure you have atleast a FileSizeList.txt and DecompressedSizeList.txt file in the path!");
                    }

                    tpGamePathTB.Text  = sfd.SelectedPath;
                    Runtime.TpGamePath = tpGamePathTB.Text;
                }
            }

            Runtime.ResourceTables.TpTable = chkTpFileTable.Checked;
        }
コード例 #23
0
        private void chkBotwFileTable_CheckedChanged(object sender, EventArgs e)
        {
            if (!System.IO.Directory.Exists(Runtime.BotwGamePath) || !IsValidBotwDirectory(Runtime.BotwGamePath))
            {
                FolderSelectDialog sfd = new FolderSelectDialog();
                sfd.Title = "Select Modded Game Path!!!";
                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    if (!IsValidBotwDirectory(sfd.SelectedPath))
                    {
                        throw new Exception($"Invalid path choosen. Make sure you have atleast an RSTB file in the path! |{sfd.SelectedPath}/System/Resource/ResourceSizeTable.product.srsizetable|");
                    }

                    botwGamePathTB.Text  = sfd.SelectedPath;
                    Runtime.BotwGamePath = botwGamePathTB.Text;
                }
            }

            Runtime.ResourceTables.BotwTable = chkBotwFileTable.Checked;
        }
コード例 #24
0
ファイル: FMAT.cs プロジェクト: cano159/Switch-Toolbox
        public void ReplaceBatch(object sender, EventArgs args)
        {
            FolderSelectDialog ofd = new FolderSelectDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                string folderPath = ofd.SelectedPath;

                foreach (var file in Directory.GetFiles(folderPath))
                {
                    string Name = Path.GetFileNameWithoutExtension(file);
                    if (((FMDL)Parent).materials.ContainsKey(Name) &&
                        (file.EndsWith(".bfmat")))
                    {
                        ((FMDL)Parent).materials[Name].Replace(file);
                    }
                }
            }
            LibraryGUI.Instance.UpdateViewport();
        }
コード例 #25
0
        public MainView()
        {
            InitializeComponent();
            _presenter = new MainPresenter(this);
            GlueBindings();

            _validationFactory = new ValidationSupportFactory(x => this.ShowMessageBox(x, Strings.AppName,
                                                                                       MessageBoxButtons.OK, MessageBoxIcon.Exclamation));
            _folderBrowserDialog = new FolderSelectDialog
            {
                Title = Strings.BrowseFolderDescription,
            };
            _saveFileDialog = new SaveFileDialog
            {
                Filter     = "Comma Separated File|*.csv",
                DefaultExt = "*.csv",
                FileName   = "Moviebase.csv",
                Title      = Strings.BrowseExportTitle
            };
        }
コード例 #26
0
        private void button_browse_backup_folder_Click(object sender, EventArgs e)
        {
            try
            {
                var sPath = textBox_backup_folder.Text;

                if (!Directory.Exists(sPath))
                {
                    while (sPath.Contains("\\"))
                    {
                        sPath = sPath.Substring(0, sPath.LastIndexOf("\\", StringComparison.Ordinal));
                        if (Directory.Exists(sPath))
                        {
                            break;
                        }
                    }
                }

                var folderSelectDialog = new FolderSelectDialog
                {
                    Title            = "Select Backup Folder",
                    InitialDirectory = sPath
                };
                if (!folderSelectDialog.ShowDialog(IntPtr.Zero))
                {
                    return;
                }
                if (folderSelectDialog.FileName.Trim() == string.Empty)
                {
                    return;
                }
                sPath = folderSelectDialog.FileName;


                textBox_backup_folder.Text = sPath;
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
コード例 #27
0
            private void ExportAllAction(object sender, EventArgs args)
            {
                OnExpand();

                List <string> Formats = new List <string>();

                Formats.Add("SMD (.smd)");
                Formats.Add("SEANIM (.seanim)");

                FolderSelectDialog sfd = new FolderSelectDialog();

                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    string folderPath = sfd.SelectedPath;

                    BatchFormatExport form = new BatchFormatExport(Formats);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        foreach (TreeNode node in Nodes)
                        {
                            Console.WriteLine($"node {node}");
                            if (!(node is IAnimationContainer))
                            {
                                continue;
                            }

                            var    anim = ((IAnimationContainer)node).AnimationController;
                            string name = Path.GetFileNameWithoutExtension(node.Text);

                            if (form.Index == 0)
                            {
                                SMD.Save((STSkeletonAnimation)anim, $"{folderPath}/{name}.smd");
                            }
                            if (form.Index == 1)
                            {
                                SEANIM.Save((STSkeletonAnimation)anim, $"{folderPath}/{name}.seanim");
                            }
                        }
                    }
                }
            }
コード例 #28
0
 private void btnSelectFolder_Click(object sender, EventArgs e)
 {
     FolderSelectDialog dlg = new FolderSelectDialog();
     dlg.Title = Messages.MSG_KSP_INSTALL_FOLDER_SELECTION;
     if (dlg.ShowDialog(this.Handle))
     {
         if (KSPPathHelper.IsKSPInstallFolder(dlg.FileName))
         {
             btnFinish.Enabled = true;
             tbKSPPath.Text = dlg.FileName;
         }
         else
         {
             MessageBox.Show(this, Messages.MSG_PLS_SELECT_VALID_KSP_INSTALL_FOLDER, Messages.MSG_TITLE_ATTENTION);
         }
     }
     else
     {
         btnFinish.Enabled = false;
     }
 }
コード例 #29
0
 private void FolderButton_Click(object sender, EventArgs e)
 {
     try
     {
         var dialog = new FolderSelectDialog
         {
             InitialDirectory = BASE_PATH,
             Title            = "Select a folder to import save file from"
         };
         if (dialog.Show(Handle))
         {
             SearchPath.Text = dialog.FileName;
             BASE_PATH       = dialog.FileName;
             Log($"Got directory: {BASE_PATH}");
         }
     }
     catch (Exception ex)
     {
         Log($"(103) {ex.Message}");
     }
 }
コード例 #30
0
 private void exportNutToFolder(object sender, EventArgs e)
 {
     using (FolderSelectDialog f = new FolderSelectDialog())
     {
         if (f.ShowDialog() == DialogResult.OK && listBox1.SelectedItem != null)
         {
             if (!Directory.Exists(f.SelectedPath))
             {
                 Directory.CreateDirectory(f.SelectedPath);
             }
             foreach (var tex in selected.textures)
             {
                 string filename = Path.Combine(f.SelectedPath, $"{tex.id.ToString("X")}.dds");
                 DDS    dds      = new DDS();
                 dds.fromNUT_Texture(tex);
                 dds.Save(filename);
             }
             Process.Start("explorer.exe", f.SelectedPath);
         }
     }
 }
コード例 #31
0
 private void ExportScripts()
 {
     if (ScriptsCollection.Any(s => s.IsSelected))
     {
         var folderDialog = new FolderSelectDialog
         {
             Title = "Select a folder where the script should be exported"
         };
         if (folderDialog.ShowDialog())
         {
             var folderPath      = folderDialog.FileName;
             var selectedScripts = ScriptsCollection.Where(s => s.IsSelected).ToList();
             ProcessScript.ExportScript(Path.Combine(folderPath, "exportedScript.ahk"), selectedScripts);
         }
     }
     else
     {
         MessageBox.Show("Please select at least one script from the grid to export", "Warning",
                         MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
コード例 #32
0
 private void OpenSelector(object sender, EventArgs args)
 {
     if (System.IO.Directory.Exists(Runtime.SmoGamePath))
     {
         OpenCostumeDialog(Runtime.SmoGamePath);
     }
     else
     {
         var result = MessageBox.Show("Please set your Mario Odyssey game path!");
         if (result == DialogResult.OK)
         {
             FolderSelectDialog ofd = new FolderSelectDialog();
             if (ofd.ShowDialog() == DialogResult.OK)
             {
                 Runtime.SmoGamePath = ofd.SelectedPath;
                 Config.Save();
                 OpenCostumeDialog(Runtime.SmoGamePath);
             }
         }
     }
 }
コード例 #33
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //bar.Value = 50;
            FolderSelectDialog fsd = new FolderSelectDialog();

            if (fsd.ShowDialog())
            {
                IEDLoad load = instance.GetEDLoad(cbType.Text);
                load.ProgressEvent += Load_ProgressEvent;
                bs.ShowProgress();

                load.Load((int)bar.Maximum, fsd.FileNames);
                //for (int i = 0; i < 100; i++)
                //{
                //    Load_ProgressEvent(i, null);
                //    Thread.Sleep(100);
                //}
                bs.Title = _titlehead;
                bs.ShowLab("完成");
            }
        }
コード例 #34
0
        private void sarcUnpackButton_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Select package to unpack");
            OpenFileDialog     openFileDialog = new OpenFileDialog();
            FolderSelectDialog saveFileDialog = new FolderSelectDialog();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                MessageBox.Show("Select destination");
                if (saveFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string path = Path.Combine(Environment.GetFolderPath(
                                                   Environment.SpecialFolder.ApplicationData).Replace(@"\Roaming", null), @"Local\Programs\Python\Python37\Scripts\sarctool.exe");
                    try {
                        Process.Start("sarc", "extract " + @"""" + openFileDialog.FileName + @"""" + @" """ + saveFileDialog.SelectedPath + @"""");
                    } catch {
                        MessageBox.Show("Sarc tool can't be found, make sure its installed and properly configured.");
                    }
                }
            }
        }
コード例 #35
0
        private void ReplaceAction(object sender, EventArgs args)
        {
            //Add folders and files from selected path
            FolderSelectDialog ofd = new FolderSelectDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                //Clear all nodes
                foreach (var node in TreeViewExtensions.Collect(Nodes))
                {
                    if (node is ArchiveFileWrapper)
                    {
                        ArchiveFile.DeleteFile(((ArchiveFileWrapper)node).ArchiveFileInfo);
                    }
                }

                Nodes.Clear();

                TreeHelper.AddFiles(this, RootNode, Directory.GetFiles(ofd.SelectedPath));
            }
        }
コード例 #36
0
        private void loadProjectButton_Click(object sender, EventArgs e)
        {
            FolderSelectDialog folderDialog = new FolderSelectDialog();

            folderDialog.Title = "Select the updates folder containing the appinfo.json file";
            if (folderDialog.ShowDialog(this.Handle))
            {
                string appInfoFile = Path.Combine(folderDialog.FileName, "appinfo.json");
                if (!File.Exists(appInfoFile))
                {
                    MessageBox.Show("Could not load project folder: Folder does not contain appinfo.json", "Failed to load project", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                AppInfo info = AppInfo.FromJson(File.ReadAllText(appInfoFile));
                if (info == null)
                {
                    MessageBox.Show("Could not load project folder: Invalid appinfo.json", "Failed to load project", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                UpdateInfo[] updates = LoadUpdates(folderDialog.FileName, info);

                NewProjectDialog dialog = new NewProjectDialog();
                dialog.appIDTextBox.Text  = info.appId;
                dialog.newProject.Updates = updates.ToList();
                dialog.SetPublisher(typeof(LocalDiskPublisher)); //TODO: enable loading with different publisher types
                dialog.appIDTextBox.Enabled      = false;
                dialog.publisherComboBox.Enabled = false;
                LocalDiskPublisherGUI gui = (LocalDiskPublisherGUI)dialog.publisherSettings.Controls[0];
                gui.SetFolder(folderDialog.FileName);
                gui.SetFolderEditable(false);

                if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    Settings.Instance.Projects.Add(dialog.newProject);
                    Settings.Instance.Save();
                    SelectPage(OpenProject(dialog.newProject));
                }
            }
        }
コード例 #37
0
        private void loadBtn_Click(object sender, EventArgs e)
        {
            try
            {
                var loadFolderPath = new FolderSelectDialog();
                var doc            = new XmlDocument();
                if (loadFolderPath.ShowDialog())
                {
                    var externalProjectsBindingList = new BindingList <ProjectDetails>();
                    _areExternalStudioProjects = true;
                    _languages.Clear();
                    _projectsDataSource.Clear();
                    var projectsPathList = Directory.GetFiles(loadFolderPath.FileName, "*.sdlproj", SearchOption.AllDirectories);
                    foreach (var projectPath in projectsPathList)
                    {
                        var reportFolderPath = Path.Combine(projectPath.Substring(0, projectPath.LastIndexOf(@"\", StringComparison.Ordinal)), "Reports");
                        if (Help.ReportFileExist(reportFolderPath))
                        {
                            var projectDetails = ProjectInformation.GetExternalProjectDetails(projectPath);

                            doc.Load(projectDetails.ProjectPath);
                            Help.LoadReports(doc, projectDetails.ProjectFolderPath, projectDetails);
                            externalProjectsBindingList.Add(projectDetails);
                        }
                    }
                    foreach (var item in externalProjectsBindingList)
                    {
                        _projectsDataSource.Add(item);
                    }

                    projListbox.DataSource = _projectsDataSource;
                    RefreshProjectsListBox();
                    RefreshLanguageListbox();
                }
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"loadBtn_Click method: {ex.Message}\n {ex.StackTrace}");
            }
        }
コード例 #38
0
        private void bBrowseBasePath_Click(object sender, EventArgs e)
        {
            FolderSelectDialog dirdialog = new FolderSelectDialog();

            dirdialog.Title            = "Select base folder";
            dirdialog.InitialDirectory = tbBasePath.Text;

            if (dirdialog.ShowDialog(this.Handle))
            {
                tbBasePath.Text = dirdialog.FileName;

                if (string.IsNullOrWhiteSpace(tbActorPath.Text))
                {
                    tbActorPath.Text = tbBasePath.Text;
                }

                if (string.IsNullOrWhiteSpace(tbModelPath.Text))
                {
                    tbModelPath.Text = tbBasePath.Text;
                }
            }
        }
コード例 #39
0
        private void exportAllAsANIMToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (var ofd = new FolderSelectDialog())
            {
                ofd.Title = "Character Folder";
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    string path = ofd.SelectedPath;

                    foreach (TreeNode v in treeView1.Nodes)
                    {
                        foreach (TreeNode a in v.Nodes)
                        {
                            if (a is Animation)
                            {
                                ANIM.CreateANIM(path + "\\" + a.Text + ".anim", ((Animation)a), Runtime.TargetVBN);
                            }
                        }
                    }
                }
            }
        }
コード例 #40
0
        public static void UploadFolder(TaskSettings taskSettings = null)
        {
            using (FolderSelectDialog folderDialog = new FolderSelectDialog())
            {
                folderDialog.Title = "ShareX - Folder upload";

                if (!string.IsNullOrEmpty(Program.Settings.FileUploadDefaultDirectory) && Directory.Exists(Program.Settings.FileUploadDefaultDirectory))
                {
                    folderDialog.InitialDirectory = Program.Settings.FileUploadDefaultDirectory;
                }
                else
                {
                    folderDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                }

                if (folderDialog.ShowDialog() && !string.IsNullOrEmpty(folderDialog.FileName))
                {
                    Program.Settings.FileUploadDefaultDirectory = folderDialog.FileName;
                    UploadFile(folderDialog.FileName);
                }
            }
        }
コード例 #41
0
        private void btnBrowse_Click(object sender, RoutedEventArgs e)
        {
            btnBrowse.IsEnabled = false;
            string dir = WindowViewModel.NewLocationInput;

            if (dir == null || dir.Length == 0 || !Directory.Exists(dir))
            {
                dir = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
            }
            var dialog = new FolderSelectDialog
            {
                InitialDirectory = dir,
                Title            = "Select your Beat Saber game folder."
            };

            if (dialog.Show(InteropHelper.Handle))
            {
                WindowViewModel.NewLocationInput = dialog.FileName;
                LocationInput.Focus();
            }
            btnBrowse.IsEnabled = true;
        }
コード例 #42
0
        private void btt_choseDirLeft_Click(object sender, EventArgs e)
        {
            string folderName = txt_folderLeft.Text;

            fsDlg = new FolderSelectDialog();
            if (!string.IsNullOrEmpty(folderName))
            {
                fsDlg.InitialDirectory = folderName;
            }
            fsDlg.Title = "Bitte einen Basispfad zu Musikdaten auswählen";
            if (fsDlg.ShowDialog(IntPtr.Zero))
            {
                folderName = fsDlg.FileName;
                if (!folderName.EndsWith("\\"))
                {
                    folderName += "\\";
                }
                txt_folderLeft.Text = folderName;
                ReadFiles(folderName, "left");
                mode = "directories";
            }
        }
コード例 #43
0
        /// <summary>
        /// Opens the FolderBrowserDialog and lets the user chose a new download folder.
        /// </summary>
        /// <returns>The new selected download folder or string.Empty.</returns>
        public static string SelectNewDownloadPath()
        {
            if (string.IsNullOrEmpty(SelectedKSPPath))
            {
                MessageBox.Show(View.ParentForm, string.Format(Messages.MSG_SELECT_0_FOLDER_FIRST, KSPINSTALL));
                return string.Empty;
            }

            string pathUser = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
            string pathDownload = Path.Combine(pathUser, DOWNLOADS);
            if (!string.IsNullOrEmpty(DownloadPath))
                pathDownload = DownloadPath;

            FolderSelectDialog dlg = new FolderSelectDialog();
            dlg.Title = Messages.MSG_DOWNLOAD_SELECTION_TITLE;
            dlg.InitialDirectory = pathDownload;
            if (dlg.ShowDialog(View.ParentForm.Handle))
                DownloadPath = dlg.FileName;

            return DownloadPath;
        }
コード例 #44
0
ファイル: ConfigForm.cs プロジェクト: Wiebbe/WoWmapper
 private void buttonLocateWoW_Click(object sender, EventArgs e)
 {
     FolderSelectDialog fbd = new FolderSelectDialog();
     var res = fbd.ShowDialog();
     if (res != true) return;
     Properties.Settings.Default.WoWInstallPath = fbd.FileName;
     Properties.Settings.Default.Save();
     textWoWPath.Text = fbd.FileName;
 }
コード例 #45
0
ファイル: SettingForm.cs プロジェクト: iseebi/EbIRC
 private void logDirectoryBrowseButton_Click(object sender, EventArgs e)
 {
     using (FolderSelectDialog dialog = new FolderSelectDialog())
     {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             logDirectoryNameTextBox.Text = dialog.SelectedDirectory;
         }
     }
 }
コード例 #46
0
        private void CustomUploaderExportAll()
        {
            if (Config.CustomUploadersList != null)
            {
                for (int i = 0; i < lbCustomUploaderList.Items.Count; i++)
                {
                    lbCustomUploaderList.SelectedIndex = i;
                    UpdateCustomUploader();
                }

                using (FolderSelectDialog fsd = new FolderSelectDialog())
                {
                    if (fsd.ShowDialog())
                    {
                        foreach (CustomUploaderItem item in Config.CustomUploadersList)
                        {
                            string json = eiCustomUploaders.Serialize(item);
                            string filepath = Path.Combine(fsd.FileName, item.Name + ".json");
                            File.WriteAllText(filepath, json, Encoding.UTF8);
                        }
                    }
                }
            }
        }
コード例 #47
0
        /// <summary>
        /// Imports ASP created BAK files (Mysql Out FILE)
        /// </summary>
        private void ImportASPBtn_Click(object sender, EventArgs e)
        {
            // Open File Select Dialog
            FolderSelectDialog Dialog = new FolderSelectDialog();
            Dialog.Title = "Select ASP Database Backup Folder";
            Dialog.InitialDirectory = Path.Combine(Paths.DocumentsFolder, "Backups");
            if (Dialog.ShowDialog())
            {
                // Get files list from path
                string path = Dialog.SelectedPath;
                string[] BakFiles = Directory.GetFiles(path, "*.bak");
                if (BakFiles.Length > 0)
                {
                    // Open the database connection
                    StatsDatabase Database;
                    try
                    {
                        Database = new StatsDatabase();
                    }
                    catch (Exception Ex)
                    {
                        MessageBox.Show(
                            "Unable to connect to database\r\n\r\nMessage: " + Ex.Message,
                            "Database Connection Error",
                            MessageBoxButtons.OK, MessageBoxIcon.Error
                        );

                        // Stop the ASP server, and close this form
                        ASP.ASPServer.Stop();
                        this.Close();
                        return;
                    }

                    // Show task dialog
                    TaskForm.Show(this, "Importing Stats", "Importing ASP Stats Bak Files...", false);
                    TaskForm.UpdateStatus("Removing old stats data");

                    // Clear old database records
                    Database.Truncate();
                    Thread.Sleep(500);

                    // Begin transaction
                    DbTransaction Transaction = Database.BeginTransaction();

                    // import each table
                    foreach (string file in BakFiles)
                    {
                        // Get table name
                        string table = Path.GetFileNameWithoutExtension(file);

                        // Update progress
                        TaskForm.UpdateStatus("Processing stats table: " + table);

                        // Import table data
                        try
                        {
                            // Sqlite kinda sucks... no import methods
                            if (Database.DatabaseEngine == DatabaseEngine.Sqlite)
                            {
                                string[] Lines = File.ReadAllLines(file);
                                foreach (string line in Lines)
                                {
                                    string[] Values = line.Split('\t');
                                    Database.Execute(
                                        String.Format("INSERT INTO {0} VALUES({1})", table, "\"" + String.Join("\", \"", Values) + "\"")
                                    );
                                }
                            }
                            else
                                Database.Execute(String.Format("LOAD DATA LOCAL INFILE '{0}' INTO TABLE {1};", file.Replace('\\', '/'), table));
                        }
                        catch (Exception Ex)
                        {
                            // Show exception error
                            ExceptionForm Form = new ExceptionForm(Ex, false);
                            Form.Message = String.Format("Failed to import data into table {0}!{2}{2}Error: {1}", table, Ex.Message, Environment.NewLine);
                            DialogResult Result = Form.ShowDialog();

                            // Rollback!
                            TaskForm.UpdateStatus("Rolling back stats data");
                            Transaction.Rollback();

                            // Update message
                            TaskForm.CloseForm();
                            return;
                        }
                    }

                    // Commit the transaction, and alert the user
                    Transaction.Commit();
                    TaskForm.CloseForm();
                    Notify.Show("Stats imported successfully!", "Operation Successful", AlertType.Success);

                    // Displose Connection
                    Database.Dispose();
                }
                else
                {
                    // Alert the user and tell them they failed
                    MessageBox.Show(
                        "Unable to locate any .bak files in this folder. Please select an ASP created database backup folder that contains backup files.",
                        "Backup Error",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error
                    );
                }
            }
        }
コード例 #48
0
ファイル: UploadManager.cs プロジェクト: KamilKZ/ShareX
        public static void UploadFolder(TaskSettings taskSettings = null)
        {
            using (FolderSelectDialog folderDialog = new FolderSelectDialog())
            {
                folderDialog.Title = "ShareX - " + Resources.UploadManager_UploadFolder_Folder_upload;

                if (!string.IsNullOrEmpty(Program.Settings.FileUploadDefaultDirectory) && Directory.Exists(Program.Settings.FileUploadDefaultDirectory))
                {
                    folderDialog.InitialDirectory = Program.Settings.FileUploadDefaultDirectory;
                }
                else
                {
                    folderDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                }

                if (folderDialog.ShowDialog() && !string.IsNullOrEmpty(folderDialog.FileName))
                {
                    Program.Settings.FileUploadDefaultDirectory = folderDialog.FileName;
                    UploadFile(folderDialog.FileName);
                }
            }
        }
コード例 #49
0
ファイル: formMain.cs プロジェクト: MrRSPEED9845/SnakeBite
        private void buttonSelectPath_Click(object sender, EventArgs e)
        {
            FolderSelectDialog fsd = new FolderSelectDialog();

            if (fsd.ShowDialog() != true) return;

            listModFiles.Items.Clear();

            string modPath = fsd.FileName;
            textModPath.Text = modPath;
            foreach (string modFile in Directory.GetFiles(modPath, "*.*", SearchOption.AllDirectories))
            {
                string filePath = modFile.Substring(modPath.Length).Replace("\\", "/");
                if(Hashing.ValidFileExtension(filePath) && filePath != "/metadata.xml") listModFiles.Items.Add(filePath);
            }

            Properties.Settings.Default.LastModDir = modPath;
            Properties.Settings.Default.Save();
        }
コード例 #50
0
        private void btnBrowseProjectsXML_Click(object sender, EventArgs e)
        {
            FolderSelectDialog selectFolder = new FolderSelectDialog();
            selectFolder.InitialDirectory = txtProjectsXML.Text;
            if (selectFolder.ShowDialog())
            {
                txtProjectsXML.Text = selectFolder.FileName;

                List<KeyValuePair<String, String>> projects = Projects.Projects.GetAllProjects(txtProjectsXML.Text).OrderBy(project => project.Value).ToList();
                projectsList.DisplayMember = "Value";
                projectsList.ValueMember = "Key";
                projectsList.DataSource = projects;
            }
        }
コード例 #51
0
ファイル: UploadManager.cs プロジェクト: KamilKZ/ShareX
 public static void IndexFolder(TaskSettings taskSettings = null)
 {
     using (FolderSelectDialog dlg = new FolderSelectDialog())
     {
         if (dlg.ShowDialog())
         {
             IndexFolder(dlg.FileName, taskSettings);
         }
     }
 }
コード例 #52
0
ファイル: EditFilesPanel.cs プロジェクト: xwiz/WixEdit
        private void ImportFolder_Click(object sender, System.EventArgs e)
        {
            TreeNode aNode = CurrentTreeView.SelectedNode;
            XmlNode aNodeElement = aNode.Tag as XmlNode;

            FolderSelectDialog ofd = new FolderSelectDialog();
            ofd.Description = "Select folder to import";
            ofd.ShowNewFolderButton = false;
            if (ofd.ShowDialog() == DialogResult.OK && !String.IsNullOrEmpty(ofd.SelectedPath))
            {
                ImportFoldersInDirectory(aNode, aNodeElement, new string[] { ofd.SelectedPath });
            }
        }
コード例 #53
0
        /// <summary>
        /// Opens the SelectFolderDialog to select a folder to backup
        /// and Starts the backup process async.
        /// </summary>
        public static void NewBackup()
        {
            if (!ValidBackupDirectory(BackupPath))
                return;

            FolderSelectDialog dlg = new FolderSelectDialog();
            dlg.Title = "Source folder selection";
            dlg.InitialDirectory = KSPPathHelper.GetPath(KSPPaths.KSPRoot);
            if (dlg.ShowDialog(View.ParentForm.Handle))
                BackupDirectoryAsync(dlg.FileName);
        }
コード例 #54
0
        /// <summary>
        /// Opens the FolderSelectDialog to select a new backup path.
        /// </summary>
        public static void SelectNewBackupPath()
        {
            var dlg = new FolderSelectDialog();
            dlg.Title = "Please select a new Backup path.";
            dlg.InitialDirectory = string.Empty;

            if (dlg.ShowDialog(View.ParentForm.Handle))
                View.BackupPath = dlg.FileName;
        }
コード例 #55
0
ファイル: FormMain.cs プロジェクト: ChainedLupine/BSAVEViewer
        private void openPathToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var fsd = new FolderSelectDialog();
            fsd.Title = "Select a folder to browse.";
            fsd.InitialDirectory = Properties.Settings.Default.LastDirectory;
            if (fsd.ShowDialog(IntPtr.Zero))
            {
                Console.WriteLine(fsd.FileName);
                currPath = fsd.FileName;
                Properties.Settings.Default.LastDirectory = currPath;
                Properties.Settings.Default.Save();

                PopulateFiles();
            }
        }
コード例 #56
0
        private void btnPath_Click(object sender, RoutedEventArgs e)
        {
            var folderSelect = new FolderSelectDialog();
            folderSelect.Title = "Choose a download directory for your wallpapers";

            if (folderSelect.ShowDialog())
            {
                txtPath.Text = folderSelect.FileName;
                FolderPath = folderSelect.FileName;
            }
        }
コード例 #57
0
        /// <summary>
        /// Asks the user for a KSP Install path with a folder browser dialog .
        /// </summary>
        /// <returns>The selected KSP path or String.Empty.</returns>
        public static string AskForKSPInstallFolder()
        {
            string kspPath = string.Empty;


            FolderSelectDialog dlg = new FolderSelectDialog();
            dlg.Title = Messages.MSG_KSP_INSTALL_FOLDER_SELECTION_TITLE;
            dlg.InitialDirectory = "c:/";
            if (dlg.ShowDialog(View.ParentForm.Handle))
            {
                if (KSPPathHelper.IsKSPInstallFolder(dlg.FileName))
                    kspPath = dlg.FileName;
                else
                    MessageBox.Show(Messages.MSG_NOT_KSP_FOLDER);
            }

            return kspPath;
        }
コード例 #58
0
ファイル: UploadManager.cs プロジェクト: Z1ni/ShareX
 public static void IndexFolder(TaskSettings taskSettings = null)
 {
     using (FolderSelectDialog dlg = new FolderSelectDialog())
     {
         if (dlg.ShowDialog())
         {
             if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();
             UploadText(dlg.FileName, taskSettings);
         }
     }
 }
コード例 #59
0
 private void HandleBtnOpenX264LogFileOutputDialog()
 {
     var fsd = new FolderSelectDialog();
     fsd.Title = "x264 (.log) files save directory";
     if (fsd.ShowDialog(IntPtr.Zero))
     {
         txtX264LogFileSaveDirectory.Text = fsd.FileName;
     }
 }
コード例 #60
0
        private void btnDownloadPath_Click(object sender, EventArgs e)
        {
            FolderSelectDialog dlg = new FolderSelectDialog();
            dlg.Title = Messages.MSG_DOWNLOAD_FOLDER_SELECTION_TITLE;
            dlg.InitialDirectory = DownloadPath;
            if (dlg.ShowDialog(this.Handle))
            {
                DownloadPath = dlg.FileName;
                Messenger.AddInfo(string.Format(Messages.MSG_DOWNLOAD_PATH_CHANGED_0, dlg.FileName));
            }

            ////FolderBrowserDialog dlg = new FolderBrowserDialog();
            ////dlg.SelectedPath = DownloadPath;
            ////if (dlg.ShowDialog(this) == DialogResult.OK)
            ////{
            ////    DownloadPath = dlg.SelectedPath;
            ////    Messenger.AddInfo(string.Format(Messages.MSG_DOWNLOAD_PATH_CHANGED_0, dlg.SelectedPath));
            ////}
        }