Beispiel #1
0
        //TODO: review here, fixed position can be reference sibling?
#if DEBUG
        ///// <summary>
        ///// ToString override.
        ///// </summary>
        ///// <returns></returns>
        //public override string ToString()
        //{
        //    var tag = HtmlElement != null ? string.Format("<{0}>", HtmlElement.Name) : "anon";

        //    if (IsBlock)
        //    {
        //        return string.Format("{0}{1} Block {2}, Children:{3}", ParentBox == null ? "Root: " : string.Empty, tag, FontSize, Boxes.Count);
        //    }
        //    else if (this.CssDisplay == CssDisplay.None)
        //    {
        //        return string.Format("{0}{1} None", ParentBox == null ? "Root: " : string.Empty, tag);
        //    }
        //    else
        //    {
        //        if (this.MayHasSomeTextContent)
        //        {
        //            return string.Format("{0}{1} {2}: {3}", ParentBox == null ? "Root: " : string.Empty, tag,
        //                this.CssDisplay.ToCssStringValue(), this.dbugCopyTextContent());
        //        }
        //        else
        //        {
        //            return string.Format("{0}{1} {2}: {3}", ParentBox == null ? "Root: " : string.Empty, tag,
        //                this.CssDisplay.ToCssStringValue(), "");
        //        }
        //    }
        //}
#endif


        //-----------------------------------------------------------------
        public static CssBox AddNewAnonInline(CssBox parent)
        {
            BoxSpec spec   = CssBox.UnsafeGetBoxSpec(parent);
            CssBox  newBox = new CssBox(spec.GetAnonVersion(), parent._rootgfx);

            parent.AppendChild(newBox);
            CssBox.ChangeDisplayType(newBox, Css.CssDisplay.Inline);
            return(newBox);
        }