Class ComponentBasedApplication
Definition
- Namespace:
- Tizen.Applications.ComponentBased.Common
- Assembly:
- Tizen.Applications.ComponentBased.dll
Represents the base class for a multi-component based application. This class allows the creation and management of multiple application components, such as Frame, Service, and Widget components.
[Obsolete("This has been deprecated in API14")]
public abstract class ComponentBasedApplication : Application, IDisposable
- Inheritance
- Implements
Remarks
This abstract class provides the core structure for applications that consist of multiple components. Each component has its own lifecycle, and the framework handles these lifecycles independently.
Constructors
View SourceComponentBasedApplication(IDictionary<Type, string>)
Initializes a new instance of the ComponentBasedApplication class with the specified component type information.
Declaration
[Obsolete("This has been deprecated in API14")]
public ComponentBasedApplication(IDictionary<Type, string> typeInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<Type, string> | typeInfo | A dictionary where the key is the component class type (FrameComponent, ServiceComponent or WidgetComponent subclass), and the value is the component ID defined in the tizen-manifest.xml file. |
Remarks
This constructor sets up the necessary callbacks for the application lifecycle and registers the provided components.
Examples
IDictionary<Type, string> components = new Dictionary<Type, string>()
{
{ typeof(MyFrameComponent), "frameComponentId" },
{ typeof(MyServiceComponent), "serviceComponentId" }
};
ComponentBasedApplication app = new MyApplication(components);
app.Run(args);
Methods
View SourceExit()
Exits the application's main loop.
Declaration
[Obsolete("This has been deprecated in API14")]
public override void Exit()
Overrides
View SourceOnExit()
Called to exit the main loop of the application.
Declaration
[Obsolete("This has been deprecated in API14")]
protected virtual void OnExit()
Remarks
Override this method to handle any logic needed before the application exits.
OnFinished()
Called after the main loop exits.
Declaration
[Obsolete("This has been deprecated in API14")]
protected virtual void OnFinished()
Remarks
Override this method to handle any cleanup logic after the application has finished running.
OnInit(string[])
Called before the main loop starts.
Declaration
[Obsolete("This has been deprecated in API14")]
protected virtual void OnInit(string[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | args | The arguments passed from the command line. |
Remarks
Override this method to handle any initialization logic before the application enters the main event loop.
OnRun()
Called to start the main loop of the application.
Declaration
[Obsolete("This has been deprecated in API14")]
protected abstract void OnRun()
Remarks
This is an abstract method that must be implemented by derived classes to define the behavior when the application starts.
RegisterComponent(Type, string)
Registers a component with the specified type and ID.
Declaration
[Obsolete("This has been deprecated in API14")]
public void RegisterComponent(Type compType, string compId)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | compType | The type of the component to register. Must be a subclass of FrameComponent, ServiceComponent, or WidgetComponent. |
| string | compId | The ID of the component, defined in the tizen-manifest.xml file. |
Remarks
This method ensures that only valid component types are registered. The component ID must be unique.
Examples
app.RegisterComponent(typeof(MyFrameComponent), "frameComponentId");
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the component type is already registered or not sub-class of FrameComponent, ServiceComponent or WidgetComponent. |
Run(string[])
Runs the application's main loop.
Declaration
[Obsolete("This has been deprecated in API14")]
public override void Run(string[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | args | The arguments passed from the command line. |
Overrides
Examples
app.Run(args);
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when component type is already added to the component. |