private PDFHeadingNumbers GetOrCreateHeadingNumbersFromDocument()
        {
            object found = this.Heading.Document.Params[HeadingNumbersKey];

            if (null == found)
            {
                found = new PDFHeadingNumbers();
                this.Heading.Document.Params[HeadingNumbersKey] = found;
            }
            return((PDFHeadingNumbers)found);
        }
        protected override void DoLayoutComponent()
        {
            bool restoreText = false;
            ListNumberingGroupStyle style = this.FullStyle.GetValue(StyleKeys.ListNumberStyleKey, ListNumberingGroupStyle.None);
            string grpname = this.FullStyle.GetValue(StyleKeys.ListGroupKey, string.Empty);

            if (style != ListNumberingGroupStyle.None && !string.IsNullOrEmpty(grpname))
            {
                PDFHeadingNumbers headingNumbers = this.GetOrCreateHeadingNumbersFromDocument();

                string listnumber = headingNumbers.PushHeading(this.Heading.HeadingDepth, grpname, this.FullStyle);
                Heading.SetHeadingNumber(listnumber);
                restoreText = true;
            }

            base.DoLayoutComponent();

            if (restoreText)
            {
                this.Heading.SetHeadingNumber(string.Empty);
            }
        }