Example #1
0
 public static List <Layout> CreateDefaultLayouts(string tabId, DashboardDefault defaultDashboard)
 {
     return(new List <Layout> {
         new Layout {
             LayoutIndex = defaultDashboard.Layout.LayoutIndex,
             TabId = tabId,
             LayoutRows = new List <LayoutRow>(
                 Enumerable.Select <LayoutRow, LayoutRow>(defaultDashboard.Layout.LayoutRows, row => new LayoutRow
             {
                 RowIndex = row.RowIndex,
                 LayoutTypeId = row.LayoutTypeId,
                 WidgetPlacements = new List <WidgetPlacement>(
                     Enumerable.Where <DashboardDefaultWidget>(defaultDashboard.DashboardDefaultWidgets, y => y.LayoutRowId == row.LayoutRowId)
                     .Select(ddw => new WidgetPlacement
                 {
                     WidgetId = ddw.WidgetId,
                     ColumnIndex = ddw.ColumnIndex,
                     UseTemplate = ddw.Widget.UseTemplate,
                     UseSettings = ddw.Widget.UseSettings,
                     Collapsed = false
                 }))
             }
                                                          ))
         }
     });
 }
Example #2
0
 public static List <Layout> CreateDefaultLayouts(string tabId, DashboardDefault defaultDashboard)
 {
     // No default dashboard exists.
     if (defaultDashboard == null)
     {
         return(new List <Layout>
         {
             new()
             {
                 LayoutIndex = 1,
                 TabId = tabId
             }
         });