Example #1
0
        private void importAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_DataMessage.Count() <= 0 || _IsBusy)
            {
                return;
            }
            string dir = DiaglogManager.FolderBrowser("Export");

            if (string.IsNullOrEmpty(dir))
            {
                return;
            }
            _IsBusy = true;
            Task.Run(() =>
            {
                try
                {
                    Operation.ImportDirectory(dir, this.progressBar);
                }
                catch (Exception err)
                {
                    _IsBusy = false;
                    MessageBox.Show($"An error occurred:\n\n{err.Message}", _MessageBoxTitle);
                }
            }).GetAwaiter().OnCompleted(() => { _IsBusy = false; });
        }
Example #2
0
        private void btnSelectGameLocation_Click(object sender, EventArgs e)
        {
            string folderPath = DiaglogManager.FolderBrowser("Drakengard 3");

            if (!string.IsNullOrEmpty(folderPath))
            {
                txtBoxGameLocation.Text = folderPath;
                if (_JsonConfig.ContainsKey("GameLocation"))
                {
                    _JsonConfig["GameLocation"] = folderPath;
                }
                else
                {
                    _JsonConfig.Add("GameLocation", folderPath);
                }
                string configStr = new JavaScriptSerializer().Serialize(_JsonConfig);
                try
                {
                    File.WriteAllText(_ConfigFile, configStr);
                }
                catch (Exception err)
                {
                    MessageBox.Show($"An error occurred:\n\n{err.Message}", _MessageBoxTitle);
                }
            }
        }