コード例 #1
0
        private void ParseLineExtended(string allText)
        {
            if (string.IsNullOrEmpty(allText))
            {
                return;
            }
            int startIndex = this.MAX_STR_LENGTH;

            if (startIndex >= allText.Length)
            {
                startIndex = allText.Length - 1;
            }
            int num1 = allText.IndexOf(".", startIndex);

            if (num1 >= 0 && num1 - startIndex < 200)
            {
                startIndex = num1;
            }
            else
            {
                int num2 = allText.IndexOf(' ', startIndex);
                if (num2 >= 0 && num2 - startIndex < 100)
                {
                    startIndex = num2;
                }
            }
            while (startIndex + 1 < allText.Length && (int)allText[startIndex + 1] == 32)
            {
                ++startIndex;
            }
            string      str       = allText.Substring(0, startIndex + 1);
            RichTextBox textBlock = this.GetTextBlock();

            BrowserNavigationService.SetText((DependencyObject)textBlock, str);
            this.stackPanel.Children.Add((UIElement)textBlock);
            allText = allText.Substring(startIndex + 1);
            if (allText.Length <= 0)
            {
                return;
            }
            this.ParseLineExtended(allText);
        }
コード例 #2
0
 private void ParseText(string value)
 {
     if (value == null)
     {
         value = "";
     }
     if (this.stackPanel == null)
     {
         return;
     }
     ((PresentationFrameworkCollection <UIElement>)((Panel)this.stackPanel).Children).Clear();
     if (this.CheckFitInMaxRenderHeight(value))
     {
         RichTextBox textBlock = this.GetTextBlock();
         BrowserNavigationService.SetText((DependencyObject)textBlock, value);
         this.stackPanel.Children.Add((UIElement)textBlock);
     }
     else
     {
         this.ParseLineExtended(value);
     }
 }