Exemplo n.º 1
0
        protected override void CreateChildControls()
        {
            if (InnerControl != null)
            {
                Controls.Add(InnerControl);
            }
            else if (PageEditing.PageIsInEditMode)
            {
                //There is no renderer for this content. If we're editing, add a notification about this to the editor.
                var message = String.Format(CultureInfo.InvariantCulture,
                                            LocalizationService.Service.GetString("/edit/content/missingrenderer"), CurrentData.GetOriginalType().Name);

                if (!string.IsNullOrEmpty(ContentRenderer.Tag))
                {
                    var withTagMessage = String.Format(CultureInfo.InvariantCulture,
                                                       LocalizationService.Service.GetString("/edit/content/withtag"), ContentRenderer.Tag);
                    message = message + " " + withTagMessage;
                }

                ApplyMissingRendererAttribute();

                Controls.Add(new LiteralControl(message));
            }
        }