Class Page.Factory
[Obsolete("Please use HomeSeer.Jui.Views.PageFactory now.", false)]
public static class Factory
Inheritance
Inherited Members
Namespace: HomeSeer.Jui.Views
Assembly: PluginSdk.dll
A factory class for creating pages
Methods
View SourceCreateDeviceConfigPage(String, String)
Create a new device configuration page
Declaration
public static Page CreateDeviceConfigPage(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID for the page |
System.String | name | The name of the page |
Returns
Type | Description |
---|---|
Page | A new Page with its type set to EPageType.DeviceConfig |
CreateDeviceIncPage(String, String)
Create a new device inclusion page
Declaration
static Page CreateDeviceIncPage(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID for the page |
System.String | name | The name of the page |
Returns
Type | Description |
---|---|
Page | A new Page with its type set to EPageType.DeviceInclude |
CreateEventActionPage(String, String)
Create a new, event action page
Declaration
public static Page CreateEventActionPage(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID for the page |
System.String | name | The name of the page |
Returns
Type | Description |
---|---|
Page | A new Page with its type set to EPageType.EventAction |
CreateEventTriggerPage(String, String)
Create a new, event trigger page
Declaration
public static Page CreateEventTriggerPage(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID for the page |
System.String | name | The name of the page |
Returns
Type | Description |
---|---|
Page | A new Page with its type set to EPageType.EventTrigger |
CreateFeaturePage(String, String)
Create a new feature page
Declaration
static Page CreateFeaturePage(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID for the page |
System.String | name | The name of the page |
Returns
Type | Description |
---|---|
Page | A new Page with its type set to EPageType.Feature |
CreateGenericPage(String, String)
Create a new, generic page
Declaration
public static Page CreateGenericPage(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID for the page |
System.String | name | The name of the page |
Returns
Type | Description |
---|---|
Page | A new Page with its type set to EPageType.Generic |
CreateGuidedProcessPage(String, String)
Create a new guided process page
Declaration
static Page CreateGuidedProcessPage(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID for the page |
System.String | name | The name of the page |
Returns
Type | Description |
---|---|
Page | A new Page with its type set to EPageType.Guide |
CreateHtmlFeaturePage(String, String)
Create a new HTML feature page
Declaration
static Page CreateHtmlFeaturePage(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID for the page |
System.String | name | The name of the page |
Returns
Type | Description |
---|---|
Page | A new Page with its type set to EPageType.FeatureHtml |
CreateSettingPage(String, String)
Create a new settings page
Declaration
[Obsolete("Please use CreateSettingsPage() now.", false)]
public static Page CreateSettingPage(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID for the page |
System.String | name | The name of the page |
Returns
Type | Description |
---|---|
Page | A new Page with its type set to EPageType.Settings |
CreateSettingsPage(String, String)
Create a new settings page
Declaration
public static Page CreateSettingsPage(string id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID for the page |
System.String | name | The name of the page |
Returns
Type | Description |
---|---|
Page | A new Page with its type set to EPageType.Settings |
FromJsonString(String)
Deserialize a JSON string to a page
This should always be wrapped in a try/catch in case the data received is malformed
Declaration
[Obsolete("Please use Page.FromJsonString() instead", true)]
public static Page FromJsonString(string jsonString)
Parameters
Type | Name | Description |
---|---|---|
System.String | jsonString | The JSON string containing the page |
Returns
Type | Description |
---|---|
Page | A Page |
Exceptions
Type | Condition |
---|---|
JsonDataException | Thrown when there was a problem deserializing the page |
JsonFromList(List<Page>)
Serialize a list of pages to a JSON string
Declaration
[Obsolete]
public static string JsonFromList(List<Page> pages)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<Page> | pages | the List of Pages to serialize |
Returns
Type | Description |
---|---|
System.String | A JSON string containing the serialized pages |
Exceptions
Type | Condition |
---|---|
JsonDataException | Thrown when there was a problem serializing the page |
ListFromJson(String)
Deserialize a JSON string to a List of Pages
Declaration
[Obsolete("Please use Page.ListFromJson() instead", true)]
public static List<Page> ListFromJson(string jsonString)
Parameters
Type | Name | Description |
---|---|---|
System.String | jsonString | The JSON string containing the list of pages |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Page> | A List of Jui.Page objects |
Exceptions
Type | Condition |
---|---|
JsonDataException | Thrown when there was a problem deserializing the page |
PageListToHtml(List<String>, Int32)
Convert a list of JSON pages into a tabbed HTML page.
Declaration
[Obsolete("Please use a SettingsCollection instead", true)]
public static string PageListToHtml(List<string> jsonPages, int selectedPage = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.String> | jsonPages | A list of pages serialized as JSON strings |
System.Int32 | selectedPage | The index of the page that should be selected by default |
Returns
Type | Description |
---|---|
System.String | A string containing a tabbed HTML page |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if the supplied list of pages is null |
System.ArgumentException | Thrown if the list of pages is empty |