Exemplo n.º 1
0
        private static int CountOccurrances(SrmDocument doc, FindOptions findOptions,
                                            DisplaySettings displaySettings)
        {
            var results = doc.SearchDocument(new Bookmark(IdentityPath.ROOT),
                                             findOptions, displaySettings);

            if (results == null)
            {
                return(0);
            }

            FindResult resultsNext = results;

            int i = 0;

            do
            {
                resultsNext = doc.SearchDocument(resultsNext.Bookmark, findOptions,
                                                 displaySettings);
                i++;
            }while (!Equals(resultsNext.Bookmark, results.Bookmark));
            return(i);
        }
Exemplo n.º 2
0
        private static int CountOccurrances(SrmDocument doc, FindOptions findOptions,
            DisplaySettings displaySettings)
        {
            var results = doc.SearchDocument(new Bookmark(IdentityPath.ROOT),
                findOptions, displaySettings);
            if (results == null)
                return 0;

            FindResult resultsNext = results;

            int i = 0;
            do
            {
                resultsNext = doc.SearchDocument(resultsNext.Bookmark, findOptions,
                    displaySettings);
                i++;
            }
            while (!Equals(resultsNext.Bookmark, results.Bookmark));
            return i;
        }