示例#1
0
        private string CreateIndentForNextLine(ISpanned dest, int dend, int istart)
        {
            if (istart > -1)
            {
                int iend;

                for (iend = ++istart;
                     iend < dend;
                     ++iend)
                {
                    char c = dest.CharAt(iend);

                    if (c != ' ' &&
                        c != '\t')
                    {
                        break;
                    }
                }
                var subsequence = dest.SubSequence(istart, iend);
                return(subsequence + AddBulletPointIfNeeded(dest.CharAt(iend)));
            }
            else
            {
                return("");
            }
        }
示例#2
0
        public ICharSequence FilterFormatted(ICharSequence source, int start, int end, ISpanned dest, int dstart,
                                             int dend)
        {
            var textToCheck = dest.SubSequence(0, dstart) + source.SubSequence(start, end) +
                              dest.SubSequence(dend, dest.Length());

            var matcher = pattern.Matcher(textToCheck);

            // Entered text does not match the pattern
            if (!matcher.Matches())
            {
                // It does not match partially too
                if (!matcher.HitEnd())
                {
                    return(null);
                }
            }

            return(null);
        }