Class AbstractView
public abstract class AbstractView
Inheritance
Inherited Members
Namespace: HomeSeer.Jui.Views
Assembly: PluginSdk.dll
The base implementation of a JUI view
Constructors
View SourceAbstractView(String)
Create an instance of an AbstractView with an ID
Declaration
protected AbstractView(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The unique ID for the AbstractView |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if a view is created with an invalid ID |
AbstractView(String, String)
Create an instance of an AbstractView with an ID and Name
Declaration
protected AbstractView(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The unique ID for the AbstractView |
System.String | name | The name for the AbstractView |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if a view is created with an invalid ID |
Fields
View SourceHtmlIndent
Represents a tab/indent for formatting HTML
Declaration
[JsonIgnore]
const string HtmlIndent = " "
Field Value
Type | Description |
---|---|
System.String |
NonAllowedCharactersForId
The list of special characters that are not allowed in a view ID
Declaration
[JsonIgnore]
static readonly char[] NonAllowedCharactersForId
Field Value
Type | Description |
---|---|
System.Char[] |
Properties
View SourceId
A unique identifier for this view. You will need to use this to identify the view when HomeSeer communicates changes to its values from a client.
Do NOT use any of the following special characters in your view id: !"#$%&'()*+,./:;<=>?@[]^`{|}~ For consistency and readability it is advised to use the format of COMPANY-PLUGIN-PAGE-VIEW
For example: a LabelView on the first settings page in the Z-Wave Plugin might have an id of HomeSeer-ZWave-Settings1-InterfaceName
Declaration
[JsonProperty("id", Required = Required.Always)]
public string Id { get; protected set; }
Property Value
Type | Description |
---|---|
System.String |
Name
The name/title of this view
Declaration
[JsonProperty("name")]
public string Name { get; protected set; }
Property Value
Type | Description |
---|---|
System.String |
Type
The type of this view.
This is automatically configured
Declaration
[JsonProperty("type", Required = Required.Always)]
public EViewType Type { get; protected set; }
Property Value
Type | Description |
---|---|
EViewType |
Methods
View SourceGetIndentStringFromNumber(Int32)
Used to generate the exact tab spacing (using spaces) for any given indent amount
Declaration
public static string GetIndentStringFromNumber(int indent)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | indent | The number of indents for the line |
Returns
Type | Description |
---|---|
System.String | A string containing the number of spaces to achieve the desired indent |
GetStringValue()
Get the value associated with this view as a string if there is one.
Declaration
public abstract string GetStringValue()
Returns
Type | Description |
---|---|
System.String | The value stored in this view as a string or NULL if there is no value stored. |
IdContainsNonAllowedCharacters()
Used to check if the view ID contains non-allowed characters
Declaration
public bool IdContainsNonAllowedCharacters()
Returns
Type | Description |
---|---|
System.Boolean | True if view ID contains at least one non-allowed characters, False otherwise |
ShallowCopy()
Create a shallow copy of this view
Declaration
public AbstractView ShallowCopy()
Returns
Type | Description |
---|---|
AbstractView | The shallow copy of the view |
ToHtml(Int32)
Get a string representation of this view converted into HTML
Declaration
public abstract 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 |
Update(AbstractView)
Update the the user editable properties from a new version of the same view
Declaration
public virtual 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 |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the new state of the view is null |
System.InvalidOperationException | Thrown when the new view's ID or Type don't match the calling view |
UpdateValue(String)
Update the value of the view
Declaration
public virtual void UpdateValue(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The new value |