--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.Applications
+{
+ public class AppControlReceivedEventArgs
+ {
+ public AppControlReceivedEventArgs(ReceivedAppControl control)
+ {
+ ReceivedAppControl = control;
+ }
+
+ public ReceivedAppControl ReceivedAppControl { get; private set; }
+ }
+}
private Interop.AppEvent.SafeAppEventHandle _localeChangedNativeHandle;
/// <summary>
+ ///
+ /// </summary>
+ public event EventHandler<EventArgs> Created;
+
+ /// <summary>
+ ///
+ /// </summary>
+ public event EventHandler<EventArgs> Terminated;
+
+ /// <summary>
+ ///
+ /// </summary>
+ public event EventHandler<AppControlReceivedEventArgs> AppControlReceived;
+
+ /// <summary>
/// The low memory event.
/// </summary>
public event EventHandler<LowMemoryEventArgs> LowMemory;
/// <summary>
///
/// </summary>
- protected virtual void OnCreate()
+ /// <param name="e"></param>
+ protected virtual void OnCreate(EventArgs e)
{
+ var eh = Created as EventHandler<EventArgs>;
+ if (eh != null)
+ {
+ eh(this, e);
+ }
}
/// <summary>
///
/// </summary>
- protected virtual void OnTerminate()
+ /// <param name="e"></param>
+ protected virtual void OnTerminate(EventArgs e)
{
+ var eh = Terminated as EventHandler<EventArgs>;
+ if (eh != null)
+ {
+ eh(this, e);
+ }
}
-
+
/// <summary>
///
/// </summary>
- /// <param name="control"></param>
- protected virtual void OnAppControlReceived(ReceivedAppControl control)
+ /// <param name="e"></param>
+ protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e)
{
+ var eh = AppControlReceived as EventHandler<AppControlReceivedEventArgs>;
+ if (eh != null)
+ {
+ eh(this, e);
+ }
}
/// <summary>
/// <param name="e"></param>
protected virtual void OnLowMemory(LowMemoryEventArgs e)
{
- EventHandler<LowMemoryEventArgs> eh = LowMemory;
+ var eh = LowMemory as EventHandler<LowMemoryEventArgs>;
if (eh != null)
{
eh(this, e);
/// <param name="e"></param>
protected virtual void OnLocaleChanged(LocaleChangedEventArgs e)
{
- EventHandler<LocaleChangedEventArgs> eh = LocaleChanged;
+ var eh = LocaleChanged as EventHandler<LocaleChangedEventArgs>;
if (eh != null)
{
eh(this, e);
internal void SendCreate()
{
ApplicationInfo = new ApplicationInfo();
- OnCreate();
+ OnCreate(EventArgs.Empty);
}
private void HandleAppEvent(string eventName, IntPtr eventData, IntPtr data)
/// you entered into with Samsung.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
namespace Tizen.Applications
{
/// <summary>
+/// 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.Collections.Generic;
using System.Linq;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+/// 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
{
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Tizen.Applications
{
/// you entered into with Samsung.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
namespace Tizen.Applications
{
/// <summary>
+/// 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.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Tizen.Internals.Errors;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Tizen.Applications
{
};
ops.OnTerminate = (data) =>
{
- OnTerminate();
+ OnTerminate(EventArgs.Empty);
};
ops.OnAppControl = (appControlHandle, data) =>
{
- OnAppControlReceived(new ReceivedAppControl(appControlHandle));
+ OnAppControlReceived(new AppControlReceivedEventArgs(new ReceivedAppControl(appControlHandle)));
};
TizenSynchronizationContext.Initialize();
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tizen.Internals.Errors;
namespace Tizen.Applications
{
/// <summary>
///
/// </summary>
+ public event EventHandler<EventArgs> Resumed;
+
+ /// <summary>
+ ///
+ /// </summary>
+ public event EventHandler<EventArgs> Paused;
+
+ /// <summary>
+ ///
+ /// </summary>
/// <param name="args"></param>
public override void Run(string[] args)
{
};
ops.OnTerminate = (data) =>
{
- OnTerminate();
+ OnTerminate(EventArgs.Empty);
};
ops.OnAppControl = (appControlHandle, data) =>
{
- OnAppControlReceived(new ReceivedAppControl(appControlHandle));
+ OnAppControlReceived(new AppControlReceivedEventArgs(new ReceivedAppControl(appControlHandle)));
};
ops.OnResume = (data) =>
{
- OnResume();
+ OnResume(EventArgs.Empty);
};
ops.OnPause = (data) =>
{
- OnPause();
+ OnPause(EventArgs.Empty);
};
TizenSynchronizationContext.Initialize();
/// <summary>
///
/// </summary>
- protected virtual void OnResume()
+ protected virtual void OnResume(EventArgs e)
{
+ var eh = Resumed as EventHandler<EventArgs>;
+ if (eh != null)
+ {
+ eh(this, e);
+ }
}
/// <summary>
///
/// </summary>
- protected virtual void OnPause()
+ protected virtual void OnPause(EventArgs e)
{
+ var eh = Paused as EventHandler<EventArgs>;
+ if (eh != null)
+ {
+ eh(this, e);
+ }
}
}
}