Ejemplo n.º 1
0
        private async void LoadArticleContent(LoadedArticle item)
        {
            grLoading.Visibility = Visibility.Visible;
            grMain.IsEnabled     = false;

            SelectedArticle = item;
            SetDirection(Trend.Unknown);
            SetWeight(int.MinValue);
            rtbArticleContent.Document = RichTextBoxHelper.LoadText(item.Content);
            var needFindMatch = cbCheckAutomatically.IsChecked.HasValue && cbCheckAutomatically.IsChecked.Value;

            Pattern pattern = null;

            if (needFindMatch)
            {
                ctrAnimation.AnimationText = "Searching for patterns ...";
                await Task.Run(() =>
                {
                    pattern = FindMatch();
                });
            }

            if (pattern != null)
            {
                HighlightMatch(pattern.Regex, pattern.Trend);
                tbRegexPattern.Text = pattern.RawRegexText;
                SetDirection(pattern.Trend);
                SetWeight(pattern.Weight);
            }

            if (cbFindMarket.IsChecked.Value)
            {
                HighlightMatch(new Regex(BeforeOpeningPatternsKeeper.Market), Colors.Blue, true);
            }

            if (cbFindExpect.IsChecked.Value)
            {
                HighlightMatch(new Regex(BeforeOpeningPatternsKeeper.Expect), Colors.DarkOrange, true);
            }

            grLoading.Visibility = Visibility.Hidden;
            grMain.IsEnabled     = true;
        }
Ejemplo n.º 2
0
 private void ResetArticleContent()
 {
     rtbArticleContent.Document = RichTextBoxHelper.LoadText(String.Empty);
 }