Ejemplo n.º 1
0
 public LanguageMenuItem(LanguageFilesFolder languageFilesFolder)
 {
     Language = CommonHelper.GetLanguageFromFolder(languageFilesFolder.Folder);
     MessagesFiles = languageFilesFolder.MessagesFiles;
     ResourcesFiles = languageFilesFolder.ResourcesFiles;
     Size = new System.Drawing.Size(165, 22);
     CheckOnClick = true;
     Text = CommonHelper.GetLanguageFromFolder(languageFilesFolder.Folder);
     LanguageId = CommonHelper.GetLanguageIdFromFolder(languageFilesFolder.Folder);
 }
Ejemplo n.º 2
0
 private void FindFiles(string initialPath)
 {
     var dirs = Directory.GetDirectories(initialPath, "Res.*");
     foreach (var dir in dirs)
     {
         var files = new LanguageFilesFolder(dir);
         files.MessagesFiles.AddRange(Directory.GetFiles(dir, "*.msg"));
         files.ResourcesFiles.AddRange(Directory.GetFiles(dir, "*.rc"));
         LangFiles.Add(files);
     }
 }
Ejemplo n.º 3
0
        private void LoadFile(object sender, EventArgs e)
        {
            var openFileDialog = new OpenFileDialog
            {
                Filter = "Messages files|*.msg|Resources files|*.rc",
                Title = "Выберите файл..."
            };

            if (openFileDialog.ShowDialog() != DialogResult.OK) return;
            if (_workingDataSet.Tables.Count == 0)
            {
                _workingDataSet = new MessagesDataSet();
                _workingDataSet.LoadInitialData(openFileDialog.FileName);
                messagesGridView.DataSource = _workingDataSet;
                messagesGridView.DataMember = "Messages";
            }
            else
            {
                var result = _workingDataSet.MegreData(openFileDialog.FileName);
                if (!result)
                {
                    MessageBox.Show("Обнаружены одинаковые колонки!", "Слияние не удалось", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            analyzeDataButton.Enabled = true;
            messagesGridView.AdjustColumnsWidth();
            var tmpLanguageFilesFolder = new LanguageFilesFolder(Path.GetDirectoryName(openFileDialog.FileName));
            tmpLanguageFilesFolder.MessagesFiles.Add(openFileDialog.FileName);
            _languageFilesList.Add(tmpLanguageFilesFolder);
            BuildLanguageMenu();
            foreach (var menuItem in _languageMenu)
            {
                if (messagesGridView.Columns.Contains(menuItem.Language))
                    menuItem.Checked = true;
            }
            if ((_languageMenu.FindIndex(o => !o.Checked)) == -1)
                selectAllLanguagesToolStripMenuItem.Checked = true;
        }