private void LoadTranslation()
        {
            var dialogResult = LoadFileDialog.ShowDialog(this);

            if (dialogResult == DialogResult.OK)
            {
                if (!CloseAllDocuments())
                {
                    return;
                }

                var workForm = new WorkingForm(dockTheme, "Cargar traducción", true);

                TranslationProject project = null;

                workForm.DoWork += (sender, args) =>
                {
                    var worker = sender as BackgroundWorker;

                    try
                    {
                        project = TranslationProject.Load(LoadFileDialog.FileName, _pluginManager, worker);
                    }
                    catch (UserCancelException e)
                    {
                        args.Cancel = true;
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(e.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                };

                workForm.ShowDialog(this);

                if (workForm.Cancelled)
                {
                    return;
                }

                _project     = project;
                _currentFile = null;

                _explorer.LoadTree(_project.FileContainers);

                _project.Save();

                Text = $"Translation Framework 2.0 - {_project.Game.Name} - {_project.WorkPath}";
                tsbExportProject.Enabled     = true;
                mniFileExport.Enabled        = true;
                tsbSearchInFiles.Enabled     = true;
                mniEditSearchInFiles.Enabled = true;

                mniBulkTextsExport.Enabled  = true;
                mniBulkTextsImport.Enabled  = true;
                mniBulkImagesExport.Enabled = true;
                mniBulkImagesImport.Enabled = true;
            }
        }
Exemple #2
0
 private void VisualizerLoadSettingsButton_Click(object sender, EventArgs e)
 {
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory() + "\\VisualizerSettings";
     if (LoadFileDialog.ShowDialog() == DialogResult.OK)
     {
         LoadSettings(LoadFileDialog.FileName);
     }
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory();
 }
Exemple #3
0
 public void LoadAAmbilightSetup(object sender, EventArgs e)
 {
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory() + "\\AmbilightSettings";
     if (LoadFileDialog.ShowDialog() == DialogResult.OK)
     {
         LoadSettings(LoadFileDialog.FileName);
     }
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory();
 }
Exemple #4
0
 private void LoadSetup(object sender, EventArgs e)
 {
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory() + "\\Setups";
     if (LoadFileDialog.ShowDialog() == DialogResult.OK)
     {
         ConfigureSetupSectionClass.LoadASetup(LoadFileDialog.FileName);
     }
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory();
 }
Exemple #5
0
 private void LoadInstructions(object sender, EventArgs e)
 {
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory() + "\\Instructions";
     if (LoadFileDialog.ShowDialog() == DialogResult.OK)
     {
         InstructionsSectionClass.LoadInstructions(LoadFileDialog.FileName);
     }
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory();
 }
Exemple #6
0
 private void AnimationModeLoadButton_Click(object sender, EventArgs e)
 {
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory() + "\\Animations";
     if (LoadFileDialog.ShowDialog() == DialogResult.OK)
     {
         AnimationModeSectionClass.LoadAnimation(LoadFileDialog.FileName);
     }
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory();
 }
Exemple #7
0
 private void InstructionsAddAmbilightUseAmbilightSettings_Click(object sender, EventArgs e)
 {
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory() + "\\AmbilightSettings";
     if (LoadFileDialog.ShowDialog() == DialogResult.OK)
     {
         Button SenderButton = sender as Button;
         SenderButton.Tag = LoadFileDialog.FileName.Split('\\')[LoadFileDialog.FileName.Split('\\').Length - 1];
     }
     LoadFileDialog.InitialDirectory = Directory.GetCurrentDirectory();
 }
Exemple #8
0
        private void abrirToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LoadFileDialog.InitialDirectory = "C:\\";
            LoadFileDialog.Filter           = "xml files (*.xml) | *.xml";
            LoadFileDialog.RestoreDirectory = true;

            if (LoadFileDialog.ShowDialog() == DialogResult.OK)
            {
                filePath = LoadFileDialog.FileName;
                document = XDocument.Load(filePath);

                llegirXML(document);
            }
        }
Exemple #9
0
        private void MainMeneFileOpen_Click(object sender, EventArgs ev)
        {
            if (LoadFileDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    // Читаем содержимое выбранного файла и преобразуем его в массив
                    string arrText = FilesUtils.Read(LoadFileDialog.FileName);
                    int[,] arr = DataConverter.StrToArray2D <int>(arrText);

                    // Копируем полученный массив в DataGridView
                    DataGridViewUtils.Array2ToGrid(inputDataGridView, arr);

                    MessagesUtils.Show("Данные загружены");
                }
                catch (Exception e)
                {
                    MessagesUtils.ShowError("Ошибка загрузки данных");
                }
            }
        }
Exemple #10
0
        private void LoadButton_Click(object sender, EventArgs e)
        {
            if (LoadFileDialog.ShowDialog() == DialogResult.OK)
            {
                NotepadArea.Text = File.ReadAllText(LoadFileDialog.FileName, Encoding.UTF8);
            }

            // Figures out where to start
            int    indexOfPath    = LoadFileDialog.FileName.IndexOf(titleFriendly + "\\");
            string fileDialogCopy = LoadFileDialog.FileName;

            fileDialogCopy = fileDialogCopy.Substring(indexOfPath);
            int indexOfName = fileDialogCopy.IndexOf("\\");


            //
            indexOfName += indexOfPath + 1;
            string loadedFile = LoadFileDialog.FileName.Substring(indexOfName);

            loadedFile = loadedFile.Substring(0, loadedFile.Length - 4);

            SaveFileNameBox.Text = loadedFile;
        }