Table of Contents

Class DashboardBase

Namespace
Dynamicweb.Dashboard
Assembly
Dynamicweb.Core.dll

The class DashboardBase provides dashboard base functionality with database persistance

public abstract class DashboardBase : IDashboard
Inheritance
DashboardBase
Implements
Inherited Members
Extension Methods

Examples

using Dynamicweb.Dashboard.Widgets;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;

namespace Dynamicweb.Dashboard.Examples;

[Export(DashboardSystemName)]
public class SimpleDashboard : DashboardBase
{
    private const string DashboardSystemName = "SimpleDashboard";

    public override DashboardConfiguration GetDefault(string path)
    {
        DashboardWidget widget = string.IsNullOrEmpty(path)
            ? new MemoryUsageCounter()
            : new FilesFolderSizes();

        return new()
        {
            Widgets = new[] { widget }
        };
    }

    public override IEnumerable<Type> GetAllAvailableWidgets(string path, IEnumerable<Type> allWidgets) => new Type[]
    {
        typeof(MemoryUsageCounter),
        typeof(FilesFolderSizes)
    };
}

Properties

Title

Gets or sets the Dashboard title

public virtual string Title { get; set; }

Property Value

string

Widgets

Gets or sets collection of widgets to show

public IEnumerable<DashboardWidget> Widgets { get; set; }

Property Value

IEnumerable<DashboardWidget>

Methods

GetAllAvailableWidgets(string, IEnumerable<Type>)

Gets widget types for the Dashboard

public virtual IEnumerable<Type> GetAllAvailableWidgets(string path, IEnumerable<Type> allWidgets)

Parameters

path string

The request path

allWidgets IEnumerable<Type>

all widget available for application

Returns

IEnumerable<Type>

The list of widget types available to the Dashboard show

Remarks

The method used to filter widget types which could be shown for the Dashboard

GetDefault(string?)

Gets default dashboard configuration

public virtual DashboardConfiguration? GetDefault(string? path)

Parameters

path string

The request path

Returns

DashboardConfiguration
To top