コード例 #1
0
ファイル: RegexTest.cs プロジェクト: zx648383079/WPF-Regex
    public void TestRender()
    {
        var regex = new RegexAnalyze("aa1222", @"\d");

        regex.Match();
        var content = regex.Compiler("{for} {" +
                                     "   '{}'," +
                                     "} {end}");

        Assert.IsTrue(content.IndexOf("1") > 0);
    }
コード例 #2
0
        private void MatchList_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(ReplaceTb.Text) || _regex == null)
            {
                return;
            }
            var template = ReplaceTb.Text;
            var dialog   = new ResultDialog
            {
                Result = _regex.Compiler(template)
            };

            _ = dialog.ShowAsync();
        }
コード例 #3
0
        private void Listbox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (_lists.Count < 1)
            {
                return;
            }
            var content = ReplaceTb.Text;

            Task.Factory.StartNew(() =>
            {
                content = _regex.Compiler(content);
                Dispatcher.Invoke(() =>
                {
                    var page = new ResultView {
                        Content = content
                    };
                    page.Show();
                });
            });
        }