Example #1
0
        /// <summary>
        /// Initializes the instance of the AppControl class with the SafeAppControlHandle.
        /// </summary>
        /// <param name="handle"></param>
        /// <since_tizen> 3 </since_tizen>
        public AppControl(SafeAppControlHandle handle)
        {
            if (handle == null)
            {
                throw new ArgumentNullException("handle");
            }

            Interop.AppControl.ErrorCode err = Interop.AppControl.DangerousClone(out _handle, handle.DangerousGetHandle());
            if (err != Interop.AppControl.ErrorCode.None)
            {
                throw new InvalidOperationException("Failed to clone the appcontrol handle. Err = " + err);
            }
        }
Example #2
0
        /// <summary>
        /// Sets an alarm to be triggered after a specific time.
        /// The alarm will first go off delay seconds later and then will go off every certain amount of time defined using period seconds.
        /// </summary>
        /// <param name="delay">The amount of time before the first execution (in seconds).</param>
        /// <param name="period"> The amount of time between subsequent alarms (in seconds). This value does not guarantee the accuracy.
        /// The actual interval is calculated by the OS. The minimum value is 600sec.</param>
        /// <param name="appControl"> The destination AppControl is used to perform a specific task when the alarm is triggered. </param>
        /// <returns> An alarm instance is created with the set param values.</returns>
        /// <exception cref="ArgumentException">Thrown in case of an invalid parameter.</exception>
        /// <exception cref="UnauthorizedAccessException">Thrown in case of a permission denied.</exception>
        /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
        /// <since_tizen> 3 </since_tizen>
        public static Alarm CreateAlarm(int delay, int period, AppControl appControl)
        {
            Alarm alarm = null;
            int   alarmId;
            SafeAppControlHandle handle = (appControl == null) ? null : appControl.SafeAppControlHandle;
            AlarmError           ret    = (AlarmError)Interop.Alarm.CreateAlarmAfterDelay(handle, delay, period, out alarmId);

            alarm = new Alarm(alarmId);
            if (ret != AlarmError.None)
            {
                throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm");
            }

            return(alarm);
        }
Example #3
0
 internal ExtraDataCollection(SafeAppControlHandle handle)
 {
     _handle = handle;
 }
Example #4
0
 /// <summary>
 /// Initializes a ReceivedAppControl class.
 /// </summary>
 public ReceivedAppControl(SafeAppControlHandle handle)
 {
 }