Esempio n. 1
0
        private static void SplitTextBlock(BlockContainer container)
        {
            var block = container.PopBlock();
            var textBlock = block as TextBlock;
            if (textBlock == null)
            {
                container.PushBlock(block);
                return;
            }

            var character = ExtractCharacter(ref textBlock);
            if (textBlock.Text.Any())
            {
                container.PushBlock(textBlock);
            }

            container.PushBlock(new TextBlock(string.Empty + character));
        }
Esempio n. 2
0
 private static GroupBlock ConvertToBlock(BlockContainer container)
 {
     switch (container.Type)
     {
         case BlockContainerType.AndContainer:
             return new AndGroupBlock(container.Blocks.ToArray());
         case BlockContainerType.OrContainer:
             return new OrGroupBlock(container.Blocks.ToArray());
         default:
             return null;
     }
 }