Class TimeSpanView
public sealed class TimeSpanView : AbstractView
Inherited Members
Namespace: HomeSeer.Jui.Views
Assembly: PluginSdk.dll
A time span allows user to enter a time interval in days, hours, minutes and seconds
Constructors
View SourceTimeSpanView(String, String)
Create a new instance of an TimeSpanView with an ID and a Name
Declaration
[JsonConstructor]
public TimeSpanView(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The unique ID for the View |
System.String | name | The name of the View |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if a view is created with an invalid ID |
TimeSpanView(String, String, TimeSpan)
Create a new instance of an InputView with an ID, a Name, and a value.
Declaration
public TimeSpanView(string id, string name, TimeSpan value)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The unique ID for the View |
System.String | name | The name of the View |
System.TimeSpan | value | The time span value |
Properties
View SourceShowDays
Wether a number of days can be entered
Declaration
[JsonProperty("show_days")]
public bool ShowDays { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ShowSeconds
Wether a number of seconds can be entered
Declaration
[JsonProperty("show_seconds")]
public bool ShowSeconds { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Value
The current value of the field
Declaration
[JsonProperty("value")]
public TimeSpan Value { get; set; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
Methods
View SourceGetStringValue()
Get the value associated with this view as a string if there is one.
Declaration
public override string GetStringValue()
Returns
Type | Description |
---|---|
System.String | The value stored in this view as a string or NULL if there is no value stored. |
Overrides
Remarks
The same as Value
ToHtml(Int32)
Get a string representation of this view converted into HTML
Declaration
public override string ToHtml(int indent = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | indent |
Returns
Type | Description |
---|---|
System.String | An HTML representation of the view as a string |
Overrides
View SourceUpdate(AbstractView)
Update the view to the new state. This will change the time span value
Declaration
public override void Update(AbstractView newViewState)
Parameters
Type | Name | Description |
---|---|---|
AbstractView | newViewState | The new state of the view being updated. This view's ID and Type must match the calling view exactly |
Overrides
Exceptions
Type | Condition |
---|---|
ViewTypeMismatchException | Thrown when the new view's class doesn't match the calling view |
UpdateValue(String)
Update the value of the view
Declaration
public override void UpdateValue(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The new value |