Class CoreApplication
Definition
- Namespace:
- Tizen.Applications
- Assembly:
- Tizen.Applications.Common.dll
The CoreApplication class provides functionality to manage application lifecycle events that are controlled by the backend system.
public class CoreApplication : Application, IDisposable
- Inheritance
- Derived
- Implements
Remarks
By inheriting from the Application class, CoreApplication enables developers to handle various application states such as creating and terminating. It also allows them to define their own event handlers for these states.
Constructors
View SourceCoreApplication(ICoreBackend)
Initializes the CoreApplication class by providing a specific implementation of the ICoreBackend interface.
Declaration
public CoreApplication(ICoreBackend backend)
Parameters
| Type | Name | Description |
|---|---|---|
| ICoreBackend | backend | An instance of the desired implementation of the ICoreBackend interface. |
Remarks
The CoreApplication class provides access to various features and functionalities related to application management. By initializing the CoreApplication class with a specific implementation of the ICoreBackend interface, developers can customize the behavior and functionality of their applications based on their requirements. It enables them to extend the capabilities of the default CoreApplication class and tailor it according to their needs.
Properties
View SourceBackend
The backend instance.
Declaration
protected ICoreBackend Backend { get; }
Property Value
| Type | Description |
|---|---|
| ICoreBackend |
Methods
View SourceDispose(bool)
Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | If true, disposes any disposable objects. If false, does not dispose disposable objects. |
Overrides
View SourceExit()
Exits the main loop of the application.
Declaration
public override void Exit()
Overrides
View SourceOnAppControlReceived(AppControlReceivedEventArgs)
Override this method to customize the behavior when the application receives the appcontrol message. If base.OnAppControlReceived() is not called, the event 'AppControlReceived' will not be triggered.
Declaration
protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| AppControlReceivedEventArgs | e | The arguments passed in the appcontrol message |
OnCreate()
Overrides this method if you want to handle specific behavior when the application is created. Calling base.OnCreate() ensures that the default implementation is executed before any custom code in this method. If base.OnCreate() is not called, the event 'Created' will not be emitted.
Declaration
protected virtual void OnCreate()
OnDeviceOrientationChanged(DeviceOrientationEventArgs)
Override this method to define specific behavior when the device orientation changes. If base.OnDeviceOrientationChanged() is not called, the 'DeviceOrientationChanged' event will not be raised.
Declaration
protected virtual void OnDeviceOrientationChanged(DeviceOrientationEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| DeviceOrientationEventArgs | e | The arguments for the device orientation change event |
OnLocaleChanged(LocaleChangedEventArgs)
Override this method to handle changes in the system language. If base.OnLocaleChanged() is not called, the LocaleChanged event will not be triggered.
Declaration
protected virtual void OnLocaleChanged(LocaleChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| LocaleChangedEventArgs | e | The arguments passed with the LocaleChanged event |
OnLowBattery(LowBatteryEventArgs)
Override this method to handle the behavior when the system battery level drops. If base.OnLowBattery() is not called, the LowBattery event will not be raised.
Declaration
protected virtual void OnLowBattery(LowBatteryEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| LowBatteryEventArgs | e | The arguments for the low battery event |
OnLowMemory(LowMemoryEventArgs)
Override this method to handle behavior when the system memory is low. Calling base.OnLowMemory() ensures that the 'LowMemory' event is emitted.
Declaration
protected virtual void OnLowMemory(LowMemoryEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| LowMemoryEventArgs | e | The low memory event argument |
OnRegionFormatChanged(RegionFormatChangedEventArgs)
Override this method to handle changes in the region format. Make sure to call base.OnRegionFormatChanged() to ensure that the RegionFormatChanged event is raised.
Declaration
protected virtual void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| RegionFormatChangedEventArgs | e | The region format changed event arguments |
OnTerminate()
Override this method to define specific actions that occur when the application terminates. Calling base.OnTerminate() ensures that the default termination process takes place and the 'Terminated' event is emitted.
Declaration
protected virtual void OnTerminate()
OnTimeZoneChanged(TimeZoneChangedEventArgs)
Override this method to handle changes in the current time zone. Calling base.OnTimeZoneChanged() ensures that the TimeZoneChanged event is triggered.
Declaration
protected virtual void OnTimeZoneChanged(TimeZoneChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeZoneChangedEventArgs | e | The arguments containing details about the time zone change |
Run(string[])
Runs the application's main loop.
Declaration
public override void Run(string[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | args | Arguments from commandline. |
Overrides
Events
View SourceAppControlReceived
Occurs whenever the application receives the appcontrol message.
Declaration
public event EventHandler<AppControlReceivedEventArgs> AppControlReceived
Event Type
| Type | Description |
|---|---|
| EventHandler<AppControlReceivedEventArgs> |
Created
Occurs when the application is launched.
Declaration
public event EventHandler Created
Event Type
| Type | Description |
|---|---|
| EventHandler |
DeviceOrientationChanged
Occurs when the device orientation is changed.
Declaration
public event EventHandler<DeviceOrientationEventArgs> DeviceOrientationChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<DeviceOrientationEventArgs> |
LocaleChanged
Occurs when the system language is chagned.
Declaration
public event EventHandler<LocaleChangedEventArgs> LocaleChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<LocaleChangedEventArgs> |
LowBattery
Occurs when the system battery is low.
Declaration
public event EventHandler<LowBatteryEventArgs> LowBattery
Event Type
| Type | Description |
|---|---|
| EventHandler<LowBatteryEventArgs> |
LowMemory
Occurs when the system memory is low.
Declaration
public event EventHandler<LowMemoryEventArgs> LowMemory
Event Type
| Type | Description |
|---|---|
| EventHandler<LowMemoryEventArgs> |
RegionFormatChanged
Occurs when the region format is changed.
Declaration
public event EventHandler<RegionFormatChangedEventArgs> RegionFormatChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<RegionFormatChangedEventArgs> |
Terminated
Occurs when the application is about to shutdown.
Declaration
public event EventHandler Terminated
Event Type
| Type | Description |
|---|---|
| EventHandler |
TimeZoneChanged
Occurs when the time zone is changed.
Declaration
public event EventHandler<TimeZoneChangedEventArgs> TimeZoneChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<TimeZoneChangedEventArgs> |