Class CoreApplication

Definition

Namespace:
Tizen.Applications
Assembly:
Tizen.Applications.Common.dll
API Level:
3

This class represents an application controlled lifecycles by the backend system.

C#
Copy
public class CoreApplication : Application
Inheritance
CoreApplication
Derived

Constructors

View Source

CoreApplication(ICoreBackend)

Initializes the CoreApplication class.

Declaration
C#
Copy
public CoreApplication(ICoreBackend backend)
Parameters
Type Name Description
ICoreBackend backend

The backend instance implementing ICoreBacked interface.

API Level: 3
View Source

CoreApplication(ICoreBackend, ICoreTask)

Initializes the CoreApplication class.

Declaration
C#
Copy
public CoreApplication(ICoreBackend backend, ICoreTask task)
Parameters
Type Name Description
ICoreBackend backend

The backend instance implementing ICoreBackend interface.

ICoreTask task

The backend instance implmenting ICoreTask interface.

API Level: 10

Properties

View Source

Backend

The backend instance.

Declaration
C#
Copy
protected ICoreBackend Backend { get; }
Property Value
Type Description
ICoreBackend
API Level: 3

Methods

View Source

Dispose(Boolean)

Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.

Declaration
C#
Copy
protected override void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

If true, disposes any disposable objects. If false, does not dispose disposable objects.

Overrides
API Level: 3
View Source

Exit()

Exits the main loop of the application.

Declaration
C#
Copy
public override void Exit()
Overrides
API Level: 3
View Source

OnAppControlReceived(AppControlReceivedEventArgs)

Overrides this method if want to handle behavior when the application receives the appcontrol message. If base.OnAppControlReceived() is not called, the event 'AppControlReceived' will not be emitted.

Declaration
C#
Copy
protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e)
Parameters
Type Name Description
AppControlReceivedEventArgs e
API Level: 3
View Source

OnCreate()

Overrides this method if want to handle behavior when the application is launched. If base.OnCreated() is not called, the event 'Created' will not be emitted.

Declaration
C#
Copy
protected virtual void OnCreate()
API Level: 3
View Source

OnDeviceOrientationChanged(DeviceOrientationEventArgs)

Overrides this method if want to handle behavior when the device orientation is changed. If base.OnRegionFormatChanged() is not called, the event 'RegionFormatChanged' will not be emitted.

Declaration
C#
Copy
protected virtual void OnDeviceOrientationChanged(DeviceOrientationEventArgs e)
Parameters
Type Name Description
DeviceOrientationEventArgs e

The device orientation changed event argument

API Level: 3
View Source

OnLocaleChanged(LocaleChangedEventArgs)

Overrides this method if want to handle behavior when the system language is changed. If base.OnLocaleChanged() is not called, the event 'LocaleChanged' will not be emitted.

Declaration
C#
Copy
protected virtual void OnLocaleChanged(LocaleChangedEventArgs e)
Parameters
Type Name Description
LocaleChangedEventArgs e

The locale changed event argument

API Level: 3
View Source

OnLowBattery(LowBatteryEventArgs)

Overrides this method if want to handle behavior when the system battery is low. If base.OnLowBattery() is not called, the event 'LowBattery' will not be emitted.

Declaration
C#
Copy
protected virtual void OnLowBattery(LowBatteryEventArgs e)
Parameters
Type Name Description
LowBatteryEventArgs e

The low battery event argument

API Level: 3
View Source

OnLowMemory(LowMemoryEventArgs)

Overrides this method if want to handle behavior when the system memory is low. If base.OnLowMemory() is not called, the event 'LowMemory' will not be emitted.

Declaration
C#
Copy
protected virtual void OnLowMemory(LowMemoryEventArgs e)
Parameters
Type Name Description
LowMemoryEventArgs e

The low memory event argument

API Level: 3
View Source

OnRegionFormatChanged(RegionFormatChangedEventArgs)

Overrides this method if want to handle behavior when the region format is changed. If base.OnRegionFormatChanged() is not called, the event 'RegionFormatChanged' will not be emitted.

Declaration
C#
Copy
protected virtual void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
Parameters
Type Name Description
RegionFormatChangedEventArgs e

