From: WonYoung Choi Date: Tue, 7 Jun 2016 06:54:38 +0000 (+0900) Subject: Use event functions of appcore_agent instead of event_xxx API X-Git-Tag: submit/trunk/20170823.075128~121^2~148^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45f1f2145ea7d5304ec5f32438b0ddcb08797b4b;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Use event functions of appcore_agent instead of event_xxx API Change-Id: I251176c568a343a1c83aaa0f94e107927f9c5ae0 --- diff --git a/Tizen.Applications/Interop/Interop.AppCommon.cs b/Tizen.Applications/Interop/Interop.AppCommon.cs old mode 100755 new mode 100644 index 74494f6..fb9a4a6 --- a/Tizen.Applications/Interop/Interop.AppCommon.cs +++ b/Tizen.Applications/Interop/Interop.AppCommon.cs @@ -6,14 +6,28 @@ // it only in accordance with the terms of the license agreement // you entered into with Samsung. +using System; using System.Runtime.InteropServices; using Tizen.Internals.Errors; +using Tizen.Applications; internal static partial class Interop { internal static partial class AppCommon { + internal enum AppEventType + { + LowMemory = 0, + LowBattery, + LanguageChanged, + DeviceOrientationChanged, + RegionFormatChanged, + SuspendedStateChanged + } + + internal delegate void AppEventCallback(IntPtr handle, IntPtr data); + [DllImport(Libraries.AppCommon, EntryPoint = "app_get_id")] internal static extern ErrorCode AppGetId(out string appId); @@ -52,6 +66,19 @@ internal static partial class Interop [DllImport(Libraries.AppCommon, EntryPoint = "app_get_version")] internal static extern ErrorCode AppGetVersion(out string version); + + [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_memory_status")] + internal static extern ErrorCode AppEventGetLowMemoryStatus(IntPtr handle, out LowMemoryStatus status); + + [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_battery_status")] + internal static extern ErrorCode AppEventGetLowBatteryStatus(IntPtr handle, out LowBatteryStatus status); + + [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_language")] + internal static extern ErrorCode AppEventGetLanguage(IntPtr handle, out string lang); + + [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_region_format")] + internal static extern ErrorCode AppEventGetRegionFormat(IntPtr handle, out string region); + } } diff --git a/Tizen.Applications/Interop/Interop.AppEvent.cs b/Tizen.Applications/Interop/Interop.AppEvent.cs deleted file mode 100755 index a6b0d98..0000000 --- a/Tizen.Applications/Interop/Interop.AppEvent.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; - -using Tizen.Internals.Errors; - -internal static partial class Interop -{ - internal static partial class AppEvent - { - internal delegate void AppEventCallback(string eventName, IntPtr bundle, IntPtr data); - - [DllImport(Libraries.AppEvent, EntryPoint = "event_add_event_handler")] - internal static extern ErrorCode AddEventHandler(string eventName, AppEventCallback callback, IntPtr data, out SafeAppEventHandle eventHandler); - - [DllImport(Libraries.AppEvent, EntryPoint = "event_remove_event_handler")] - internal static extern ErrorCode DangerousRemoveEventHandler(IntPtr eventHandler); - - [DllImport(Libraries.AppEvent, EntryPoint = "event_publish_app_event")] - internal static extern ErrorCode Publish(string eventName, IntPtr bundle); - - [DllImport(Libraries.AppEvent, EntryPoint = "event_publish_trusted_app_event")] - internal static extern ErrorCode PublishTrusted(string eventName, IntPtr bundle); - - internal sealed class SafeAppEventHandle : SafeHandle - { - public SafeAppEventHandle() : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid - { - get { return handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - DangerousRemoveEventHandler(handle); - SetHandle(IntPtr.Zero); - return true; - } - } - - internal static class EventNames - { - public const string LowMemory = "tizen.system.event.low_memory"; - public const string LanguageSet = "tizen.system.event.language_set"; - } - - internal static class EventKeys - { - public const string LowMemory = "low_memory"; - public const string LanguageSet = "language_set"; - } - - internal static class EventValues - { - public const string MemoryNormal = "normal"; - public const string MemorySoftWarning = "soft_warning"; - public const string MemoryHardWarning = "hard_warning"; - } - } -} - diff --git a/Tizen.Applications/Interop/Interop.Application.cs b/Tizen.Applications/Interop/Interop.Application.cs old mode 100755 new mode 100644 index 9e524f4..56db6e6 --- a/Tizen.Applications/Interop/Interop.Application.cs +++ b/Tizen.Applications/Interop/Interop.Application.cs @@ -9,6 +9,8 @@ using System; using System.Runtime.InteropServices; +using Tizen.Internals.Errors; + internal static partial class Interop { internal static partial class Application @@ -24,12 +26,18 @@ internal static partial class Interop internal delegate void AppControlCallback(IntPtr appControl, IntPtr userData); [DllImport(Libraries.Application, EntryPoint = "ui_app_main")] - internal static extern int Main(int argc, string[] argv, ref UIAppLifecycleCallbacks callback, IntPtr userData); + internal static extern ErrorCode Main(int argc, string[] argv, ref UIAppLifecycleCallbacks callback, IntPtr userData); [DllImport(Libraries.Application, EntryPoint = "ui_app_exit")] internal static extern void Exit(); - [StructLayoutAttribute(LayoutKind.Sequential)] + [DllImport(Libraries.Application, EntryPoint = "ui_app_add_event_handler")] + internal static extern ErrorCode AddEventHandler(out IntPtr handle, AppCommon.AppEventType eventType, AppCommon.AppEventCallback callback, IntPtr data); + + [DllImport(Libraries.Application, EntryPoint = "ui_app_remove_event_handler")] + internal static extern ErrorCode RemoveEventHandler(IntPtr handle); + + [StructLayout(LayoutKind.Sequential)] internal struct UIAppLifecycleCallbacks { public AppCreateCallback OnCreate; diff --git a/Tizen.Applications/Interop/Interop.Service.cs b/Tizen.Applications/Interop/Interop.Service.cs old mode 100755 new mode 100644 index 26cb4f6..cda4b1b --- a/Tizen.Applications/Interop/Interop.Service.cs +++ b/Tizen.Applications/Interop/Interop.Service.cs @@ -9,6 +9,8 @@ using System; using System.Runtime.InteropServices; +using Tizen.Internals.Errors; + internal static partial class Interop { internal static partial class Service @@ -20,11 +22,17 @@ internal static partial class Interop internal delegate void ServiceAppControlCallback(IntPtr appControl, IntPtr userData); [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_main")] - internal static extern int Main(int argc, string[] argv, ref ServiceAppLifecycleCallbacks callback, IntPtr userData); + internal static extern ErrorCode Main(int argc, string[] argv, ref ServiceAppLifecycleCallbacks callback, IntPtr userData); [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_exit")] internal static extern void Exit(); + [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_add_event_handler")] + internal static extern ErrorCode AddEventHandler(out IntPtr handle, AppCommon.AppEventType eventType, AppCommon.AppEventCallback callback, IntPtr data); + + [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_remove_event_handler")] + internal static extern ErrorCode RemoveEventHandler(IntPtr handle); + [StructLayoutAttribute(LayoutKind.Sequential)] internal struct ServiceAppLifecycleCallbacks { diff --git a/Tizen.Applications/Tizen.Applications.csproj b/Tizen.Applications/Tizen.Applications.csproj old mode 100755 new mode 100644 index 57bb922..fc11fc8 --- a/Tizen.Applications/Tizen.Applications.csproj +++ b/Tizen.Applications/Tizen.Applications.csproj @@ -53,7 +53,6 @@ - @@ -73,9 +72,12 @@ + + + @@ -133,4 +135,4 @@ --> - + \ No newline at end of file diff --git a/Tizen.Applications/Tizen.Applications/Application.cs b/Tizen.Applications/Tizen.Applications/Application.cs index e60a096..74055c7 100644 --- a/Tizen.Applications/Tizen.Applications/Application.cs +++ b/Tizen.Applications/Tizen.Applications/Application.cs @@ -17,26 +17,34 @@ namespace Tizen.Applications /// public abstract class Application : IDisposable { - private const string LogTag = "Tizen.Applications"; + internal const string LogTag = "Tizen.Applications"; private static Application s_CurrentApplication = null; - private Interop.AppEvent.SafeAppEventHandle _lowMemoryNativeHandle; - private Interop.AppEvent.SafeAppEventHandle _localeChangedNativeHandle; + private object _lock = new object(); - private Interop.AppEvent.AppEventCallback _appEventCallback; + private Interop.AppCommon.AppEventCallback _lowMemoryCallback; + private Interop.AppCommon.AppEventCallback _lowBatteryCallback; + private Interop.AppCommon.AppEventCallback _localeChangedCallback; + private Interop.AppCommon.AppEventCallback _regionChangedCallback; - private object _lock = new object(); + private IntPtr _lowMemoryEventHandle = IntPtr.Zero; + private IntPtr _lowBatteryEventHandle = IntPtr.Zero; + private IntPtr _localeChangedEventHandle = IntPtr.Zero; + private IntPtr _regionChangedEventHandle = IntPtr.Zero; private DirectoryInfo _directoryInfo; private ApplicationInfo _applicationInfo; /// - /// Initializes Application instance. + /// Initializes the Application class. /// public Application() { - _appEventCallback = new Interop.AppEvent.AppEventCallback(HandleAppEvent); + _lowMemoryCallback = new Interop.AppCommon.AppEventCallback(OnLowMemoryNative); + _lowBatteryCallback = new Interop.AppCommon.AppEventCallback(OnLowBatteryNative); + _localeChangedCallback = new Interop.AppCommon.AppEventCallback(OnLocaleChangedNative); + _regionChangedCallback = new Interop.AppCommon.AppEventCallback(OnRegionChangedNative); } /// @@ -60,11 +68,21 @@ namespace Tizen.Applications public event EventHandler LowMemory; /// + /// Occurs when the system battery is low. + /// + public event EventHandler LowBattery; + + /// /// Occurs when the system language is chagned. /// public event EventHandler LocaleChanged; /// + /// Occurs when the region format is changed. + /// + public event EventHandler RegionFormatChanged; + + /// /// Gets the instance of current application. /// public static Application Current { get { return s_CurrentApplication; } } @@ -121,10 +139,34 @@ namespace Tizen.Applications throw new ArgumentNullException("args"); } + TizenSynchronizationContext.Initialize(); + s_CurrentApplication = this; - Interop.AppEvent.AddEventHandler(Interop.AppEvent.EventNames.LowMemory, _appEventCallback, IntPtr.Zero, out _lowMemoryNativeHandle); - Interop.AppEvent.AddEventHandler(Interop.AppEvent.EventNames.LanguageSet, _appEventCallback, IntPtr.Zero, out _localeChangedNativeHandle); + ErrorCode err = ErrorCode.None; + err = AddEventHandler(out _lowMemoryEventHandle, Interop.AppCommon.AppEventType.LowMemory, _lowMemoryCallback); + if (err != ErrorCode.None) + { + Log.Error(LogTag, "Failed to add event handler for LowMemory event. Err = " + err); + } + + err = AddEventHandler(out _lowBatteryEventHandle, Interop.AppCommon.AppEventType.LowBattery, _lowBatteryCallback); + if (err != ErrorCode.None) + { + Log.Error(LogTag, "Failed to add event handler for LowBattery event. Err = " + err); + } + + err = AddEventHandler(out _localeChangedEventHandle, Interop.AppCommon.AppEventType.LanguageChanged, _localeChangedCallback); + if (err != ErrorCode.None) + { + Log.Error(LogTag, "Failed to add event handler for LocaleChanged event. Err = " + err); + } + + err = AddEventHandler(out _regionChangedEventHandle, Interop.AppCommon.AppEventType.RegionFormatChanged, _regionChangedCallback); + if (err != ErrorCode.None) + { + Log.Error(LogTag, "Failed to add event handler for RegionFormatChanged event. Err = " + err); + } } /// @@ -170,6 +212,15 @@ namespace Tizen.Applications } /// + /// 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. + /// + protected virtual void OnLowBattery(LowBatteryEventArgs e) + { + LowBattery?.Invoke(this, e); + } + + /// /// 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. /// @@ -178,29 +229,67 @@ namespace Tizen.Applications LocaleChanged?.Invoke(this, e); } - private void HandleAppEvent(string eventName, IntPtr eventData, IntPtr data) + /// + /// 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. + /// + protected virtual void OnRegionFormatChanged(RegionFormatChangedEventArgs e) + { + RegionFormatChanged?.Invoke(this, e); + } + + internal virtual ErrorCode AddEventHandler(out IntPtr handle, Interop.AppCommon.AppEventType type, Interop.AppCommon.AppEventCallback callback) + { + handle = IntPtr.Zero; + return ErrorCode.None; + } + + internal virtual void RemoveEventHandler(IntPtr handle) { - Bundle b = new Bundle(eventData); - if (eventName == Interop.AppEvent.EventNames.LowMemory) + } + + private void OnLowMemoryNative(IntPtr infoHandle, IntPtr data) + { + LowMemoryStatus status = LowMemoryStatus.None; + ErrorCode err = Interop.AppCommon.AppEventGetLowMemoryStatus(infoHandle, out status); + if (err != ErrorCode.None) { - string value = b.GetItem(Interop.AppEvent.EventKeys.LowMemory); - LowMemoryStatus status = LowMemoryStatus.Normal; - if (value == Interop.AppEvent.EventValues.MemorySoftWarning) - { - status = LowMemoryStatus.SoftWarning; - } - else if (value == Interop.AppEvent.EventValues.MemoryHardWarning) - { - status = LowMemoryStatus.HardWarning; - } - OnLowMemory(new LowMemoryEventArgs { LowMemoryStatus = status }); + Log.Error(LogTag, "Failed to get memory status. Err = " + err); } - else if (eventName == Interop.AppEvent.EventNames.LanguageSet) + OnLowMemory(new LowMemoryEventArgs(status)); + } + + private void OnLowBatteryNative(IntPtr infoHandle, IntPtr data) + { + LowBatteryStatus status = LowBatteryStatus.None; + ErrorCode err = Interop.AppCommon.AppEventGetLowBatteryStatus(infoHandle, out status); + if (err != ErrorCode.None) + { + Log.Error(LogTag, "Failed to get battery status. Err = " + err); + } + OnLowBattery(new LowBatteryEventArgs(status)); + } + + private void OnLocaleChangedNative(IntPtr infoHandle, IntPtr data) + { + string lang; + ErrorCode err = Interop.AppCommon.AppEventGetLanguage(infoHandle, out lang); + if (err != ErrorCode.None) { - string value = b.GetItem(Interop.AppEvent.EventKeys.LanguageSet); - OnLocaleChanged(new LocaleChangedEventArgs { Locale = value }); + Log.Error(LogTag, "Failed to get changed language. Err = " + err); } - b.Dispose(); + OnLocaleChanged(new LocaleChangedEventArgs(lang)); + } + + private void OnRegionChangedNative(IntPtr infoHandle, IntPtr data) + { + string region; + ErrorCode err = Interop.AppCommon.AppEventGetRegionFormat(infoHandle, out region); + if (err != ErrorCode.None) + { + Log.Error(LogTag, "Failed to get changed region format. Err = " + err); + } + OnRegionFormatChanged(new RegionFormatChangedEventArgs(region)); } #region IDisposable Support @@ -220,14 +309,23 @@ namespace Tizen.Applications { _applicationInfo.Dispose(); } - if (_lowMemoryNativeHandle != null && !_lowMemoryNativeHandle.IsInvalid) - { - _lowMemoryNativeHandle.Dispose(); - } - if (_localeChangedNativeHandle != null && !_localeChangedNativeHandle.IsInvalid) - { - _localeChangedNativeHandle.Dispose(); - } + } + + if (_lowMemoryEventHandle != IntPtr.Zero) + { + RemoveEventHandler(_lowMemoryEventHandle); + } + if (_lowBatteryEventHandle != IntPtr.Zero) + { + RemoveEventHandler(_lowBatteryEventHandle); + } + if (_localeChangedEventHandle != IntPtr.Zero) + { + RemoveEventHandler(_localeChangedEventHandle); + } + if (_regionChangedEventHandle != IntPtr.Zero) + { + RemoveEventHandler(_regionChangedEventHandle); } disposedValue = true; diff --git a/Tizen.Applications/Tizen.Applications/LocaleChangedEventArgs.cs b/Tizen.Applications/Tizen.Applications/LocaleChangedEventArgs.cs old mode 100755 new mode 100644 index 3836cea..8304a66 --- a/Tizen.Applications/Tizen.Applications/LocaleChangedEventArgs.cs +++ b/Tizen.Applications/Tizen.Applications/LocaleChangedEventArgs.cs @@ -15,9 +15,24 @@ namespace Tizen.Applications /// public class LocaleChangedEventArgs : EventArgs { + + /// + /// + /// + /// + public LocaleChangedEventArgs(string locale) + { + Locale = locale; + } + + /// + /// + /// + public string Locale { get; private set; } + /// /// /// - public string Locale { get; internal set; } + public string Region { get; internal set; } } } diff --git a/Tizen.Applications/Tizen.Applications/LowBatteryEventArgs.cs b/Tizen.Applications/Tizen.Applications/LowBatteryEventArgs.cs new file mode 100644 index 0000000..b523f0b --- /dev/null +++ b/Tizen.Applications/Tizen.Applications/LowBatteryEventArgs.cs @@ -0,0 +1,30 @@ +// Copyright 2016 by Samsung Electronics, Inc., +// +// This software is the confidential and proprietary information +// of Samsung Electronics, Inc. ("Confidential Information"). You +// shall not disclose such Confidential Information and shall use +// it only in accordance with the terms of the license agreement +// you entered into with Samsung. + +namespace Tizen.Applications +{ + /// + /// + /// + public class LowBatteryEventArgs + { + /// + /// + /// + /// + public LowBatteryEventArgs(LowBatteryStatus status) + { + LowBatteryStatus = status; + } + + /// + /// + /// + public LowBatteryStatus LowBatteryStatus { get; private set; } + } +} diff --git a/Tizen.Applications/Tizen.Applications/LowBatteryStatus.cs b/Tizen.Applications/Tizen.Applications/LowBatteryStatus.cs new file mode 100644 index 0000000..6419733 --- /dev/null +++ b/Tizen.Applications/Tizen.Applications/LowBatteryStatus.cs @@ -0,0 +1,31 @@ +// Copyright 2016 by Samsung Electronics, Inc., +// +// This software is the confidential and proprietary information +// of Samsung Electronics, Inc. ("Confidential Information"). You +// shall not disclose such Confidential Information and shall use +// it only in accordance with the terms of the license agreement +// you entered into with Samsung. + +namespace Tizen.Applications +{ + /// + /// Enumeration for low battery status. + /// + public enum LowBatteryStatus + { + /// + /// + /// + None = 0, + + /// + /// The battery status is under 1% + /// + PowerOff = 1, + + /// + /// The battery status is under 5% + /// + CriticalLow + } +} diff --git a/Tizen.Applications/Tizen.Applications/LowMemoryEventArgs.cs b/Tizen.Applications/Tizen.Applications/LowMemoryEventArgs.cs old mode 100755 new mode 100644 index 0a9c897..356112c --- a/Tizen.Applications/Tizen.Applications/LowMemoryEventArgs.cs +++ b/Tizen.Applications/Tizen.Applications/LowMemoryEventArgs.cs @@ -18,6 +18,15 @@ namespace Tizen.Applications /// /// /// - public LowMemoryStatus LowMemoryStatus { get; internal set; } + /// + public LowMemoryEventArgs(LowMemoryStatus status) + { + LowMemoryStatus = status; + } + + /// + /// + /// + public LowMemoryStatus LowMemoryStatus { get; private set; } } } diff --git a/Tizen.Applications/Tizen.Applications/RegionFormatChangedEventArgs.cs b/Tizen.Applications/Tizen.Applications/RegionFormatChangedEventArgs.cs new file mode 100644 index 0000000..54a3264 --- /dev/null +++ b/Tizen.Applications/Tizen.Applications/RegionFormatChangedEventArgs.cs @@ -0,0 +1,33 @@ +// Copyright 2016 by Samsung Electronics, Inc., +// +// This software is the confidential and proprietary information +// of Samsung Electronics, Inc. ("Confidential Information"). You +// shall not disclose such Confidential Information and shall use +// it only in accordance with the terms of the license agreement +// you entered into with Samsung. + +using System; + +namespace Tizen.Applications +{ + /// + /// + /// + public class RegionFormatChangedEventArgs : EventArgs + { + + /// + /// + /// + /// + public RegionFormatChangedEventArgs(string region) + { + Region = region; + } + + /// + /// + /// + public string Region { get; private set; } + } +} diff --git a/Tizen.Applications/Tizen.Applications/ServiceApplication.cs b/Tizen.Applications/Tizen.Applications/ServiceApplication.cs index 10b6aea..a443acd 100644 --- a/Tizen.Applications/Tizen.Applications/ServiceApplication.cs +++ b/Tizen.Applications/Tizen.Applications/ServiceApplication.cs @@ -8,6 +8,8 @@ using System; +using Tizen.Internals.Errors; + namespace Tizen.Applications { /// @@ -35,8 +37,11 @@ namespace Tizen.Applications { base.Run(args); - TizenSynchronizationContext.Initialize(); - Interop.Service.Main(args.Length, args, ref _callbacks, IntPtr.Zero); + ErrorCode err = Interop.Service.Main(args.Length, args, ref _callbacks, IntPtr.Zero); + if (err != ErrorCode.None) + { + Log.Error(LogTag, "Failed to run the service. Err = " + err); + } } /// @@ -47,6 +52,16 @@ namespace Tizen.Applications Interop.Service.Exit(); } + internal override ErrorCode AddEventHandler(out IntPtr handle, Interop.AppCommon.AppEventType type, Interop.AppCommon.AppEventCallback callback) + { + return Interop.Service.AddEventHandler(out handle, type, callback, IntPtr.Zero); + } + + internal override void RemoveEventHandler(IntPtr handle) + { + Interop.Service.RemoveEventHandler(handle); + } + private bool OnCreateNative(IntPtr data) { OnCreate(); diff --git a/Tizen.Applications/Tizen.Applications/UIApplication.cs b/Tizen.Applications/Tizen.Applications/UIApplication.cs index 170e56b..9648ef0 100644 --- a/Tizen.Applications/Tizen.Applications/UIApplication.cs +++ b/Tizen.Applications/Tizen.Applications/UIApplication.cs @@ -7,6 +7,7 @@ // you entered into with Samsung. using System; +using Tizen.Internals.Errors; using Tizen.UI; namespace Tizen.Applications @@ -56,8 +57,11 @@ namespace Tizen.Applications { base.Run(args); - TizenSynchronizationContext.Initialize(); - Interop.Application.Main(args.Length, args, ref _callbacks, IntPtr.Zero); + ErrorCode err = Interop.Application.Main(args.Length, args, ref _callbacks, IntPtr.Zero); + if (err != ErrorCode.None) + { + Log.Error(LogTag, "Failed to run the application. Err = " + err); + } } /// @@ -86,6 +90,16 @@ namespace Tizen.Applications Paused?.Invoke(this, EventArgs.Empty); } + internal override ErrorCode AddEventHandler(out IntPtr handle, Interop.AppCommon.AppEventType type, Interop.AppCommon.AppEventCallback callback) + { + return Interop.Application.AddEventHandler(out handle, type, callback, IntPtr.Zero); + } + + internal override void RemoveEventHandler(IntPtr handle) + { + Interop.Application.RemoveEventHandler(handle); + } + private bool OnCreateNative(IntPtr data) { Window = new Window("C# UI Application");