public void FlowProblem1_AsFlowDocument_WithRegistry() { RapidFindReplaceControlViewModel finder = new RapidFindReplaceControlViewModel(); bool hit = false; FlowDocument content = LoadFlowDocument("FlowDocument1.xaml"); finder.FindTextIn(FindHandlerRegistry.CreateIRunReaderHandlerFor(content), delegate(Run run, int index, int length) { hit = true; }, new Query("urna jimmy")); Assert.IsTrue(hit); }
public void FlowProblem_Jimmy_SecondColumn_no2() { RapidFindReplaceControlViewModel finder = new RapidFindReplaceControlViewModel(); FlowDocument content = LoadFlowDocument("FlowDocument4.xaml"); int hitCount = 0; finder.FindTextIn(new FlowDocumentRunReader(content), delegate(Run run, int index, int length) { hitCount++; }, new Query("jimmy")); Assert.AreEqual(2, hitCount); }
public void Flow_3() { RapidFindReplaceControlViewModel finder = new RapidFindReplaceControlViewModel(); // finder.FindOptions.IgnoreWhitespaceCharacters = true; bool hit = false; FlowDocument content = LoadFlowDocument("FlowDocument3.xaml"); finder.FindTextIn(FindHandlerRegistry.CreateIRunReaderHandlerFor(content), delegate(Run run, int index, int length) { hit = true; }, new Query("a b c")); Assert.IsTrue(hit); }
public void FlowProblem1() { RapidFindReplaceControlViewModel finder = new RapidFindReplaceControlViewModel(); bool hit = false; FlowDocument content = LoadFlowDocument("FlowDocument1.xaml"); System.Collections.Generic.List <Run> runs = new System.Collections.Generic.List <Run>(5); FindRuns(content.Blocks, runs); finder.FindTextIn(runs, delegate(Run run, int index, int length) { hit = true; }, new Query("urna jimmy")); Assert.IsTrue(hit); }