Exemple #1
0
        ChartObject DoFind()
        {
            string findWhat = CmbFindWhat.Text;

            if (!string.IsNullOrEmpty(findWhat))
            {
                if (LastFindWhat != findWhat)
                {
                    Finder.Reset();
                }
                LastFindWhat = findWhat;

                ChartObject chartObject = ChartPageView.FindNext(Finder, findWhat);
                if (chartObject != null)
                {
                    //MapView.SelectTopic(topic, true);
                    ChartPageView.Select(chartObject);
                    PopFindTextHistory(findWhat);
                    AddHistoryItem(CmbFindWhat, findWhat);

                    return(chartObject);
                }
            }

            return(null);
        }
Exemple #2
0
        bool DoReplace()
        {
            string findWhat    = CmbFindWhat.Text;
            string replaceWith = CmbReplaceWith.Text;

            if (string.IsNullOrEmpty(findWhat))
            {
                return(false);
            }

            if (ChartPageView.SelectedObject != null)
            {
                var    topic   = ChartPageView.SelectedObject;
                string newText = Finder.Replace(topic.Text, findWhat, replaceWith);
                if (topic.Text != newText)
                {
                    ChartPageView.ChangeObjectText(topic, newText);
                }
            }

            // find next
            return(DoFind() != null);
        }