CountWidget Class | 
Namespace: Dynamicweb.Dashboards.Widgets
The CountWidget type exposes the following members.
| Name | Description | |
|---|---|---|
| CountWidget | 
            The counter widget default constructor
              | 
| Name | Description | |
|---|---|---|
| BackgroundColor | 
            Gets or sets counter background color
              | |
| Columns | 
            Gets or sets widget size
              (Inherited from DashboardWidget.) | |
| CreatedDate | 
            Gets the created date and time.
              (Inherited from DashboardWidget.) | |
| DefaultAction | 
            Gets or sets action for click on counter number.
              | |
| DefaultBackgroundColor | 
            Gets or sets counter default background color
              | |
| Element | 
            The  to be shown
              (Inherited from DashboardElementWidget.) | |
| Id | 
            Gets widget Id
              (Inherited from DashboardWidget.) | |
| ModifiedDate | 
            Gets the last modified date and time.
              (Inherited from DashboardWidget.) | |
| Order | 
            Gets or sets widget order
              (Inherited from DashboardWidget.) | |
| ShowTitle | 
            Gets or sets value indicating whether to show widget title.
              (Inherited from DashboardWidget.) | |
| Subtitle | 
            Gets or sets counter sub title
              | |
| Title | 
            Gets or sets widget title
              (Inherited from DashboardWidget.) | |
| TitleAction | 
            Gets or sets widget title action
              (Inherited from DashboardWidget.) | 
| Name | Description | |
|---|---|---|
| Fetch | 
            Fetches widget  with data
              (Overrides DashboardWidgetFetch(IDashboard, String).) | |
| GetCounterNumber | 
            Gets or sets counter number
              | |
| GetIdSuitableString | (Inherited from ConfigurableAddIn.) | |
| GetOptions | 
            Return dropdown options
              (Inherited from DashboardWidget.) | |
| GetParametersToXml | (Inherited from ConfigurableAddIn.) | |
| GetParametersToXml(Boolean) | (Inherited from ConfigurableAddIn.) | |
| LoadParametersFromXml | (Inherited from ConfigurableAddIn.) | |
| Render | 
            The method render widget and return html
              (Inherited from DashboardElementWidget.) | |
| RenderAdditionalContent | (Inherited from ConfigurableAddIn.) | |
| ScriptDependencies | 
            Specifies relative paths to all script files that this widget is dependent upon.
              (Inherited from DashboardWidget.) | |
| SetValue | (Inherited from ConfigurableAddIn.) | |
| StylesheetDependencies | 
            Specifies relative paths to all style files that this widget is dependent upon.
              (Inherited from DashboardWidget.) | |
| UpdateFromPost | (Inherited from ConfigurableAddIn.) | 
using Dynamicweb.Dashboards.Widgets; using Dynamicweb.Extensibility.AddIns; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Dynamicweb.Dashboards.Examples { [AddInName("Application memory usage")] [AddInDescription("Show current process memory usage information")] [AddInIcon(Core.UI.Icons.KnownIcon.Dehaze)] public sealed class MemoryUsageCounter: CountWidget { public MemoryUsageCounter() { Title = "Memory usage"; } [AddInParameterEditor("", "")] public override int Columns { get { return 2; } set {} } protected override string GetCounterNumber(IDashboard dashboard, string path) { double count; string subtitle; var currentProcess = Process.GetCurrentProcess(); long totalBytesOfMemoryUsed = currentProcess.WorkingSet64; Helper.HumanizeByteSize(totalBytesOfMemoryUsed, out count, out subtitle); Subtitle = subtitle; return string.Format("{0:0.##}", count); } } }