コード例 #1
0
        // Token: 0x060039B6 RID: 14774 RVA: 0x00105D68 File Offset: 0x00103F68
        private static int FindMatchIndexFromFindContent(string textString, string findPattern, CultureInfo cultureInfo, bool matchCase, bool matchWholeWord, bool matchLast, bool matchDiacritics, bool matchKashida, bool matchAlefHamza, bool hasPreceedingSeparatorChar, bool hasFollowingSeparatorChar, out int matchLength)
        {
            bool flag;
            bool flag2;

            TextFindEngine.InitializeBidiFlags(findPattern, out flag, out flag2);
            CompareInfo compareInfo = cultureInfo.CompareInfo;
            int         result;

            if (!matchDiacritics && flag)
            {
                result = TextFindEngine.BidiIgnoreDiacriticsMatchIndexCalculation(textString, findPattern, matchKashida, matchAlefHamza, matchWholeWord, matchLast, !matchCase, compareInfo, hasPreceedingSeparatorChar, hasFollowingSeparatorChar, out matchLength);
            }
            else
            {
                result = TextFindEngine.StandardMatchIndexCalculation(textString, findPattern, matchWholeWord, matchLast, !matchCase, compareInfo, hasPreceedingSeparatorChar, hasFollowingSeparatorChar, out matchLength);
            }
            return(result);
        }
コード例 #2
0
        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: 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);
        }