UnsafeSetTextBuffer() 공개 정적인 메소드

public static UnsafeSetTextBuffer ( CssBox box, char textBuffer ) : void
box CssBox
textBuffer char
리턴 void
예제 #1
0
 //---------------------------------------------------------------------------------------
 public static void AddRunList(CssBox toBox,
                               BoxSpec spec,
                               List <CssRun> runlist,
                               char[] buffer,
                               bool isAllWhitespace)
 {
     CssBox.UnsafeSetTextBuffer(toBox, buffer);
     if (runlist != null)
     {
         for (int i = runlist.Count - 1; i >= 0; --i)
         {
             runlist[i].SetOwner(toBox);
         }
     }
     CssBox.UnsafeSetContentRuns(toBox, runlist, isAllWhitespace);
 }
        public static CssBox CreateListItemBox(CssBox parent, HtmlElement childElement)
        {
            var spec   = childElement.Spec;
            var newBox = new CssBoxListItem(spec, parent.RootGfx);

            newBox.SetController(childElement);
            parent.AppendChild(newBox);
            if (spec.ListStyleType != CssListStyleType.None)
            {
                //create sub item collection
                var itemBulletBox = new CssBox(spec.GetAnonVersion(), parent.RootGfx);
                newBox.BulletBox = itemBulletBox;
                CssBox.UnsafeSetParent(itemBulletBox, newBox);
                CssBox.ChangeDisplayType(itemBulletBox, CssDisplay.Inline);
                //---------------------------------------------------------------
                //set content of bullet
                char[] text_content = null;
                switch (spec.ListStyleType)
                {
                case CssListStyleType.Disc:
                {
                    text_content = discItem;
                }
                break;

                case CssListStyleType.Circle:
                {
                    text_content = circleItem;
                }
                break;

                case CssListStyleType.Square:
                {
                    text_content = squareItem;
                }
                break;

                case CssListStyleType.Decimal:
                {
                    text_content = (GetIndexForList(newBox, childElement).ToString(CultureInfo.InvariantCulture) + ".").ToCharArray();
                }
                break;

                case CssListStyleType.DecimalLeadingZero:
                {
                    text_content = (GetIndexForList(newBox, childElement).ToString("00", CultureInfo.InvariantCulture) + ".").ToCharArray();
                }
                break;

                default:
                {
                    text_content = (BulletNumberFormatter.ConvertToAlphaNumber(GetIndexForList(newBox, childElement), spec.ListStyleType) + ".").ToCharArray();
                }
                break;
                }
                //---------------------------------------------------------------
                CssBox.UnsafeSetTextBuffer(itemBulletBox, text_content);
                List <CssRun> runlist = new List <CssRun>();
                bool          hasSomeCharacter;
                splitter.ParseWordContent(text_content, spec, itemBulletBox.IsBlock, runlist, out hasSomeCharacter);
                RunListHelper.AddRunList(itemBulletBox, spec, runlist, text_content, false);
            }
            return(newBox);
        }