private static String _GetPageString(FixedDocument doc, int translatedPageNo, bool replaceAlefWithAlefHamza)
        {
            String pageString = null;

            Debug.Assert(doc != null);
            Debug.Assert(translatedPageNo >= 0 && translatedPageNo < doc.PageCount);

            PageContent pageContent = doc.Pages[translatedPageNo];
            Stream      pageStream  = pageContent.GetPageStream();
            bool        reverseRTL  = true;

            if (doc.HasExplicitStructure)
            {
                reverseRTL = false;
            }
            if (pageStream != null)
            {
                pageString = _ConstructPageString(pageStream, reverseRTL);

                if (replaceAlefWithAlefHamza)
                {
                    // Replace the alef-hamza with the alef.
                    pageString = TextFindEngine.ReplaceAlefHamzaWithAlef(pageString);
                }
            }
            return(pageString);
        }
        private static CompareOptions _InitializeSearch(CultureInfo cultureInfo,
                                                        bool matchCase,
                                                        bool matchAlefHamza,
                                                        bool matchDiacritics,
                                                        ref string findPattern,
                                                        out bool replaceAlefWithAlefHamza)
        {
            CompareOptions compareOptions = CompareOptions.None;

            replaceAlefWithAlefHamza = false;

            if (!matchCase)
            {
                compareOptions |= CompareOptions.IgnoreCase;
            }

            bool stringContainedBidiCharacter;
            bool stringContainedAlefCharacter;

            // Initialize Bidi flags whether the string contains the bidi characters
            // or alef character.
            TextFindEngine.InitializeBidiFlags(
                findPattern,
                out stringContainedBidiCharacter,
                out stringContainedAlefCharacter);

            if (stringContainedAlefCharacter && !matchAlefHamza)
            {
                // Replace the alef-hamza with the alef.
                findPattern = TextFindEngine.ReplaceAlefHamzaWithAlef(findPattern);
                replaceAlefWithAlefHamza = true;
            }

            // Ignore Bidi diacritics that use for only Bidi language.
            if (!matchDiacritics && stringContainedBidiCharacter)
            {
                // Ignore Bidi diacritics with checking non-space character.
                compareOptions |= CompareOptions.IgnoreNonSpace;
            }
            return(compareOptions);
        }
예제 #3
0
        // Token: 0x06002E75 RID: 11893 RVA: 0x000D2854 File Offset: 0x000D0A54
        private static string _GetPageString(FixedDocument doc, int translatedPageNo, bool replaceAlefWithAlefHamza)
        {
            string      text        = null;
            PageContent pageContent = doc.Pages[translatedPageNo];
            Stream      pageStream  = pageContent.GetPageStream();
            bool        reverseRTL  = true;

            if (doc.HasExplicitStructure)
            {
                reverseRTL = false;
            }
            if (pageStream != null)
            {
                text = FixedFindEngine._ConstructPageString(pageStream, reverseRTL);
                if (replaceAlefWithAlefHamza)
                {
                    text = TextFindEngine.ReplaceAlefHamzaWithAlef(text);
                }
            }
            return(text);
        }
예제 #4
0
        // Token: 0x06002E73 RID: 11891 RVA: 0x000D272C File Offset: 0x000D092C
        private static CompareOptions _InitializeSearch(CultureInfo cultureInfo, bool matchCase, bool matchAlefHamza, bool matchDiacritics, ref string findPattern, out bool replaceAlefWithAlefHamza)
        {
            CompareOptions compareOptions = CompareOptions.None;

            replaceAlefWithAlefHamza = false;
            if (!matchCase)
            {
                compareOptions |= CompareOptions.IgnoreCase;
            }
            bool flag;
            bool flag2;

            TextFindEngine.InitializeBidiFlags(findPattern, out flag, out flag2);
            if (flag2 && !matchAlefHamza)
            {
                findPattern = TextFindEngine.ReplaceAlefHamzaWithAlef(findPattern);
                replaceAlefWithAlefHamza = true;
            }
            if (!matchDiacritics && flag)
            {
                compareOptions |= CompareOptions.IgnoreNonSpace;
            }
            return(compareOptions);
        }