示例#1
0
 void Common_ChangedLanguageDirection(object sender, EventArgs e)
 {
     this.LangDirection = CurrentLangInfo.LanguageDirection;
     UpdateFormCaption();
     DictCollection.CheckDictionariesForLanguage(this.LangDirection, toolStripDictionary.Items);
     // TODO: Search
 }
        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();
            }
        }
示例#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);
     }
 }
示例#4
0
 public void OpenInLast()
 {
     if (lastDictionary != null)
     {
         using (new WaitCursor())
             DictCollection.Dict_Click(lastDictionary, EventArgs.Empty);
     }
 }
示例#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);
     }
 }
示例#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);
         }
     }
 }
 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;
     }
 }
示例#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();
        }