The region format changed event argument

API Level: 3
View Source

OnTerminate()

Overrides this method if want to handle behavior when the application is terminated. If base.OnTerminate() is not called, the event 'Terminated' will not be emitted.

Declaration
C#
Copy
protected virtual void OnTerminate()
API Level: 3
View Source

OnTimeZoneChanged(TimeZoneChangedEventArgs)

Override this method if you want to handle behavior when the time zone is changed. If base.OnTimeZoneChanged() is not called, the event "TimeZoneChanged" will not be emitted.

Declaration
C#
Copy
protected virtual void OnTimeZoneChanged(TimeZoneChangedEventArgs e)
Parameters
Type Name Description
TimeZoneChangedEventArgs e

The time zone changed event argument

API Level: 11
View Source

Post(Action)

Dispatches an asynchronous message to a main loop of the CoreApplication.

Declaration
C#
Copy
public static void Post(Action runner)
Parameters
Type Name Description
Action runner

The runner callaback.

Remarks

If an application uses UI thread App Model, the asynchronous message will be delivered to the UI thread. If not, the asynchronous message will be delivered to the main thread.

API Level: 3
View Source

Post<T>(Func<T>)

Dispatches an asynchronous message to a main loop of the CoreApplication.

Declaration
C#
Copy
public static Task<T> Post<T>(Func<T> runner)
Parameters
Type Name Description
Func<T> runner

The runner callback.

Returns
Type Description
Task<T>

A task with the result.

Type Parameters
Name Description
T

The type of the result.

Remarks

If an application uses UI thread App Model, the asynchronous message will be delivered to the UI thread. If not, the asynchronous message will be delivered to the main thread.

API Level: 3
View Source

Run(String[])

Runs the application's main loop.

Declaration
C#
Copy
public override void Run(string[] args)
Parameters
Type Name Description
String[] args

Arguments from commandline.

Overrides
API Level: 3

Events

View Source

AppControlReceived

Occurs whenever the application receives the appcontrol message.

Declaration
C#
Copy
public event EventHandler<AppControlReceivedEventArgs> AppControlReceived
Event Type
Type Description
EventHandler<AppControlReceivedEventArgs>
API Level: 3
View Source

Created

Occurs when the application is launched.

Declaration
C#
Copy
public event EventHandler Created
Event Type
Type Description
EventHandler
API Level: 3
View Source

DeviceOrientationChanged

Occurs when the device orientation is changed.

Declaration
C#
Copy
public event EventHandler<DeviceOrientationEventArgs> DeviceOrientationChanged
Event Type
Type Description
EventHandler<DeviceOrientationEventArgs>
API Level: 3
View Source

LocaleChanged

Occurs when the system language is chagned.

Declaration
C#
Copy
public event EventHandler<LocaleChangedEventArgs> LocaleChanged
Event Type
Type Description
EventHandler<LocaleChangedEventArgs>
API Level: 3
View Source

LowBattery

Occurs when the system battery is low.

Declaration
C#
Copy
public event EventHandler<LowBatteryEventArgs> LowBattery
Event Type
Type Description
EventHandler<LowBatteryEventArgs>
API Level: 3
View Source

LowMemory

Occurs when the system memory is low.

Declaration
C#
Copy
public event EventHandler<LowMemoryEventArgs> LowMemory
Event Type
Type Description
EventHandler<LowMemoryEventArgs>
API Level: 3
View Source

RegionFormatChanged

Occurs when the region format is changed.

Declaration
C#
Copy
public event EventHandler<RegionFormatChangedEventArgs> RegionFormatChanged
Event Type
Type Description
EventHandler<RegionFormatChangedEventArgs>
API Level: 3
View Source

Terminated

Occurs when the application is about to shutdown.

Declaration
C#
Copy
public event EventHandler Terminated
Event Type
Type Description
EventHandler
API Level: 3
View Source

TimeZoneChanged

Occurs when the time zone is changed.

Declaration
C#
Copy
public event EventHandler<TimeZoneChangedEventArgs> TimeZoneChanged
Event Type
Type Description
EventHandler<TimeZoneChangedEventArgs>
API Level: 11

Extension Methods