Class InputView
public sealed class InputView : AbstractView
Inherited Members
Namespace: HomeSeer.Jui.Views
Assembly: PluginSdk.dll
An input view is an editable text box for the user to enter strings, numbers, etc.
Constructors
View SourceInputView(String, String, EInputType)
Create a new instance of an InputView with an ID, a Name, and the specified style.
Declaration
[JsonConstructor]
public InputView(string id, string name, EInputType type = EInputType.Text)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The unique ID for the View |
System.String | name | The name of the View |
EInputType | type | The style of the input. DEFAULT: Text |
InputView(String, String, String, EInputType)
Create a new instance of an InputView with an ID, a Name, a Value, and the specified style.
Declaration
public InputView(string id, string name, string value, EInputType type = EInputType.Text)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The unique ID for the View |
System.String | name | The name of the View |
System.String | value | The value inputted into the field |
EInputType | type | The style of the input. DEFAULT: Text |
Exceptions
Type | Condition |
---|---|
InvalidValueForTypeException | Thrown when the value is invalid for the input type |
Fields
View Source_value
Declaration
string _value
Field Value
Type | Description |
---|---|
System.String |
Properties
View SourceInputType
The style of input accepted by this field. This determines the keyboard the user is shown when on a mobile device.
Declaration
[JsonProperty("input_type")]
public EInputType InputType { get; set; }
Property Value
Type | Description |
---|---|
EInputType |
Value
The current value of the field
Declaration
[JsonProperty("value")]
public string Value { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Exceptions
Type | Condition |
---|---|
InvalidValueForTypeException | Thrown when the value is invalid for the input type |
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
IsValueValidForType(String)
Check if the value is valid for the type set on the input view
Declaration
public bool IsValueValidForType(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to check |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the value is valid for the type or FALSE if it is not |
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 inputted 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 |
InvalidValueForTypeException | Thrown when the value is invalid for the input type |
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 |