public List<WidgetEntity> GetFavoriteWidgets() { List<WidgetEntity> widgets = new List<WidgetEntity>(); WidgetEntity widget; var res = GetAllWidgetData().Where(p => p.Attribute("isFavorite") != null && p.Attribute("isFavorite").Value == "true"); foreach (var obj in res) { widget = new WidgetEntity(); widget.WidgetName = obj.Attribute("name").Value; widget.WidgetHref = "~/" + widget.WidgetName + "/Overview.aspx"; widget.Title = obj.Attribute("text") != null ? obj.Attribute("text").Value : widget.WidgetName; widget.Icon = "~/explore/css/images/icons/widget/" + widget.WidgetName + ".png"; //widget.Icon = "explore/css/images/icons/widget/accordion.png"; widgets.Add(GetWidgetEntity(obj,true)); } return widgets; }
public List <WidgetEntity> GetAllWidgets() { List <WidgetEntity> widgets = new List <WidgetEntity>(); WidgetEntity widget; var res = GetAllWidgetData(); foreach (var obj in res) { widget = new WidgetEntity(); widget.WidgetName = obj.Attribute("name").Value; widget.WidgetHref = "~/" + widget.WidgetName + "/Overview.aspx"; widget.Title = obj.Attribute("text") != null?obj.Attribute("text").Value : widget.WidgetName; widget.Icon = "~/explore/css/images/icons/widget/" + widget.WidgetName + ".png"; //widget.Icon = "explore/css/images/icons/widget/accordion.png"; widgets.Add(GetWidgetEntity(obj, false)); } return(widgets); }
public WidgetEntity GetWidgetEntity(XElement obj, bool bigIcon){ var widget = new WidgetEntity(); widget.WidgetName = obj.Attribute("name").Value; widget.WidgetHref = "~/" + widget.WidgetName + "/Overview.aspx"; widget.Title = obj.Attribute("text") != null ? obj.Attribute("text").Value : widget.WidgetName; widget.Icon = "~/explore/css/images/icons/widget/" + widget.WidgetName + ".png"; if (bigIcon) { //widget.Icon = "explore/css/images/icons/widget/accordion.png"; widget.Icon = "~/explore/css/images/icons/widget/" + widget.WidgetName + ".png"; } else { //widget.Icon = "explore/css/images/icons/widget/accordion.png"; widget.Icon = "~/explore/css/images/icons/widget/" + widget.WidgetName + ".png"; } return widget; }
public WidgetEntity GetWidgetEntity(XElement obj, bool bigIcon) { var widget = new WidgetEntity(); widget.WidgetName = obj.Attribute("name").Value; widget.WidgetHref = "~/" + widget.WidgetName + "/Overview.aspx"; widget.Title = obj.Attribute("text") != null?obj.Attribute("text").Value : widget.WidgetName; widget.Icon = "~/explore/css/images/icons/widget/" + widget.WidgetName + ".png"; if (bigIcon) { //widget.Icon = "explore/css/images/icons/widget/accordion.png"; widget.Icon = "~/explore/css/images/icons/widget/" + widget.WidgetName + ".png"; } else { //widget.Icon = "explore/css/images/icons/widget/accordion.png"; widget.Icon = "~/explore/css/images/icons/widget/" + widget.WidgetName + ".png"; } return(widget); }