public void ParagraphUnitStart(IParagraphUnitProperties properties)
        {
            if (_processingMode != Mode.None)
            {
                _buffer.Hold();
            }

            _buffer.ParagraphUnitStart(properties);
        }
        private static IParagraphUnit CreateParagraphUnitMock(List <ISegmentPair> segmentPairs,
                                                              IParagraphUnitProperties paragraphUnitPropertiesMock)
        {
            var paragraphUnitMock = A.Fake <IParagraphUnit>();

            A.CallTo(() => paragraphUnitMock.SegmentPairs).Returns(segmentPairs);
            A.CallTo(() => paragraphUnitMock.Properties).Returns(paragraphUnitPropertiesMock);
            return(paragraphUnitMock);
        }
Exemplo n.º 3
0
        public IParagraphUnit CreateParagraphUnit(IParagraphUnitProperties properties)
        {
            var paragraphUnit = ItemFactory.CreateParagraphUnit(properties?.LockType ?? LockTypeFlags.Unlocked);

            if (properties != null)
            {
                paragraphUnit.Properties = properties.Clone() as IParagraphUnitProperties;
            }

            return(paragraphUnit);
        }
Exemplo n.º 4
0
        private string GetContextType(IParagraphUnitProperties paragraphUnitProperties)
        {
            if (paragraphUnitProperties?.Contexts?.Contexts != null)
            {
                foreach (var context in paragraphUnitProperties.Contexts.Contexts)
                {
                    if (context.ContextType == "Recommended" || context.ContextType.StartsWith("Alternative "))
                    {
                        return(context.ContextType);
                    }
                }
            }

            return(null);
        }
 // each paragraph unit should appear in a new line
 // therefore use a DIV element
 public override void ParagraphUnitStart(IParagraphUnitProperties properties)
 {
     _preview.WriteLine("<div>");
     _paragraphUnitId = properties.ParagraphUnitId.Id;
 }