Example #1
0
        private void GetFileName(string filter, TextBox box)
        {
            string fileName = FileManager.FindPathAndReturnFullFileName(box.Text);

            this.openFileDialog1.InitialDirectory = GetFolderForFileSelection(box.Text);

            this.openFileDialog1.FileName = box.Text;
            this.openFileDialog1.Filter   = filter;
            if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                box.Text = this.openFileDialog1.FileName;
                this.toolTip1.SetToolTip(box, box.Text);
            }
        }
Example #2
0
        public static void OpenInDictionaryBlend(string word)
        {
            if (string.IsNullOrEmpty(word))
            {
                return;
            }

            string fileName = FileManager.FindPathAndReturnFullFileName("dictionaryblend.exe");

            if (File.Exists(fileName))
            {
                ProcessStartInfo info = new ProcessStartInfo(fileName, word);
                Process.Start(info);
            }
        }
        public static void RunLessson(string lessonFileName)
        {
            string fileName = FileManager.FindPathAndReturnFullFileName("Easy4LearnTutor.exe");

            if (File.Exists(fileName))
            {
                ProcessStartInfo info = new ProcessStartInfo(fileName, "\"" + lessonFileName + "\"");

                // убираем негативный момент при запуске своих приложений
                // using(new AbandonTopPosition(VideoForm.CurrentForm)) {
                if (VideoForm.CurrentForm != null &&
                    !VideoForm.CurrentForm.IsDisposed &&
                    !VideoForm.CurrentForm.Disposing &&
                    VideoForm.CurrentForm.TopMost)
                {
                    VideoForm.CurrentForm.TopMost = false;
                }
                Process.Start(info);
            }
            else
            {
                MessageBox.Show("The program 'Easy-Learn' was not found", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }