private void ComboFontSize_SelectedIndexChanged(object sender, EventArgs e)
        {
            if ((comboFontSize.SelectedValue as String) == null)
            {
                return;
            }

            int intLengthSearch = (int)(txtBookText.Text.Count() / 10);
            int intStartSearch  = (int)(txtBookText.Text.Count() / 2) - (int)(intLengthSearch / 2);

            string strForSearchText =
                txtBookText.Text.Substring(intStartSearch, intLengthSearch);

            //////////////////////////

            FontSize         = float.Parse(comboFontSize.SelectedValue.ToString());
            txtBookText.Font = new System.Drawing.Font(FontFamily, FontSize, FontStyle);
            AnalyseText(BookAllText, (int)FontSize);
            txtPageCount.Text = BookPages.Count().ToString();
            /////////////////////////

            int intPageNumberSearchInNewPages =
                BookPages.FindIndex(Current => Current.Contains(strForSearchText));

            CurrentPageNumber = intPageNumberSearchInNewPages + 1;
            txtGotoPage.Text  = CurrentPageNumber.ToString();
            txtBookText.Text  = BookPages[CurrentPageNumber - 1].ToString();
        }
예제 #2
0
 public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
 {
     if (postCollection[postDataKey] != CurrentPageNumber.ToString())
     {
         m_NewPageNumber = Convert.ToInt32(postCollection[postDataKey]);
         return(true);
     }
     return(false);
 }
 private void BtnLastPage_Click(object sender, EventArgs e)
 {
     if (CurrentPageNumber > 1)
     {
         CurrentPageNumber--;
         txtBookText.Text = BookPages[CurrentPageNumber - 1].ToString();
         txtGotoPage.Text = CurrentPageNumber.ToString();
     }
 }
 private void BtnNextPage_Click(object sender, EventArgs e)
 {
     if (CurrentPageNumber < BookPages.Count())
     {
         CurrentPageNumber++;
         txtBookText.Text = BookPages[CurrentPageNumber - 1].ToString();
         txtGotoPage.Text = CurrentPageNumber.ToString();
     }
 }
예제 #5
0
 private void UpdatePageNumberDisplay()
 {
     if (pageNumberText != null)
     {
         pageNumberText.text = CurrentPageNumber.ToString();
     }
     if (pageCountText != null)
     {
         pageCountText.text = CurrentPageCount.ToString();
     }
     if (resultCountText != null)
     {
         resultCountText.text = UIUtilities.ValueToDisplayString(currentPage.resultTotal);
     }
 }
 private void LoadedHandler(object sender, RoutedEventArgs e)
 {
     PageNumberText = CurrentPageNumber.ToString();
     pageNumberTextBox.FocusAndSelectAll();
 }