Esempio n. 1
0
        /// <summary>
        /// Enlève un espace entre chaque mot du texte sélectionné. Ne fait rien s'il n'y a
        /// qu'un seul espace.
        /// </summary>
        /// <remarks>
        /// A priori, la config n'est pas utilisée, mais ça permet de réutiliser le même "pattern"
        /// </remarks>
        /// <param name="conf">La <see cref="Config"/> à utiliser.</param>
        public void ShrinkSpace(Config conf)
        {
            logger.ConditionalDebug("ShrinkSpace");
            int countSpace = 0;

            for (int i = txtRange.Length - 1; i >= 0; i--)
            {
                if (txtRange.Text[i] == ' ')
                {
                    countSpace++;
                }
                else
                {
                    if (countSpace > 1)
                    {
                        TextRange space = txtRange.Characters(i + 2, 1);
                        space.Delete();
                    }
                    countSpace = 0;
                }
            }
            if (countSpace > 1)
            {
                TextRange space = txtRange.Characters(0, 1);
                space.Delete();
            }
        }
Esempio n. 2
0
 public override bool Delete()
 {
     return(_bufferRange.Delete());
 }