Table of Contents

Class ThresholdCountWidget

Namespace
Dynamicweb.Dashboard.Widgets
Assembly
Dynamicweb.Core.dll

The class ThresholdCountWidget provides base counter dashboard widget with threshold states

[AddInUseParameterGrouping(true)]
public abstract class ThresholdCountWidget : CountWidgetBase, IParameterOptions
Inheritance
ThresholdCountWidget
Implements
Derived
Inherited Members

Properties

DefaultBackgroundColor

Gets or sets counter default background color

[AddInParameterGroup(" ")]
[AddInLabel("Color")]
[AddInParameter("ColorParameterEditor")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "")]
public override WidgetColor DefaultBackgroundColor { get; set; }

Property Value

WidgetColor

Threshold1Color

Gets or sets counter threshold 1 background color

[AddInLabel("Color")]
[AddInParameterOrder(40)]
[AddInParameter("Threshold1Color")]
[AddInParameterGroup("Background color 1")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "presets=#0085CA,#03A9F4,#00BCD4,#009688,#4CAF50,#8BC34A,#CDDC39,#FFEB3B,#FFC107,#FF9800,#FF5722,#F44336,#9C27B0,#673AB7,#E91E63,#795548,#9E9E9E,#607D8B,#78909C,#263238")]
public virtual WidgetColor Threshold1Color { get; set; }

Property Value

WidgetColor

Threshold1Condition

Gets or sets counter threshold 1 condition

[AddInLabel("Condition")]
[AddInParameterOrder(60)]
[AddInParameter("Threshold1Condition")]
[AddInParameterGroup("Background color 1")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=false;container=body")]
public virtual string Threshold1Condition { get; set; }

Property Value

string

Threshold1Enable

Gets or sets threshold 1 enable

[AddInLabel("Enable")]
[AddInParameterOrder(20)]
[AddInParameter("Threshold1Enable")]
[AddInParameterGroup("Background color 1")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
public virtual bool Threshold1Enable { get; set; }

Property Value

bool

Threshold1Value

Gets or sets counter threshold 1 value

[AddInLabel("Threshold")]
[AddInParameterOrder(80)]
[AddInParameter("Threshold1Value")]
[AddInParameterGroup("Background color 1")]
[AddInParameterEditor(typeof(TextParameterEditor), "")]
public virtual string Threshold1Value { get; set; }

Property Value

string

Threshold2Color

Gets or sets counter threshold 2 background color

[AddInLabel("Color")]
[AddInParameterOrder(120)]
[AddInParameter("Threshold2Color")]
[AddInParameterGroup("Background color 2")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "")]
public virtual WidgetColor Threshold2Color { get; set; }

Property Value

WidgetColor

Threshold2Condition

Gets or sets counter threshold 2 condition

[AddInLabel("Condition")]
[AddInParameterOrder(140)]
[AddInParameter("Threshold2Condition")]
[AddInParameterGroup("Background color 2")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=false;container=body")]
public virtual string Threshold2Condition { get; set; }

Property Value

string

Threshold2Enable

Gets or sets threshold 2 enable

[AddInLabel("Enable")]
[AddInParameterOrder(100)]
[AddInParameter("Threshold2Enable")]
[AddInParameterGroup("Background color 2")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
public virtual bool Threshold2Enable { get; set; }

Property Value

bool

Threshold2Value

Gets or sets counter threshold 2 value

[AddInLabel("Threshold")]
[AddInParameterOrder(160)]
[AddInParameter("Threshold2Value")]
[AddInParameterGroup("Background color 2")]
[AddInParameterEditor(typeof(TextParameterEditor), "")]
public virtual string Threshold2Value { get; set; }

Property Value

string

Title

Gets or sets widget title

[AddInParameterGroup(" ")]
[AddInLabel("Title")]
[AddInParameter("WidgetTitleEditor")]
[AddInParameterOrder(0)]
[AddInParameterEditor(typeof(TextParameterEditor), "")]
public override string Title { get; set; }

Property Value

string

Methods

ApplyThresholdState(double, string)

Apply thrashold states to widget

protected virtual string ApplyThresholdState(double counterValue, string formattedValue)

Parameters

counterValue double

The request path

formattedValue string

The formated string value equivalent counter value

Returns

string

GetCounterNumber()

Gets formated counter number

public override sealed string GetCounterNumber()

Returns

string

GetCounterValue(out string)

Gets counter value

protected abstract double GetCounterValue(out string formattedValue)

Parameters

formattedValue string

When this method returns, contains the formated string value equivalent counted value

Returns

double

GetParameterOptions(string)

Gets parameteroptions

public override IEnumerable<ParameterOption> GetParameterOptions(string parameterName)

Parameters

parameterName string

Returns

IEnumerable<ParameterOption>

IsValueFollowThresholdCondition(double, string, double)

protected virtual bool IsValueFollowThresholdCondition(double counterValue, string thresholdCondition, double thresholdValue)

Parameters

counterValue double
thresholdCondition string
thresholdValue double

Returns

bool
To top