Ejemplo n.º 1
0
 void Common_ChangedLanguageDirection(object sender, EventArgs e)
 {
     this.LangDirection = CurrentLangInfo.LanguageDirection;
     UpdateFormCaption();
     DictCollection.CheckDictionariesForLanguage(this.LangDirection, toolStripDictionary.Items);
     // TODO: Search
 }
Ejemplo n.º 2
0
        private void btSearch_Click(object sender, EventArgs e)
        {
            ToolStripButton lastDictionary = null;

            foreach (ToolStripItem item in toolStripDictionary.Items)
            {
                if ((item is ToolStripButton) && ((ToolStripButton)item).Checked)
                {
                    lastDictionary = (ToolStripButton)item;
                }
            }

            if (lastDictionary != null)
            {
                DictCollection.miDict_Click(lastDictionary, EventArgs.Empty);
            }
            else
            // using (WaitCursor wc = new WaitCursor())
            {
                string[] langPairs = LangPair.Split(CurrentLangInfo.PairSeparator);
                new Gator.GatorStarter(this.Word, langPairs[0], langPairs[1], waitingUIObject);
                //                bool f = (new Gator()).ShowArticles(this.Word, langPairs[0], langPairs[1], this);
                RegisterEvent();
            }
        }
Ejemplo n.º 3
0
 void Common_ChangedLanguageDirection(object sender, EventArgs e)
 {
     DictCollection.CheckDictionariesForLanguage(CurrentLangInfo.LanguageDirection, this.btOpenIn.DropDownItems);
     if (lastDictionary != null)
     {
         btOpenInLast.Enabled = this.IsWordAavailable && ((RunDictContent)lastDictionary.Tag).Providers[0].IsSupport(CurrentLangInfo.LanguageDirection);
     }
 }
Ejemplo n.º 4
0
 public void OpenInLast()
 {
     if (lastDictionary != null)
     {
         using (new WaitCursor())
             DictCollection.Dict_Click(lastDictionary, EventArgs.Empty);
     }
 }
Ejemplo n.º 5
0
 public void InitDictionaries(ITextWithSelection text)
 {
     DictCollection.InitMenuForProviders(this.btOpenIn.DropDownItems, text, null);
     foreach (ToolStripItem item in this.btOpenIn.DropDownItems)
     {
         item.Click += new EventHandler(item_Click);
     }
 }
Ejemplo n.º 6
0
 private void InitPanelWithDictionaries()
 {
     DictCollection.InitMenuForProviders(toolStripDictionary.Items, this, webBrowser1);
     foreach (ToolStripItem item in toolStripDictionary.Items)
     {
         if (item is ToolStripItem)
         {
             item.Click += new EventHandler(item_Click);
         }
     }
 }
Ejemplo n.º 7
0
 private void FillDictionaries()
 {
     DictCollection.InitMenuForProviders(toolStripDictionary.Items, this, webBrowser1);
     foreach (ToolStripItem item in toolStripDictionary.Items)
     {
         if (item is ToolStripButton)
         {
             item.Click += new EventHandler(item_Click);
         }
         // item.c = true;
     }
 }
Ejemplo n.º 8
0
        //private void btSearch_Click(object sender, EventArgs e)
        //{
        //  DoSearching();
        //}

        private void DoSearching()
        {
            ToolStripItem lastDictionary = this.LastUsedDict;

            if (lastDictionary != null)
            {
                //this.pictureBoxWating.Visible = true;
                //MethodDelegate md = new MethodDelegate(DictCollection.Dict_Click);
                //this.BeginInvoke(md, lastDictionary, EventArgs.Empty);
                DictCollection.Dict_Click(lastDictionary, EventArgs.Empty);
            }
            else
            {
                // DictCollection.Dict_Click(lastDictionary, EventArgs.Empty);


                string[] langPairs = LangDirection.Split(CurrentLangInfo.PairSeparator);
                WaitingUIObjectWithFinish waitingUIObject = new WaitingUIObjectWithFinish(this, this.pictureBoxWating, null);
                new Gator.GatorStarter(this.Word, langPairs[0], langPairs[1], waitingUIObject);
                //                bool f = (new Gator()).ShowArticles(this.Word, langPairs[0], langPairs[1], this);
            }
            OnAfterSearchClick();
        }