Using Visual Studio 2010 .net 4 and WPF
I have collection of names of paragraphs named as FavoriteBookmarksCollection drawn from a flowdocument named as BeforeSortDocument .
For each item in FavoriteBookmarkCollection, the item will be modified to represent a paragraph name of "S" language to get the paragraph from the flowdocument and also the same item will be again modified to represent English Language which is a translation of the other language.
First selection of paragraph is "S" language and followed by "E" language. I have to select both the paragraphs from BeforeSortDocument into another document using linq query.
My not working query in VB.net is:
dim RequiredParaCollection = (From para in ParasOfBeforeSortDocument
where (Regex.IsMatch(para.name,"B\d{4}S\d{2}") Or regex.ismatch(para.name,"B\d{4}E\d{2}")
Select ctype(LogicalTreeHelper.FindLogicalNode(BeforeSortDocument,para.name)).ToList()
ParasOfBeforeSortDocument is a readonlyCollection(of Paragraph) and is OK.
BeforeSortDocument is flowdocument and is without any error.
I request help from YOU to write two conditions in 'Where' one follows another and get the paragraphs of the document in that order.
Thanx