Пример #1
0
        //
        // Constructors and destructor
        //

        public MainFrame()
        {
            InitializeComponent();
            Icon = Properties.Resources.icon_main;

            findDlg = new FindDialog();

            Application.Idle += new EventHandler(OnIdle);

            // Speedup DataGreedView

            if (!SystemInformation.TerminalServerSession)
            {
                Type         dgvType = dataGrid.GetType();
                PropertyInfo pi      = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
                pi.SetValue(dataGrid, true, null);
            }
        }
Пример #2
0
        private void lvTranslations_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F2)
            {
                OnEditEntry(sender, e);
                return;
            }

            if (e.KeyCode == Keys.F3)
            {
                if (doneSearching)
                {
                    if (MessageBox.Show("Do you want to re-start search from the beginning ?", "Question", MessageBoxButtons.YesNo,
                                        MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        doneSearching = false;
                        _lastIndex    = 0;
                    }
                }
                else
                {
                    _lastIndex++;
                }

                FindNextItem();
                return;
            }

            if (e.Modifiers == Keys.Control)
            {
                if (e.KeyCode == Keys.F)
                {
                    FindDialog dlg = new FindDialog();
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        _find      = dlg.TextToFind.ToLowerInvariant();
                        _lastIndex = 0;

                        FindNextItem();
                    }
                }
                else if (e.KeyCode == Keys.M)
                {
                    string[] files =
                        Directory.EnumerateFiles(_lookupPath, TranslationFile.TranslationFileEnglishName, SearchOption.AllDirectories).ToArray();

                    CopyAndMoveDialog dlg = new CopyAndMoveDialog(files);
                    dlg.ShowDialog();
                }
            }

            if (e.Modifiers == (Keys.Control | Keys.Shift))
            {
                if (e.KeyCode == Keys.V)
                {
                    string[] files =
                        Directory.EnumerateFiles(_lookupPath, TranslationFile.TranslationFileEnglishName, SearchOption.AllDirectories).ToArray();

                    ResourceValidationDialog dlg = new ResourceValidationDialog(files);
                    dlg.Show();
                }
            }
        }