private static IStartTagProperties CreateStartTagProperties(IPropertiesFactory propertyFactory,
                                                                    IFormattingItemFactory formattingFactory, IFormattingItem formattingItem, int tagId, string colorName)
        {
            var startTagProperties = propertyFactory.CreateStartTagProperties("<cf highlight=" + colorName + ">");

            if (startTagProperties.Formatting == null)
            {
                startTagProperties.Formatting = formattingFactory.CreateFormatting();
            }

            startTagProperties.Formatting.Add(formattingItem);
            startTagProperties.TagId       = new TagId(tagId.ToString());
            startTagProperties.CanHide     = true;
            startTagProperties.DisplayText = "cf";
            startTagProperties.SetMetaData(CadfBackgroundColorKey, "True");
            foreach (var keyPair in GetBackgroundColorMetaData(colorName))
            {
                startTagProperties.SetMetaData(keyPair.Key, keyPair.Value);
            }

            return(startTagProperties);
        }
예제 #2
0
 public SegmentBuilder()
 {
     _factory           = DefaultDocumentItemFactory.CreateInstance();
     _propertiesFactory = DefaultPropertiesFactory.CreateInstance();
     _formattingFactory = _propertiesFactory.FormattingItemFactory;
 }