Exemplo n.º 1
0
        protected override void RenderContent(PrintContext printContext, XElement output)
        {
            if (ScriptHelper.ExecuteScriptReference(printContext, this.RenderingItem, this.GetDataItem(printContext), output))
            {
                return;
            }
            bool flag = !SitecoreHelper.HasScriptItemAssigned(this.RenderingItem) && !SitecoreHelper.HasMergeItemAssigned(this.RenderingItem);

            if (flag && string.IsNullOrEmpty(this.ContentFieldName))
            {
                Item obj = this.RenderingItem.Children.FirstOrDefault <Item>((Func <Item, bool>)(c => c.TemplateName.Equals("p_text", StringComparison.InvariantCultureIgnoreCase)));
                if (obj != null && obj.Fields[printContext.Settings.StaticTextFieldName] != null)
                {
                    this.DataSource       = obj.ID.ToString();
                    this.ContentFieldName = printContext.Settings.StaticTextFieldName;
                    this.RenderDeep       = false;
                }
            }
            Item     dataItem = this.GetDataItem(printContext);
            XElement xelement = RenderItemHelper.CreateXElement("TextFrame", this.RenderingItem, printContext.Settings.IsClient, dataItem);

            this.SetAttributes(xelement);
            IEnumerable <XElement> xelements = (IEnumerable <XElement>)null;

            if (flag)
            {
                xelements = this.GetContent(printContext, xelement);
            }
            output.Add((object)xelement);
            xelement.Add((object)xelements);
            this.RenderChildren(printContext, xelement);
        }