Пример #1
0
        public TutorList()
        {
            InitializeComponent();

            this.openFileDialog.Filter = GlobalOptions.GetFileFilterForLesson(true);

            //   this.ReadOnly =
            this.toolStripSeparator1.Visible         =
                this.toolStripSeparator3.Visible     =
                    this.toolStripSeparator2.Visible =

                        this.btEstimate.Visible =
                            this.btFind.Visible =
                                this.toolStripMenuItem4.Visible =

                                    this.miPasteText.Visible =
                                        this.btOpen.Visible  = //  here file with extension .lesson will be opened how lesson to subtitles
                                                               this.btVideo.Visible =
                                            this.btTranslate.Visible =

                                                this.miHowtoAdd.Visible       =
                                                    this.miPaste.Visible      =
                                                        this.btLesson.Visible = false;

            this.btText.Text  = "Lesson File";
            this.btText.Image = null;

            this.btText.Visible          = true;
            this.menuForList.Visible     = false;
            this.btText.DropDownOpening += new EventHandler(btText_DropDownOpening);
            AddExtensions();
            this.Load += new EventHandler(TutorList_Load);
        }
Пример #2
0
        bool SaveAsLesson()
        {
            this.saveFileDialog.FileName         = this.LessonFileName;
            this.openFileDialog.InitialDirectory = FileSelector.GetFolderForFileSelection(this.FileName);

            using (new AbandonTopPosition(VideoForm.CurrentForm))
            {
                using (new FilterFileDialog(this.saveFileDialog))
                {
                    this.saveFileDialog.Filter = GlobalOptions.GetFileFilterForLesson(true);
                    DialogResult dr = this.saveFileDialog.ShowDialog();
                    if (dr == DialogResult.OK)
                    {
                        if (!this.IsHaveLesson)
                        {
                            MessageBox.Show("You not have words for lessons. To add words, double-click on a word.");
                            return(true);
                        }
                        // TODO: здесь урок переоткроется (пока так)
                        this.LessonFileName = SaveLessonFile(this.saveFileDialog.FileName);
                    }
                    else if (dr == DialogResult.Cancel)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
Пример #3
0
 private void OpenLessonUI()
 {
     this.openFileDialog.InitialDirectory = FileSelector.GetFolderForFileSelection(this.FileName);
     using (new FilterFileDialog(this.openFileDialog))
     {
         this.openFileDialog.Filter = GlobalOptions.GetFileFilterForLesson(true);
         using (new AbandonTopPosition(VideoForm.CurrentForm))
         {
             if (openFileDialog.ShowDialog() == DialogResult.OK)
             {
                 this.LessonFileName = this.openFileDialog.FileName;
             }
         }
     }
 }
Пример #4
0
 // common open for all allFiles
 internal override void OpenFileUI()
 {
     this.openFileDialog.InitialDirectory = FileSelector.GetFolderForFileSelection(this.FileName);
     using (new AbandonTopPosition(VideoForm.CurrentForm))
     {
         using (new FilterFileDialog(this.openFileDialog))
         {
             this.openFileDialog.Filter  = GlobalOptions.GetFileFilterForVideo(false);
             this.openFileDialog.Filter += "|" + GlobalOptions.GetFileFilterForSubtitles(false);
             this.openFileDialog.Filter += "|" + GlobalOptions.GetFileFilterForLesson(false);
             this.openFileDialog.Filter += "|" + GlobalOptions.GetFileFilterForText(false);
             this.openFileDialog.Filter += GlobalOptions.Allfiles;
             if (openFileDialog.ShowDialog() == DialogResult.OK)
             {
                 CheckAndAssignFileNameFormUI(openFileDialog.FileName);
             }
         }
     }
 }
Пример #5
0
        public SentenceList()
        {
            InitializeComponent();

            //this.BackColor = CF.ExternalBorder;

            //this.miSynchronizeWithVideo.ShortcutKeys = System.Windows.Forms.Keys.F11; // End;
            //this.miRepeatVideo.ShortcutKeys = System.Windows.Forms.Keys.F12; // Home;

            this.saveLessonFileDialog.Filter = GlobalOptions.GetFileFilterForLesson(true);

            this.Load += new EventHandler(SentenceList_Load);

            this.btFilter.Click += new System.EventHandler(this.btFilter_Click);
            this.miGoToTranslatebyPromt.Click += new System.EventHandler(this.miGoToTranslateByGoogle_Click);

            #region Images
            //zoomInToolStripMenuItem.Image = f.button_images.zoom_in.ToBitmap();
            //zoomOutToolStripMenuItem.Image = f.button_images.zoom_out.ToBitmap();
            this.miPaste.Image = f.button_images.paste;

            this.miGoToTranslateByGoogle.Image    = this.miTranslateByGoogle.Image;
            this.miGoToTranslateByMicrosoft.Image = this.miTranslateByMicrosoft.Image;
            this.miGoToTranslateByYahoo.Image     = this.miTranslateByYahoo.Image;

            //this.btEstimate.Image = global::f.button_images.estimate;
            //this.btFind.Image = global::f.button_images.find;
            // this.btSearchSubtitles.Image = global::f.button_images.find;

            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SentenceList));
            this.miOpenLesson.Image = ((System.Drawing.Image)(resources.GetObject("btOpen.Image")));
            this.miOpenText.Image   = ((System.Drawing.Image)(resources.GetObject("btOpen.Image")));
            this.miOpenVideo.Image  = ((System.Drawing.Image)(resources.GetObject("btOpen.Image")));

            this.saveToolStripMenuItem.Image = // miSaveText
                                               this.miSaveLesson.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));

            this.miCloseText.Image      =
                this.miCloseVideo.Image = global::f.button_images.Close;
            // this.miCloseLesson.Image = global::f.button_images.Close; чтобы не отвлекал внимание
            #endregion

            #region events
            // -------- text
            this.miPaste.Click     += new System.EventHandler(this.miPaste_Click);
            this.miOpenText.Click  += new EventHandler(miOpenText_Click);
            this.miCloseText.Click += new System.EventHandler(this.miCloseText_Click);

            this.nextSentenceToolStripMenuItem.Click     += new System.EventHandler(this.nextSentenceToolStripMenuItem_Click);
            this.previousSentenceToolStripMenuItem.Click += new System.EventHandler(this.previousSentenceToolStripMenuItem_Click);

            this.zoomInToolStripMenuItem.Click  += new System.EventHandler(this.zoomInToolStripMenuItem_Click);
            this.zoomOutToolStripMenuItem.Click += new System.EventHandler(this.zoomOutToolStripMenuItem_Click);
            this.miPasteText.Click += new EventHandler(miPasteText_Click);

            this.btText.DropDownOpening += new System.EventHandler(this.moreMenuButton_Click);
            #endregion

            this.openFileDialog.InitialDirectory = FileSelector.GetFolderForFileSelection("");
            this.panelTopIndent.Visible          = false;
        }
Пример #6
0
 protected override void AssignFilterForTextFile()
 {
     this.openFileDialog.Filter = GlobalOptions.GetFileFilterForLesson(true);
 }