Exemplo n.º 1
0
        private void RefreshSearchList()
        {
            if (txtBibSearch.Text == "")
            {
                return;
            }

            pnlSearchSelection.BringToFront();
            lbSearchVerses.SuspendLayout();
            lbSearchVerses.Items.Clear();
            lock (lResults)
            {
                #if !DEMO
                // Get search terms
                List <string> searchTerms = SearchHelper.BreakSearchTerms(txtBibSearch.Text); // Caller is responsible to make sure that search terms have not changed

                // Sort the results
                BibleVerseComparer bvc = new BibleVerseComparer();
                if (rRelevent.Checked && searchTerms.Count > 1)
                {
                    // Sort the verses based on score
                    BibleSearchHelper.ScoreResults(lResults, searchTerms);
                    SearchRelevancyComparer comp = new SearchRelevancyComparer();
                    lResults.Sort(comp);
                }
                else
                {
                    lResults.Sort(bvc);
                }

                // Double filter the results
                List <BibleSearchResult> lDoubleFilter = new List <BibleSearchResult>();
                foreach (BibleSearchResult r in lResults)
                {
                    foreach (BookData bd in lbBibleBook.Items) // Check book
                    {
                        if (bd.mappingName == r.bibVerse.RefBook)
                        {
                            lDoubleFilter.Add(r);
                            break;
                        }
                    }
                }

                // Add to the list
                foreach (BibleSearchResult r in lDoubleFilter)
                {
                    lbSearchVerses.Items.Add(r);
                }

                // Turn off the tumbler
                pnlInitTumbler.Visible = false;

                // Set visible items based on search result count
                pbNoItems.Visible = llNoResults.Visible = lDoubleFilter.Count == 0;
                lblSort.Visible   = rNoSort.Visible = rRelevent.Visible = lbSearchVerses.Visible = !pbNoItems.Visible;

                lblTitleSearchResults.Text = Loc.Get("Search results:") + " (" + lDoubleFilter.Count + ")";
                #endif
            }
            lbSearchVerses.ResumeLayout();
        }
Exemplo n.º 2
0
 private void imgBtn_MouseEnter(object sender, EventArgs e)
 {
     lblInfo.Text = Loc.Get(((Control)sender).Tag.ToString());
 }
Exemplo n.º 3
0
        private void btnClose_Click(object sender, EventArgs e)
        {
            if (proj.dirty && MessageBox.Show(this, Loc.Get("Project not saved. Save now?"), Loc.Get("Warning"), MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                btnSave_Click(null, null);
            }

            proj.CloseProject();
        }
Exemplo n.º 4
0
 private void UpdateInfoLabel()
 {
     lblInfo.Text = Loc.Get("Preview:");
 }