public bool IsWidgetUnique(MetaWidgetLocation location) { if (Widgets.Count == 0) { return(true); } else { return(Widgets.Any(w => w.WidgetLocation == location)); }; }
private void RenderWidget(MetaWidget metaWidget, MetaWidgetLocation widgetLocation, int widgetCount) { var article = new HtmlGenericControl("article"); article.Attributes.Add("class", "col-sm-12 col-md-12 col-lg-12"); var mainDiv = (metaWidget != null) ? PrepareArticleOutlineForWidget(metaWidget, widgetCount) : PrepareArticlePlaceholderWidget(); if (_isPublisher && metaWidget != null) { var editDiv = PrepareArticleEditForWidget(metaWidget, true); mainDiv.Controls.Add(editDiv); } article.Controls.Add(mainDiv); if (widgetLocation == Core.ValueTypes.MetaWidgetLocation.TopLeft) { spnTopLeft.Controls.Add(article); } if (widgetLocation == Core.ValueTypes.MetaWidgetLocation.TopRight) { spnTopRight.Controls.Add(article); } if (widgetLocation == Core.ValueTypes.MetaWidgetLocation.MiddleLeft) { spnMiddleLeft.Controls.Add(article); } if (widgetLocation == Core.ValueTypes.MetaWidgetLocation.MiddleRight) { spnMiddleRight.Controls.Add(article); } if (widgetLocation == Core.ValueTypes.MetaWidgetLocation.BottomLeft) { spnBottomLeft.Controls.Add(article); } if (widgetLocation == Core.ValueTypes.MetaWidgetLocation.BottomRight) { spnBottomRight.Controls.Add(article); } }